`#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=`

# EXP in HUD for Blizz-ABS by Blizzard

# Version: 1.01b

# Type: Blizz-ABS Add-on

# Date: 27.11.2008

# Date 1.01b: 23.2.2010

#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

#

# This script is to be distributed under the same terms and conditions like

# the script it was created for: Blizz-ABS.

#

#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

#

# Information:

#

# This script must be placed below Blizz-ABS and requires Blizz-ABS v2.7 or

# higher to work properly. It will add an EXP bar to the default HUD.

#

#

# If you find any bugs, please report them here:

# http://forum.chaos-project.com

#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=

if !$BlizzABS || BlizzABS::VERSION < 2.7

raise 'ERROR: The "EXP in HUD" requires Blizz-ABS 2.7 or higher.'

end

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

# START Configuration

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

# word displayed for EXP

EXP_WORD = 'EXP'

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

# END Configuration

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

$blizzabs_exp_in_hud = 1.01

#==============================================================================

# Hud

#==============================================================================

class Hud

alias create_positions_expinhud_later create_positions

def create_positions

create_positions_expinhud_later

@exp_x, @exp_y = 4, 49 + @hud_height - @original_height

@hud_height += 16

@hot_y += 16

@left_y += 16

end

alias draw_basic_expinhud_later draw_basic

def draw_basic

draw_basic_expinhud_later

color = case BlizzABS::Config::HUD_TYPE

when 0 then Color.new(255, 255, 255, 192)

when 1 then Color.new(0, 0, 0, 0)

end

self.bitmap.fill_rect(@exp_x+32, @exp_y+3, 116, 14, color) if color.is_a?(Color)

self.bitmap.fill_rect(@exp_x, @exp_y, 32, 20, Color.new(0, 0, 0, 128))

self.bitmap.font.color = system_color

self.bitmap.draw_text_full(@exp_x, @exp_y, 80, 20, EXP_WORD)

self.bitmap.font.color = normal_color

end

alias draw_empty_expinhud_later draw_empty

def draw_empty

draw_empty_expinhud_later

self.bitmap.gradient_bar_hud(@exp_x + 32, @exp_y + 3, 114, 0, 'hud_white_bar')

self.bitmap.font.color = disabled_color

self.bitmap.draw_text_full(@exp_x + 54, @exp_y, 84, 20, '0', 2)

@exp = nil

end

def draw_exp

@exp = actor.exp

rate = (actor.next_exp != 0 ? actor.now_exp.to_f / actor.next_exp : 1)

self.bitmap.gradient_bar_hud(@exp_x + 32, @exp_y + 3, 114, rate, 'hud_white_bar')

self.bitmap.font.color = normal_color

self.bitmap.draw_text_full(@exp_x + 54, @exp_y, 84, 20, actor.next_rest_exp_s, 2)

end

alias upd_expinhud_later update

def update

$game_temp.hud_refresh ? draw_exp : test_exp if actor != nil

upd_expinhud_later

end

def test_exp

draw_exp if actor.exp != @exp

end

end