#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
# This class is for all in-game windows.
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# * Draw Graphic
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# frame : frame of animation we want to draw.
#--------------------------------------------------------------------------
def draw_actor_graphic_anim(actor, x, y, frame = 0)
bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
cw = bitmap.width / 4
ch = bitmap.height / 4
src_rect = Rect.new(0 + (frame * bitmap.width / 4), 0, cw, ch)
self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
end
end
#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
# This window displays party member status on the menu screen.
#==============================================================================
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# * Constant Variables
#--------------------------------------------------------------------------
FRAME_UPDATE = 10
#--------------------------------------------------------------------------
# * Alias Methods
#--------------------------------------------------------------------------
alias pasq_animatedchar_window_menustatus_initialize initialize
alias pasq_animatedchar_window_menustatus_update update
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
pasq_animatedchar_window_menustatus_initialize
@update_in = FRAME_UPDATE
@step = 0
end
#--------------------------------------------------------------------------
# * Refresh !OVERRIDE!
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 64
y = i * 116
actor = $game_party.actors[i]
draw_actor_graphic_anim(actor, x - 40, y + 80)
draw_actor_name(actor, x, y)
draw_actor_class(actor, x + 144, y)
draw_actor_level(actor, x, y + 32)
draw_actor_state(actor, x + 90, y + 32)
draw_actor_exp(actor, x, y + 64)
draw_actor_hp(actor, x + 236, y + 32)
draw_actor_sp(actor, x + 236, y + 64)
end
end
#--------------------------------------------------------------------------
# * Frame Update !ALIAS!
#--------------------------------------------------------------------------
def update
pasq_animatedchar_window_menustatus_update
# Update timer.
@update_in -= 1
# If the timer has run it's course.
if @update_in == 0
# Update which step we are on.
@step += 1
# Reset the step if necessary.
@step = 0 if @step == 4
# Reset the timer.
@update_in = FRAME_UPDATE
clear = Color.new(0, 0, 0, 0)
# Draw the animated frames.
for i in 0...$game_party.actors.size
actor, x, y = $game_party.actors[i], 24, i * 116
self.contents.fill_rect(0, y, 64, 64, clear)
draw_actor_graphic_anim(actor, x, y + 80, @step)
end
end
end
end