赞 | 4 |
VIP | 211 |
好人卡 | 175 |
积分 | 8 |
经验 | 48096 |
最后登录 | 2014-1-9 |
在线时间 | 1327 小时 |
Lv2.观梦者 (?????)
- 梦石
- 0
- 星屑
- 787
- 在线时间
- 1327 小时
- 注册时间
- 2011-7-18
- 帖子
- 3184

|
本帖最后由 各种压力的猫君 于 2011-12-29 01:11 编辑
默认只有物品为“重要物品”分类才会出现在选择菜单中
- #==============================================================================
- # ■ Window_ItemList
- #------------------------------------------------------------------------------
- # アイテム画面で、所持アイテムの一覧を表示するウィンドウです。
- #==============================================================================
- class Window_ItemList < Window_Selectable
- #--------------------------------------------------------------------------
- # ● アイテムをリストに含めるかどうか
- #--------------------------------------------------------------------------
- def include?(item)
- case @category
- when :item
- item.is_a?(RPG::Item) && !item.key_item?
- 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?
- #--------------------------------------------------------------------------
- when :all_item
- item.is_a?(RPG::Item)
- when :everything
- true
- #--------------------------------------------------------------------------
- else
- false
- end
- end
- end
- #==============================================================================
- # ■ Window_KeyItem
- #------------------------------------------------------------------------------
- # イベントコマンド[アイテム選択の処理]に使用するウィンドウです。
- #==============================================================================
- class Window_KeyItem < Window_ItemList
- #--------------------------------------------------------------------------
- # ● 入力処理の開始
- #--------------------------------------------------------------------------
- def start
- #--------------------------------------------------------------------------
- self.category = :everything
- # 如果想不显示武器和防具就把上面一行的 :everything 换成 :all_item
- #--------------------------------------------------------------------------
- update_placement
- refresh
- select(0)
- open
- activate
- end
- end
复制代码 以上脚本插入到Main以上,即可选择所有物品
(其实修改的不多,建议你对照原有的自己改进去) 至于用法,选择物品会返回物品ID到指定变量,
你只要在下面用条件分歧判断变量ID是否为对应的物品ID就可以了。
之后可以不用把这个变量归零,因为下一次选择时会自动返回新的ID(取消选择会返回0) |
|