mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-28 15:02:01 +00:00
3e67a8bafa
- better handling of ForceScale for the fullscreen HUD that doesn't mess around with CVARs. - moved the mug shot into the status bar, because this is global state that needs to be shared between different pieces of code which want to display a mug shot. - SBARINFO should work off the current status bar settings instead of the ones stored in its script object
80 lines
No EOL
1.5 KiB
Text
80 lines
No EOL
1.5 KiB
Text
|
|
struct SBarInfo native ui
|
|
{
|
|
native void SetScaled(bool scaled);
|
|
native void Destroy();
|
|
native void AttachToPlayer(PlayerInfo player);
|
|
native void Draw(int state);
|
|
native void NewGame();
|
|
native bool MustDrawLog(int state);
|
|
native void Tick();
|
|
native void FlashItem(class<Inventory> itemtype);
|
|
native void ShowPop(int popnum);
|
|
}
|
|
|
|
|
|
// The sole purpose of this wrapper is to elimintate the native dependencies of the status bar object
|
|
// because those would seriously impede the script conversion of the base class.
|
|
|
|
class SBarInfoWrapper : BaseStatusBar
|
|
{
|
|
private clearscope SBarInfo core;
|
|
|
|
override void OnDestroy()
|
|
{
|
|
if (core != null) core.Destroy(); // note that the core is not a GC'd object!
|
|
Super.OnDestroy();
|
|
}
|
|
|
|
override void SetScaled(bool scale, bool force)
|
|
{
|
|
Super.SetScaled(scale, force);
|
|
core.SetScaled(Scaled);
|
|
}
|
|
|
|
override void AttachToPlayer(PlayerInfo player)
|
|
{
|
|
Super.AttachToPlayer(player);
|
|
core.AttachToPlayer(player);
|
|
}
|
|
|
|
override void Draw(int state, double TicFrac)
|
|
{
|
|
Super.Draw(state, TicFrac);
|
|
core.Draw(state);
|
|
}
|
|
|
|
override void NewGame()
|
|
{
|
|
Super.NewGame();
|
|
if (CPlayer != NULL)
|
|
{
|
|
AttachToPlayer(CPlayer);
|
|
core.NewGame();
|
|
}
|
|
}
|
|
|
|
override bool MustDrawLog(int state)
|
|
{
|
|
return core.MustDrawLog(state);
|
|
}
|
|
|
|
override void Tick()
|
|
{
|
|
Super.Tick();
|
|
core.Tick();
|
|
}
|
|
|
|
override void FlashItem(class<Inventory> itemtype)
|
|
{
|
|
core.FlashItem(itemtype);
|
|
}
|
|
|
|
override void ShowPop(int popnum)
|
|
{
|
|
Super.ShowPop(popnum);
|
|
core.ShowPop(popnum);
|
|
}
|
|
|
|
|
|
} |