Merge branch 'terencehill/vec2_optimizations' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud / hud.qh
1 #pragma once
2
3 #include <common/weapons/_all.qh>
4
5 void Hud_Dynamic_Frame();
6
7 bool HUD_Radar_Clickable();
8 void HUD_Radar_Mouse();
9
10 REGISTRY(hud_panels, BITS(6))
11 #define hud_panels_from(i) _hud_panels_from(i, NULL)
12 REGISTER_REGISTRY(hud_panels)
13
14 #define REGISTER_HUD_PANEL(id, draw_func, name, configflags, showflags) \
15         void draw_func(); \
16         REGISTER(hud_panels, HUD_PANEL, id, m_id, new_pure(hud_panel)) { \
17                 this.panel_id = this.m_id; \
18                 this.panel_draw = draw_func; \
19                 this.panel_name = #name; \
20                 this.panel_configflags = configflags; \
21                 this.panel_showflags = showflags; \
22         }
23
24 #define HUD_PANEL(NAME) HUD_PANEL_##NAME
25
26 // draw the background/borders
27 #define HUD_Panel_DrawBg() MACRO_BEGIN { \
28         if(panel.current_panel_bg != "0" && panel.current_panel_bg != "") \
29                 draw_BorderPicture( \
30                         HUD_Shift(panel_pos - '1 1 0' * panel_bg_border), \
31                         panel.current_panel_bg, \
32                         HUD_Scale(panel_size + '1 1 0' * 2 * panel_bg_border), \
33                         panel_bg_color, panel_bg_alpha, \
34                         HUD_Scale('1 1 0' * (panel_bg_border/BORDER_MULTIPLIER)) \
35                 ); \
36 } MACRO_END
37
38 int panel_order[hud_panels_MAX];
39 string hud_panelorder_prev;
40
41 bool hud_draw_maximized;
42 bool hud_panel_radar_maximized;
43 bool hud_panel_radar_mouse;
44 float hud_panel_radar_bottom;
45 bool hud_panel_radar_temp_hidden;
46 bool chat_panel_modified;
47 bool radar_panel_modified;
48
49 float HUD_Radar_InputEvent(float bInputType, float nPrimary, float nSecondary);
50 void HUD_Radar_Hide_Maximized();
51
52 float HUD_GetRowCount(int item_count, vector size, float item_aspect);
53 vector HUD_Get_Num_Color (float hp, float maxvalue);
54 void DrawNumIcon(vector myPos, vector mySize, float theTime, string icon, bool vertical, bool icon_right_align, vector color, float theAlpha);
55 void DrawNumIcon_expanding(vector myPos, vector mySize, float theTime, string icon, bool vertical, int icon_right_align, vector color, float theAlpha, float fadelerp);
56 void HUD_Panel_DrawHighlight(vector pos, vector mySize, vector color, float theAlpha, int drawflag);
57 vector HUD_GetTableSize_BestItemAR(int item_count, vector psize, float item_aspect);
58
59 void HUD_Reset ();
60 void HUD_Main ();
61
62 int race_CheckName(string net_name);
63 string MakeRaceString(int cp, float mytime, float theirtime, float lapdelta, string theirname);
64
65 int vote_yescount;
66 int vote_nocount;
67 int vote_needed;
68 int vote_highlighted; // currently selected vote
69
70 int vote_active; // is there an active vote?
71 int vote_prev; // previous state of vote_active to check for a change
72 float vote_alpha;
73 float vote_change; // "time" when vote_active changed
74
75 float hud_panel_quickmenu;
76
77 vector mousepos;
78 vector panel_click_distance; // mouse cursor distance from the top left corner of the panel (saved only upon a click)
79 vector panel_click_resizeorigin; // coordinates for opposite point when resizing
80 float resizeCorner; // 1 = topleft, 2 = topright, 3 = bottomleft, 4 = bottomright
81 entity highlightedPanel;
82 float highlightedAction; // 0 = nothing, 1 = move, 2 = resize
83
84 const float BORDER_MULTIPLIER = 0.25;
85 float scoreboard_bottom;
86 int weapon_accuracy[Weapons_MAX];
87
88 int complain_weapon;
89 float complain_weapon_type;
90 float complain_weapon_time;
91
92 PlayerScoreField ps_primary, ps_secondary;
93 int ts_primary, ts_secondary;
94
95 .Weapon last_switchweapon;
96 .Weapon last_activeweapon;
97 float weapontime;
98 float weaponprevtime;
99
100 float teamnagger;
101
102 int hudShiftState;
103 const int S_SHIFT = 1;
104 const int S_CTRL = 2;
105 const int S_ALT = 4;
106
107 float hud_fade_alpha;
108
109 string hud_skin_path;
110 string hud_skin_prev;
111
112 vector myteamcolors;
113
114 entity highlightedPanel_backup;
115 vector panel_pos_backup;
116 vector panel_size_backup;
117
118 vector panel_size_copied;
119
120 entity panel;
121 entityclass(HUDPanel);
122 class(HUDPanel) .string panel_name;
123 class(HUDPanel) .int panel_id;
124 class(HUDPanel) .vector current_panel_pos;
125 class(HUDPanel) .vector current_panel_size;
126 class(HUDPanel) .string current_panel_bg;
127 class(HUDPanel) .float current_panel_bg_alpha;
128 class(HUDPanel) .float current_panel_bg_border;
129 class(HUDPanel) .vector current_panel_bg_color;
130 class(HUDPanel) .float current_panel_bg_color_team;
131 class(HUDPanel) .float current_panel_bg_padding;
132 class(HUDPanel) .float current_panel_fg_alpha;
133 class(HUDPanel) .float update_time;
134 float panel_enabled;
135 vector panel_pos;
136 vector panel_size;
137 string panel_bg_str; // "_str" vars contain the raw value of the cvar, non-"_str" contains what hud.qc code should use
138 vector panel_bg_color;
139 string panel_bg_color_str;
140 float panel_bg_color_team;
141 string panel_bg_color_team_str;
142 float panel_fg_alpha;
143 float panel_bg_alpha;
144 string panel_bg_alpha_str;
145 float panel_bg_border;
146 string panel_bg_border_str;
147 float panel_bg_padding;
148 string panel_bg_padding_str;
149
150 class(HUDPanel) .void() panel_draw;
151
152 // chat panel can be reduced / moved while the mapvote is active
153 // let know the mapvote panel about chat pos and size
154 float chat_posy;
155 float chat_sizey;
156
157 float current_player;
158
159 float autocvar_hud_dynamic_follow;
160 float autocvar_hud_dynamic_follow_scale;
161 vector autocvar_hud_dynamic_follow_scale_xyz;
162
163 vector hud_dynamic_shake_realofs;
164 float hud_dynamic_shake_factor;
165 float hud_dynamic_shake_time;
166
167 // shared across viewmodel effects and dynamic hud code
168 vector cl_followmodel_ofs;
169 float cl_followmodel_time;
170
171 vector hud_scale;
172 vector hud_scale_current = '1 1 0';
173 vector hud_shift;
174 vector hud_shift_current = '0 0 0';
175 vector hud_scale_center;
176
177 float stringwidth_colors(string s, vector theSize);
178 float stringwidth_nocolors(string s, vector theSize);
179 void HUD_Panel_DrawProgressBar(vector theOrigin, vector theSize, string pic, float length_ratio, bool vertical, float baralign, vector theColor, float theAlpha, int drawflag);
180
181 .int panel_showflags;
182 const int PANEL_SHOW_NEVER    = 0x00;
183 const int PANEL_SHOW_MAINGAME = 0x01;
184 const int PANEL_SHOW_MINIGAME = 0x02;
185 const int PANEL_SHOW_MAPVOTE  = 0x04;
186 const int PANEL_SHOW_WITH_SB  = 0x08;
187 const int PANEL_SHOW_ALWAYS   = 0xff;
188
189 .int panel_configflags;
190 const int PANEL_CONFIG_NO        = 0x00;
191 const int PANEL_CONFIG_MAIN      = 0x01;
192 const int PANEL_CONFIG_CANBEOFF  = 0x02; // panel can be disabled (if disabled it's displayed with a low alpha)
193
194
195 // prev_* vars contain the health/armor at the previous FRAME
196 // set to -1 when player is dead or was not playing
197 int prev_health, prev_armor;
198 float health_damagetime, armor_damagetime;
199 int health_beforedamage, armor_beforedamage;
200 // old_p_* vars keep track of previous values when smoothing value changes of the progressbar
201 int old_p_health, old_p_armor;
202 float old_p_healthtime, old_p_armortime;
203 // prev_p_* vars contain the health/armor progressbar value at the previous FRAME
204 // set to -1 to forcedly stop effects when we switch spectated player (e.g. from playerX: 70h to playerY: 50h)
205 int prev_p_health, prev_p_armor;
206
207 void HUD_ItemsTime();
208
209 REGISTER_HUD_PANEL(WEAPONS,         HUD_Weapons,        weapons,        PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // WEAPONS
210 REGISTER_HUD_PANEL(AMMO,            HUD_Ammo,           ammo,           PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // AMMO
211 REGISTER_HUD_PANEL(POWERUPS,        HUD_Powerups,       powerups,       PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // POWERUPS
212 REGISTER_HUD_PANEL(HEALTHARMOR,     HUD_HealthArmor,    healtharmor,    PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // HEALTHARMOR
213 REGISTER_HUD_PANEL(NOTIFY,          HUD_Notify,         notify,         PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME                                          ) // NOTIFY
214 REGISTER_HUD_PANEL(TIMER,           HUD_Timer,          timer,          PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME                      | PANEL_SHOW_WITH_SB) // TIMER
215 REGISTER_HUD_PANEL(RADAR,           HUD_Radar,          radar,          PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // RADAR
216 REGISTER_HUD_PANEL(SCORE,           HUD_Score,          score,          PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME                                          ) // SCORE
217 REGISTER_HUD_PANEL(RACETIMER,       HUD_RaceTimer,      racetimer,      PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // RACETIMER
218 REGISTER_HUD_PANEL(VOTE,            HUD_Vote,           vote,           PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // VOTE
219 REGISTER_HUD_PANEL(MODICONS,        HUD_ModIcons,       modicons,       PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                            | PANEL_SHOW_WITH_SB) // MODICONS
220 REGISTER_HUD_PANEL(PRESSEDKEYS,     HUD_PressedKeys,    pressedkeys,    PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // PRESSEDKEYS
221 REGISTER_HUD_PANEL(CHAT,            HUD_Chat,           chat,           PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // CHAT
222 REGISTER_HUD_PANEL(ENGINEINFO,      HUD_EngineInfo,     engineinfo,     PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // ENGINEINFO
223 REGISTER_HUD_PANEL(INFOMESSAGES,    HUD_InfoMessages,   infomessages,   PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // INFOMESSAGES
224 REGISTER_HUD_PANEL(PHYSICS,         HUD_Physics,        physics,        PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // PHYSICS
225 REGISTER_HUD_PANEL(CENTERPRINT,     HUD_CenterPrint,    centerprint,    PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                            | PANEL_SHOW_WITH_SB) // CENTERPRINT
226 REGISTER_HUD_PANEL(MINIGAME_BOARD,  HUD_MinigameBoard,  minigameboard,  PANEL_CONFIG_NO                          ,                       PANEL_SHOW_MINIGAME                      | PANEL_SHOW_WITH_SB) // MINIGAME_BOARD
227 REGISTER_HUD_PANEL(MINIGAME_STATUS, HUD_MinigameStatus, minigamestatus, PANEL_CONFIG_NO                          ,                       PANEL_SHOW_MINIGAME                      | PANEL_SHOW_WITH_SB) // MINIGAME_STATUS
228 REGISTER_HUD_PANEL(MINIGAME_HELP,   HUD_MinigameHelp,   minigamehelp,   PANEL_CONFIG_NO                          ,                       PANEL_SHOW_MINIGAME                      | PANEL_SHOW_WITH_SB) // MINIGAME_HELP
229 REGISTER_HUD_PANEL(MINIGAME_MENU,   HUD_MinigameMenu,   minigamemenu,   PANEL_CONFIG_NO                          , PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // MINIGAME_MENU
230 REGISTER_HUD_PANEL(MAPVOTE,         MapVote_Draw,       mapvote,        PANEL_CONFIG_NO                          ,                                             PANEL_SHOW_MAPVOTE                     ) // MAPVOTE
231 REGISTER_HUD_PANEL(ITEMSTIME,       HUD_ItemsTime,      itemstime,      PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME                                                                ) // ITEMSTIME
232 REGISTER_HUD_PANEL(QUICKMENU,       HUD_QuickMenu,      quickmenu,      PANEL_CONFIG_MAIN                        , PANEL_SHOW_MAINGAME                                                                ) // QUICKMENU
233 REGISTER_HUD_PANEL(SCOREBOARD,      Scoreboard_Draw,    scoreboard,     PANEL_CONFIG_NO                          , PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // SCOREBOARD
234 // always add new panels to the end of list
235
236 // Because calling lots of functions in QC apparently cuts fps in half on many machines:
237 // ----------------------
238 // MACRO HELL STARTS HERE
239 // ----------------------
240 // Little help for the poor people who have to make sense of this: Start from the bottom ;)
241
242 // Get value for panel.current_panel_bg: if "" fetch default, else use panel_bg_str
243 // comment on last line of macro: // we probably want to see a background in config mode at all times...
244 #define HUD_Panel_GetBg() MACRO_BEGIN {                                                                             \
245         string panel_bg;                                                                                                \
246         if (!autocvar__hud_configure && panel_bg_str == "0") {                                                          \
247                 panel_bg = "0";                                                                                             \
248         } else {                                                                                                        \
249                 if (panel_bg_str == "") {                                                                                   \
250                         panel_bg_str = autocvar_hud_panel_bg;                                                                   \
251                 }                                                                                                           \
252                 if (panel_bg_str == "0" && !autocvar__hud_configure) {                                                      \
253                         panel_bg = "0";                                                                                         \
254                 } else {                                                                                                    \
255                         if (panel_bg_str == "0" && autocvar__hud_configure)                                                     \
256                                 panel_bg_alpha_str = "0";                                                                           \
257                         panel_bg = strcat(hud_skin_path, "/", panel_bg_str);                                                    \
258                         if (precache_pic(panel_bg) == "") {                                                                     \
259                                 panel_bg = strcat(hud_skin_path, "/", "border_default");                                            \
260                                 if (precache_pic(panel_bg) == "") {                                                                 \
261                                         panel_bg = strcat("gfx/hud/default/", "border_default");                                        \
262                                 }                                                                                                   \
263                         }                                                                                                       \
264                 }                                                                                                           \
265         }                                                                                                               \
266         if (panel.current_panel_bg)                                                                                     \
267                 strunzone(panel.current_panel_bg);                                                                          \
268         panel.current_panel_bg = strzone(panel_bg);                                                                     \
269 } MACRO_END
270
271 // Get value for panel_bg_color: if "" fetch default, else use panel_bg_color. Convert pants, shirt or teamcolor into a vector.
272 #define HUD_Panel_GetColor() MACRO_BEGIN {                                                                          \
273         if ((teamplay) && panel_bg_color_team > 0) {                                                                        \
274                 if (autocvar__hud_configure && myteam == NUM_SPECTATOR)                                                     \
275                         panel_bg_color = '1 0 0' * panel_bg_color_team;                                                         \
276                 else                                                                                                        \
277                         panel_bg_color = myteamcolors * panel_bg_color_team;                                                    \
278         } else if (autocvar_hud_configure_teamcolorforced && autocvar__hud_configure && panel_bg_color_team > 0) {          \
279                 panel_bg_color = '1 0 0' * panel_bg_color_team;                                                             \
280         } else {                                                                                                        \
281                 if (panel_bg_color_str == "") {                                                                             \
282                         panel_bg_color = autocvar_hud_panel_bg_color;                                                           \
283                 } else {                                                                                                    \
284                         if (panel_bg_color_str == "shirt") {                                                                    \
285                                 panel_bg_color = colormapPaletteColor(floor(entcs_GetClientColors(current_player) / 16), 0); \
286                         } else if (panel_bg_color_str == "pants") {                                                             \
287                                 panel_bg_color = colormapPaletteColor(entcs_GetClientColors(current_player) % 16, 1); \
288                         } else {                                                                                                \
289                                 panel_bg_color = stov(panel_bg_color_str);                                                          \
290                         }                                                                                                       \
291                 }                                                                                                           \
292         }                                                                                                               \
293 } MACRO_END
294
295 // Get value for panel_bg_color_team: if "" fetch default, else use panel_bg_color_team_str
296 #define HUD_Panel_GetColorTeam() MACRO_BEGIN {                                                                      \
297         if (panel_bg_color_team_str == "") {                                                                            \
298                 panel_bg_color_team = autocvar_hud_panel_bg_color_team;                                                     \
299         } else {                                                                                                        \
300                 panel_bg_color_team = stof(panel_bg_color_team_str);                                                        \
301         }                                                                                                               \
302 } MACRO_END
303
304 // Get value for panel_bg_alpha: if "" fetch default, else use panel_bg_alpha. Also do various menu dialog fadeout/in checks, and minalpha checks
305 // comment on line 3 of macro: // do not set a minalpha cap when showing the config dialog for this panel
306 #define HUD_Panel_GetBgAlpha() MACRO_BEGIN {                                                                        \
307         if (panel_bg_alpha_str == "") {                                                                                 \
308                 panel_bg_alpha_str = ftos(autocvar_hud_panel_bg_alpha);                                                     \
309         }                                                                                                               \
310         panel_bg_alpha = stof(panel_bg_alpha_str);                                                                      \
311         if (autocvar__hud_configure) {                                                                                  \
312                 if (!panel_enabled)                                                                                         \
313                         panel_bg_alpha = 0.25;                                                                                  \
314                 else if (hud_configure_menu_open == 2 && panel == highlightedPanel)                                                    \
315                         panel_bg_alpha = (1 - autocvar__menu_alpha) * max(cvar("hud_configure_bg_minalpha"), panel_bg_alpha) + autocvar__menu_alpha * panel_bg_alpha;\
316                 else                                                                                                        \
317                         panel_bg_alpha = max(cvar("hud_configure_bg_minalpha"), panel_bg_alpha);                                \
318         }                                                                                                               \
319 } MACRO_END
320
321 // Get value for panel_fg_alpha. Also do various minalpha checks
322 // comment on line 2 of macro: // ALWAYS show disabled panels at 0.25 alpha when in config mode
323 #define HUD_Panel_GetFgAlpha() MACRO_BEGIN {                                                                        \
324         panel_fg_alpha = autocvar_hud_panel_fg_alpha;                                                                   \
325         if (autocvar__hud_configure && !panel_enabled)                                                                  \
326                 panel_fg_alpha = 0.25;                                                                                      \
327 } MACRO_END
328
329 // Get border. See comments above, it's similar.
330 #define HUD_Panel_GetBorder() MACRO_BEGIN {                                                                         \
331         if (panel_bg_border_str == "") {                                                                                \
332                 panel_bg_border = autocvar_hud_panel_bg_border;                                                             \
333         } else {                                                                                                        \
334                 panel_bg_border = stof(panel_bg_border_str);                                                                \
335         }                                                                                                               \
336 } MACRO_END
337
338 // Get padding. See comments above, it's similar.
339 // last line is a port of the old function, basically always make sure the panel contents are at least 5 pixels tall/wide, to disallow extreme padding values
340 #define HUD_Panel_GetPadding() MACRO_BEGIN {                                                                        \
341         if (panel_bg_padding_str == "") {                                                                               \
342                 panel_bg_padding = autocvar_hud_panel_bg_padding;                                                           \
343         } else {                                                                                                        \
344                 panel_bg_padding = stof(panel_bg_padding_str);                                                              \
345         }                                                                                                               \
346         panel_bg_padding = min(min(panel_size.x, panel_size.y)/2 - 5, panel_bg_padding);                                \
347 } MACRO_END
348
349 // return smoothly faded pos and size of given panel when a dialog is active
350 // don't center too wide panels, it doesn't work with different resolutions
351 #define HUD_Panel_UpdatePosSize_ForMenu() MACRO_BEGIN { \
352         vector new_size = panel_size; \
353         float max_panel_width = 0.52 * vid_conwidth; \
354         if(panel_size.x > max_panel_width) \
355         { \
356                 new_size.x = max_panel_width; \
357                 new_size.y = panel_size.y * (new_size.x / panel_size.x); \
358         } \
359         vector new_pos = vec2(panel_bg_border + 0.5 * max_panel_width, 0.5 * vid_conheight) - 0.5 * new_size; \
360         panel_pos = (1 - autocvar__menu_alpha) * panel_pos + (autocvar__menu_alpha) * new_pos; \
361         panel_size = (1 - autocvar__menu_alpha) * panel_size + (autocvar__menu_alpha) * new_size; \
362 } MACRO_END
363
364 // Scale the pos and size vectors to absolute coordinates
365 #define HUD_Panel_ScalePosSize() MACRO_BEGIN {                                                                      \
366         panel_pos.x *= vid_conwidth;  panel_pos.y *= vid_conheight;                                                     \
367         panel_size.x *= vid_conwidth; panel_size.y *= vid_conheight;                                                    \
368 } MACRO_END
369
370 float panel_fade_alpha;
371 void HUD_Panel_LoadCvars();
372
373 #define Hud_Panel_GetPanelEnabled() \
374         panel_enabled = ((panel.panel_configflags & PANEL_CONFIG_CANBEOFF) \
375                                         ? cvar(strcat("hud_panel_", panel.panel_name)) : true)
376
377 #define HUD_Panel_UpdatePosSize() MACRO_BEGIN {                                                                     \
378         Hud_Panel_GetPanelEnabled(); \
379         panel_pos = stov(cvar_string(strcat("hud_panel_", panel.panel_name, "_pos")));                                  \
380         panel_size = stov(cvar_string(strcat("hud_panel_", panel.panel_name, "_size")));                                \
381         HUD_Panel_ScalePosSize();                                                                                       \
382         if (hud_configure_menu_open == 2 && panel == highlightedPanel) {                                                           \
383                 HUD_Panel_UpdatePosSize_ForMenu();                                                                          \
384         }                                                                                                               \
385         panel_bg_border_str = cvar_string(strcat("hud_panel_", panel.panel_name, "_bg_border"));                        \
386         HUD_Panel_GetBorder();                                                                                          \
387 } MACRO_END
388
389 const int NOTIFY_MAX_ENTRIES = 10;
390 const float NOTIFY_ICON_MARGIN = 0.02;
391
392 int notify_index;
393 int notify_count;
394 float notify_times[NOTIFY_MAX_ENTRIES];
395 string notify_attackers[NOTIFY_MAX_ENTRIES];
396 string notify_victims[NOTIFY_MAX_ENTRIES];
397 string notify_icons[NOTIFY_MAX_ENTRIES];
398
399 void HUD_Notify_Push(string icon, string attacker, string victim);
400
401 var void HUD_ModIcons_GameType(vector pos, vector size);
402 void HUD_ModIcons_SetFunc();