From 7201b00de3809e8b3d4fdfd8fc72f536d2f7071a Mon Sep 17 00:00:00 2001 From: fruitiex Date: Sat, 3 Oct 2009 17:08:14 +0000 Subject: [PATCH] new cvar for enabling/disabling the weapon icons git-svn-id: svn://svn.icculus.org/nexuiz/trunk@8032 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/defaultNexuiz.cfg | 3 ++- data/qcsrc/client/sbar.qc | 28 ++++++++++++++-------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/data/defaultNexuiz.cfg b/data/defaultNexuiz.cfg index 6612eb81d..ff7243001 100644 --- a/data/defaultNexuiz.cfg +++ b/data/defaultNexuiz.cfg @@ -1247,9 +1247,10 @@ seta sbar_color_bg_team 0.5 "team color multiplier of the HUD background" seta sbar_scoreboard_alpha_bg 0.6 "scoreboard background alpha" seta sbar_scoreboard_highlight 1 "enable highlighting for rows and columns in the scoreboard" seta sbar_hudselector 1 "0 = health/armor positions flipped, 1 = default hud layout, 2 = combined health and armor display" -seta sbar_hud_accuracy 0 "1 = weapon accuracy on HUD" +seta sbar_hud_accuracy 0 "1 = weapon accuracy on the weapon icons" seta sbar_showcurrentammo 0 "0 = show all ammo types, 1 = show only the ammo type of the current weapon" seta sbar_increment_maptime 0 "1 = show elapsed time on the timer" +seta sbar_showweaponicons 1 "1 = show icons of weapons that you have" // for menu server list (eventually make them have engine support?) seta menu_slist_showfull 1 "show servers even if they are full and have no slots to join" diff --git a/data/qcsrc/client/sbar.qc b/data/qcsrc/client/sbar.qc index 505d5db41..b3110d670 100644 --- a/data/qcsrc/client/sbar.qc +++ b/data/qcsrc/client/sbar.qc @@ -2538,19 +2538,6 @@ void Sbar_Draw (void) Sbar_DrawXNum_Colored(health_pos, x, 24, sbar_alpha_fg); } - // weapon icons - x = 1.0; - Sbar_DrawWeapon_Clear(); - for(i = 1; i <= 24; ++i) - { - if(weaponimpulse[i-1] >= 0) - if(stat_weapons & x) - { - Sbar_DrawWeapon(i-1, fade, (i == activeweapon), i); - } - x *= 2; - } - // ammo float a; // i will be the ammo type (already declared), a will contain how much ammo there is of type i @@ -2638,7 +2625,20 @@ void Sbar_Draw (void) // draw strength/invincibility icon and timer CSQC_Strength_Timer(); - + + // weapon icons + if(cvar("sbar_showweaponicons")) { + x = 1.0; + Sbar_DrawWeapon_Clear(); + for(i = 1; i <= 24; ++i) + { + if(weaponimpulse[i-1] >= 0) + if(stat_weapons & x) + Sbar_DrawWeapon(i-1, fade, (i == activeweapon), i); + x *= 2; + } + } + // draw gametype specific icons if(gametype == GAME_KEYHUNT) CSQC_kh_hud(); -- 2.39.2