}\
}
+// NOTE: in hud_configure mode cvars must be reloaded every frame
#define HUD_Panel_UpdateCvars() \
-panel_enabled = cvar(strcat("hud_panel_", panel.panel_name)); \
if(panel.update_time < time) { \
+ if(autocvar__hud_configure) panel_enabled = cvar(strcat("hud_panel_", panel.panel_name)); \
panel_pos = stov(cvar_string(strcat("hud_panel_", panel.panel_name, "_pos"))); \
panel_size = stov(cvar_string(strcat("hud_panel_", panel.panel_name, "_size"))); \
panel_bg_str = cvar_string(strcat("hud_panel_", panel.panel_name, "_bg")); \
} ENDS_WITH_CURLY_BRACE
#define HUD_Panel_UpdatePosSize() {\
+panel_enabled = cvar(strcat("hud_panel_", panel.panel_name)); \
panel_pos = stov(cvar_string(strcat("hud_panel_", panel.panel_name, "_pos"))); \
panel_size = stov(cvar_string(strcat("hud_panel_", panel.panel_name, "_size"))); \
HUD_Panel_GetScaledVectors()\
myTarget = myPos;
for (i = 0; i < HUD_PANEL_NUM; ++i) {
- if(hud_panel[i] == highlightedPanel || !panel_enabled)
- continue;
-
panel = hud_panel[i];
+ if(panel == highlightedPanel) continue;
HUD_Panel_UpdatePosSize()
+ if(!panel_enabled) continue;
panel_pos -= '1 1 0' * panel_bg_border;
panel_size += '2 2 0' * panel_bg_border;
ratio = mySize_x/mySize_y;
for (i = 0; i < HUD_PANEL_NUM; ++i) {
- if(hud_panel[i] == highlightedPanel || !panel_enabled)
- continue;
-
panel = hud_panel[i];
+ if(panel == highlightedPanel) continue;
HUD_Panel_UpdatePosSize()
+ if(!panel_enabled) continue;
panel_pos -= '1 1 0' * panel_bg_border;
panel_size += '2 2 0' * panel_bg_border;
return true;
if (highlightedPanel)
- cvar_set(strcat("hud_panel_", highlightedPanel.panel_name), ftos(!(panel_enabled)));
+ cvar_set(strcat("hud_panel_", highlightedPanel.panel_name), ftos(!cvar(strcat("hud_panel_", highlightedPanel.panel_name))));
else
cvar_set(strcat("hud_dock"), (autocvar_hud_dock == "") ? "dock" : "");
}