#==============================================================================
# ** Window_EquipLeft
#------------------------------------------------------------------------------
# This window displays actor parameter changes on the equipment screen.
#==============================================================================
class Window_EquipLeft < Window_Base
attr_accessor :equip
#--------------------------------------------------------------------------
# * Object Initialization
# actor : actor
#--------------------------------------------------------------------------
def initialize(actor)
super(0, 64, 272, 192)
self.contents = Bitmap.new(width - 32, height - 32)
@actor = actor
@equip = [0, 0, 0, 0, 0, 0, 0, 0]
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_name(@actor, 4, 0)
draw_actor_class(@actor, 120, 0)
draw_actor_level(@actor, 4, 20)
draw_actor_parameter(@actor, 4, 42, 0)
draw_actor_parameter(@actor, 4, 57, 1)
draw_actor_parameter(@actor, 4, 72, 2)
draw_actor_parameter(@actor, 4, 87, 3)
draw_actor_parameter(@actor, 4, 102, 4)
draw_actor_parameter(@actor, 4, 117, 5)
draw_actor_parameter(@actor, 4, 132, 6)
if @new_atk != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 42, 40, 32, "->", 1)
if @equip[0] == 0
self.contents.font.color = normal_color
elsif @equip[0] == -1
self.contents.font.color = decrease_color
else
self.contents.font.color = increase_color
end
self.contents.draw_text(200, 42, 36, 32, @new_atk.to_s, 2)
end
if @new_pdef != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 57, 40, 32, "->", 1)
if @equip[1] == 0
self.contents.font.color = normal_color
elsif @equip[1] == -1
self.contents.font.color = decrease_color
else
self.contents.font.color = increase_color
end
self.contents.draw_text(200, 57, 36, 32, @new_pdef.to_s, 2)
end
if @new_mdef != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 72, 40, 32, "->", 1)
if @equip[2] == 0
self.contents.font.color = normal_color
elsif @equip[2] == -1
self.contents.font.color = decrease_color
else
self.contents.font.color = increase_color
end
self.contents.draw_text(200, 72, 36, 32, @new_mdef.to_s, 2)
end
if @new_str != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 87, 40, 32, "->", 1)
if @equip[3] == 0
self.contents.font.color = normal_color
elsif @equip[3] == -1
self.contents.font.color = decrease_color
else
self.contents.font.color = increase_color
end
self.contents.draw_text(200, 87, 36, 32, @new_str.to_s, 2)
end
if @new_dex != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 102, 40, 32, "->", 1)
if @equip[4] == 0
self.contents.font.color = normal_color
elsif @equip[4] == -1
self.contents.font.color = decrease_color
else
self.contents.font.color = increase_color
end
self.contents.draw_text(200, 102, 36, 32, @new_dex.to_s, 2)
end
if @new_agi != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 117, 40, 32, "->", 1)
if @equip[5] == 0
self.contents.font.color = normal_color
elsif @equip[5] == -1
self.contents.font.color = decrease_color
else
self.contents.font.color = increase_color
end
self.contents.draw_text(200, 117, 36, 32, @new_agi.to_s, 2)
end
if @new_int != nil
self.contents.font.color = system_color
self.contents.draw_text(160, 132, 40, 32, "->", 1)
if @equip[6] == 0
self.contents.font.color = normal_color
elsif @equip[6] == -1
self.contents.font.color = decrease_color
else
self.contents.font.color = increase_color
end
self.contents.draw_text(200, 132, 36, 32, @new_agi.to_s, 2)
end
end
#--------------------------------------------------------------------------
# * Set parameters after changing equipment
# new_atk : attack power after changing equipment
# new_pdef : physical defense after changing equipment
# new_mdef : magic defense after changing equipment
#--------------------------------------------------------------------------
def set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex, new_agi, new_int)
if @new_atk != new_atk or @new_pdef != new_pdef or @new_mdef != new_mdef or @new_str != new_str or @new_dex != new_dex or @new_agi != new_agi or @new_int != new_int
@new_atk = new_atk
@new_pdef = new_pdef
@new_mdef = new_mdef
@new_str = new_str
@new_dex = new_dex
@new_agi = new_agi
@new_int = new_int
refresh
end
end
end