#==============================================================================
# ■ Window_BattleResult
#------------------------------------------------------------------------------
# 战斗结束时、显示获得的 EXP 及金钱的窗口。
#==============================================================================
class Window_BattleResult < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对像
# exp : EXP
# gold : 金钱
# treasures : 宝物
#--------------------------------------------------------------------------
def initialize(exp, gold, treasures)
@exp = exp
@gold = gold
@treasures = treasures
super(160, 30, 320, 3 * 32 + 324)#@treasures.size * 32 + 164)
self.contents = Bitmap.new(width - 32, height - 32)
self.y = 160 - height / 2
self.z = 99999
#self.back_opacity = 160
#self.back_opacity = 0
self.windowskin = RPG::Cache.windowskin("")
#self.visible = false
# if @treasures.size != 3
@win_window = Window_Base.new(260, 88, 118, 48)
# else
# @win_window = Window_Base.new(260, 88 + 40, 118, 48)
# end
@win_window.contents = Bitmap.new(368, 32)
win_string = "战斗总结"
#@win_window.contents.font.name = "黑体"
@win_window.contents.font.size = 16
@win_window.contents.font.name = Font.default_name
#@win_window.contents.font.size = Font.default_size
@win_window.contents.font.color = Color.new(255,255,255,255)
@win_window.contents.draw_text(5, -8, 268, 32, win_string)
@win_window.z = 9999
@win_window.windowskin = RPG::Cache.windowskin("plainpearl.png")
# if @treasures.size != 3
@exp_window = Window_Base.new(225, 141, 188, 48)
# else
# @exp_window = Window_Base.new(225, 141 + 40, 188, 48)
# end
@exp_window.contents = Bitmap.new(368, 32)
exp_string = "获得经验值"
@exp_window.contents.font.size = 16
@exp_window.contents.font.name = Font.default_name
#@win_window.contents.font.size = Font.default_size
@exp_window.contents.font.color = Color.new(255,255,255,255)
@exp_window.contents.draw_text(5, -8, 268, 32, exp_string)
@exp_window.z = 9999
@exp_window.visible = false
@exp_window.windowskin = RPG::Cache.windowskin("plainpearl.png")
# if @treasures.size != 3
@money_window = Window_Base.new(190, 146 + 58 - 10, 268, 48)
# else
# @money_window = Window_Base.new(190, 146 + 88, 268, 48)
# end
@money_window.contents = Bitmap.new(368, 32)
money_string = "打败敌人获得 金币"
@money_window.contents.font.size = 16
@money_window.contents.font.name = Font.default_name
#@win_window.contents.font.size = Font.default_size
@money_window.contents.font.color = Color.new(255,255,255,255)
@money_window.contents.draw_text(5, -8, 268, 32, money_string)
@money_window.z = 9999
@money_window.visible = false
@money_window.windowskin = RPG::Cache.windowskin("plainpearl.png")
#if @treasures.size != 3 and @treasures.size > 3
#@win_item_window = Window_Base.new(205, 146 + 116 - 15, 238, 48)
@win_item_window = Window_Base.new(120, 146 + 116 - 15, 400, 150)
#@win_item_window = Window_Base.new(205 + 48, 146 + 116 - 15, 118, 88)
@win_item_window.contents = Bitmap.new(400, 32)
win_item_string = "获得物品"
@win_item_window.contents.font.size = 16
@win_item_window.contents.font.name = Font.default_name
@win_item_window.contents.font.color = Color.new(255,255,255,255)
@win_item_window.contents.draw_text(150, -8, 200, 32, win_item_string)
@win_item_window.z = 9999
@win_item_window.visible = false
@win_item_window.windowskin = RPG::Cache.windowskin("plainpearl.png")
# end
refresh
end
#--------------------------------------------------------------------------
# ● 描绘物品名
# item : 物品
# x : 描画目标 X 坐标
# y : 描画目标 Y 坐标
#--------------------------------------------------------------------------
def draw_item_name1(item, x, y)
if item == nil
return
end
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
self.contents.font.color = Color.new(-255, -255, -255, 255)
self.contents.font.size = 18
self.contents.draw_text(x +24, y, 212, 32, item.name)
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
x = 4
#self.contents.font.color = normal_color
20.times{Graphics.update}
@exp_window.visible = true
self.contents.font.color = Color.new(-255,-255,-255,255)
cx = contents.text_size(@exp.to_s).width
#self.contents.draw_text(155, 74, cx, 32, @exp.to_s)
# if @treasures.size != 3
self.contents.draw_text(155, 74 + 114 - 5, cx, 32, @exp.to_s)
# else
# self.contents.draw_text(155, 74 + 114 + 35, cx, 32, @exp.to_s)
# end
#self.contents.draw_text(x, 0, cx, 32, @exp.to_s)
x += cx + 4
20.times{Graphics.update}
#self.contents.font.color = system_color
#cx = contents.text_size("").width
#self.contents.draw_text(x, 0, 64, 32, "")
#x += cx + 16
#self.contents.font.color = normal_color
self.contents.font.color = Color.new(-255,-255,-255,255)
cx = contents.text_size(@gold.to_s).width
#self.contents.draw_text(x, 0, cx, 32, @gold.to_s)
#self.contents.draw_text(145, 74 + 60, cx, 32, @gold.to_s)
@money_window.visible = true
# if @treasures.size != 3
self.contents.draw_text(140, 74 + 172 - 10, cx, 32, @gold.to_s)
# else
# self.contents.draw_text(140, 74 + 172 + 30, cx, 32, @gold.to_s)
# end
x += cx+20
#self.contents.font.color = system_color
#self.contents.draw_text(x, 0, 128, 32, $data_system.words.gold)
y = 282 + 26#21 - 15
20.times{Graphics.update}
for item in @treasures
#self.contents.color = Color.new(-255,-255,-255,255)
#self.contents.draw_item_name(item, 90, y)
# if @treasures.size != 3 and @treasures.size > 3
@win_item_window.visible = true
# end
draw_item_name1(item,x-200 ,320)#90, y)
#draw_item_name(item,90, y)
x += 120
y += 32
end
20.times{Graphics.update}
end
def dispose
super
@win_window.dispose
@exp_window.dispose
@money_window.dispose
@win_item_window.dispose
end
end