}
}
+#define acc_color(i) stov(cvar_string(strcat("hud_weaponicons_accuracy_color", ftos(i))))
#define MAX_ACCURACY_LEVELS 10
float acc_lev[MAX_ACCURACY_LEVELS];
if(!autocvar_hud_weaponicons && !autocvar__hud_configure)
return;
- float id = HUD_PANEL_WEAPONICONS;
- HUD_Panel_UpdateCvarsForId(id);
+ active_panel = HUD_PANEL_WEAPONICONS;
+ HUD_Panel_UpdateCvars(weaponicons);
vector pos, mySize;
float i, weapid, fade, weapon_stats, weapon_number, weapon_cnt;
while ( j && weapon_stats < acc_lev[j] )
--j;
-#define acc_color(i) stov(cvar_string(strcat("hud_weaponicons_accuracy_color", ftos(i))))
-
// inject color j+1 in color j, how much depending on how much weapon_stats is higher than level j
float factor;
factor = (weapon_stats - acc_lev[j]) / (acc_lev[j+1] - acc_lev[j]);
if(!autocvar_hud_inventory && !autocvar__hud_configure)
return;
- float id = HUD_PANEL_INVENTORY;
- HUD_Panel_UpdateCvarsForId(id);
+ active_panel = HUD_PANEL_INVENTORY;
+ HUD_Panel_UpdateCvars(inventory);
float i, currently_selected;
vector pos, mySize;
if(!autocvar_hud_powerups && !autocvar__hud_configure)
return;
- float id = HUD_PANEL_POWERUPS;
- HUD_Panel_UpdateCvarsForId(id);
+ active_panel = HUD_PANEL_POWERUPS;
+ HUD_Panel_UpdateCvars(powerups);
float stat_items;
stat_items = getstati(STAT_ITEMS);
if(!autocvar_hud_healtharmor && !autocvar__hud_configure)
return;
- float id = HUD_PANEL_HEALTHARMOR;
- HUD_Panel_UpdateCvarsForId(id);
+ active_panel = HUD_PANEL_HEALTHARMOR;
+ HUD_Panel_UpdateCvars(healtharmor);
vector pos, mySize;
pos = panel_pos;
mySize = panel_size;
if(!autocvar_hud_notify && !autocvar__hud_configure)
return;
- float id = HUD_PANEL_NOTIFY;
- HUD_Panel_UpdateCvarsForId(id);
+ active_panel = HUD_PANEL_NOTIFY;
+ HUD_Panel_UpdateCvars(notify);
vector pos, mySize;
pos = panel_pos;
mySize = panel_size;
if(!autocvar_hud_timer && !autocvar__hud_configure)
return;
- float id = HUD_PANEL_TIMER;
- HUD_Panel_UpdateCvarsForId(id);
+ active_panel = HUD_PANEL_TIMER;
+ HUD_Panel_UpdateCvars(timer);
vector pos, mySize;
pos = panel_pos;
mySize = panel_size;
if ((autocvar_hud_radar == 0 || (autocvar_hud_radar != 2 && !teamplay)) && !autocvar__hud_configure)
return;
- float id = HUD_PANEL_RADAR;
- HUD_Panel_UpdateCvarsForId(id);
+ active_panel = HUD_PANEL_RADAR;
+ HUD_Panel_UpdateCvars(radar);
vector pos, mySize;
pos = panel_pos;
mySize = panel_size;
if(!autocvar_hud_score && !autocvar__hud_configure)
return;
- float id = HUD_PANEL_SCORE;
- HUD_Panel_UpdateCvarsForId(id);
+ active_panel = HUD_PANEL_SCORE;
+ HUD_Panel_UpdateCvars(score);
vector pos, mySize;
pos = panel_pos;
mySize = panel_size;
if(!autocvar_hud_racetimer && !(gametype == GAME_RACE || gametype == GAME_CTS) && !autocvar__hud_configure)
return;
- float id = HUD_PANEL_RACETIMER;
- HUD_Panel_UpdateCvarsForId(id);
+ active_panel = HUD_PANEL_RACETIMER;
+ HUD_Panel_UpdateCvars(racetimer);
vector pos, mySize;
pos = panel_pos;
mySize = panel_size;
if(!autocvar_hud_vote && !autocvar__hud_configure)
return;
- float id = HUD_PANEL_VOTE;
- HUD_Panel_UpdateCvarsForId(id);
+ active_panel = HUD_PANEL_VOTE;
+ HUD_Panel_UpdateCvars(vote);
vector pos, mySize;
pos = panel_pos;
mySize = panel_size;
if (gametype != GAME_KEYHUNT && gametype != GAME_CTF && gametype != GAME_NEXBALL && gametype != GAME_CTS && gametype != GAME_RACE && !autocvar__hud_configure)
return;
- float id = HUD_PANEL_MODICONS;
- HUD_Panel_UpdateCvarsForId(id);
+ active_panel = HUD_PANEL_MODICONS;
+ HUD_Panel_UpdateCvars(modicons);
vector pos, mySize;
pos = panel_pos;
mySize = panel_size;
if(!(spectatee_status > 0 || autocvar_hud_pressedkeys >= 2 || autocvar__hud_configure))
return;
- float id = HUD_PANEL_PRESSEDKEYS;
- HUD_Panel_UpdateCvarsForId(id);
+ active_panel = HUD_PANEL_PRESSEDKEYS;
+ HUD_Panel_UpdateCvars(pressedkeys);
vector pos, mySize;
pos = panel_pos;
mySize = panel_size;
return;
}
- float id = HUD_PANEL_CHAT;
- HUD_Panel_UpdateCvarsForId(id);
+ active_panel = HUD_PANEL_CHAT;
+ HUD_Panel_UpdateCvars(chat);
vector pos, mySize;
pos = panel_pos;
mySize = panel_size;
if(!autocvar_hud_engineinfo && !autocvar__hud_configure)
return;
- float id = HUD_PANEL_ENGINEINFO;
- HUD_Panel_UpdateCvarsForId(id);
+ active_panel = HUD_PANEL_ENGINEINFO;
+ HUD_Panel_UpdateCvars(engineinfo);
vector pos, mySize;
pos = panel_pos;
mySize = panel_size;
if(!autocvar_hud_infomessages && !autocvar__hud_configure)
return;
- float id = HUD_PANEL_INFOMESSAGES;
- HUD_Panel_UpdateCvarsForId(id);
+ active_panel = HUD_PANEL_INFOMESSAGES;
+ HUD_Panel_UpdateCvars(infomessages);
vector pos, mySize;
pos = panel_pos;
mySize = panel_size;