From: Mario Date: Mon, 13 Jul 2020 09:07:34 +0000 (+1000) Subject: Fix CA modicons pointing to a freezetag cvar X-Git-Tag: xonotic-v0.8.5~855^2~10 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=12d5054e3c9c3f7f5eac7d362ff132da9d917e99;p=xonotic%2Fxonotic-data.pk3dir.git Fix CA modicons pointing to a freezetag cvar --- diff --git a/qcsrc/common/gamemodes/gamemode/clanarena/cl_clanarena.qc b/qcsrc/common/gamemodes/gamemode/clanarena/cl_clanarena.qc index 2bf470f15..2bded9d6a 100644 --- a/qcsrc/common/gamemodes/gamemode/clanarena/cl_clanarena.qc +++ b/qcsrc/common/gamemodes/gamemode/clanarena/cl_clanarena.qc @@ -42,16 +42,8 @@ void DrawCAItem(vector myPos, vector mySize, float aspect_ratio, int layout, int drawstring_aspect(myPos, ftos(stat), mySize, color, panel_fg_alpha, DRAWFLAG_NORMAL); } -// Clan Arena and Freeze Tag HUD modicons -void HUD_Mod_CA(vector myPos, vector mySize) +void HUD_Mod_CA_Draw(vector myPos, vector mySize, int layout) { - mod_active = 1; // required in each mod function that always shows something - - int layout; - if(ISGAMETYPE(CA)) - layout = autocvar_hud_panel_modicons_ca_layout; - else //if(ISGAMETYPE(FREEZETAG)) - layout = autocvar_hud_panel_modicons_freezetag_layout; int rows, columns; float aspect_ratio; aspect_ratio = (layout) ? 2 : 1; @@ -77,3 +69,11 @@ void HUD_Mod_CA(vector myPos, vector mySize) } } } + +// Clan Arena and Freeze Tag HUD modicons +void HUD_Mod_CA(vector myPos, vector mySize) +{ + mod_active = 1; // required in each mod function that always shows something + + HUD_Mod_CA_Draw(myPos, mySize, autocvar_hud_panel_modicons_ca_layout); +} diff --git a/qcsrc/common/gamemodes/gamemode/clanarena/cl_clanarena.qh b/qcsrc/common/gamemodes/gamemode/clanarena/cl_clanarena.qh index 206f1f5db..7ccd5bbb2 100644 --- a/qcsrc/common/gamemodes/gamemode/clanarena/cl_clanarena.qh +++ b/qcsrc/common/gamemodes/gamemode/clanarena/cl_clanarena.qh @@ -1,4 +1,5 @@ #pragma once void HUD_Mod_CA(vector myPos, vector mySize); +void HUD_Mod_CA_Draw(vector myPos, vector mySize, int layout); void HUD_Mod_CA_Export(int fh); diff --git a/qcsrc/common/gamemodes/gamemode/freezetag/cl_freezetag.qc b/qcsrc/common/gamemodes/gamemode/freezetag/cl_freezetag.qc index e7443db67..df4931a37 100644 --- a/qcsrc/common/gamemodes/gamemode/freezetag/cl_freezetag.qc +++ b/qcsrc/common/gamemodes/gamemode/freezetag/cl_freezetag.qc @@ -1,6 +1,15 @@ #include "cl_freezetag.qh" +#include + void HUD_Mod_FreezeTag_Export(int fh) { HUD_Write_Cvar("hud_panel_modicons_freezetag_layout"); } + +void HUD_Mod_FreezeTag(vector myPos, vector mySize) +{ + mod_active = 1; // required in each mod function that always shows something + + HUD_Mod_CA_Draw(myPos, mySize, autocvar_hud_panel_modicons_freezetag_layout); +} diff --git a/qcsrc/common/gamemodes/gamemode/freezetag/freezetag.qh b/qcsrc/common/gamemodes/gamemode/freezetag/freezetag.qh index 66eda3615..61d3b91e9 100644 --- a/qcsrc/common/gamemodes/gamemode/freezetag/freezetag.qh +++ b/qcsrc/common/gamemodes/gamemode/freezetag/freezetag.qh @@ -6,6 +6,7 @@ #endif #ifdef CSQC +void HUD_Mod_FreezeTag(vector myPos, vector mySize); void HUD_Mod_FreezeTag_Export(int fh); #endif CLASS(FreezeTag, Gametype) @@ -42,7 +43,7 @@ CLASS(FreezeTag, Gametype) returns(menu, _("Frag limit:"), 5, 100, 5, "fraglimit_override", "g_freezetag_teams_override", _("The amount of frags needed before the match will end")); } #ifdef CSQC - ATTRIB(FreezeTag, m_modicons, void(vector pos, vector mySize), HUD_Mod_CA); + ATTRIB(FreezeTag, m_modicons, void(vector pos, vector mySize), HUD_Mod_FreezeTag); ATTRIB(FreezeTag, m_modicons_export, void(int fh), HUD_Mod_FreezeTag_Export); #endif ATTRIB(FreezeTag, m_legacydefaults, string, "10 20 0");