#==============================================================================
# 本脚本来自[url]www.66rpg.com[/url],转载和使用请保留此声明
#==============================================================================
# ■ Window_ShopSell
#------------------------------------------------------------------------------
# 商店画面、浏览显示可以卖掉的商品的窗口。
#==============================================================================
class Window_ShopSell < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
def initialize
item=[]
@not_for_sell_item=[]
for i in 1...$data_items.size
if $data_items[i].price==0
@not_for_sell_item=@not_for_sell_item+[i]
end
end
weapon=[]
@not_for_sell_weapon=[]
for i in 1...$data_weapons.size
if $data_weapons[i].price==0
@not_for_sell_weapon=@not_for_sell_weapon+[i]
end
end
armor=[]
@not_for_sell_armor=[]
for i in 1...$data_armors.size
if $data_armors[i].price==0
@not_for_sell_armor=@not_for_sell_armor+[i]
end
end
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],转载和使用请保留此声明
#==============================================================================