From b5173b18fa20e7ac5577beb067201ba7ba3f6598 Mon Sep 17 00:00:00 2001 From: FruitieX Date: Thu, 10 Jun 2010 03:22:32 +0300 Subject: [PATCH] move HUD_Panel_GetName into common/util.qc for easy menu access --- qcsrc/client/hud.qc | 20 -------------------- qcsrc/common/util.qc | 22 ++++++++++++++++++++++ qcsrc/common/util.qh | 2 ++ 3 files changed, 24 insertions(+), 20 deletions(-) diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index ab59b5c23..0db9ffe1b 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -550,26 +550,6 @@ HUD panels ================== */ -string HUD_Panel_GetName(float id) -{ - switch(id) { - case 0: return "weaponicons"; break; - case 1: return "inventory"; break; - case 2: return "powerups"; break; - case 3: return "healtharmor"; break; - case 4: return "notify"; break; - case 5: return "timer"; break; - case 6: return "radar"; break; - case 7: return "score"; break; - case 8: return "racetimer"; break; - case 9: return "vote"; break; - case 10: return "modicons"; break; - case 11: return "pressedkeys"; break; - case 12: return "chat"; break; - default: return ""; - } -} - // Save the config void HUD_Panel_ExportCfg(string cfgname) { diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index 9875529d3..bad6ee940 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -1948,3 +1948,25 @@ float get_model_parameters(string m, float sk) return 1; } + +// return name of given panel id +string HUD_Panel_GetName(float id) +{ + switch(id) { + case 0: return "weaponicons"; break; + case 1: return "inventory"; break; + case 2: return "powerups"; break; + case 3: return "healtharmor"; break; + case 4: return "notify"; break; + case 5: return "timer"; break; + case 6: return "radar"; break; + case 7: return "score"; break; + case 8: return "racetimer"; break; + case 9: return "vote"; break; + case 10: return "modicons"; break; + case 11: return "pressedkeys"; break; + case 12: return "chat"; break; + default: return ""; + } +} + diff --git a/qcsrc/common/util.qh b/qcsrc/common/util.qh index 23126b633..2a57be012 100644 --- a/qcsrc/common/util.qh +++ b/qcsrc/common/util.qh @@ -210,3 +210,5 @@ float get_model_parameters_weight; float get_model_parameters_age; string get_model_parameters_desc; float get_model_parameters(string mod, float skn); // call with string_null to clear; skin -1 means mod is the filename of the txt file and is to be split + +string HUD_Panel_GetName(float id) -- 2.39.2