ZS Category Items
Category Items // Using item notetags, you can display regular and key items in the Weapons and Armor tab.Customization: None.
Screenshots:
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
本贴来自国际rpgmaker官方论坛作者:tvghost处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/zs-category-items.107814/
页:
[1]