class Window_NewEquip < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(300, 20, 350, 450)
self.contents = Bitmap.new(width - 32, height - 32)
self.index = 0
self.active = false
self.opacity = 0
@item_max = 5
@old_index = $game_temp.cms_index
refresh
end
#--------------------------------------------------------------------------
# * Item Acquisition
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.size = 18
self.contents.font.bold = true
@actor = $game_party.actors[$game_temp.cms_index]
self.contents.draw_text(164, 10, 100, 32, @actor.name)
draw_actor_state(@actor, 164, 42)
self.contents.draw_text(164, 74, 100, 32, "LV #{@actor.level}")
self.contents.blt(20,20,RPG::Cache.picture("Faces/" + @actor.character_name), Rect.new(0,0,100,100))
@data = []
@data.push($data_weapons[@actor.weapon_id])
@data.push($data_armors[@actor.armor1_id])
@data.push($data_armors[@actor.armor2_id])
@data.push($data_armors[@actor.armor3_id])
@data.push($data_armors[@actor.armor4_id])
@item_max = @data.size
self.contents.font.color = system_color
y = 115
self.contents.draw_text(14, 25 * 0 + y, 92, 32, $data_system.words.weapon)
self.contents.draw_text(14, 25 * 1 + y, 92, 32, $data_system.words.armor1)
self.contents.draw_text(14, 25 * 2 + y, 92, 32, $data_system.words.armor2)
self.contents.draw_text(14, 25 * 3 + y, 92, 32, $data_system.words.armor3)
self.contents.draw_text(15, 25 * 4 + y, 92, 32, $data_system.words.armor4)
draw_item_name(@data[0], 110, 25 * 0 + y)
draw_item_name(@data[1], 110, 25 * 1 + y)
draw_item_name(@data[2], 110, 25 * 2 + y)
draw_item_name(@data[3], 110, 25 * 3 + y)
draw_item_name(@data[4], 110, 25 * 4 + y)
self.contents.font.color = normal_color
self.contents.draw_text(14, 250, 500, 32, $data_system.words.str)
self.contents.draw_text(14, 270, 500, 32, $data_system.words.atk)
self.contents.draw_text(14, 290, 500, 32, $data_system.words.int)
self.contents.draw_text(14, 310, 500, 32, $data_system.words.dex)
self.contents.draw_text(144, 250, 500, 32, $data_system.words.agi)
self.contents.draw_text(144, 270, 500, 32, $data_system.words.pdef)
self.contents.draw_text(144, 290, 500, 32, $data_system.words.mdef)
up_color = Color.new(60, 255, 255)
str = @actor.str.to_s
if @new_str != nil
str = @new_str.to_s
@actor.str == @new_str ? self.contents.font.color = normal_color : @actor.str < @new_str ?
self.contents.font.color = up_color : self.contents.font.color = disabled_color
end
self.contents.draw_text(25, 250, 100, 32, str, 2)
atk = @actor.atk.to_s
if @new_atk != nil
atk = @new_atk.to_s
@actor.atk == @new_atk ? self.contents.font.color = normal_color : @actor.atk < @new_atk ?
self.contents.font.color = up_color : self.contents.font.color = disabled_color
end
self.contents.draw_text(25, 270, 100, 32, atk, 2)
int = @actor.int.to_s
if @new_int != nil
int = @new_int.to_s
@actor.int == @new_int ? self.contents.font.color = normal_color : @actor.int < @new_int ?
self.contents.font.color = up_color : self.contents.font.color = disabled_color
end
self.contents.draw_text(25, 290, 100, 32, int, 2)
agi = @actor.agi.to_s
if @new_agi != nil
agi = @new_agi.to_s
@actor.agi == @new_agi ? self.contents.font.color = normal_color : @actor.agi < @new_agi ?
self.contents.font.color = up_color : self.contents.font.color = disabled_color
end
self.contents.draw_text(160, 250, 100, 32, agi, 2)
pdef = @actor.pdef.to_s
if @new_pdef != nil
pdef = @new_pdef.to_s
@actor.pdef == @new_pdef ? self.contents.font.color = normal_color : @actor.pdef < @new_pdef ?
self.contents.font.color = up_color : self.contents.font.color = disabled_color
end
self.contents.draw_text(160, 270, 100, 32, pdef, 2)
mdef = @actor.mdef.to_s
if @new_mdef != nil
mdef = @new_mdef.to_s
@actor.mdef == @new_mdef ? self.contents.font.color = normal_color : @actor.mdef < @new_mdef ?
self.contents.font.color = up_color : self.contents.font.color = disabled_color
end
self.contents.draw_text(160, 290, 100, 32, mdef, 2)
dex = @actor.dex.to_s
if @new_mdef != nil
dex = @new_dex.to_s
@actor.dex == @new_dex ? self.contents.font.color = normal_color : @actor.dex < @new_dex ?
self.contents.font.color = up_color : self.contents.font.color = disabled_color
end
self.contents.draw_text(160, 310, 100, 32, dex, 2)
self.contents.font.color = normal_color
self.contents.draw_text(14, 353, 500, 32, "EXP")
self.contents.draw_text(14, 370, 500, 32, "NEXT")
self.contents.draw_text(14, 353, 240, 32, "#{@actor.exp}",2)
self.contents.draw_text(14, 370, 240, 32, "#{@actor.next_exp}",2)
end
#--------------------------------------------------------------------------
# * Set parameters after changing equipment
#--------------------------------------------------------------------------
def set_new_parameters(new_str, new_atk, new_int, new_agi, new_pdef, new_mdef, new_dex)
if @new_atk != new_atk or @new_pdef != new_pdef or @new_mdef != new_mdef or
@new_str != new_str or @new_int != new_int or @new_agi != new_agi or @new_dex != new_dex
@new_str = new_str
@new_atk = new_atk
@new_int = new_int
@new_agi = new_agi
@new_pdef = new_pdef
@new_mdef = new_mdef
@new_dex = new_dex
refresh
end
end
#--------------------------------------------------------------------------
# * Cursor Rectangle Update
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(14, @index * 25 + 115, 0, 0)
end
end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
def update
super
if @old_index != $game_temp.cms_index
refresh
@old_index = $game_temp.cms_index
end
end
end