class Window_EquipStatus < Window_Base
def refresh
contents.clear
draw_actor_name(@actor, 0, 0) if @actor
s=0
8.times {|i|
case i
when 1, 4, 7
s+=1
next
end
draw_item(0, line_height * (i-s + 1), i)
}
end
end
class Window_EquipCommand < Window_HorzCommand
def window_width; return Graphics.width * 2 / 5; end
def visible_line_number; return 3; end
end
class Window_EquipActor < Window_Base
def window_width; return Graphics.width * 2 / 5; end
def refresh
contents.clear
return unless @actor
draw_actor_face(@actor, 0, 0)
draw_actor_name(@actor, 120, 0)
draw_actor_class(@actor, 120, 30)
end
end # Window_EquipActor
class Scene_Equip < Scene_MenuBase
def start
super
create_help_window
create_command_window
create_status_window
create_slot_window
create_item_window
end
def create_status_window
wx = Graphics.width - (Graphics.width * 2 / 5)
wy = @actor_window.y + @actor_window.height
@status_window = Window_EquipStatus.new(wx, wy)
@status_window.viewport = @viewport
@status_window.actor = @actor
end
def create_command_window
wx = Graphics.width - (Graphics.width * 2 / 5)
wy = @help_window.height
ww = Graphics.width * 2 / 5
@command_window = Window_EquipCommand.new(wx, wy, ww)
@command_window.viewport = @viewport
@command_window.help_window = @help_window
if !$game_temp.scene_equip_index.nil?
@command_window.select($game_temp.scene_equip_index)
@command_window.oy = $game_temp.scene_equip_oy
end
$game_temp.scene_equip_index = nil
$game_temp.scene_equip_oy = nil
@command_window.set_handler(:equip, method(:command_equip))
@command_window.set_handler(:optimize, method(:command_optimize))
@command_window.set_handler(:clear, method(:command_clear))
@command_window.set_handler(:cancel, method(:return_scene))
@command_window.set_handler(:pagedown, method(:next_actor))
@command_window.set_handler(:pageup, method(:prev_actor))
process_custom_equip_commands
create_actor_window
end
def create_actor_window
wx = Graphics.width - (Graphics.width * 2 / 5)
wy = @command_window.y + @command_window.height
@actor_window = Window_EquipActor.new(wx, wy)
@actor_window.viewport = @viewport
@actor_window.actor = @actor
end
def create_slot_window
wx = 0
wy = @help_window.height
ww = Graphics.width - @status_window.width
@slot_window = Window_EquipSlot.new(wx, wy, ww)
@slot_window.viewport = @viewport
@slot_window.help_window = @help_window
@slot_window.status_window = @status_window
@slot_window.actor = @actor
@slot_window.set_handler(:ok, method(:on_slot_ok))
@slot_window.set_handler(:cancel, method(:on_slot_cancel))
end
end