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