Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation
previous class next class | frames no frames

# TribesGUI.HUDHealthBarVehicle

00001 00002 00003 00004 00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054

    class HUDHealthBarVehicle extends HUDValueBar;

    var() config HUDMaterial	lowHealthAlertMaterial;
    var() config float			lowHealthThreshold;

    //
    // Updates the data
    function UpdateData(ClientSideCharacter c)
    {
    	value = c.vehicleHealth;
    	maximumValue = c.vehicleHealthMaximum;

    	super.UpdateData(c);
    }

    //
    // Renders the element. Overridden here due to the special requirements
    // of the effects on the health bar when healing & losing health
    //
    function RenderElement(Canvas C)
    {
    	local float oldClipX;

    	// calc the actual health ratio
    	CalculateRatio();

    	// draw the empty bar
    	RenderHUDMaterial(C, activeEmptyTexture, Width, Height);
    	// DrawTile sets CurX, CurY
    	C.CurX = 0;
    	C.CurY = 0;

    	// Clip to the current bar value
    	ClipToValue(C, activeFullTexture, ratio);

    	if(ratio < lowHealthThreshold)
    		// low health flashy warning alert thingy
    		RenderHUDMaterial(C, lowHealthAlertMaterial, Width, Height);
    	else
    		// normal bar
    		RenderHUDMaterial(C, activeFullTexture, Width, Height);

    	// DrawTile sets CurX, CurY
    	C.CurX = 0;
    	C.CurY = 0;

    	// return to the old clip
    	C.ClipX = oldClipX;
    }

    defaultproperties
    {
    	lowHealthThreshold = 0.25
    }

Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation
previous class next class | frames no frames

Class file time: st 16.4.2014 10:20:44.000 - Creation time: st 23.5.2018 00:10:44.312 - Created with UnCodeX