class Window_ShopBuy
#--------------------------------------------------------------------------
# * Object Initialization
# shop_goods : goods
#--------------------------------------------------------------------------
def initialize(shop_goods)
super(0, 128, 368, 352)
@shop_goods = []
#rearrange by price *** BREW
for i in 0..10000
for item in shop_goods
case item[0]
when 0 #item
if $data_items[item[1]].price == i
@shop_goods.push(item)
end
when 1 #weapon
if $data_weapons[item[1]].price == i
@shop_goods.push(item)
end
when 2 #armor
if $data_armors[item[1]].price == i
@shop_goods.push(item)
end
end
end
end
refresh
self.index = 0
end
end
class Window_ShopSell
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
sell_data = []
for i in 1...$data_items.size
if $game_party.item_number(i) > 0
sell_data.push($data_items[i])
end
end
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0
sell_data.push($data_weapons[i])
end
end
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0
sell_data.push($data_armors[i])
end
end
#rearrange by price *** BREW
@data = []
for i in 0..10000
for item in sell_data
if item.price == i
@data.push(item)
end
end
end
# If item count is not 0, make a bitmap and draw all items
@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