#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# ■ Window_Party
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
class Window_Party < Window_Selectable
def initialize(help_window)
@help_window = help_window
dy = @help_window.height
super(0, dy, Graphics.width, Graphics.height - dy)
select(0)
activate
refresh
end
def item_max
return @data ? @data.size : 1
end
def item
return @data && index >= 0 ? @data[index] : nil
end
def item_rect(index)
rect = Rect.new
rect.width = item_width
rect.height = item_height
rect.x = index % col_max * (item_width + spacing)
rect.y = item_height + (index / col_max * item_height)
rect
end
def refresh
make_item_list
create_contents
draw_header
draw_all_items
end
def draw_header
reset_font_settings
change_color(system_color)
rect = Rect.new(24, 0, contents.width, line_height)
draw_text(rect, 'Name')
rect.x += 156
draw_text(rect, 'HP')
rect.x += 180
draw_text(rect, 'MP')
end
def make_item_list
@data = []
$game_party.all_members.each {|member| @data << member.id if !member.nil?}
end
def draw_item(index)
return if @data[index] == 0
rect = item_rect(index)
actor = $game_actors[@data[index]]
draw_actor(actor, rect)
end
def draw_actor(actor, rect)
change_color(normal_color)
draw_text(rect.x+24, rect.y, contents.width, line_height, actor.name)
draw_actor_hp(actor, rect.x + 180, rect.y)
draw_actor_mp(actor, rect.x + 360, rect.y)
end
def select_last
select(@data.index($game_party.menu_actor.index) || 0)
end
def show
@help_window.show
super
end
def hide
select_last
@help_window.hide
super
end
end
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# ■ Scene_Status
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
class Scene_Status < Scene_MenuBase
def start
super
create_help_window
create_party_window
create_status_window
refresh_help_window
end
def create_help_window
@help_window = Window_Help.new(1)
@help_window.viewport = @viewport
end
def create_party_window
@party_window = Window_Party.new(@help_window)
@party_window.set_handler(:ok, method(:select_actor))
@party_window.set_handler(:cancel, method(:return_scene))
end
def user
@party_window.item
end
def select_actor
@party_window.hide.deactivate
@status_window.show.activate
end
def create_status_window
@status_window = Window_Status.new(@actor)
@status_window.set_handler(:cancel, method(:on_status_cancel))
@status_window.set_handler(:pagedown, method(:next_actor))
@status_window.set_handler(:pageup, method(:prev_actor))
@status_window.deactivate.hide
end
def on_status_cancel
@party_window.show.activate.select(0)
@status_window.hide.deactivate
end
def on_actor_change
@status_window.actor = @actor
@status_window.activate
end
def refresh_help_window
@help_window.contents.clear
@help_window.draw_text_ex(4, 0, "Whose status will you view?")
end
end