From c365c112b1918921fcd6d149d880a0183c5c1a56 Mon Sep 17 00:00:00 2001 From: erysdren Date: Sat, 7 Dec 2024 12:19:01 -0600 Subject: [PATCH 01/15] SERVER: network velocity to CSQC --- source/server/main.qc | 3 ++- source/shared/shared_defs.qc | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/source/server/main.qc b/source/server/main.qc index d3e5b716..1b0b665b 100644 --- a/source/server/main.qc +++ b/source/server/main.qc @@ -377,6 +377,7 @@ void() worldspawn = clientstat(STAT_VIEWZOOM, EV_FLOAT, viewzoom); clientstat(STAT_MAXHEALTH, EV_FLOAT, max_health); clientstat(STAT_PERKS, EV_FLOAT, perks); + clientstat(STAT_VELOCITY, EV_VECTOR, velocity); #endif // FTE @@ -581,4 +582,4 @@ void() EndFrame = if (cheats_have_been_activated == false && cvar("sv_cheats") == 1) { cheats_have_been_activated = true; } -}; \ No newline at end of file +}; diff --git a/source/shared/shared_defs.qc b/source/shared/shared_defs.qc index 3df92761..0e9ff4a9 100644 --- a/source/shared/shared_defs.qc +++ b/source/shared/shared_defs.qc @@ -309,6 +309,10 @@ float map_compatibility_mode; #define STAT_MAXHEALTH 67 #define STAT_WEAPONSKIN 68 #define STAT_PERKS 69 +#define STAT_VELOCITY 70 +#define STAT_VELOCITY_X 70 +#define STAT_VELOCITY_Y 71 +#define STAT_VELOCITY_Z 72 .float playernum; float game_over; From 25c65eaf41706541d72aa96be5c82cee84a65e20 Mon Sep 17 00:00:00 2001 From: erysdren Date: Sat, 7 Dec 2024 12:19:11 -0600 Subject: [PATCH 02/15] CLIENT: first pass at Draw_UPS() --- source/client/hud.qc | 31 +++++++++++++++++++++++++++++++ source/client/main.qc | 3 +++ 2 files changed, 34 insertions(+) diff --git a/source/client/hud.qc b/source/client/hud.qc index ef113689..79d79300 100644 --- a/source/client/hud.qc +++ b/source/client/hud.qc @@ -1925,6 +1925,35 @@ void(float width, float height) HUD_RoundStopWatch = Draw_String([width - (getTextWidth(stopwatch, 12)) - 2, 16], stopwatch, [12, 12], [1, 1, 1], 1, 0); } +/******************* +* HUD UPS * +*******************/ + +void() Draw_UPS = +{ + static float lastupstime; + static float lastups; + + if (!cvar("show_speed")) + return; + + if ((time - lastupstime) >= 1.0 / 20) + { + vector vel = [ + getstatf(STAT_VELOCITY_X), + getstatf(STAT_VELOCITY_Y), + getstatf(STAT_VELOCITY_Z) + ]; + + lastups = vlen(vel); + lastupstime = time; + } + + string str = sprintf("%3.1f UPS", lastups); + vector pos = [cvar("show_speed_x"), cvar("show_speed_y")]; + Draw_String(pos, str, [12, 12], [1, 1, 1], 1, 0); +}; + /******************* * HUD Draw * *******************/ @@ -1999,6 +2028,8 @@ void(float width, float height) HUD_Draw = HUD_Scores(); HUD_Achievements(width, height); + + Draw_UPS(); if (screenflash_duration > time) HUD_Screenflash(); diff --git a/source/client/main.qc b/source/client/main.qc index cee21491..fa7e9ebc 100644 --- a/source/client/main.qc +++ b/source/client/main.qc @@ -175,6 +175,9 @@ noref void(float apiver, string enginename, float enginever) CSQC_Init = autocvar(in_rumbleenabled, 1); autocvar(in_aimassist, 0); + cvar_set("show_speed_x", ftos(32)); + cvar_set("show_speed_y", ftos(32)); + // Runtime check if we're running this in WebASM/WebGL. if (cvar_string("sys_platform") == "Web") platform_is_web = true; From 81b033318d9613e7c5238828ec00cae097fe5846 Mon Sep 17 00:00:00 2001 From: erysdren Date: Sun, 8 Dec 2024 08:24:45 -0600 Subject: [PATCH 03/15] SERVER: don't network velocity manually --- source/server/main.qc | 1 - source/shared/shared_defs.qc | 4 ---- 2 files changed, 5 deletions(-) diff --git a/source/server/main.qc b/source/server/main.qc index 1b0b665b..53208748 100644 --- a/source/server/main.qc +++ b/source/server/main.qc @@ -377,7 +377,6 @@ void() worldspawn = clientstat(STAT_VIEWZOOM, EV_FLOAT, viewzoom); clientstat(STAT_MAXHEALTH, EV_FLOAT, max_health); clientstat(STAT_PERKS, EV_FLOAT, perks); - clientstat(STAT_VELOCITY, EV_VECTOR, velocity); #endif // FTE diff --git a/source/shared/shared_defs.qc b/source/shared/shared_defs.qc index 0e9ff4a9..3df92761 100644 --- a/source/shared/shared_defs.qc +++ b/source/shared/shared_defs.qc @@ -309,10 +309,6 @@ float map_compatibility_mode; #define STAT_MAXHEALTH 67 #define STAT_WEAPONSKIN 68 #define STAT_PERKS 69 -#define STAT_VELOCITY 70 -#define STAT_VELOCITY_X 70 -#define STAT_VELOCITY_Y 71 -#define STAT_VELOCITY_Z 72 .float playernum; float game_over; From 167e85acf9cb0eac369006d70baff695129fed14 Mon Sep 17 00:00:00 2001 From: erysdren Date: Sun, 8 Dec 2024 08:24:56 -0600 Subject: [PATCH 04/15] CLIENT: HUD_PlayerDebugInfo() --- source/client/hud.qc | 34 +++++++++++++++++++++------------- source/client/main.qc | 8 ++++++-- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/source/client/hud.qc b/source/client/hud.qc index 79d79300..ca2fafef 100644 --- a/source/client/hud.qc +++ b/source/client/hud.qc @@ -1926,32 +1926,40 @@ void(float width, float height) HUD_RoundStopWatch = } /******************* -* HUD UPS * +* HUD Debug Info * *******************/ -void() Draw_UPS = +// set from CSQC_Ent_Update +vector player_velocity; + +void(float width, float height) HUD_PlayerDebugInfo = { static float lastupstime; static float lastups; - if (!cvar("show_speed")) + if (!cvar("scr_playerdebuginfo")) return; if ((time - lastupstime) >= 1.0 / 20) { - vector vel = [ - getstatf(STAT_VELOCITY_X), - getstatf(STAT_VELOCITY_Y), - getstatf(STAT_VELOCITY_Z) - ]; - - lastups = vlen(vel); + lastups = vlen(player_velocity); lastupstime = time; } - string str = sprintf("%3.1f UPS", lastups); - vector pos = [cvar("show_speed_x"), cvar("show_speed_y")]; + string str = sprintf("speed: %3.1f qu/s", lastups); + vector pos = [cvar("scr_playerdebuginfo_x"), cvar("scr_playerdebuginfo_y")]; Draw_String(pos, str, [12, 12], [1, 1, 1], 1, 0); + + if (cvar("scr_playerdebuginfo") >= 2) + { + pos.y += 16; + str = sprintf("angles: %v", getproperty(VF_ANGLES)); + Draw_String(pos, str, [12, 12], [1, 1, 1], 1, 0); + + pos.y += 16; + str = sprintf("origin: %v", getproperty(VF_ORIGIN)); + Draw_String(pos, str, [12, 12], [1, 1, 1], 1, 0); + } }; /******************* @@ -2029,7 +2037,7 @@ void(float width, float height) HUD_Draw = HUD_Achievements(width, height); - Draw_UPS(); + HUD_PlayerDebugInfo(width, height); if (screenflash_duration > time) HUD_Screenflash(); diff --git a/source/client/main.qc b/source/client/main.qc index fa7e9ebc..e4a4b5db 100644 --- a/source/client/main.qc +++ b/source/client/main.qc @@ -175,8 +175,9 @@ noref void(float apiver, string enginename, float enginever) CSQC_Init = autocvar(in_rumbleenabled, 1); autocvar(in_aimassist, 0); - cvar_set("show_speed_x", ftos(32)); - cvar_set("show_speed_y", ftos(32)); + autocvar(scr_playerdebuginfo, 0); + autocvar(scr_playerdebuginfo_x, 48); + autocvar(scr_playerdebuginfo_y, 48); // Runtime check if we're running this in WebASM/WebGL. if (cvar_string("sys_platform") == "Web") @@ -432,6 +433,9 @@ noref void(float isnew) CSQC_Ent_Update = self.kills = readshort(); self.is_in_menu = readbyte(); + // set for HUD_PlayerDebugInfo + player_velocity = self.velocity; + RegisterPointChange(self.points - old_points, self.playernum); if (self.movetype == MOVETYPE_BOUNCE) From 1ae4e646bad879f05fce49b130cde636074ffce0 Mon Sep 17 00:00:00 2001 From: erysdren Date: Sun, 8 Dec 2024 20:02:22 -0600 Subject: [PATCH 05/15] CLIENT: change default playerdebuginfo pos to 64,64 --- source/client/main.qc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/client/main.qc b/source/client/main.qc index bd34050a..d1e475c3 100644 --- a/source/client/main.qc +++ b/source/client/main.qc @@ -176,8 +176,8 @@ noref void(float apiver, string enginename, float enginever) CSQC_Init = autocvar(in_aimassist, 0); autocvar(scr_playerdebuginfo, 0); - autocvar(scr_playerdebuginfo_x, 48); - autocvar(scr_playerdebuginfo_y, 48); + autocvar(scr_playerdebuginfo_x, 64); + autocvar(scr_playerdebuginfo_y, 64); // Runtime check if we're running this in WebASM/WebGL. if (cvar_string("sys_platform") == "Web") From a9356369acd5ff77da494aba1ef797229d3ca8b1 Mon Sep 17 00:00:00 2001 From: erysdren Date: Sun, 8 Dec 2024 20:13:23 -0600 Subject: [PATCH 06/15] CLIENT: HUD_PlayerDebugInfo: draw with capitals --- source/client/hud.qc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/client/hud.qc b/source/client/hud.qc index d56505cb..2552d862 100644 --- a/source/client/hud.qc +++ b/source/client/hud.qc @@ -1955,18 +1955,18 @@ void(float width, float height) HUD_PlayerDebugInfo = lastupstime = time; } - string str = sprintf("speed: %3.1f qu/s", lastups); + string str = sprintf("Speed: %3.1f qu/s", lastups); vector pos = [cvar("scr_playerdebuginfo_x"), cvar("scr_playerdebuginfo_y")]; Draw_String(pos, str, [12, 12], [1, 1, 1], 1, 0); if (cvar("scr_playerdebuginfo") >= 2) { pos.y += 16; - str = sprintf("angles: %v", getproperty(VF_ANGLES)); + str = sprintf("Angles: %v", getproperty(VF_ANGLES)); Draw_String(pos, str, [12, 12], [1, 1, 1], 1, 0); pos.y += 16; - str = sprintf("origin: %v", getproperty(VF_ORIGIN)); + str = sprintf("Origin: %v", getproperty(VF_ORIGIN)); Draw_String(pos, str, [12, 12], [1, 1, 1], 1, 0); } }; From 35dc06686856638c05209217ab42a70793f63613 Mon Sep 17 00:00:00 2001 From: erysdren Date: Sun, 8 Dec 2024 20:13:37 -0600 Subject: [PATCH 07/15] CLIENT: HUD_PlayerDebugInfo: add ultrawide offset --- source/client/hud.qc | 1 + 1 file changed, 1 insertion(+) diff --git a/source/client/hud.qc b/source/client/hud.qc index 2552d862..17899c49 100644 --- a/source/client/hud.qc +++ b/source/client/hud.qc @@ -1957,6 +1957,7 @@ void(float width, float height) HUD_PlayerDebugInfo = string str = sprintf("Speed: %3.1f qu/s", lastups); vector pos = [cvar("scr_playerdebuginfo_x"), cvar("scr_playerdebuginfo_y")]; + pos.x += GetUltraWideOffset(); Draw_String(pos, str, [12, 12], [1, 1, 1], 1, 0); if (cvar("scr_playerdebuginfo") >= 2) From 9e96f938bc1c2e1c7ec5fde523fb49227b6c852e Mon Sep 17 00:00:00 2001 From: erysdren Date: Sun, 8 Dec 2024 20:14:09 -0600 Subject: [PATCH 08/15] CLIENT: change default playerdebuginfo y pos to 6 --- source/client/main.qc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/client/main.qc b/source/client/main.qc index d1e475c3..9ede104a 100644 --- a/source/client/main.qc +++ b/source/client/main.qc @@ -177,7 +177,7 @@ noref void(float apiver, string enginename, float enginever) CSQC_Init = autocvar(scr_playerdebuginfo, 0); autocvar(scr_playerdebuginfo_x, 64); - autocvar(scr_playerdebuginfo_y, 64); + autocvar(scr_playerdebuginfo_y, 6); // Runtime check if we're running this in WebASM/WebGL. if (cvar_string("sys_platform") == "Web") From 697de09f973761d89ed3b9ad2d73c5acedf53db7 Mon Sep 17 00:00:00 2001 From: Peter0x44 Date: Mon, 9 Dec 2024 07:06:28 +0000 Subject: [PATCH 09/15] CLIENT: Delete unused input code --- progs/csqc.src | 3 +-- source/client/user_input.qc | 49 ------------------------------------- 2 files changed, 1 insertion(+), 51 deletions(-) delete mode 100644 source/client/user_input.qc diff --git a/progs/csqc.src b/progs/csqc.src index c32610e4..002e57f3 100644 --- a/progs/csqc.src +++ b/progs/csqc.src @@ -28,9 +28,8 @@ defs/custom.qc achievements.qc hud.qc chat.qc -user_input.qc view_model.qc particles.qc chasecam.qc main.qc -#endlist \ No newline at end of file +#endlist diff --git a/source/client/user_input.qc b/source/client/user_input.qc deleted file mode 100644 index 4e283411..00000000 --- a/source/client/user_input.qc +++ /dev/null @@ -1,49 +0,0 @@ -/* - client/user_input.qc - - User Input scheme for menus. - - Copyright (C) 2021-2024 NZ:P Team - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to: - - Free Software Foundation, Inc. - 59 Temple Place - Suite 330 - Boston, MA 02111-1307, USA - -*/ - -string(string source, float spec_key, float key, float max_length) GetUserInput = -{ - // Welcome to the world's worst user input implementation. - // Seriously, though -- it's kind of hacked together. - // I think at least. Upon further looking it seems,, decent? - - // Backspace -- just return the string minus 1. - if (spec_key == K_BACKSPACE) { - return substring(source, 0, strlen(source) - 1); - } - - // If we've hit our max length, do nothing. - if (strlen(source) >= max_length) - return source; - - // Key is out of range (thanks Nuclide) - if ((key < 32 || key > 125)) - return source; - - // Append and send that shit out! - return sprintf("%s%s", source, chr2str(key)); -} \ No newline at end of file From 31282c700d4451aff8434eb3fbdc989386a1437d Mon Sep 17 00:00:00 2001 From: erysdren Date: Mon, 9 Dec 2024 19:50:04 -0600 Subject: [PATCH 10/15] CLIENT: hud.qc: make the readout all fancy and stuff --- source/client/hud.qc | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/source/client/hud.qc b/source/client/hud.qc index 17899c49..a7106397 100644 --- a/source/client/hud.qc +++ b/source/client/hud.qc @@ -1941,6 +1941,21 @@ void(float width, float height) HUD_RoundStopWatch = // set from CSQC_Ent_Update vector player_velocity; +// probably only need these right here +static void(vector pos, string label, vector v) Draw_Vector_Fancy = +{ + Draw_String(pos, label, [12, 12], [1, 1, 0], 1, 0); + Draw_String(pos + [32, 16], sprintf("X: %d", v.x), [12, 12], [1, 1, 1], 1, 0); + Draw_String(pos + [32, 32], sprintf("Y: %d", v.y), [12, 12], [1, 1, 1], 1, 0); + Draw_String(pos + [32, 48], sprintf("Z: %d", v.z), [12, 12], [1, 1, 1], 1, 0); +}; + +static void(vector pos, string label, float f, string suffix) Draw_Float_Fancy = +{ + Draw_String(pos, label, [12, 12], [1, 1, 0], 1, 0); + Draw_String(pos + [32, 16], sprintf("%d %s", f, suffix), [12, 12], [1, 1, 1], 1, 0); +}; + void(float width, float height) HUD_PlayerDebugInfo = { static float lastupstime; @@ -1955,20 +1970,15 @@ void(float width, float height) HUD_PlayerDebugInfo = lastupstime = time; } - string str = sprintf("Speed: %3.1f qu/s", lastups); vector pos = [cvar("scr_playerdebuginfo_x"), cvar("scr_playerdebuginfo_y")]; pos.x += GetUltraWideOffset(); - Draw_String(pos, str, [12, 12], [1, 1, 1], 1, 0); + + Draw_Float_Fancy(pos, "Speed:", lastups, "qu/s"); if (cvar("scr_playerdebuginfo") >= 2) { - pos.y += 16; - str = sprintf("Angles: %v", getproperty(VF_ANGLES)); - Draw_String(pos, str, [12, 12], [1, 1, 1], 1, 0); - - pos.y += 16; - str = sprintf("Origin: %v", getproperty(VF_ORIGIN)); - Draw_String(pos, str, [12, 12], [1, 1, 1], 1, 0); + Draw_Vector_Fancy(pos + [0, 36], "Angles:", getproperty(VF_ANGLES)); + Draw_Vector_Fancy(pos + [0, 106], "Origin:", getproperty(VF_ORIGIN)); } }; From 798e1b257ac9bd56ec66733efae81e66e34c28c0 Mon Sep 17 00:00:00 2001 From: erysdren Date: Mon, 9 Dec 2024 20:15:47 -0600 Subject: [PATCH 11/15] CLIENT: hud.qc: add a nice drawfill for a11y --- source/client/hud.qc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/client/hud.qc b/source/client/hud.qc index a7106397..7f3d0368 100644 --- a/source/client/hud.qc +++ b/source/client/hud.qc @@ -1973,6 +1973,8 @@ void(float width, float height) HUD_PlayerDebugInfo = vector pos = [cvar("scr_playerdebuginfo_x"), cvar("scr_playerdebuginfo_y")]; pos.x += GetUltraWideOffset(); + drawfill(pos - [8, 8], [128, 192], [0, 0, 0], 0.75, 0); + Draw_Float_Fancy(pos, "Speed:", lastups, "qu/s"); if (cvar("scr_playerdebuginfo") >= 2) From eb8bd3456e18e5bb676d55bacc5ae8b63951d365 Mon Sep 17 00:00:00 2001 From: erysdren Date: Mon, 9 Dec 2024 20:36:28 -0600 Subject: [PATCH 12/15] CLIENT: move Draw_Fancy* functions into draw.qc --- source/client/draw.qc | 16 +++++++++++++++- source/client/hud.qc | 21 +++------------------ 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/source/client/draw.qc b/source/client/draw.qc index 674a2eb1..ff3c7b96 100644 --- a/source/client/draw.qc +++ b/source/client/draw.qc @@ -91,4 +91,18 @@ void(vector position, string text, vector size, vector rgb, float alpha, float d else x += (font_kerningamount[(chr - 33)] + 1) * (size_x/8); } -}; \ No newline at end of file +}; + +void(vector pos, string label, vector v) Draw_FancyVector = +{ + Draw_String(pos, label, [12, 12], [1, 1, 0], 1, 0); + Draw_String(pos + [32, 16], sprintf("X: %d", v.x), [12, 12], [1, 1, 1], 1, 0); + Draw_String(pos + [32, 32], sprintf("Y: %d", v.y), [12, 12], [1, 1, 1], 1, 0); + Draw_String(pos + [32, 48], sprintf("Z: %d", v.z), [12, 12], [1, 1, 1], 1, 0); +}; + +void(vector pos, string label, float f, string suffix) Draw_FancyFloat = +{ + Draw_String(pos, label, [12, 12], [1, 1, 0], 1, 0); + Draw_String(pos + [32, 16], sprintf("%d %s", f, suffix), [12, 12], [1, 1, 1], 1, 0); +}; diff --git a/source/client/hud.qc b/source/client/hud.qc index 7f3d0368..bbc5eb34 100644 --- a/source/client/hud.qc +++ b/source/client/hud.qc @@ -1941,21 +1941,6 @@ void(float width, float height) HUD_RoundStopWatch = // set from CSQC_Ent_Update vector player_velocity; -// probably only need these right here -static void(vector pos, string label, vector v) Draw_Vector_Fancy = -{ - Draw_String(pos, label, [12, 12], [1, 1, 0], 1, 0); - Draw_String(pos + [32, 16], sprintf("X: %d", v.x), [12, 12], [1, 1, 1], 1, 0); - Draw_String(pos + [32, 32], sprintf("Y: %d", v.y), [12, 12], [1, 1, 1], 1, 0); - Draw_String(pos + [32, 48], sprintf("Z: %d", v.z), [12, 12], [1, 1, 1], 1, 0); -}; - -static void(vector pos, string label, float f, string suffix) Draw_Float_Fancy = -{ - Draw_String(pos, label, [12, 12], [1, 1, 0], 1, 0); - Draw_String(pos + [32, 16], sprintf("%d %s", f, suffix), [12, 12], [1, 1, 1], 1, 0); -}; - void(float width, float height) HUD_PlayerDebugInfo = { static float lastupstime; @@ -1975,12 +1960,12 @@ void(float width, float height) HUD_PlayerDebugInfo = drawfill(pos - [8, 8], [128, 192], [0, 0, 0], 0.75, 0); - Draw_Float_Fancy(pos, "Speed:", lastups, "qu/s"); + Draw_FancyFloat(pos, "Speed:", lastups, "qu/s"); if (cvar("scr_playerdebuginfo") >= 2) { - Draw_Vector_Fancy(pos + [0, 36], "Angles:", getproperty(VF_ANGLES)); - Draw_Vector_Fancy(pos + [0, 106], "Origin:", getproperty(VF_ORIGIN)); + Draw_FancyVector(pos + [0, 36], "Angles:", getproperty(VF_ANGLES)); + Draw_FancyVector(pos + [0, 106], "Origin:", getproperty(VF_ORIGIN)); } }; From c1c726acd63d981fb6efa6d1324f622297221a32 Mon Sep 17 00:00:00 2001 From: erysdren Date: Mon, 9 Dec 2024 20:38:05 -0600 Subject: [PATCH 13/15] SERVER: undo added newline, sorry --- source/server/main.qc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/server/main.qc b/source/server/main.qc index 79aed459..579b9941 100644 --- a/source/server/main.qc +++ b/source/server/main.qc @@ -581,4 +581,4 @@ void() EndFrame = if (cheats_have_been_activated == false && cvar("sv_cheats") == 1) { cheats_have_been_activated = true; } -}; +}; \ No newline at end of file From a29bd7262b908e78e45ca60f512fa05e1a5e05cf Mon Sep 17 00:00:00 2001 From: erysdren Date: Sat, 14 Dec 2024 16:56:57 -0600 Subject: [PATCH 14/15] MENU: menu_coop.qc: fix macro syntax error --- source/menu/menu_coop.qc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/menu/menu_coop.qc b/source/menu/menu_coop.qc index 52860bd5..19197bdb 100644 --- a/source/menu/menu_coop.qc +++ b/source/menu/menu_coop.qc @@ -308,7 +308,7 @@ string(string prev_id) fn ## _GetNextButton = \ } \ \ return ret; \ -}; \ +}; NEXTBUTTON_FUNC(Menu_Coop_Browse, menu_coop_browse_buttons) NEXTBUTTON_FUNC(Menu_Coop_Direct, menu_coop_direct_buttons) @@ -337,7 +337,7 @@ string(string next_id) fn ## _GetPreviousButton = \ } \ \ return ret; \ -}; \ +}; PREVBUTTON_FUNC(Menu_Coop_Browse, menu_coop_browse_buttons) PREVBUTTON_FUNC(Menu_Coop_Direct, menu_coop_direct_buttons) From b36ca9fe826a50925f123037a0caac80cb60ea0d Mon Sep 17 00:00:00 2001 From: Peter0x44 Date: Thu, 19 Dec 2024 02:36:10 +0000 Subject: [PATCH 15/15] CLIENT: Fix restart button being gray in solo Fixes https://github.com/nzp-team/nzportable/issues/1047 It looks like the player count was changed from a 0 index to a 1 index, but this code was not updated. --- source/menu/menu_paus.qc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/menu/menu_paus.qc b/source/menu/menu_paus.qc index 476af59d..dbf8008f 100644 --- a/source/menu/menu_paus.qc +++ b/source/menu/menu_paus.qc @@ -21,7 +21,7 @@ string(string prev_id) Menu_Pause_GetNextButton = } } - if (player_count != 0 && ret == "pm_reloa") + if (player_count != 1 && ret == "pm_reloa") ret = "pm_opts"; if (ret == "") @@ -47,7 +47,7 @@ string(string next_id) Menu_Pause_GetPreviousButton = } } - if (player_count != 0 && ret == "pm_reloa") + if (player_count != 1 && ret == "pm_reloa") ret = "pm_resum"; if (ret == "") @@ -86,7 +86,7 @@ void() Menu_Pause = { Menu_Button(1, "pm_resum", "RESUME CARNAGE", "Return to Game.") ? ToggleMenu() : 0; - if (player_count == 0) + if (player_count == 1) Menu_Button(2, "pm_reloa", "RESTART LEVEL", "Tough luck? Give things another go.") ? Menu_Pause_EnterSubMenu(1) : 0; else Menu_GreyButton(2, "RESTART LEVEL"); @@ -122,4 +122,4 @@ void() Menu_Pause = } sui_pop_frame(); -}; \ No newline at end of file +};