| 赞 | 95 |
| VIP | |
| 好人卡 | |
| 积分 | 69 |
| 经验 | |
| 最后登录 | 2025-2-12 |
| 在线时间 | 7027 小时 |
- 梦石
- 0
- 星屑
- 6891
- 在线时间
- 7027 小时
- 注册时间
- 2013-11-2
- 回帖
- 1263
 
|
发表于 2016-10-25 19:17:37
|
显示全部楼层
本帖最后由 RaidenInfinity 于 2016-10-25 19:20 编辑
[pre lang="ruby"]
class Window_ItemCategory < Window_HorzCommand
def col_max
return 5 #分类总数
end
def make_command_list
add_command(Vocab::item, :item)
add_command("装备", :equip) #增加分类:装备
add_command(Vocab::weapon, :weapon) #既然有了装备分类…还要留下原本的武器/护甲分类吗?
add_command(Vocab::armor, :armor) #那就要看你自己的决定了。
add_command(Vocab::key_item, :key_item)
end
end
class Window_ItemList < Window_Selectable
def include?(item)
case @category
when :item
item.is_a?(RPG::Item) && !item.key_item?
when :equip
item.is_a?(RPG::Weapon) || item.is_a?(RPG::Armor) #武器+护甲都会显示在这个分类中
when :weapon
item.is_a?(RPG::Weapon)
when :armor
item.is_a?(RPG::Armor)
when :key_item
item.is_a?(RPG::Item) && item.key_item?
else
false
end
end
end
[/pre] |
评分
-
查看全部评分
|