ZS Category Items

Category Items // Using item notetags, you can display regular and key items in the Weapons and Armor tab.

Customization: None.

Screenshots:
upload_2019-4-10_11-37-13.png


Setup:

  • Paste under the Materials slot, above main.
  • Open your game's database, and in your item's note section, write either <weapon> or <armor>.
Usage Notes:
  • Script is allowed for commercial, non-commercial projects. Reposting isn't allowed.

Code:
#==============================================================================
#
# ** Title: ZS Category Items 1.1
#
#------------------------------------------------------------------------------
# 1.1 - Added support for notetagging armor and weapon items.
# 1.0 - Initial release.
#------------------------------------------------------------------------------
#
# Instructions:
# Type <weapon> in an item's note window for it to be shown in the Weapons tab.
# Type <armor> in an item's note window for it to be shown in the Armor tab.
#
# >> Items can only be given one notetag. You can give notetags to Key Items.
# >> Armors and Weapons will still appear in the Items menu.
#
#==============================================================================

module GhostChecker
    WeaponTagRegex = /<weapon>/i
    ArmorTagRegex = /<armor>/i
end

class Window_ItemList < Window_Selectable
  alias ghost_include include?
  def include?(item)
    case @category
    when :item #no tags
      item.is_a?(RPG::Item) && !item.key_item? && item.note == ""
    when :weapon
      item.is_a?(RPG::Weapon) && item.note == "" ||
      item.is_a?(RPG::Item) && item.note =~ GhostChecker::WeaponTagRegex ||
      item.is_a?(RPG::Armor) && item.note =~ GhostChecker::WeaponTagRegex
    when :armor
      item.is_a?(RPG::Armor)&& item.note == "" ||
      item.is_a?(RPG::Item) && item.note =~ GhostChecker::ArmorTagRegex ||
      item.is_a?(RPG::Weapon) && item.note =~ GhostChecker::ArmorTagRegex
    when :key_item #no tags
      item.is_a?(RPG::Item) && item.key_item? && item.note == ""
    else
      false
    end
  end
end
1.1 released - You can now put armor items in the weapons category, and vice versa.
Next update will probably allow notetags for showing stuff in the item + key item categories.

Original thread: https://forums.rpgmakerweb.com/threads/zs-category-items.107814/