==================
*/
+void HUD_Panel_LoadCvars()
+{
+ // NOTE: in hud_configure mode cvars must be reloaded every frame
+ if (panel.update_time <= time)
+ {
+ 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_ScalePosSize();
+ panel_bg_str = cvar_string(strcat("hud_panel_", panel.panel_name, "_bg"));
+ panel_bg_color_str = cvar_string(strcat("hud_panel_", panel.panel_name, "_bg_color"));
+ panel_bg_color_team_str = cvar_string(strcat("hud_panel_", panel.panel_name, "_bg_color_team"));
+ panel_bg_alpha_str = cvar_string(strcat("hud_panel_", panel.panel_name, "_bg_alpha"));
+ panel_bg_border_str = cvar_string(strcat("hud_panel_", panel.panel_name, "_bg_border"));
+ panel_bg_padding_str = cvar_string(strcat("hud_panel_", panel.panel_name, "_bg_padding"));
+ HUD_Panel_GetBg();
+ if (panel.current_panel_bg != "0")
+ {
+ HUD_Panel_GetBgAlpha();
+ HUD_Panel_GetBorder();
+ }
+ HUD_Panel_GetColorTeam();
+ HUD_Panel_GetColor();
+ HUD_Panel_GetFgAlpha();
+ HUD_Panel_GetPadding();
+ panel.current_panel_bg_alpha = panel_bg_alpha;
+ panel.current_panel_fg_alpha = panel_fg_alpha;
+ if (hud_configure_menu_open == 2 && panel == highlightedPanel)
+ HUD_Panel_UpdatePosSize_ForMenu();
+ else
+ {
+ panel_bg_alpha *= hud_fade_alpha * panel_fade_alpha;
+ panel_fg_alpha *= hud_fade_alpha * panel_fade_alpha;
+ }
+ panel.current_panel_pos = panel_pos;
+ panel.current_panel_size = panel_size;
+ panel.current_panel_bg_border = panel_bg_border;
+ panel.current_panel_bg_color = panel_bg_color;
+ panel.current_panel_bg_color_team = panel_bg_color_team;
+ panel.current_panel_bg_padding = panel_bg_padding;
+ panel.update_time = (autocvar__hud_configure) ? time : time + autocvar_hud_panel_update_interval;
+ return;
+ }
+
+ panel_pos = panel.current_panel_pos;
+ panel_size = panel.current_panel_size;
+ panel_bg_alpha = panel.current_panel_bg_alpha * hud_fade_alpha * panel_fade_alpha;
+ panel_bg_border = panel.current_panel_bg_border;
+ panel_bg_color = panel.current_panel_bg_color;
+ panel_bg_color_team = panel.current_panel_bg_color_team;
+ panel_bg_padding = panel.current_panel_bg_padding;
+ panel_fg_alpha = panel.current_panel_fg_alpha * hud_fade_alpha * panel_fade_alpha;
+}
+
//basically the same code of draw_ButtonPicture and draw_VertButtonPicture for the menu
void HUD_Panel_DrawProgressBar(vector theOrigin, vector theSize, string pic, float length_ratio, bool vertical, float baralign, vector theColor, float theAlpha, int drawflag)
{
panel_size.x *= vid_conwidth; panel_size.y *= vid_conheight; \
} MACRO_END
-// NOTE: in hud_configure mode cvars must be reloaded every frame
float panel_fade_alpha;
-#define HUD_Panel_LoadCvars() MACRO_BEGIN { \
- if (panel.update_time <= time) { \
- 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_ScalePosSize(); \
- panel_bg_str = cvar_string(strcat("hud_panel_", panel.panel_name, "_bg")); \
- panel_bg_color_str = cvar_string(strcat("hud_panel_", panel.panel_name, "_bg_color")); \
- panel_bg_color_team_str = cvar_string(strcat("hud_panel_", panel.panel_name, "_bg_color_team")); \
- panel_bg_alpha_str = cvar_string(strcat("hud_panel_", panel.panel_name, "_bg_alpha")); \
- panel_bg_border_str = cvar_string(strcat("hud_panel_", panel.panel_name, "_bg_border")); \
- panel_bg_padding_str = cvar_string(strcat("hud_panel_", panel.panel_name, "_bg_padding")); \
- HUD_Panel_GetBg(); \
- if (panel.current_panel_bg != "0") { \
- HUD_Panel_GetBgAlpha(); \
- HUD_Panel_GetBorder(); \
- } \
- HUD_Panel_GetColorTeam(); \
- HUD_Panel_GetColor(); \
- HUD_Panel_GetFgAlpha(); \
- HUD_Panel_GetPadding(); \
- panel.current_panel_bg_alpha = panel_bg_alpha; \
- panel.current_panel_fg_alpha = panel_fg_alpha; \
- if (hud_configure_menu_open == 2 && panel == highlightedPanel) { \
- HUD_Panel_UpdatePosSize_ForMenu(); \
- } else { \
- panel_bg_alpha *= hud_fade_alpha * panel_fade_alpha; \
- panel_fg_alpha *= hud_fade_alpha * panel_fade_alpha; \
- } \
- panel.current_panel_pos = panel_pos; \
- panel.current_panel_size = panel_size; \
- panel.current_panel_bg_border = panel_bg_border; \
- panel.current_panel_bg_color = panel_bg_color; \
- panel.current_panel_bg_color_team = panel_bg_color_team; \
- panel.current_panel_bg_padding = panel_bg_padding; \
- panel.update_time = (autocvar__hud_configure) ? time : time + autocvar_hud_panel_update_interval; \
- } else { \
- panel_pos = panel.current_panel_pos; \
- panel_size = panel.current_panel_size; \
- panel_bg_alpha = panel.current_panel_bg_alpha * hud_fade_alpha * panel_fade_alpha; \
- panel_bg_border = panel.current_panel_bg_border; \
- panel_bg_color = panel.current_panel_bg_color; \
- panel_bg_color_team = panel.current_panel_bg_color_team; \
- panel_bg_padding = panel.current_panel_bg_padding; \
- panel_fg_alpha = panel.current_panel_fg_alpha * hud_fade_alpha * panel_fade_alpha; \
- } \
-} MACRO_END
+void HUD_Panel_LoadCvars();
#define Hud_Panel_GetPanelEnabled() \
panel_enabled = ((panel.panel_configflags & PANEL_CONFIG_CANBEOFF) \