Advertisement
Fomar0153

Fomar0153 - Improved Item Processing 1.0

Feb 6th, 2012
872
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.96 KB | None | 0 0
  1. =begin
  2. Improved Item Processing
  3. by Fomar0153
  4. Version 1.0
  5. ----------------------
  6. Notes
  7. ----------------------
  8. Allows you to define which items appear in the item
  9. processing window.
  10. ----------------------
  11. Instructions
  12. ----------------------
  13. Set VARIABLE_CAT to the id of the variable you wish
  14. to use to define what appears.
  15. By defualt:
  16. VARIABLE -> What appear
  17. 0 -> Normal Items
  18. 1 -> Weapons
  19. 2 -> Armours
  20. 3 -> Key Items
  21. 4 -> All Items
  22. 5+ will open up a custom selection window.
  23. You define the items to be included in it by note tagging.
  24. <itemp x>
  25. Where x is the value of the variable you want to use.
  26. ----------------------
  27. Known bugs
  28. ----------------------
  29. None
  30. =end
  31. class Window_KeyItem < Window_ItemList
  32.   #--------------------------------------------------------------------------
  33.   # ● Change the number to the id of the variable you wish to use
  34.   #--------------------------------------------------------------------------
  35.   VARIABLE_CAT = 2
  36.   #--------------------------------------------------------------------------
  37.   # ● Replaces the inherited method.
  38.   #--------------------------------------------------------------------------
  39.   def include?(item)
  40.     case $game_variables[VARIABLE_CAT]
  41.     when 0 # Normal Items
  42.       item.is_a?(RPG::Item) && !item.key_item?
  43.     when 1 # Weapons
  44.       item.is_a?(RPG::Weapon)
  45.     when 2 # Armours
  46.       item.is_a?(RPG::Armor)
  47.     when 3 # Key Items
  48.       item.is_a?(RPG::Item) && item.key_item?
  49.     when 4 # All Items
  50.       item.is_a?(RPG::Item)
  51.     else
  52.       item.is_a?(RPG::Item) && item.note.include?("<itemp " + $game_variables[VARIABLE_CAT].to_s + ">")
  53.     end
  54.   end
  55.   #--------------------------------------------------------------------------
  56.   # ● Otherwise weapons and armours are not clickable - hopefully this won't
  57.   #   have any unforseen consequences.
  58.   #--------------------------------------------------------------------------
  59.   def enable?(item)
  60.     return true
  61.   end
  62. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement