~Site
Accueil
Forum
Admin

~Base de scripts
Scripts de base
Scripts Menu
Scripts Combat
Scripts Systθme
Scripts Modifiιs

Scripts de Base
Game_Temp
Game_System
Game_Switches
Game_Variables
Game_SelfSwitches
Game_Screen
Game_Picture
Game_Battler 1
Game_Battler 2
Game_Battler 3
Game_BattleAction
Game_Actor
Game_Enemy
Game_Actors
Game_Party
Game_Troop
Game_Map
Game_CommonEvent
Game_Character 1
Game_Character 2
Game_Character 3
Game_Event
Game_Player
Sprite_Character
Sprite_Battler
Sprite_Picture
Sprite_Timer
Spriteset_Map
Spriteset_Battle
Window_Base
Window_Selectable
Window_Command
Window_Help
Window_Gold
Window_PlayTime
Window_Steps
Window_MenuStatus
Window_Item
Window_Skill
Window_SkillStatus
Window_Target
Window_EquipLeft
Window_EquipRight
Window_EquipItem
Window_Status
Window_SaveFile
Window_ShopCommand
Window_ShopBuy
Window_ShopSell
Window_ShopNumber
Window_ShopStatus
Window_NameEdit
Window_NameInput
Window_InputNumber
Window_Message
Window_PartyCommand
Window_BattleStatus
Window_BattleResult
Window_DebugLeft
Window_DebugRight
Window_Dataset
Arrow_Base
Arrow_Enemy
Arrow_Actor
Interpreter 1
Interpreter 2
Interpreter 3
Interpreter 4
Interpreter 5
Interpreter 6
Interpreter 7
Scene_Title
Scene_Map
Scene_Menu
Scene_Item
Scene_Skill
Scene_Equip
Scene_Status
Scene_File
Scene_Save
Scene_Load
Scene_End
Scene_Battle 1
Scene_Battle 2
Scene_Battle 3
Scene_Battle 4
Scene_Shop
Scene_Name
Scene_Gameover
Scene_Debug
Main


Window_ShopBuy ::: postι le 2006-02-16 @ 09:55:00
Auteur: Yukihiro matsumoto

#============================================
# ‘ Window_ShopBuy
#----------------------------------------------
# @ƒVƒ‡ƒbƒv‰ζ–ʂŁAw“ό‚Ε‚«‚鏀•i‚Μˆκ——‚π•Ž¦‚·‚ιƒEƒBƒ“ƒhƒE‚Ε‚·B
#============================================

class Window_ShopBuy < Window_Selectable
#------------------------------------------
# œ ƒIƒuƒWƒFƒNƒg‰Šϊ‰»
# shop_goods : €•i
#------------------------------------------
def initialize(shop_goods)
super(0, 128, 368, 352)
@shop_goods = shop_goods
refresh
self.index = 0
end
#------------------------------------------
# œ ƒAƒCƒeƒ€‚ΜŽζ“Ύ
#------------------------------------------
def item
return @data[self.index]
end
#------------------------------------------
# œ ƒŠƒtƒŒƒbƒVƒ…
#------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for goods_item in @shop_goods
case goods_item[0]
when 0
item = $data_items[goods_item[1]]
when 1
item = $data_weapons[goods_item[1]]
when 2
item = $data_armors[goods_item[1]]
end
if item != nil
@data.push(item)
end
end
# €–ڐ”‚ͺ 0 ‚Ε‚Θ‚―‚κ‚Ξƒrƒbƒgƒ}ƒbƒv‚πμ¬‚΅A‘S€–Ϊ‚π•`‰ζ
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
for i in 0...@item_max
draw_item(i)
end
end
end
#------------------------------------------
# œ €–Ϊ‚Μ•`‰ζ
# index : €–ڔԍ†
#------------------------------------------
def draw_item(index)
item = @data[index]
# ƒAƒCƒeƒ€‚ΜŠŽ”‚πŽζ“Ύ
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
# ‰ΏŠi‚ͺŠŽ‹ΰˆΘ‰ΊA‚©‚ΒŠŽ”‚ͺ 99 ‚Ε‚Θ‚―‚κ‚Ξ’Κν•ΆŽšF‚ɁA
# ‚»‚€‚Ε‚Θ‚―‚κ‚Ξ–³Œψ•ΆŽšF‚ɐݒθ
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)
self.contents.draw_text(x + 240, y, 88, 32, item.price.to_s, 2)
end
#------------------------------------------
# œ ƒwƒ‹ƒvƒeƒLƒXƒgXV
#------------------------------------------
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end
Design By RaZ © Watery Build 2005