MrTrivel

MrTS_Icon_Item_List

Jun 17th, 2014
366
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # )----------------------------------------------------------------------------(
  2. # )--     AUTHOR:     Mr Trivel                                              --(
  3. # )--     NAME:       Item List Icons                                        --(
  4. # )--     CREATED:    2014-06-17                                             --(
  5. # )--     VERSION:    1.0                                                    --(
  6. # )----------------------------------------------------------------------------(
  7. # )--                          DESCRIPTION                                   --(
  8. # )--  Instead of using Icon > Name > Quantity in an item list. It will only --(
  9. # )--  show Icon and quantity in top right corner of the item.               --(
  10. # )----------------------------------------------------------------------------(
  11. # )--                          INSTRUCTIONS                                  --(
  12. # )--                          Plug & Play                                   --(
  13. # )----------------------------------------------------------------------------(
  14. # )--                          LICENSE INFO                                  --(
  15. # )--    http://mrtrivelvx.wordpress.com/terms-of-use/                       --(
  16. # )----------------------------------------------------------------------------(
  17.  
  18. class Window_ItemList < Window_Selectable
  19.   def col_max
  20.     return 16
  21.   end
  22.  
  23.   def draw_item(index)
  24.     item = @data[index]
  25.     if item
  26.       rect = item_rect(index)
  27.       rect.width -= 4
  28.       draw_icon(item.icon_index, rect.x+3, rect.y+2, enable?(item))
  29.       draw_item_number(rect, item)
  30.     end
  31.   end
  32.  
  33.   def item_rect(index)
  34.     rect = Rect.new
  35.     rect.width = 32
  36.     rect.height = item_height + 4
  37.     rect.x = index % col_max * (32)
  38.     rect.y = index / col_max * (item_height + 4)
  39.     rect
  40.   end
  41.  
  42.   def draw_item_number(rect, item)
  43.     make_font_smaller
  44.     rect.y -= 5
  45.     rect.x += 3
  46.     draw_text(rect, sprintf("%2d", $game_party.item_number(item)),2) if $game_party.item_number(item) > 1
  47.     make_font_bigger
  48.   end
  49. end
RAW Paste Data