- Fix issues with startup on fresh config following CVAR overhaul.

This commit is contained in:
Mitchell Richters 2022-10-22 14:42:04 +11:00
parent 4e8331b16b
commit db5fcde0db
6 changed files with 14 additions and 14 deletions

View file

@ -203,7 +203,7 @@ CCMD (togglemessages)
}
}
CVARD_NAMED(Int, hud_flashing, althud_flashing, true, CVAR_ARCHIVE, "enable/disable althud flashing")
CVARD(Bool, althud_flashing, true, CVAR_ARCHIVE, "enable/disable althud flashing")
CUSTOM_CVARD(Int, r_fov, 90, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "change the field of view")
{
if (self < 60) self = 60;

View file

@ -68,7 +68,7 @@ EXTERN_CVAR(Bool, hud_messages)
EXTERN_CVAR(Int, althud_numbertile)
EXTERN_CVAR(Int, althud_numberpal)
EXTERN_CVAR(Int, althud_shadows)
EXTERN_CVAR(Int, althud_flashing)
EXTERN_CVAR(Bool, althud_flashing)
EXTERN_CVAR(Bool, am_textfont)
EXTERN_CVAR(Bool, am_showlabel)

View file

@ -143,10 +143,10 @@ class DukeStatusBar : DukeCommonStatusBar
imgScale = baseScale / siz.Y;
DrawTexture(img, (2, -1.5), DI_ITEM_LEFT_BOTTOM, scale:(imgScale, imgScale));
if (!hud_flashing || p.last_extra > (Duke.MaxPlayerHealth() >> 2) || (PlayClock & 32) || (p.IsFrozen() && p.last_extra < 2))
if (!althud_flashing || p.last_extra > (Duke.MaxPlayerHealth() >> 2) || (PlayClock & 32) || (p.IsFrozen() && p.last_extra < 2))
{
int s = -8;
if (hud_flashing && p.last_extra > Duke.MaxPlayerHealth())
if (althud_flashing && p.last_extra > Duke.MaxPlayerHealth())
s += Raze.bsin(Raze.GetBuildTime() << 5) >> 10;
int intens = clamp(255 - 6 * s, 0, 255);
format = String.Format("%d", p.last_extra);
@ -194,7 +194,7 @@ class DukeStatusBar : DukeCommonStatusBar
imgX += (imgX * 0.6) * (strlen - 1);
}
if (weapon != DukeWpn.KNEE_WEAPON && (!hud_flashing || PlayClock & 32 || ammo > (Duke.MaxAmmoAmount(weapon) / 10)))
if (weapon != DukeWpn.KNEE_WEAPON && (!althud_flashing || PlayClock & 32 || ammo > (Duke.MaxAmmoAmount(weapon) / 10)))
{
DrawString(numberFont, format, (-3, texty), DI_TEXT_ALIGN_RIGHT, Font.CR_UNTRANSLATED);
}

View file

@ -90,10 +90,10 @@ class RedneckStatusBar : DukeCommonStatusBar
imgScale = baseScale / siz.Y;
DrawTexture(img, (2, -2), DI_ITEM_LEFT_BOTTOM, scale:(imgScale, imgScale));
if (!hud_flashing || p.last_extra > (Duke.MaxPlayerHealth() >> 2) || (PlayClock & 32) || (p.IsFrozen() && p.last_extra < 2))
if (!althud_flashing || p.last_extra > (Duke.MaxPlayerHealth() >> 2) || (PlayClock & 32) || (p.IsFrozen() && p.last_extra < 2))
{
int s = -8;
if (hud_flashing && p.last_extra > Duke.MaxPlayerHealth())
if (althud_flashing && p.last_extra > Duke.MaxPlayerHealth())
s += Raze.bsin(Raze.GetBuildTime() << 5) >> 10;
int intens = clamp(255 - 6 * s, 0, 255);
format = String.Format("%d", p.last_extra);
@ -160,7 +160,7 @@ class RedneckStatusBar : DukeCommonStatusBar
imgX += (imgX * 0.755) * (strlen - 1);
}
if (weapon != RRWpn.KNEE_WEAPON && weapon != RRWpn.SLINGBLADE_WEAPON && (!hud_flashing || PlayClock & 32 || ammo > (Duke.MaxAmmoAmount(weapon) / 10)))
if (weapon != RRWpn.KNEE_WEAPON && weapon != RRWpn.SLINGBLADE_WEAPON && (!althud_flashing || PlayClock & 32 || ammo > (Duke.MaxAmmoAmount(weapon) / 10)))
{
DrawString(numberFont, format, (-1, -numberFont.mFont.GetHeight() * scale + 4), DI_TEXT_ALIGN_RIGHT, scale:(scale, scale));
}

View file

@ -255,10 +255,10 @@ class ExhumedStatusBar : RazeStatusBar
imgScale = baseScale / size.Y;
DrawTexture(img, (1.5, -1), DI_ITEM_LEFT_BOTTOM, scale:(imgScale, imgScale));
if (!hud_flashing || pp.nHealth > 150 || (PlayClock & 32))
if (!althud_flashing || pp.nHealth > 150 || (PlayClock & 32))
{
int s = -8;
if (hud_flashing && pp.nHealth > 800)
if (althud_flashing && pp.nHealth > 800)
s += Raze.bsin(PlayClock << 5) >> 10;
int intens = clamp(255 - 4 * s, 0, 255);
format = String.Format("%d", pp.nHealth >> 3);
@ -334,7 +334,7 @@ class ExhumedStatusBar : RazeStatusBar
}
*/
if ((!hud_flashing || PlayClock & 32 || ammo > 10))// (DamageData[weapon].max_ammo / 10)))
if ((!althud_flashing || PlayClock & 32 || ammo > 10))// (DamageData[weapon].max_ammo / 10)))
{
DrawString(numberFont, format, (-3, -numberFont.mFont.GetHeight() + 3), DI_TEXT_ALIGN_RIGHT);
}

View file

@ -747,10 +747,10 @@ class SWStatusBar : RazeStatusBar
let Health = pp.Health();
let MaxHealth = pp.MaxUserHealth();
if (!hud_flashing || Health > (MaxHealth >> 2) || (PlayClock & 32))
if (!althud_flashing || Health > (MaxHealth >> 2) || (PlayClock & 32))
{
int s = -8;
if (hud_flashing && Health > MaxHealth)
if (althud_flashing && Health > MaxHealth)
s += Raze.bsin(PlayClock << 5) >> 10;
int intens = clamp(255 - 4 * s, 0, 255);
let pe = Color(255, intens, intens, intens);
@ -813,7 +813,7 @@ class SWStatusBar : RazeStatusBar
imgX += (imgX * 0.855) * (strlen - 1);
}
if ((!hud_flashing || PlayClock & 32 || ammo > (SW.WeaponMaxAmmo(weapon) / 10)))
if ((!althud_flashing || PlayClock & 32 || ammo > (SW.WeaponMaxAmmo(weapon) / 10)))
{
DrawString(numberFont, format, (-1.5, -numberFont.mFont.GetHeight() - 0.5), DI_TEXT_ALIGN_RIGHT);
}