tell me how this works for you did the best i can with what info you gave
#==============================================================================
# Hud
#------------------------------------------------------------------------------
# This class was modified to support SR display and modify the number of
# skills left to use.
#==============================================================================
class Hud < Sprite
#----------------------------------------------------------------------------
# Initialization
# viewport - the viewport for the sprite
#----------------------------------------------------------------------------
def initialize(viewport = nil)
# call superclass method
super
# create positions
create_positions
# get height
h = BlizzABS::Config::DIRECT_HOTKEYS ? @hud_height - 28 : @hud_height
# create bitmap
self.bitmap = Bitmap.new(@hud_width, h)
# set font
self.bitmap.font.name = 'Arial'
# set font size
self.bitmap.font.size = 16
# set font to bold
self.bitmap.font.bold = true
# set x, y position
self.x, self.y = -10, -10
# set z coordinate
self.z = 1000
# draw basic HUD
draw_basic
# update
update
end
#----------------------------------------------------------------------------
# create_positions
# Sets drawing positions. This method can be aliased and the positions
# modified to create a different HUD.
#----------------------------------------------------------------------------
def create_positions
@original_width = @hud_width = 670
@original_height = @hud_height = 140
end
#----------------------------------------------------------------------------
# draw_basic
# Draws the HUD template.
#----------------------------------------------------------------------------
def draw_basic
# fill with grey rectangle
self.bitmap.fill_rect(0, 0, self.bitmap.width, self.bitmap.height,
Color.new(0, 0, 0, 0))
# determine color depending on HUD style
color = Color.new(0, 0, 0, 0)
end
#----------------------------------------------------------------------------
# draw_hp
# Draws the HP display.
#----------------------------------------------------------------------------
def draw_hp
# set current variables
@hp, @maxhp = actor.hp, actor.maxhp
# remove old display
self.bitmap.fill_rect(135 ,0, 488, 32, Color.new(0, 0, 0, 0))
# draw gradient bar
self.draw_actor_hp(actor, 135,0, width = 488)
end
#----------------------------------------------------------------------------
# draw_sp
# Draws the SP display.
#----------------------------------------------------------------------------
def draw_sp
# set current variables
@sp, @maxsp = actor.sp, actor.maxsp
# remove old display
self.bitmap.fill_rect(135 ,42, 488, 32, Color.new(0, 0, 0, 0))
# draw gradient bar
self.draw_actor_sp(actor, 135,42, width = 488)
end
#----------------------------------------------------------------------------
# draw_exp
# Draws the EXP display.
#----------------------------------------------------------------------------
def draw_exp
# set current variables
@now_exp, @next_exp = actor.now_exp, actor.next_exp
# remove old display
self.bitmap.fill_rect(135 ,50, 488, 32, Color.new(0, 0, 0, 0))
# draw gradient bar
self.draw_actor_exp(actor, 135, 50, width = 488)
end
#----------------------------------------------------------------------------
# draw_hp
# Draws the HP display.
#----------------------------------------------------------------------------
def draw_graphic
# set current variables
@name = actor.name
# remove old display
self.bitmap.fill_rect(20 ,117, 100, 100, Color.new(0, 0, 0, 0))
# load bitmap
bitmap = RPG::Cache.picture(@name+'avatar')
s# draw bitmap
self.bitmap.blt(@face_x, @face_y, bitmap, Rect.new(20, 117, 670, 140))
end
end
#----------------------------------------------------------------------------
# update
# Checks if HUD needs refreshing.
#----------------------------------------------------------------------------
def update
# if actor doesn't exist
if actor == nil
# unless already drawn empty HUD
unless @empty_hud_drawn
# draw HUD template
draw_basic
# empty HUD was drawn
@empty_hud_drawn = true
end
else
# if HUD needs refresh
if $game_temp.hud_refresh
# draw all data about actor
draw_graphic
draw_hp
draw_sp
draw_exp
# remove flag
$game_temp.hud_refresh = nil
else
# draw data that needs to ve updated
test_graphic
test_hp
test_sp
test_exp
end
# empty HUD wasn't drawn
@empty_hud_drawn = false
end
end
#----------------------------------------------------------------------------
# test_hp
# Tests and draws the HP.
#----------------------------------------------------------------------------
def test_hp
# draw new HP if HP or max HP have changed
draw_hp if actor.hp != @hp || actor.maxhp != @maxhp
end
#----------------------------------------------------------------------------
# test_sp
# Tests and draws the SP.
#----------------------------------------------------------------------------
def test_sp
# draw new SP if SP or max SP have changed
draw_sp if actor.sp != @sp || actor.maxsp != @maxsp
end
#----------------------------------------------------------------------------
# test_exp
# Tests and draws the EXP.
#----------------------------------------------------------------------------
def test_exp
# draw new EXP if EXP or NEXT_EXP have changed
draw_exp if actor.now_exp != @now_exp || actor.next_exp != @next_exp
end
#----------------------------------------------------------------------------
# test_exp
# Tests and draws the EXP.
#----------------------------------------------------------------------------
def test_graphic
# draw new GRAPHIC if NAME has changed
draw_graphic if actor.name != @name
end
#----------------------------------------------------------------------------
# actor
# Returns the party leader's battler for easier reference.
#----------------------------------------------------------------------------
def actor
return $game_player.battler
end
end
#==============================================================================
# Game_Actor
#==============================================================================
class Game_Actor
#----------------------------------------------------------------------------
# now_exp
# Returns the EXP collected in this level.
#----------------------------------------------------------------------------
def now_exp
return @exp - @exp_list[@level]
end
#----------------------------------------------------------------------------
# next_exp
# Returns the EXP needed to level up as number.
#----------------------------------------------------------------------------
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end
#==============================================================================
# Hotkey_Assignment
#------------------------------------------------------------------------------
# This class creates and display currently assigned hotkeys and is more
# effiecient than the Window class.
#==============================================================================
class Hotkey_Assignment < Sprite
#----------------------------------------------------------------------------
# Initialization
# viewport - the viewport for the sprite
#----------------------------------------------------------------------------
def initialize(viewport = nil)
# call superclass
super
# create bitmap
self.bitmap = Bitmap.new(320, 32)
# set font to bold
self.bitmap.font.bold = true
# decrease font size
self.bitmap.font.size -= 8
# set font color
self.bitmap.font.color = system_color
# set x and y position
self.x, self.y, self.z = 160, 445, 1100
# skill IDs on hotkeys
@skills = BlizzABS::Cache::EmptyKeys
# item IDs on hotkeys
@items = BlizzABS::Cache::EmptyKeys
# update display
update
end
end