#============================================================================== # 本脚本来自www.66rpg.com,转载和使用请保留此声明 #============================================================================== # ■ Window_ShopSell #------------------------------------------------------------------------------ # 商店画面、浏览显示可以卖掉的商品的窗口。 #============================================================================== class Window_ShopSell < Window_Selectable #-------------------------------------------------------------------------- # ● 初始化对像 #-------------------------------------------------------------------------- def initialize @not_for_sell_item = [1,2,3] @not_for_sell_weapon = [2,3,4] @not_for_sell_armor = [1,2,3,4,5] super(0, 128, 640, 352) @column_max = 2 refresh self.index = 0 end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh if self.contents != nil self.contents.dispose self.contents = nil end @data = [] for i in 1...$data_items.size if $game_party.item_number(i) > 0 @data.push($data_items[i]) unless @not_for_sell_item.include?(i) end end for i in 1...$data_weapons.size if $game_party.weapon_number(i) > 0 @data.push($data_weapons[i]) unless @not_for_sell_weapon.include?(i) end end for i in 1...$data_armors.size if $game_party.armor_number(i) > 0 @data.push($data_armors[i]) unless @not_for_sell_armor.include?(i) end end # 如果项目数不是 0 就生成位图、描绘全部项目 @item_max = @data.size if @item_max > 0 self.contents = Bitmap.new(width - 32, row_max * 32) for i in 0...@item_max draw_item(i) end end end end #============================================================================== # 本脚本来自www.66rpg.com,转载和使用请保留此声明 #============================================================================== |