gzdoom-gles/wadsrc/static/zscript/statusbar/statusbar.txt
2017-03-22 18:38:09 +01:00

116 lines
2.9 KiB
Text

class BaseStatusBar native ui
{
enum EPop
{
POP_NoChange = -1,
POP_None,
POP_Log,
POP_Keys,
POP_Status
}
// Status face stuff
enum EMug
{
ST_NUMPAINFACES = 5,
ST_NUMSTRAIGHTFACES = 3,
ST_NUMTURNFACES = 2,
ST_NUMSPECIALFACES = 3,
ST_NUMEXTRAFACES = 2,
ST_FACESTRIDE = ST_NUMSTRAIGHTFACES+ST_NUMTURNFACES+ST_NUMSPECIALFACES,
ST_NUMFACES = ST_FACESTRIDE*ST_NUMPAINFACES+ST_NUMEXTRAFACES,
ST_TURNOFFSET = ST_NUMSTRAIGHTFACES,
ST_OUCHOFFSET = ST_TURNOFFSET + ST_NUMTURNFACES,
ST_EVILGRINOFFSET = ST_OUCHOFFSET + 1,
ST_RAMPAGEOFFSET = ST_EVILGRINOFFSET + 1,
ST_GODFACE = ST_NUMPAINFACES*ST_FACESTRIDE,
ST_DEADFACE = ST_GODFACE + 1
}
enum EHudState
{
HUD_StatusBar,
HUD_Fullscreen,
HUD_None,
HUD_AltHud // Used for passing through popups to the alt hud
}
enum EHudDraw
{
HUD_Normal,
HUD_HorizCenter
}
const XHAIRSHRINKSIZE =(1./18);
const XHAIRPICKUPSIZE = (2+XHAIRSHRINKSIZE);
native int ST_X, ST_Y;
native int RelTop;
native int HorizontalResolution, VerticalResolution;
native bool Scaled;
native bool Centering;
native bool FixedOrigin;
native bool CompleteBorder;
native double CrosshairSize;
native double Displacement;
native PlayerInfo CPlayer;
native bool ShowLog;
native void SetSize(int height, int vwidth, int vheight);
virtual void Init() {}
native virtual void SetScaled(bool scale, bool force = false);
native virtual void Tick ();
native virtual void Draw (int state, double TicFrac);
native virtual void ScreenSizeChanged ();
virtual void FlashItem (class<Inventory> itemtype) {}
virtual void AttachToPlayer (PlayerInfo player) { CPlayer = player; }
virtual void FlashCrosshair () { CrosshairSize = XHAIRPICKUPSIZE; }
virtual void NewGame () {}
virtual void ShowPop (int popnum) { ShowLog = (popnum == POP_Log && !ShowLog); }
virtual clearscope void ReceivedWeapon (Weapon weapn) {}
virtual bool MustDrawLog(int state) { return true; }
virtual void SetMugShotState (String state_name, bool wait_till_done=false, bool reset=false) {}
native void RefreshBackground () const;
native Inventory ValidateInvFirst (int numVisible) const;
//============================================================================
//
// DBaseStatusBar :: GetCurrentAmmo
//
// Returns the types and amounts of ammo used by the current weapon. If the
// weapon only uses one type of ammo, it is always returned as ammo1.
//
//============================================================================
Inventory, Inventory, int, int GetCurrentAmmo () const
{
Ammo ammo1, ammo2;
if (CPlayer.ReadyWeapon != NULL)
{
ammo1 = CPlayer.ReadyWeapon.Ammo1;
ammo2 = CPlayer.ReadyWeapon.Ammo2;
if (ammo1 == NULL)
{
ammo1 = ammo2;
ammo2 = NULL;
}
}
else
{
ammo1 = ammo2 = NULL;
}
let ammocount1 = ammo1 != NULL ? ammo1.Amount : 0;
let ammocount2 = ammo2 != NULL ? ammo2.Amount : 0;
return ammo1, ammo2, ammocount1, ammocount2;
}
}