Skip to content

Commit

Permalink
"Show Kills Percentage" setting
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlaux committed Nov 15, 2023
1 parent 779e18a commit 49ec730
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- Ammo and Health icons;
- Toggle to apply patch offsets.
- **Further Extended HUD color customization**
- **_Show Kills Percentage [in Stats display]_ setting**
- **_Direct Vertical Aiming_ for melee attacks**
- **_Disable Melee Snapping_ setting**

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ For these settings, their CVAR names are provided alongside the _CFG-Only_ label
- _**Alternative Arms Display**_ setting, to show the Chainsaw or SSG's availability on the Arms widget in place of the trivial Pistol
- **Blink Missing Keys** setting (CFG-Only: `blink_keys`) [partially p.f. Crispy Doom]
- _**Smart Totals**_ setting [p.f. So Doom]
- _**Show Kills Percentage [in Stats display]**_ setting
- **Event Timers:**
- _"Use" Button Timer_ [p.f. Crispy Doom];
- _Teleport Timer_ [i.b. the above];
Expand Down
1 change: 1 addition & 0 deletions src/doomstat.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ int show_ssg; // CFG-Only
int alt_arms;
int blink_keys; // CFG-Only
int smarttotals;
int hud_kills_percentage;
int event_timers[NUMTIMERS];

int hudcolor_time_scale;
Expand Down
1 change: 1 addition & 0 deletions src/doomstat.h
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ extern int show_ssg; // CFG-Only
extern int alt_arms;
extern int blink_keys; // CFG-Only
extern int smarttotals;
extern int hud_kills_percentage;

typedef enum {
TIMER_USE,
Expand Down
12 changes: 9 additions & 3 deletions src/hu_stuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -1296,7 +1296,10 @@ static void HU_widget_build_monsec(void)

if ((hud_threelined_widgets && !st_crispyhud) || (st_crispyhud && nughud.sts_ml)) // [Nugget] NUGHUD
{
sprintf(hud_monsecstr + offset, " \x1b%c%d%%", kills_percent_color, kills_percent);
// [Nugget]
if (hud_kills_percentage)
{ sprintf(hud_monsecstr + offset, " \x1b%c%d%%", kills_percent_color, kills_percent); }

HUlib_add_string_to_cur_line(&w_monsec, hud_monsecstr);

sprintf(hud_monsecstr, "\x1b%cI \x1b%c%d/%d", ('0'+hudcolor_items), items_color, items, totalitems);
Expand All @@ -1307,9 +1310,12 @@ static void HU_widget_build_monsec(void)
}
else
{
// [Nugget]
if (hud_kills_percentage)
{ offset += sprintf(hud_monsecstr + offset, " \x1b%c%d%%", kills_percent_color, kills_percent); }

sprintf(hud_monsecstr + offset,
" \x1b%c%d%% \x1b%cI \x1b%c%d/%d \x1b%cS \x1b%c%d/%d",
kills_percent_color, kills_percent,
" \x1b%cI \x1b%c%d/%d \x1b%cS \x1b%c%d/%d",
'0'+hudcolor_items, items_color, items, totalitems,
'0'+hudcolor_secrets, secrets_color, secrets, totalsecret);

Expand Down
8 changes: 5 additions & 3 deletions src/m_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -3659,6 +3659,7 @@ enum {
stat4_powers,
stat4_altarms,
stat4_smart,
stat4_killspct,
stat4_stub2,
stat4_title2,
stat4_timeruse,
Expand All @@ -3670,9 +3671,10 @@ setup_menu_t stat_settings4[] =
{
{"Nugget - Extended HUD", S_SKIP|S_TITLE, m_null, M_X, M_Y + stat4_title1 * M_SPC},

{"Show Powerup Timers", S_YESNO|S_COSMETIC, m_null, M_X, M_Y + stat4_powers * M_SPC, {"hud_power_timers"}},
{"Alternative Arms Display", S_YESNO, m_null, M_X, M_Y + stat4_altarms * M_SPC, {"alt_arms"}},
{"Smart Totals", S_YESNO, m_null, M_X, M_Y + stat4_smart * M_SPC, {"smarttotals"}},
{"Show Powerup Timers", S_YESNO|S_COSMETIC, m_null, M_X, M_Y + stat4_powers * M_SPC, {"hud_power_timers"}},
{"Alternative Arms Display", S_YESNO, m_null, M_X, M_Y + stat4_altarms * M_SPC, {"alt_arms"}},
{"Smart Totals", S_YESNO, m_null, M_X, M_Y + stat4_smart * M_SPC, {"smarttotals"}},
{"Show Kills Percentage", S_YESNO, m_null, M_X, M_Y + stat4_killspct * M_SPC, {"hud_kills_percentage"}},

{"", S_SKIP, m_null, M_X, M_Y + stat4_stub2 * M_SPC},
{"Nugget - Event Timers", S_SKIP|S_TITLE, m_null, M_X, M_Y + stat4_title2 * M_SPC},
Expand Down
7 changes: 7 additions & 0 deletions src/m_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3365,6 +3365,13 @@ default_t defaults[] = {
"1 to enable Smart Totals"
},

{ // [Nugget]
"hud_kills_percentage",
(config_t *) &hud_kills_percentage, NULL,
{1}, {0,1}, number, ss_stat, wad_no,
"1 to show Kills percentage in Stats display"
},

// [Nugget] Extended HUD colors /-------------------------------------------

{
Expand Down

0 comments on commit 49ec730

Please sign in to comment.