HealthBars.as

Summary
HealthBars.as
Variables
m_Slot
m_DynelSlot
m_CurrentHealth
m_MaxHealth
m_Target
m_NameXOrgPos
Functions
Init
SetSlot
onDynelOnClient
onSlotChangedwhen a slot is changed.
onStatUpdatedlistens to a change in stats.
SetMaxHealthRetrieves the maxhealt and creates a factor by dividing it with the number of frames in the active healthbar, if max health is 0 remove the healthbar, othervise set the max health text
UpdatePercent
UpdateHealthUpdates the health text and bar
SlotNewTeamLeader
AddStar
RemoveStar
ResizeHandler

Variables

m_Slot

var m_Slot: Number

m_DynelSlot

var m_DynelSlot: DynelSlot

m_CurrentHealth

var m_CurrentHealth: Number

m_MaxHealth

var m_MaxHealth: Number

m_Target

var m_Target: Number

m_NameXOrgPos

var m_NameXOrgPos: Number

Functions

Init

function Init()

SetSlot

function SetSlot(p_Slot: Number)

onDynelOnClient

function onDynelOnClient(p_OnClient: Boolean)

onSlotChanged

function onSlotChanged(p_Slot: Number,
p_Exists: Boolean)

when a slot is changed.  Match the target to a target enum and update as neccessary.

Parameters

p_Slot:Number - The slot enum as defined under DynelSlot in ASEnums
p_Exists:Booelan - True if the slot has a dynel.

onStatUpdated

function onStatUpdated(p_stat: Number,
p_value: Number)

listens to a change in stats.

Parameters

p_stat:Number - The type of stat, defined in the Stat Enum
p_value:Number - The value of the stat

SetMaxHealth

function SetMaxHealth(p_maxhealth: Number) : Void

Retrieves the maxhealt and creates a factor by dividing it with the number of frames in the active healthbar, if max health is 0 remove the healthbar, othervise set the max health text

Parameters

p_maxhealth:String - the max health as a string

Returns

void

UpdatePercent

function UpdatePercent()

UpdateHealth

function UpdateHealth(p_health: Number,
p_barrier: Number) : Void

Updates the health text and bar

Parameters

p_health:String - the health as a string

Returns

void

SlotNewTeamLeader

function SlotNewTeamLeader(id: com.Utils.ID32)

AddStar

function AddStar()

RemoveStar

function RemoveStar()

ResizeHandler

function ResizeHandler() : Void
var m_Slot: Number
var m_DynelSlot: DynelSlot
var m_CurrentHealth: Number
var m_MaxHealth: Number
var m_Target: Number
var m_NameXOrgPos: Number
function Init()
function SetSlot(p_Slot: Number)
function onDynelOnClient(p_OnClient: Boolean)
function onSlotChanged(p_Slot: Number,
p_Exists: Boolean)
when a slot is changed.
function onStatUpdated(p_stat: Number,
p_value: Number)
listens to a change in stats.
function SetMaxHealth(p_maxhealth: Number) : Void
Retrieves the maxhealt and creates a factor by dividing it with the number of frames in the active healthbar, if max health is 0 remove the healthbar, othervise set the max health text
function UpdatePercent()
function UpdateHealth(p_health: Number,
p_barrier: Number) : Void
Updates the health text and bar
function SlotNewTeamLeader(id: com.Utils.ID32)
function AddStar()
function RemoveStar()
function ResizeHandler() : Void
Close