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