mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 14:51:51 +00:00
Fixed status bar chain wiggling when paused
Made ZScript implementation of chain wiggling in Heretic status bar as close as possible to C++ SBARINFO one https://forum.zdoom.org/viewtopic.php?t=59840
This commit is contained in:
parent
a2b9a70835
commit
b4d3715345
1 changed files with 7 additions and 1 deletions
|
@ -6,6 +6,7 @@ class HereticStatusBar : BaseStatusBar
|
|||
HUDFont mBigFont;
|
||||
InventoryBarState diparms;
|
||||
InventoryBarState diparms_sbar;
|
||||
private int wiggle;
|
||||
|
||||
|
||||
override void Init()
|
||||
|
@ -40,6 +41,12 @@ class HereticStatusBar : BaseStatusBar
|
|||
{
|
||||
Super.Tick();
|
||||
mHealthInterpolator.Update(CPlayer.health);
|
||||
|
||||
// wiggle the chain if it moves
|
||||
if (level.time & 1)
|
||||
{
|
||||
wiggle = (mHealthInterpolator.GetValue() != CPlayer.health) && Random[ChainWiggle](0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
override void Draw (int state, double TicFrac)
|
||||
|
@ -73,7 +80,6 @@ class HereticStatusBar : BaseStatusBar
|
|||
DrawImage("CHAINCAC", (0, 190), DI_ITEM_OFFSETS);
|
||||
// wiggle the chain if it moves
|
||||
int inthealth = mHealthInterpolator.GetValue();
|
||||
int wiggle = (inthealth != CPlayer.health) && Random[ChainWiggle](0, 1);
|
||||
DrawGem("CHAIN", "LIFEGEM2",inthealth, CPlayer.mo.GetMaxHealth(true), (2, 191 + wiggle), 15, 25, 16, (multiplayer? DI_TRANSLATABLE : 0) | DI_ITEM_LEFT_TOP);
|
||||
DrawImage("LTFACE", (0, 190), DI_ITEM_OFFSETS);
|
||||
DrawImage("RTFACE", (276, 190), DI_ITEM_OFFSETS);
|
||||
|
|
Loading…
Reference in a new issue