Advertisement
Guest User

[RPGMVXA] Combined Item Category

a guest
Dec 4th, 2022
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.89 KB | None | 0 0
  1. class Window_ItemCategory < Window_HorzCommand
  2.   def col_max
  3.     if $game_switches[3] == true
  4.       return 1
  5.     else
  6.       return 4
  7.     end
  8.   end
  9.   def make_command_list
  10.     if $game_switches[3] == true
  11.       add_command("Reinforce",   :weapon)
  12.     else
  13.       add_command(Vocab::item,     :item)
  14.       add_command(Vocab::weapon,   :weapon)
  15.       add_command(Vocab::armor,    :armor)
  16.       add_command(Vocab::key_item, :key_item)
  17.     end
  18.   end
  19. end
  20.  
  21. class Window_ItemList < Window_Selectable
  22.   def include?(item)
  23.     if $game_switches[3]
  24.       true if item
  25.     else
  26.       case @category
  27.       when :item
  28.         item.is_a?(RPG::Item) && !item.key_item?
  29.       when :weapon
  30.         item.is_a?(RPG::Weapon)
  31.       when :armor
  32.         item.is_a?(RPG::Armor)
  33.       when :key_item
  34.         item.is_a?(RPG::Item) && item.key_item?
  35.       else
  36.         false
  37.       end
  38.     end
  39.   end
  40. end
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement