#============================================================================
# ** Advance Money System
#----------------------------------------------------------------------------
# vpcdmd
# 1.0
# 2/9/2008
#---
# ~ Originally requested by : aeuwa
#============================================================================
#==============================================================================
# ** Window_Gold
#------------------------------------------------------------------------------
# This window displays amount of gold.
#==============================================================================
class Window_Gold < Window_Base
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
pound = $game_party.gold/240
shilling = ($game_party.gold - (pound * 240)) / 12
penny = ($game_party.gold - (pound * 240) - (shilling * 12))
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120, 32, pound.to_s + 'P. ' + shilling.to_s +
'S. ' + penny.to_s + "p.", 2)
end
end
#==============================================================================
# ** Window_ShopBuy
#------------------------------------------------------------------------------
# This window displays buyable goods on the shop screen.
#==============================================================================
class Window_ShopBuy < Window_Selectable
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
case item
when RPG::Item
number = $game_party.item_number(item.id)
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
if item.price <= $game_party.gold and number < 99
self.contents.font.color = normal_color
else
self.contents.font.color = disabled_color
end
x = 4
y = index * 32
rect = Rect.new(x, y, self.width - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(item.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
pound = item.price/240
shilling = (item.price - (pound * 240)) / 12
penny = (item.price - (pound * 240) - (shilling * 12))
self.contents.draw_text(x + 213, y, 120, 32, pound.to_s + 'P. ' +
shilling.to_s + 'S. ' + penny.to_s + "p.", 2)
end
end
#==============================================================================
# ** Window_ShopNumber
#------------------------------------------------------------------------------
# This window is for inputting quantity of items to buy or sell on the
# shop screen.
#==============================================================================
class Window_ShopNumber < Window_Base
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_item_name(@item, 4, 96)
self.contents.font.color = normal_color
self.contents.draw_text(272, 96, 32, 32, "×")
self.contents.draw_text(308, 96, 24, 32, @number.to_s, 2)
self.cursor_rect.set(304, 96, 32, 32)
total_price = @price * @number
pound = total_price/240
shilling = (total_price - (pound * 240)) / 12
penny = (total_price - (pound * 240) - (shilling * 12))
self.contents.font.color = normal_color
self.contents.draw_text(4, 160, 328, 32, pound.to_s + 'P. ' +
shilling.to_s + 'S. ' + penny.to_s + "p.", 2)
end
end