#==============================================================================
# 本脚本来自[url]www.66rpg.com[/url],转载和使用请保留此声明
#==============================================================================
# ■ Window_ShopSell
#------------------------------------------------------------------------------
# 商店画面、浏览显示可以卖掉的商品的窗口。
#==============================================================================
class Window_ShopSell < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
def initialize
@not_for_sell_item = [40,41,42,43,44,45,46,47,48,49,50,51,66,67,68,69,70,71,72,80]
@not_for_sell_weapon = [12,13]
@not_for_sell_armor = [26,29,30]
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
#=======================================================================
# 本脚本来自[url]www.66rpg.com[/url],转载和使用请保留此声明
#=======================================================================