- Exhumed: Make use of cl_showmagamt.

* Fixes #463.
This commit is contained in:
Mitchell Richters 2021-07-16 23:52:56 +10:00
parent 76554f5f4d
commit 7b8dcde5d2
4 changed files with 19 additions and 7 deletions

View file

@ -2796,6 +2796,11 @@ DEFINE_ACTION_FUNCTION(_Exhumed, GetViewPlayer)
ACTION_RETURN_POINTER(&PlayerList[nLocalPlayer]); ACTION_RETURN_POINTER(&PlayerList[nLocalPlayer]);
} }
DEFINE_ACTION_FUNCTION(_Exhumed, GetPistolClip)
{
ACTION_RETURN_POINTER(&nPistolClip[nLocalPlayer]);
}
DEFINE_ACTION_FUNCTION(_ExhumedPlayer, IsUnderwater) DEFINE_ACTION_FUNCTION(_ExhumedPlayer, IsUnderwater)
{ {
PARAM_SELF_STRUCT_PROLOGUE(Player); PARAM_SELF_STRUCT_PROLOGUE(Player);

View file

@ -1229,11 +1229,9 @@ OptionMenu "HUDOptions" protected
Option "$MSGMNU_PULSEMESSAGES", "con_pulsetext", "OnOff", "con_notify_advanced" Option "$MSGMNU_PULSEMESSAGES", "con_pulsetext", "OnOff", "con_notify_advanced"
Slider "$MSGMNU_MESSAGESCALE", "con_notifyscale", 0.36, 1.0, 0.04, 2 Slider "$MSGMNU_MESSAGESCALE", "con_notifyscale", 0.36, 1.0, 0.04, 2
ifnotgame(Exhumed)
{
StaticText "" StaticText ""
Option "$DSPLYMNU_CLIPAMT", "cl_showmagamt", OnOff Option "$DSPLYMNU_CLIPAMT", "cl_showmagamt", OnOff
}
StaticText "" StaticText ""
Option "$DSPLYMNU_CROSSHAIR", "cl_crosshair", OnOff Option "$DSPLYMNU_CROSSHAIR", "cl_crosshair", OnOff
Slider "$DSPLYMNU_CROSSHAIRSCALE", "crosshairscale", 0.25, 1.0, 0.125, 2 Slider "$DSPLYMNU_CROSSHAIRSCALE", "crosshairscale", 0.25, 1.0, 0.125, 2

View file

@ -11,6 +11,7 @@ struct Exhumed native
native static int MoveStatusSequence(int s1, int s2); native static int MoveStatusSequence(int s1, int s2);
native static int SizeOfStatusSequence(int s1); native static int SizeOfStatusSequence(int s1);
native static ExhumedPlayer GetViewPlayer(); native static ExhumedPlayer GetViewPlayer();
native static int GetPistolClip();
static void DrawAbs(String img, int x, int y, int shade = 0) static void DrawAbs(String img, int x, int y, int shade = 0)
{ {

View file

@ -304,10 +304,18 @@ class ExhumedStatusBar : RazeStatusBar
// Weapon // Weapon
// //
int weapon = pp.nCurrentWeapon; int weapon = pp.nCurrentWeapon;
int ammo = nCounterDest; int ammo = pp.nAmmo[weapon];
if (ammo > 0) // wicon > 0 if (ammo > 0) // wicon > 0
{
if (weapon != kWeaponPistol || (weapon == kWeaponPistol && !cl_showmagamt))
{ {
format = String.Format("%d", ammo); format = String.Format("%d", ammo);
}
else
{
int clip = CalcMagazineAmount(ammo, 6, Exhumed.GetPistolClip() == 0);
format = String.Format("%d/%d", clip, ammo - clip);
}
/* non-implemented weapon icon. /* non-implemented weapon icon.
int wicon = 0;// ammo_sprites[weapon]; int wicon = 0;// ammo_sprites[weapon];
img = tileGetTexture(wicon); img = tileGetTexture(wicon);