Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
hud.qh File Reference
Include dependency graph for hud.qh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define _REGISTER_HUD_PANEL(id, draw_func, export_func, configflags, showflags)
#define HUD_PANEL(NAME)
#define HUD_Panel_DrawBg()
#define HUD_Panel_GetBg()
#define HUD_Panel_GetBgAlpha()
#define HUD_Panel_GetBorder()
#define HUD_Panel_GetColor()
#define HUD_Panel_GetColorTeam()
#define HUD_Panel_GetFgAlpha()
#define HUD_Panel_GetPadding()
#define Hud_Panel_GetPanelEnabled()
#define HUD_Panel_ScalePosSize()
#define HUD_Panel_UpdatePosSize()
#define HUD_Panel_UpdatePosSize_ForMenu()
#define HUD_ScaleX(f)
#define HUD_ScaleY(f)
#define HUD_ShiftX(f)
#define HUD_ShiftY(f)
#define REGISTER_HUD_PANEL(id, draw_func, configflags, showflags)

Functions

 classfield (HUDPanel) .string panel_name
void draw_cursor (vector pos, vector ofs, string img, vector col, float a)
void draw_cursor_normal (vector pos, vector col, float a)
void DrawNumIcon (vector myPos, vector mySize, float theTime, string icon, bool vertical, bool isInfinite, bool icon_right_align, vector color, float theAlpha)
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)
 entityclass (HUDPanel)
void Hud_Dynamic_Frame ()
vector HUD_Get_Num_Color (float hp, float maxvalue, bool blink)
vector HUD_GetFontsize (string cvarname)
float HUD_GetRowCount (int item_count, vector size, float item_aspect)
vector HUD_GetTableSize_BestItemAR (int item_count, vector psize, float item_aspect)
void HUD_ItemsTime ()
void HUD_Main ()
var void HUD_ModIcons_GameType (vector pos, vector size)
void HUD_ModIcons_SetFunc ()
void HUD_Notify_Push (string icon, string attacker, string victim)
void HUD_Panel_DrawHighlight (vector pos, vector mySize, vector color, float theAlpha, int drawflag)
void HUD_Panel_DrawProgressBar (vector theOrigin, vector theSize, string pic, float length_ratio, bool vertical, float baralign, vector theColor, float theAlpha, int drawflag)
void HUD_Panel_LoadCvars ()
bool HUD_Radar_Clickable ()
void HUD_Radar_Hide_Maximized ()
float HUD_Radar_InputEvent (float bInputType, float nPrimary, float nSecondary)
void HUD_Radar_Mouse ()
void HUD_Reset ()
vector HUD_Scale (vector v)
void HUD_Scale_Disable ()
void HUD_Scale_Enable ()
vector HUD_Shift (vector v)
bool HUD_WouldShowCursor ()
void LoadMenuSkinValues ()
string MakeRaceString (int cp, float mytime, float theirtime, float othertime, float lapdelta, string theirname)
bool QuickMenu_IsOpened ()
int race_CheckName (string net_name)

Variables

int armor_beforedamage
float armor_damagetime
string autocvar__hud_panelorder
float autocvar__menu_alpha
bool autocvar_hud_cursormode = true
string autocvar_hud_dock
float autocvar_hud_dock_alpha
string autocvar_hud_dock_color
bool autocvar_hud_dock_color_team
float autocvar_hud_dynamic_follow
float autocvar_hud_dynamic_follow_scale
vector autocvar_hud_dynamic_follow_scale_xyz
string autocvar_hud_panel_bg
float autocvar_hud_panel_bg_alpha
float autocvar_hud_panel_bg_border
vector autocvar_hud_panel_bg_color
float autocvar_hud_panel_bg_color_team
float autocvar_hud_panel_bg_padding
float autocvar_hud_panel_fg_alpha
float autocvar_hud_panel_update_interval
float autocvar_hud_progressbar_alpha
string autocvar_hud_skin
int autocvar_hud_speed_unit
const float BORDER_MULTIPLIER = 4
bool chat_panel_modified
float chat_posy
float chat_sizey
vector cl_followmodel_ofs
float cl_followmodel_time
entity complain_weapon
float complain_weapon_time
int complain_weapon_type
float current_player
int health_beforedamage
float health_damagetime
float highlightedAction
entity highlightedPanel
entity highlightedPanel_backup
bool hud_draw_maximized
float hud_dynamic_shake_factor
vector hud_dynamic_shake_realofs
float hud_dynamic_shake_time
float hud_fade_alpha
float hud_panel_radar_bottom
bool hud_panel_radar_maximized
bool hud_panel_radar_mouse
bool hud_panel_radar_temp_hidden
string hud_panelorder_prev
vector hud_scale
vector hud_scale_center
vector hud_scale_current = '1 1 0'
vector hud_shift
vector hud_shift_current = '0 0 0'
string hud_skin_path
string hud_skin_prev
int hudShiftState
Weapon last_activeweapon
Weapon last_switchweapon
vector mousepos
vector myteamcolors
string notify_attackers [NOTIFY_MAX_ENTRIES]
int notify_count
const float NOTIFY_ICON_MARGIN = 0.02
string notify_icons [NOTIFY_MAX_ENTRIES]
int notify_index
const int NOTIFY_MAX_ENTRIES = 10
float notify_times [NOTIFY_MAX_ENTRIES]
string notify_victims [NOTIFY_MAX_ENTRIES]
vector OFFSET_CURSOR = '0 0 0'
int old_p_armor
float old_p_armortime
int old_p_health
float old_p_healthtime
entity panel
float panel_bg_alpha
string panel_bg_alpha_str
float panel_bg_border
string panel_bg_border_str
vector panel_bg_color
string panel_bg_color_str
float panel_bg_color_team
string panel_bg_color_team_str
float panel_bg_padding
string panel_bg_padding_str
string panel_bg_str
vector panel_click_distance
vector panel_click_resizeorigin
const int PANEL_CONFIG_CANBEOFF = 0x02
const int PANEL_CONFIG_MAIN = 0x01
const int PANEL_CONFIG_NO = 0x00
int panel_configflags
float panel_enabled
float panel_fade_alpha
float panel_fg_alpha
int panel_order [REGISTRY_MAX(hud_panels)]
vector panel_pos
vector panel_pos_backup
const int PANEL_SHOW_MAINGAME = BIT(0)
const int PANEL_SHOW_MAPVOTE = BIT(2)
const int PANEL_SHOW_MINIGAME = BIT(1)
const int PANEL_SHOW_WITH_SB = BIT(3)
int panel_showflags
vector panel_size
vector panel_size_backup
vector panel_size_copied
int prev_armor
int prev_health
int prev_p_armor
int prev_p_health
PlayerScoreField ps_primary
PlayerScoreField ps_secondary
bool radar_panel_modified
float resizeCorner
const int S_ALT = 4
const int S_CTRL = 2
const int S_SHIFT = 1
const int S_TAB = 8
vector SIZE_CURSOR = '32 32 0'
int teamnagger
float timer
int ts_primary
int ts_secondary
int vote_active
float vote_alpha
float vote_change
int vote_highlighted
int vote_needed
int vote_nocount
int vote_prev
int vote_yescount
int weapon_accuracy [REGISTRY_MAX(Weapons)]
float weaponprevtime
float weapontime

Macro Definition Documentation

◆ _REGISTER_HUD_PANEL

#define _REGISTER_HUD_PANEL ( id,
draw_func,
export_func,
configflags,
showflags )
Value:
void draw_func(); \
void export_func(int fh); \
REGISTER(hud_panels, HUD_PANEL, id, m_id, new_pure(hud_panel)) \
{ \
this.panel_id = this.m_id; \
this.panel_draw = draw_func; \
this.panel_export = export_func; \
this.panel_name = strzone(strtolower(#id)); \
this.panel_configflags = configflags; \
this.panel_showflags = showflags; \
}
string strtolower(string s)
int m_id
Definition effect.qh:19
#define HUD_PANEL(NAME)
Definition hud.qh:52
int panel_showflags
Definition hud.qh:229
int panel_configflags
Definition hud.qh:235
string strzone(string s)
#define new_pure(class)
purely logical entities (not linked to the area grid)
Definition oo.qh:67

Definition at line 36 of file hud.qh.

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 { \
41 this.panel_id = this.m_id; \
42 this.panel_draw = draw_func; \
43 this.panel_export = export_func; \
44 this.panel_name = strzone(strtolower(#id)); \
45 this.panel_configflags = configflags; \
46 this.panel_showflags = showflags; \
47 }

◆ HUD_PANEL

#define HUD_PANEL ( NAME)

◆ HUD_Panel_DrawBg

#define HUD_Panel_DrawBg ( )
Value:
MACRO_BEGIN \
if (panel.current_panel_bg != "0" && panel.current_panel_bg != "") \
draw_BorderPicture( \
panel.current_panel_bg, \
HUD_Scale(panel_size + '1 1 0' * 2 * panel_bg_border), \
); \
vector HUD_Shift(vector v)
Definition hud.qc:105
vector HUD_Scale(vector v)
Definition hud.qc:98
vector panel_size
Definition hud.qh:163
float panel_bg_border
Definition hud.qh:172
const float BORDER_MULTIPLIER
Definition hud.qh:110
vector panel_pos
Definition hud.qh:162
float panel_bg_alpha
Definition hud.qh:170
vector panel_bg_color
Definition hud.qh:165
entity panel
Definition hud.qh:147
#define MACRO_END
Definition macro.qh:7

Definition at line 55 of file hud.qh.

55#define HUD_Panel_DrawBg() MACRO_BEGIN \
56 if (panel.current_panel_bg != "0" && panel.current_panel_bg != "") \
57 draw_BorderPicture( \
58 HUD_Shift(panel_pos - '1 1 0' * panel_bg_border), \
59 panel.current_panel_bg, \
60 HUD_Scale(panel_size + '1 1 0' * 2 * panel_bg_border), \
61 panel_bg_color, panel_bg_alpha, \
62 HUD_Scale('1 1 0' * BORDER_MULTIPLIER * panel_bg_border) \
63 ); \
64MACRO_END

Referenced by HUD_Ammo(), HUD_CenterPrint(), HUD_Chat(), HUD_Checkpoints(), HUD_EngineInfo(), HUD_HealthArmor(), HUD_InfoMessages(), HUD_ItemsTime(), HUD_MinigameMenu(), HUD_ModIcons(), HUD_Notify(), HUD_Physics(), HUD_Pickup(), HUD_Powerups(), HUD_PressedKeys(), HUD_QuickMenu(), HUD_RaceTimer(), HUD_Radar(), HUD_Score(), HUD_StrafeHUD(), HUD_Timer(), HUD_Vote(), MapVote_Draw(), Scoreboard_AccuracyStats_Draw(), Scoreboard_ItemStats_Draw(), Scoreboard_MakeTable(), Scoreboard_MapStats_Draw(), Scoreboard_Rankings_Draw(), and Weapons_Draw().

◆ HUD_Panel_GetBg

#define HUD_Panel_GetBg ( )
Value:
MACRO_BEGIN \
string panel_bg; \
panel_bg = "0"; \
else \
{ \
if (panel_bg_str == "") \
panel_bg = "0"; \
else \
{ \
panel_bg = strcat(hud_skin_path, "/", panel_bg_str); \
if (precache_pic(panel_bg) == "") \
{ \
panel_bg = strcat(hud_skin_path, "/", "border_default"); \
if (precache_pic(panel_bg) == "") \
panel_bg = strcat("gfx/hud/default/", "border_default"); \
} \
} \
} \
strcpy(panel.current_panel_bg, panel_bg); \
string panel_bg_alpha_str
Definition hud.qh:171
string panel_bg_str
Definition hud.qh:164
string autocvar_hud_panel_bg
Definition hud.qh:196
string hud_skin_path
Definition hud.qh:136
bool autocvar__hud_configure
Definition hud_config.qh:3
string precache_pic(string name,...)
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))

Definition at line 294 of file hud.qh.

294#define HUD_Panel_GetBg() MACRO_BEGIN \
295 string panel_bg; \
296 if (!autocvar__hud_configure && panel_bg_str == "0") \
297 panel_bg = "0"; \
298 else \
299 { \
300 if (panel_bg_str == "") \
301 panel_bg_str = autocvar_hud_panel_bg; \
302 if (panel_bg_str == "0" && !autocvar__hud_configure) \
303 panel_bg = "0"; \
304 else \
305 { \
306 if (panel_bg_str == "0" && autocvar__hud_configure) \
307 panel_bg_alpha_str = "0"; \
308 panel_bg = strcat(hud_skin_path, "/", panel_bg_str); \
309 if (precache_pic(panel_bg) == "") \
310 { \
311 panel_bg = strcat(hud_skin_path, "/", "border_default"); \
312 if (precache_pic(panel_bg) == "") \
313 panel_bg = strcat("gfx/hud/default/", "border_default"); \
314 } \
315 } \
316 } \
317 strcpy(panel.current_panel_bg, panel_bg); \
318MACRO_END

Referenced by HUD_Panel_LoadCvars().

◆ HUD_Panel_GetBgAlpha

#define HUD_Panel_GetBgAlpha ( )
Value:
MACRO_BEGIN \
if (panel_bg_alpha_str == "") \
{ \
if (!panel_enabled) \
panel_bg_alpha = 0.25; \
else \
panel_bg_alpha = max(cvar("hud_configure_bg_minalpha"), panel_bg_alpha); \
} \
entity highlightedPanel
Definition hud.qh:107
float autocvar__menu_alpha
Definition hud.qh:187
float autocvar_hud_panel_bg_alpha
Definition hud.qh:197
float panel_enabled
Definition hud.qh:161
float hud_configure_menu_open
Definition hud_config.qh:22
float stof(string val,...)
float cvar(string name)
string ftos(float f)
float max(float f,...)

Definition at line 357 of file hud.qh.

357#define HUD_Panel_GetBgAlpha() MACRO_BEGIN \
358 if (panel_bg_alpha_str == "") \
359 panel_bg_alpha_str = ftos(autocvar_hud_panel_bg_alpha); \
360 panel_bg_alpha = stof(panel_bg_alpha_str); \
361 if (autocvar__hud_configure) \
362 { \
363 if (!panel_enabled) \
364 panel_bg_alpha = 0.25; \
365 else if (hud_configure_menu_open == 2 && panel == highlightedPanel) \
366 panel_bg_alpha = (1 - autocvar__menu_alpha) * max(cvar("hud_configure_bg_minalpha"), panel_bg_alpha) + autocvar__menu_alpha * panel_bg_alpha; \
367 else \
368 panel_bg_alpha = max(cvar("hud_configure_bg_minalpha"), panel_bg_alpha); \
369 } \
370MACRO_END

Referenced by HUD_Panel_LoadCvars().

◆ HUD_Panel_GetBorder

#define HUD_Panel_GetBorder ( )
Value:
MACRO_BEGIN \
if (panel_bg_border_str == "") \
else \
panel_bg_border = stof(panel_bg_border_str); \
string panel_bg_border_str
Definition hud.qh:173
float autocvar_hud_panel_bg_border
Definition hud.qh:198

Definition at line 381 of file hud.qh.

381#define HUD_Panel_GetBorder() MACRO_BEGIN \
382 if (panel_bg_border_str == "") \
383 panel_bg_border = autocvar_hud_panel_bg_border; \
384 else \
385 panel_bg_border = stof(panel_bg_border_str); \
386MACRO_END

Referenced by HUD_Panel_LoadCvars().

◆ HUD_Panel_GetColor

#define HUD_Panel_GetColor ( )
Value:
MACRO_BEGIN \
{ \
else \
panel_bg_color = myteamcolors * panel_bg_color_team; \
} \
else \
{ \
if (panel_bg_color_str == "") \
else \
{ \
if (panel_bg_color_str == "shirt") \
else if (panel_bg_color_str == "pants") \
else \
panel_bg_color = stov(panel_bg_color_str); \
} \
} \
#define colormapPaletteColor(c, isPants)
Definition color.qh:5
int entcs_GetClientColors(int i)
Definition ent_cs.qh:115
float panel_bg_color_team
Definition hud.qh:167
string panel_bg_color_str
Definition hud.qh:166
vector autocvar_hud_panel_bg_color
Definition hud.qh:199
float current_player
Definition hud.qh:185
vector myteamcolors
Definition hud.qh:139
bool autocvar_hud_configure_teamcolorforced
Definition hud_config.qh:8
vector stov(string s)
float floor(float f)
int myteam
Definition teams.qh:60
const int NUM_SPECTATOR
Definition teams.qh:23
bool teamplay
Definition teams.qh:59

Definition at line 321 of file hud.qh.

321#define HUD_Panel_GetColor() MACRO_BEGIN \
322 if (teamplay && panel_bg_color_team > 0) \
323 { \
324 if (autocvar__hud_configure && myteam == NUM_SPECTATOR) \
325 panel_bg_color = '1 0 0' * panel_bg_color_team; \
326 else \
327 panel_bg_color = myteamcolors * panel_bg_color_team; \
328 } \
329 else if (autocvar_hud_configure_teamcolorforced && autocvar__hud_configure && panel_bg_color_team > 0) \
330 panel_bg_color = '1 0 0' * panel_bg_color_team; \
331 else \
332 { \
333 if (panel_bg_color_str == "") \
334 panel_bg_color = autocvar_hud_panel_bg_color; \
335 else \
336 { \
337 if (panel_bg_color_str == "shirt") \
338 panel_bg_color = colormapPaletteColor(floor(entcs_GetClientColors(current_player) / 16), 0); \
339 else if (panel_bg_color_str == "pants") \
340 panel_bg_color = colormapPaletteColor(entcs_GetClientColors(current_player) % 16, 1); \
341 else \
342 panel_bg_color = stov(panel_bg_color_str); \
343 } \
344 } \
345MACRO_END

Referenced by HUD_Panel_LoadCvars().

◆ HUD_Panel_GetColorTeam

#define HUD_Panel_GetColorTeam ( )
Value:
MACRO_BEGIN \
else \
panel_bg_color_team = stof(panel_bg_color_team_str); \
string panel_bg_color_team_str
Definition hud.qh:168
float autocvar_hud_panel_bg_color_team
Definition hud.qh:200

Definition at line 348 of file hud.qh.

348#define HUD_Panel_GetColorTeam() MACRO_BEGIN \
349 if (panel_bg_color_team_str == "") \
350 panel_bg_color_team = autocvar_hud_panel_bg_color_team; \
351 else \
352 panel_bg_color_team = stof(panel_bg_color_team_str); \
353MACRO_END

Referenced by HUD_Panel_LoadCvars().

◆ HUD_Panel_GetFgAlpha

#define HUD_Panel_GetFgAlpha ( )
Value:
MACRO_BEGIN \
panel_fg_alpha = autocvar_hud_panel_fg_alpha; \
panel_fg_alpha = 0.25; \
float panel_fg_alpha
Definition hud.qh:169
float autocvar_hud_panel_fg_alpha
Definition hud.qh:202

Definition at line 374 of file hud.qh.

374#define HUD_Panel_GetFgAlpha() MACRO_BEGIN \
375 panel_fg_alpha = autocvar_hud_panel_fg_alpha; \
376 if (autocvar__hud_configure && !panel_enabled) \
377 panel_fg_alpha = 0.25; \
378MACRO_END

Referenced by HUD_Panel_LoadCvars().

◆ HUD_Panel_GetPadding

#define HUD_Panel_GetPadding ( )
Value:
MACRO_BEGIN \
if (panel_bg_padding_str == "") \
else \
panel_bg_padding = stof(panel_bg_padding_str); \
float panel_bg_padding
Definition hud.qh:174
float autocvar_hud_panel_bg_padding
Definition hud.qh:201
string panel_bg_padding_str
Definition hud.qh:175
float min(float f,...)

Definition at line 390 of file hud.qh.

390#define HUD_Panel_GetPadding() MACRO_BEGIN \
391 if (panel_bg_padding_str == "") \
392 panel_bg_padding = autocvar_hud_panel_bg_padding; \
393 else \
394 panel_bg_padding = stof(panel_bg_padding_str); \
395 panel_bg_padding = min(min(panel_size.x, panel_size.y) * 0.5 - 5, panel_bg_padding); \
396MACRO_END

Referenced by HUD_Panel_LoadCvars().

◆ Hud_Panel_GetPanelEnabled

#define Hud_Panel_GetPanelEnabled ( )
Value:
panel_enabled = ((panel.panel_configflags & PANEL_CONFIG_CANBEOFF) \
? cvar(strcat("hud_panel_", panel.panel_name)) : true)
#define true
Definition csprogsdefs.qh:5
const int PANEL_CONFIG_CANBEOFF
Definition hud.qh:238

Definition at line 424 of file hud.qh.

424#define Hud_Panel_GetPanelEnabled() \
425 panel_enabled = ((panel.panel_configflags & PANEL_CONFIG_CANBEOFF) \
426 ? cvar(strcat("hud_panel_", panel.panel_name)) : true)

Referenced by HUD_Panel_Draw().

◆ HUD_Panel_ScalePosSize

#define HUD_Panel_ScalePosSize ( )
Value:
MACRO_BEGIN \
panel_pos.x *= vid_conwidth; \
noref float vid_conwidth
Definition draw.qh:8
noref float vid_conheight
Definition draw.qh:9

Definition at line 414 of file hud.qh.

414#define HUD_Panel_ScalePosSize() MACRO_BEGIN \
415 panel_pos.x *= vid_conwidth; \
416 panel_pos.y *= vid_conheight; \
417 panel_size.x *= vid_conwidth; \
418 panel_size.y *= vid_conheight; \
419MACRO_END

Referenced by HUD_Panel_LoadCvars().

◆ HUD_Panel_UpdatePosSize

#define HUD_Panel_UpdatePosSize ( )
Value:
MACRO_BEGIN \
Hud_Panel_GetPanelEnabled(); \
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(); \
HUD_Panel_UpdatePosSize_ForMenu(); \
panel_bg_border_str = cvar_string(strcat("hud_panel_", panel.panel_name, "_bg_border")); \
HUD_Panel_GetBorder(); \
const string cvar_string(string name)

Definition at line 428 of file hud.qh.

428#define HUD_Panel_UpdatePosSize() MACRO_BEGIN \
429 Hud_Panel_GetPanelEnabled(); \
430 panel_pos = stov(cvar_string(strcat("hud_panel_", panel.panel_name, "_pos"))); \
431 panel_size = stov(cvar_string(strcat("hud_panel_", panel.panel_name, "_size"))); \
432 HUD_Panel_ScalePosSize(); \
433 if (hud_configure_menu_open == 2 && panel == highlightedPanel) \
434 HUD_Panel_UpdatePosSize_ForMenu(); \
435 panel_bg_border_str = cvar_string(strcat("hud_panel_", panel.panel_name, "_bg_border")); \
436 HUD_Panel_GetBorder(); \
437MACRO_END

Referenced by HUD_Configure_PostDraw(), HUD_Panel_Arrow_Action(), HUD_Panel_Check_Mouse_Pos(), HUD_Panel_CheckMove(), HUD_Panel_CheckResize(), HUD_Panel_Highlight(), HUD_Panel_InputEvent(), HUD_Panel_Mouse(), HUD_Panel_SetPos(), and HUD_Panel_SetPosSize().

◆ HUD_Panel_UpdatePosSize_ForMenu

#define HUD_Panel_UpdatePosSize_ForMenu ( )
Value:
MACRO_BEGIN \
vector new_size = panel_size; \
float max_panel_width = 0.52 * vid_conwidth; \
if (panel_size.x > max_panel_width) \
{ \
new_size.x = max_panel_width; \
new_size.y = panel_size.y * (new_size.x / panel_size.x); \
} \
vector new_pos = vec2(panel_bg_border + 0.5 * max_panel_width, 0.5 * vid_conheight) - 0.5 * new_size; \
vector
Definition self.qh:92
#define vec2(...)
Definition vector.qh:90

Definition at line 400 of file hud.qh.

400#define HUD_Panel_UpdatePosSize_ForMenu() MACRO_BEGIN \
401 vector new_size = panel_size; \
402 float max_panel_width = 0.52 * vid_conwidth; \
403 if (panel_size.x > max_panel_width) \
404 { \
405 new_size.x = max_panel_width; \
406 new_size.y = panel_size.y * (new_size.x / panel_size.x); \
407 } \
408 vector new_pos = vec2(panel_bg_border + 0.5 * max_panel_width, 0.5 * vid_conheight) - 0.5 * new_size; \
409 panel_pos = (1 - autocvar__menu_alpha) * panel_pos + (autocvar__menu_alpha) * new_pos; \
410 panel_size = (1 - autocvar__menu_alpha) * panel_size + (autocvar__menu_alpha) * new_size; \
411MACRO_END

Referenced by HUD_Panel_LoadCvars().

◆ HUD_ScaleX

#define HUD_ScaleX ( f)
Value:
(f * hud_scale.x)
vector hud_scale
Definition hud.qh:221

Definition at line 15 of file hud.qh.

Referenced by HUD_Scale(), StrafeHUD_DrawGradient(), and StrafeHUD_DrawStrafeArrow().

◆ HUD_ScaleY

#define HUD_ScaleY ( f)
Value:
(f * hud_scale.y)

Definition at line 16 of file hud.qh.

Referenced by HUD_Scale(), StrafeHUD_DrawGradient(), and StrafeHUD_DrawStrafeArrow().

◆ HUD_ShiftX

#define HUD_ShiftX ( f)
Value:
(f + hud_shift.x + hud_shift.z * (f - hud_scale_center.x))
vector hud_scale_center
Definition hud.qh:225
vector hud_shift
Definition hud.qh:223

Definition at line 17 of file hud.qh.

Referenced by HUD_Shift().

◆ HUD_ShiftY

#define HUD_ShiftY ( f)
Value:
(f + hud_shift.y + hud_shift.z * (f - hud_scale_center.y))

Definition at line 18 of file hud.qh.

Referenced by HUD_Shift().

◆ REGISTER_HUD_PANEL

#define REGISTER_HUD_PANEL ( id,
draw_func,
configflags,
showflags )
Value:
_REGISTER_HUD_PANEL(id, draw_func, draw_func##_Export, configflags, showflags)
#define _REGISTER_HUD_PANEL(id, draw_func, export_func, configflags, showflags)
Definition hud.qh:36

Definition at line 49 of file hud.qh.

49#define REGISTER_HUD_PANEL(id, draw_func, configflags, showflags) \
50 _REGISTER_HUD_PANEL(id, draw_func, draw_func##_Export, configflags, showflags)

Function Documentation

◆ classfield()

classfield ( HUDPanel )

◆ draw_cursor()

void draw_cursor ( vector pos,
vector ofs,
string img,
vector col,
float a )

Definition at line 31 of file hud.qc.

32{
33 ofs = vec2(ofs.x * SIZE_CURSOR.x, ofs.y * SIZE_CURSOR.y);
34 drawpic(pos - ofs, strcat(draw_currentSkin, img), SIZE_CURSOR, col, a, DRAWFLAG_NORMAL);
35}
#define drawpic(position, pic, size, rgb, alpha, flag)
Definition draw.qh:21
const float DRAWFLAG_NORMAL
vector SIZE_CURSOR
Definition hud.qh:7

References DRAWFLAG_NORMAL, drawpic, SIZE_CURSOR, strcat(), vec2, and vector.

Referenced by draw_cursor_normal(), and HUD_Cursor_Show().

◆ draw_cursor_normal()

void draw_cursor_normal ( vector pos,
vector col,
float a )

Definition at line 37 of file hud.qc.

38{
39 draw_cursor(pos, OFFSET_CURSOR, "/cursor", col, a);
40}
void draw_cursor(vector pos, vector ofs, string img, vector col, float a)
Definition hud.qc:31
vector OFFSET_CURSOR
Definition hud.qh:6

References draw_cursor(), OFFSET_CURSOR, and vector.

Referenced by HUD_Cursor_Show().

◆ DrawNumIcon()

void DrawNumIcon ( vector myPos,
vector mySize,
float theTime,
string icon,
bool vertical,
bool isInfinite,
bool icon_right_align,
vector color,
float theAlpha )

References color, and vector.

◆ DrawNumIcon_expanding()

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 at line 393 of file hud.qc.

394{
395 TC(bool, vertical); TC(int, icon_right_align);
396 vector newPos = '0 0 0', newSize = '0 0 0';
397 vector picpos, numpos;
398 string text = isInfinite ? "\xE2\x88\x9E" : ftos(theTime); // Use infinity symbol (U+221E)
399
400 if (vertical)
401 {
402 if (mySize.y / mySize.x > 2)
403 {
404 newSize.y = 2 * mySize.x;
405 newSize.x = mySize.x;
406
407 newPos.y = myPos.y + (mySize.y - newSize.y) * 0.5;
408 newPos.x = myPos.x;
409 }
410 else
411 {
412 newSize.x = 1/2 * mySize.y;
413 newSize.y = mySize.y;
414
415 newPos.x = myPos.x + (mySize.x - newSize.x) * 0.5;
416 newPos.y = myPos.y;
417 }
418
419 if (icon_right_align)
420 {
421 numpos = newPos;
422 picpos = newPos + eY * newSize.x;
423 }
424 else
425 {
426 picpos = newPos;
427 numpos = newPos + eY * newSize.x;
428 }
429
430 newSize.y *= 0.5;
431 drawpic_aspect_skin(picpos, icon, newSize, '1 1 1', panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL);
432 // make number smaller than icon, it looks better
433 // reduce only y to draw numbers with different number of digits with the same y size
434 numpos.y += newSize.y * ((1 - 0.7) / 2);
435 newSize.y *= 0.7;
436 drawstring_aspect(numpos, text, newSize, color, panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL);
437 return;
438 }
439
440 if (mySize.x / mySize.y > 3)
441 {
442 newSize.x = 3 * mySize.y;
443 newSize.y = mySize.y;
444
445 newPos.x = myPos.x + (mySize.x - newSize.x) * 0.5;
446 newPos.y = myPos.y;
447 }
448 else
449 {
450 newSize.y = 1/3 * mySize.x;
451 newSize.x = mySize.x;
452
453 newPos.y = myPos.y + (mySize.y - newSize.y) * 0.5;
454 newPos.x = myPos.x;
455 }
456
457 if (icon_right_align) // right align
458 {
459 numpos = newPos;
460 picpos = newPos + eX * 2 * newSize.y;
461 }
462 else // left align
463 {
464 numpos = newPos + eX * newSize.y;
465 picpos = newPos;
466 }
467
468 // NOTE: newSize_x is always equal to 3 * mySize_y so we can use
469 // '2 1 0' * newSize_y instead of eX * (2/3) * newSize_x + eY * newSize_y
470 drawstring_aspect_expanding(numpos, text, '2 1 0' * newSize.y, color, panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL, fadelerp);
471 drawpic_aspect_skin_expanding(picpos, icon, '1 1 0' * newSize.y, '1 1 1', panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL, fadelerp);
472}
void drawstring_aspect(vector pos, string text, vector sz, vector color, float theAlpha, float drawflag)
Definition draw.qc:110
void drawpic_aspect_skin_expanding(vector position, string pic, vector theScale, vector rgb, float theAlpha, float flag, float fadelerp)
Definition draw.qc:61
void drawstring_aspect_expanding(vector pos, string text, vector sz, vector color, float theAlpha, float drawflag, float fadelerp)
Definition draw.qc:139
#define drawpic_aspect_skin(pos, pic, sz, color, theAlpha, drawflag)
Definition draw.qh:78
vector color
Definition dynlight.qc:15
#define TC(T, sym)
Definition _all.inc:82
const vector eY
Definition vector.qh:45
const vector eX
Definition vector.qh:44

References color, DRAWFLAG_NORMAL, drawpic_aspect_skin, drawpic_aspect_skin_expanding(), drawstring_aspect(), drawstring_aspect_expanding(), eX, eY, ftos(), panel_fg_alpha, TC, and vector.

Referenced by DrawNumIcon(), and HUD_Powerups().

◆ entityclass()

entityclass ( HUDPanel )

◆ Hud_Dynamic_Frame()

void Hud_Dynamic_Frame ( )

Definition at line 589 of file hud.qc.

590{
591 vector ofs = '0 0 0';
592 hud_scale_current = '1 1 0';
593 hud_shift_current = '0 0 0';
594
596 {
603
604 if (fabs(ofs.x) < 0.001) ofs.x = 0;
605 if (fabs(ofs.y) < 0.001) ofs.y = 0;
606 if (fabs(ofs.z) < 0.001) ofs.z = 0;
607 ofs.x = bound(-0.1, ofs.x, 0.1);
608 ofs.y = bound(-0.1, ofs.y, 0.1);
609 ofs.z = bound(-0.1, ofs.z, 0.1);
610
613 hud_shift_current.z = ofs.x;
614
617 }
618
620 {
621 static float old_health = 0;
622 float health = max(-1, STAT(HEALTH));
623 if (hud_dynamic_shake_factor == -1) // don't allow the effect for this frame
624 {
626 old_health = health;
627 }
628 else
629 {
630 float new_hud_dynamic_shake_factor = 0;
633 && old_health > 0 && !intermission)
634 {
636 new_hud_dynamic_shake_factor = (old_health - health - m) / (autocvar_hud_dynamic_shake_damage_max - m);
637 if (new_hud_dynamic_shake_factor >= 1)
638 new_hud_dynamic_shake_factor = 1;
639 if (new_hud_dynamic_shake_factor >= hud_dynamic_shake_factor)
640 {
641 hud_dynamic_shake_factor = new_hud_dynamic_shake_factor;
643 }
644 }
645 old_health = health;
648 }
649
651 {
654 }
655 }
656
659
661}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
float time
float player_localentnum
float intermission
entity CSQCModel_server2csqc(int i)
Definition cl_model.qc:314
float autocvar_hud_dynamic_shake_damage_max
Definition hud.qc:563
float autocvar_hud_dynamic_shake
Definition hud.qc:562
bool Hud_Shake_Update()
Definition hud.qc:568
float autocvar_hud_dynamic_shake_damage_min
Definition hud.qc:564
void HUD_Scale_Disable()
Definition hud.qc:84
float hud_dynamic_shake_time
Definition hud.qh:215
float hud_dynamic_shake_factor
Definition hud.qh:214
vector hud_dynamic_shake_realofs
Definition hud.qh:213
vector autocvar_hud_dynamic_follow_scale_xyz
Definition hud.qh:211
float autocvar_hud_dynamic_follow
Definition hud.qh:209
vector hud_scale_current
Definition hud.qh:222
vector cl_followmodel_ofs
Definition hud.qh:218
float autocvar_hud_dynamic_follow_scale
Definition hud.qh:210
vector hud_shift_current
Definition hud.qh:224
#define STAT(...)
Definition stats.qh:82
float bound(float min, float value, float max)
float fabs(float f)
float health
Legacy fields for the resources. To be removed.
Definition resources.qh:9
void calc_followmodel_ofs(entity view)
Definition view.qc:113

References autocvar_hud_dynamic_follow, autocvar_hud_dynamic_follow_scale, autocvar_hud_dynamic_follow_scale_xyz, autocvar_hud_dynamic_shake, autocvar_hud_dynamic_shake_damage_max, autocvar_hud_dynamic_shake_damage_min, bound(), calc_followmodel_ofs(), cl_followmodel_ofs, CSQCModel_server2csqc(), entity(), fabs(), health, hud_dynamic_shake_factor, hud_dynamic_shake_realofs, hud_dynamic_shake_time, hud_scale_center, hud_scale_current, HUD_Scale_Disable(), Hud_Shake_Update(), hud_shift_current, intermission, max(), player_localentnum, STAT, time, vector, vid_conheight, and vid_conwidth.

Referenced by HUD_Draw().

◆ HUD_Get_Num_Color()

vector HUD_Get_Num_Color ( float hp,
float maxvalue,
bool blink )

Definition at line 123 of file hud.qc.

124{
125 const vector COLOR100 = '0 1 0'; // green
126 const vector COLOR75 = '0.4 0.9 0'; // lightgreen
127 const vector COLOR50 = '1 1 1'; // white
128 const vector COLOR25 = '1 1 0.2'; // lightyellow
129 const vector COLOR10 = '1 0 0'; // red
131
132 float hp_percent = hp / maxvalue * 100;
133 #define CASE_COLOR_BETWEEN(min, max) \
134 if (hp_percent > min) \
135 color = COLOR##min + (COLOR##max - COLOR##min) * ((hp_percent - min) / (max - min))
136
137 if (hp_percent > 100) color = COLOR100;
138 else CASE_COLOR_BETWEEN(75, 100);
139 else CASE_COLOR_BETWEEN(50, 75);
140 else CASE_COLOR_BETWEEN(25, 50);
141 else CASE_COLOR_BETWEEN(10, 25);
142 else color = COLOR10;
143
144 #undef CASE_COLOR_BETWEEN
145
146 if (blink)
147 {
148 if (hp_percent >= 100)
149 {
150 float f = sin(2*M_PI * time);
151 if (color.x == 0) color.x = f;
152 if (color.y == 0) color.y = f;
153 if (color.z == 0) color.z = f;
154 }
155 else if (hp_percent < 25)
156 {
157 float f = (1 - hp_percent / 25) * sin(2*M_PI * time);
158 color *= 1 - f;
159 }
160 }
161
162 return color;
163}
ERASEABLE float blink(float base, float range, float freq)
Definition util.qc:2178
#define CASE_COLOR_BETWEEN(min, max)
#define M_PI
Definition mathlib.qh:108
float sin(float f)

References blink(), CASE_COLOR_BETWEEN, color, M_PI, sin(), time, and vector.

Referenced by crosshair_getcolor(), HUD_EngineInfo(), and HUD_HealthArmor().

◆ HUD_GetFontsize()

vector HUD_GetFontsize ( string cvarname)

Definition at line 112 of file hud.qc.

113{
114 vector v = stov(cvar_string(cvarname));
115 if (v.x == 0)
116 v = '8 8 0';
117 if (v.y == 0)
118 v.y = v.x;
119 v.z = 0;
120 return v;
121}

References cvar_string(), stov(), and vector.

Referenced by Cmd_Scoreboard_SetFields(), MapVote_Draw(), and Scoreboard_Draw().

◆ HUD_GetRowCount()

float HUD_GetRowCount ( int item_count,
vector size,
float item_aspect )

Definition at line 165 of file hud.qc.

166{
167 TC(int, item_count);
168 float aspect = size_y / size_x;
169 return bound(1, floor((sqrt(4 * item_aspect * aspect * item_count + aspect * aspect) + aspect + 0.5) * 0.5), item_count);
170}
float sqrt(float f)

References bound(), floor(), size, sqrt(), TC, and vector.

Referenced by HUD_Ammo(), HUD_ItemsTime(), HUD_Mod_CA_Draw(), HUD_Mod_Dom(), HUD_Mod_LMS_Draw(), and HUD_Score().

◆ HUD_GetTableSize_BestItemAR()

vector HUD_GetTableSize_BestItemAR ( int item_count,
vector psize,
float item_aspect )

Definition at line 172 of file hud.qc.

173{
174 TC(int, item_count);
175 bool vertical = psize.x / psize.y >= item_aspect;
176 if (vertical)
177 {
178 psize = eX * psize.y + eY * psize.x;
179 item_aspect = 1 / item_aspect;
180 }
181
182 float rows = ceil(sqrt(item_count));
183 float columns = ceil(item_count / rows);
184 float ratio, best_ratio = 0;
185 float best_columns = 1, best_rows = 1;
186 while (columns >= 1)
187 {
188 ratio = (psize.x / columns) / (psize.y / rows);
189 if (ratio > item_aspect)
190 ratio = item_aspect * item_aspect / ratio;
191
192 if (ratio <= best_ratio)
193 break; // ratio starts decreasing by now, skip next configurations
194
195 best_columns = columns;
196 best_rows = rows;
197 best_ratio = ratio;
198
199 if (columns == 1)
200 break;
201
202 --columns;
203 rows = ceil(item_count/columns);
204 }
205
206 return vertical ? vec2(best_rows, best_columns) : vec2(best_columns, best_rows);
207}
float ceil(float f)

References ceil(), eX, eY, sqrt(), TC, vec2, and vector.

Referenced by MapVote_Draw().

◆ HUD_ItemsTime()

void HUD_ItemsTime ( )

Definition at line 287 of file itemstime.qc.

288{
290 {
291 if (!(
293 || (autocvar_hud_panel_itemstime == 2 && (spectatee_status != 0 || warmup_stage || STAT(ITEMSTIME) == 2))
294 )) { return; }
295 }
296
297 int count = 0;
299 {
300 FOREACH(Items, Item_ItemsTime_Allow(it), {
301 count += (Item_ItemsTime_GetTime(it.m_id) > time || -Item_ItemsTime_GetTime(it.m_id) > time);
302 });
304 }
306 {
307 FOREACH(Items, Item_ItemsTime_Allow(it), {
308 count += (Item_ItemsTime_GetTime(it.m_id) > time);
309 });
311 }
312 else
313 {
314 FOREACH(Items, Item_ItemsTime_Allow(it), {
315 count += (Item_ItemsTime_GetTime(it.m_id) != -1);
316 });
317 count += (Item_ItemsTime_GetTime(REGISTRY_MAX(Items)) != -1);
318 }
319 if (count == 0)
320 return;
321
323
324 vector pos, mySize;
325 pos = panel_pos;
326 mySize = panel_size;
327
329 {
330 pos += '1 1 0' * panel_bg_padding;
331 mySize -= '2 2 0' * panel_bg_padding;
332 }
333
334 float rows, columns;
335 float ar = max(2, autocvar_hud_panel_itemstime_ratio) + 1;
336 rows = HUD_GetRowCount(count, mySize, ar);
337 columns = ceil(count/rows);
338
339 vector itemstime_size = vec2(mySize.x / columns, mySize.y / rows);
340
341 vector offset = '0 0 0';
342 float newSize;
344 {
347 HUD_Panel_DrawBg(); // also draw the bg of the entire panel
348
349 // reduce panel to avoid spacing items
350 if (itemstime_size.x / itemstime_size.y < ar)
351 {
352 newSize = rows * itemstime_size.x / ar;
353 pos.y += (mySize.y - newSize) / 2;
354 mySize.y = newSize;
355 itemstime_size.y = mySize.y / rows;
356 }
357 else
358 {
359 newSize = columns * itemstime_size.y * ar;
360 pos.x += (mySize.x - newSize) / 2;
361 mySize.x = newSize;
362 itemstime_size.x = mySize.x / columns;
363 }
364 panel_pos = pos - '1 1 0' * panel_bg_padding;
365 panel_size = mySize + '2 2 0' * panel_bg_padding;
366 }
367 else
368 {
369 if (itemstime_size.x/itemstime_size.y > ar)
370 {
371 newSize = ar * itemstime_size.y;
372 offset.x = itemstime_size.x - newSize;
373 pos.x += offset.x/2;
374 itemstime_size.x = newSize;
375 }
376 else
377 {
378 newSize = 1/ar * itemstime_size.x;
379 offset.y = itemstime_size.y - newSize;
380 pos.y += offset.y/2;
381 itemstime_size.y = newSize;
382 }
383 }
384
387
388 float row = 0, column = 0;
389 bool item_available;
390 int id = 0;
391 string icon = "";
392 FOREACH(Items, Item_ItemsTime_Allow(it) && Item_ItemsTime_GetTime(it.m_id) != -1, {
393 id = it.m_id;
394 icon = it.m_icon;
395
396LABEL(iteration)
397 float item_time = Item_ItemsTime_GetTime(id);
398 if (item_time < -1)
399 {
400 item_available = true;
401 item_time = -item_time;
402 }
403 else
404 item_available = (item_time <= time);
405
406 if (Item_ItemsTime_GetTime(id) >= 0)
407 {
408 if (time <= Item_ItemsTime_GetTime(id))
410 else if (ItemsTime_availableTime[id] == 0)
412 }
413 else if (ItemsTime_availableTime[id] == 0)
415
416 float f = (time - ItemsTime_availableTime[id]) * 2;
417 f = (f > 1) ? 0 : bound(0, f, 1);
418
421 continue;
422
424 if (!(Item_ItemsTime_GetTime(id) > time))
425 continue;
426
427 DrawItemsTimeItem(pos + vec2(column * (itemstime_size.x + offset.x), row * (itemstime_size.y + offset.y)), itemstime_size, ar, icon, item_time, item_available, f);
428 ++row;
429 if (row >= rows)
430 {
431 row = 0;
432 column = column + 1;
433 }
434 if(id == REGISTRY_MAX(Items)) // can happen only in the last fake iteration
435 break;
436 });
437 // add another fake iteration for superweapons time
438 if(id < REGISTRY_MAX(Items) && Item_ItemsTime_GetTime(REGISTRY_MAX(Items)) != -1)
439 {
440 id = REGISTRY_MAX(Items);
441 icon = "superweapons";
442 goto iteration;
443 }
444}
float count
Definition powerups.qc:22
int spectatee_status
the -1 disables HUD panels before CSQC receives necessary data
Definition main.qh:197
bool warmup_stage
Definition main.qh:120
void HUD_Panel_LoadCvars()
Definition hud.qc:215
float HUD_GetRowCount(int item_count, vector size, float item_aspect)
Definition hud.qc:165
void HUD_Scale_Enable()
Definition hud.qc:91
#define HUD_Panel_DrawBg()
Definition hud.qh:55
void DrawItemsTimeItem(vector myPos, vector mySize, float ar, string item_icon, float item_time, bool item_available, float item_availableTime)
Definition itemstime.qc:207
int autocvar_hud_panel_itemstime
Definition itemstime.qc:41
float Item_ItemsTime_GetTime(int item)
Definition itemstime.qc:269
bool Item_ItemsTime_Allow(GameItem it)
Definition itemstime.qc:66
float autocvar_hud_panel_itemstime_dynamicsize
Definition itemstime.qc:42
float autocvar_hud_panel_itemstime_ratio
Definition itemstime.qc:43
float ItemsTime_availableTime[REGISTRY_MAX(Items)+1]
Definition itemstime.qc:22
bool autocvar_hud_panel_itemstime_hidespawned
Definition itemstime.qc:50
#define FOREACH(list, cond, body)
Definition iter.qh:19
#define REGISTRY_MAX(id)
Definition registry.qh:17
if(frag_attacker.flagcarried)
Definition sv_ctf.qc:2325

References autocvar__hud_configure, autocvar_hud_panel_itemstime, autocvar_hud_panel_itemstime_dynamicsize, autocvar_hud_panel_itemstime_hidespawned, autocvar_hud_panel_itemstime_ratio, bound(), ceil(), count, DrawItemsTimeItem(), FOREACH, hud_configure_menu_open, HUD_GetRowCount(), HUD_Panel_DrawBg, HUD_Panel_LoadCvars(), HUD_Scale_Enable(), if(), Item_ItemsTime_Allow(), Item_ItemsTime_GetTime(), ItemsTime_availableTime, max(), panel_bg_padding, panel_pos, panel_size, REGISTRY_MAX, spectatee_status, STAT, time, vec2, vector, and warmup_stage.

◆ HUD_Main()

void HUD_Main ( )

Definition at line 682 of file hud.qc.

683{
685 hud_fade_alpha = 1;
686 else
688
689 if (myteam != prev_myteam)
690 {
692 FOREACH(hud_panels, true, it.update_time = time);
694 }
695
697
699 return;
700
701 // Drawing stuff
703 {
706 }
707
708 // draw the dock
709 if (autocvar_hud_dock != "" && autocvar_hud_dock != "0")
710 {
712 float hud_dock_color_team = autocvar_hud_dock_color_team;
713 if (teamplay && hud_dock_color_team)
714 {
716 color = '1 0 0' * hud_dock_color_team;
717 else
718 color = myteamcolors * hud_dock_color_team;
719 }
720 else if (autocvar_hud_configure_teamcolorforced && autocvar__hud_configure && hud_dock_color_team)
721 color = '1 0 0' * hud_dock_color_team;
722 else
723 {
724 string hud_dock_color = autocvar_hud_dock_color;
725 int f;
726 if (hud_dock_color == "shirt")
727 {
729 color = colormapPaletteColor(floor(f / 16), 0);
730 }
731 else if (hud_dock_color == "pants")
732 {
734 color = colormapPaletteColor(f % 16, 1);
735 }
736 else
737 color = stov(hud_dock_color);
738 }
739
740 string pic = strcat(hud_skin_path, "/", autocvar_hud_dock);
741 if (precache_pic(pic) == "")
742 {
743 pic = strcat(hud_skin_path, "/dock_medium");
744 if (precache_pic(pic) == "")
745 pic = "gfx/hud/default/dock_medium";
746 }
747 drawpic('0 0 0', pic, eX * vid_conwidth + eY * vid_conheight, color, autocvar_hud_dock_alpha * hud_fade_alpha, DRAWFLAG_NORMAL); // no aspect ratio forcing on dock...
748 }
749
750 // cache the panel order into the panel_order array
751 int i;
753 {
754 for (i = 0; i < REGISTRY_COUNT(hud_panels); ++i)
755 panel_order[i] = -1;
756 string s = "";
757 int p_num;
759 bool warning = (argc > REGISTRY_COUNT(hud_panels));
760 // first detect wrong/missing panel numbers
761 for (i = 0; i < REGISTRY_COUNT(hud_panels); ++i)
762 {
763 p_num = stoi(argv(i));
764 if (p_num >= 0 && p_num < REGISTRY_COUNT(hud_panels)) // correct panel number?
765 {
766 if (panel_order[p_num] == -1) // found for the first time?
767 s = strcat(s, ftos(p_num), " ");
768 panel_order[p_num] = 1; // mark as found
769 }
770 else
771 warning = true;
772 }
773 for (i = 0; i < REGISTRY_COUNT(hud_panels); ++i)
774 if (panel_order[i] == -1)
775 {
776 warning = true;
777 s = strcat(s, ftos(i), " "); // add missing panel number
778 }
779 if (warning)
780 LOG_TRACE("Automatically fixed wrong/missing panel numbers in _hud_panelorder");
781
782 cvar_set("_hud_panelorder", s);
784
785 // now properly set panel_order
787 for (i = 0; i < REGISTRY_COUNT(hud_panels); ++i)
788 panel_order[i] = stof(argv(i));
789 }
790
792 // draw panels in the order specified by panel_order array
793 for (i = REGISTRY_COUNT(hud_panels) - 1; i >= 0; --i)
794 HUD_Panel_Draw(REGISTRY_GET(hud_panels, panel_order[i]));
795
796 HUD_Vehicle();
797
798 hud_draw_maximized = 1; // panels that may be maximized must check this var
799 // draw maximized panels on top
804 if (QuickMenu_IsOpened())
805 HUD_Panel_Draw(HUD_PANEL(QUICKMENU));
806 HUD_Panel_Draw(HUD_PANEL(SCOREBOARD));
807
808 int cursor_active_prev = cursor_active;
810 if (cursor_active_prev != cursor_active && autocvar_hud_cursormode)
811 {
812 setcursormode(cursor_active);
813 // cursor inactive this frame, will be set to 1 the next frame
814 if (cursor_active)
815 cursor_active = -1;
816 }
817
818 if (intermission == 2)
819 HUD_Reset();
820
822
824}
bool autocvar__con_chat_maximized
Definition chat.qh:6
#define tokenize_console
void HUD_Reset()
Definition hud.qc:555
void HUD_Panel_Draw(entity panent)
Definition hud.qc:507
bool HUD_WouldShowCursor()
Definition hud.qc:663
void HUD_Vehicle()
Definition hud.qc:488
float prev_myteam
Definition hud.qc:681
string autocvar_hud_dock
Definition hud.qh:192
float autocvar_hud_dock_alpha
Definition hud.qh:193
string hud_skin_prev
Definition hud.qh:137
string autocvar__hud_panelorder
Definition hud.qh:189
bool hud_draw_maximized
Definition hud.qh:69
string autocvar_hud_skin
Definition hud.qh:203
bool hud_panel_radar_maximized
Definition hud.qh:70
int panel_order[REGISTRY_MAX(hud_panels)]
Definition hud.qh:66
bool autocvar_hud_dock_color_team
Definition hud.qh:195
string hud_panelorder_prev
Definition hud.qh:67
bool QuickMenu_IsOpened()
Definition quickmenu.qc:291
float hud_fade_alpha
Definition hud.qh:134
string autocvar_hud_dock_color
Definition hud.qh:194
bool autocvar_hud_cursormode
Definition hud.qh:191
void HUD_Configure_PostDraw()
void HUD_Configure_Frame()
float hud_configure_prev
Definition hud_config.qh:18
#define stoi(s)
Definition int.qh:4
#define LOG_TRACE(...)
Definition log.qh:76
void cvar_set(string name, string value)
string argv(float n)
#define REGISTRY_COUNT(id)
Definition registry.qh:18
#define REGISTRY_GET(id, i)
Definition registry.qh:43
float scoreboard_fade_alpha
Definition scoreboard.qh:17
#define strcpy(this, s)
Definition string.qh:52
int cursor_active
Definition view.qh:112

References argv(), autocvar__con_chat_maximized, autocvar__hud_configure, autocvar__hud_panelorder, autocvar__menu_alpha, autocvar_hud_configure_teamcolorforced, autocvar_hud_cursormode, autocvar_hud_dock, autocvar_hud_dock_alpha, autocvar_hud_dock_color, autocvar_hud_dock_color_team, autocvar_hud_skin, color, colormapPaletteColor, current_player, cursor_active, cvar_set(), DRAWFLAG_NORMAL, drawpic, entcs_GetClientColors(), eX, eY, floor(), FOREACH, ftos(), HUD_Configure_Frame(), hud_configure_menu_open, HUD_Configure_PostDraw(), hud_configure_prev, hud_draw_maximized, hud_fade_alpha, HUD_PANEL, HUD_Panel_Draw(), hud_panel_radar_maximized, hud_panelorder_prev, HUD_Reset(), hud_skin_path, hud_skin_prev, HUD_Vehicle(), HUD_WouldShowCursor(), intermission, LOG_TRACE, myteam, myteamcolors, NUM_SPECTATOR, panel_order, precache_pic(), prev_myteam, QuickMenu_IsOpened(), REGISTRY_COUNT, REGISTRY_GET, scoreboard_fade_alpha, stof(), stoi, stov(), strcat(), strcpy, teamplay, time, tokenize_console, vector, vid_conheight, and vid_conwidth.

Referenced by HUD_Draw().

◆ HUD_ModIcons_GameType()

var void HUD_ModIcons_GameType ( vector pos,
vector size )

References size, and vector.

Referenced by HUD_ModIcons(), and HUD_ModIcons_SetFunc().

◆ HUD_ModIcons_SetFunc()

void HUD_ModIcons_SetFunc ( )

Definition at line 19 of file modicons.qc.

20{
22}
entity gametype
Definition main.qh:43
var void HUD_ModIcons_GameType(vector pos, vector size)

References gametype, and HUD_ModIcons_GameType().

Referenced by NET_HANDLE().

◆ HUD_Notify_Push()

void HUD_Notify_Push ( string icon,
string attacker,
string victim )

Definition at line 19 of file notify.qc.

20{
21 if (icon == "")
22 return;
23
26
27 if (notify_index == -1)
29
30 // Free old strings
37
38 // Allocate new strings
39 if (victim != "")
40 {
43 }
44 else
45 {
46 // In case of a notification without a victim, the attacker
47 // is displayed on the victim's side. Instead of special
48 // treatment later on, we can simply switch them here.
51 }
52
55}
float notify_times[NOTIFY_MAX_ENTRIES]
Definition hud.qh:444
string notify_icons[NOTIFY_MAX_ENTRIES]
Definition hud.qh:447
const int NOTIFY_MAX_ENTRIES
Definition hud.qh:439
int notify_count
Definition hud.qh:443
int notify_index
Definition hud.qh:442
string notify_attackers[NOTIFY_MAX_ENTRIES]
Definition hud.qh:445
string notify_victims[NOTIFY_MAX_ENTRIES]
Definition hud.qh:446
void strunzone(string s)
string string_null
Definition nil.qh:9

References notify_attackers, notify_count, notify_icons, notify_index, NOTIFY_MAX_ENTRIES, notify_times, notify_victims, string_null, strunzone(), strzone(), and time.

Referenced by Local_Notification_HUD_Notify_Push(), and minigame_prompt().

◆ HUD_Panel_DrawHighlight()

void HUD_Panel_DrawHighlight ( vector pos,
vector mySize,
vector color,
float theAlpha,
int drawflag )

Definition at line 374 of file hud.qc.

375{
376 TC(int, drawflag);
377 if (!theAlpha)
378 return;
379
380 pos = HUD_Shift(pos);
381 mySize = HUD_Scale(mySize);
382
383 string pic = strcat(hud_skin_path, "/num_leading");
384 if (precache_pic(pic) == "")
385 pic = "gfx/hud/default/num_leading";
386
387 drawsubpic(pos, eX * min(mySize.x * 0.5, mySize.y) + eY * mySize.y, pic, '0 0 0', '0.25 1 0', color, theAlpha, drawflag);
388 if (mySize.x / mySize.y > 2)
389 drawsubpic(pos + eX * mySize.y, eX * (mySize.x - 2 * mySize.y) + eY * mySize.y, pic, '0.25 0 0', '0.5 1 0', color, theAlpha, drawflag);
390 drawsubpic(pos + eX * mySize.x - eX * min(mySize.x * 0.5, mySize.y), eX * min(mySize.x * 0.5, mySize.y) + eY * mySize.y, pic, '0.75 0 0', '0.25 1 0', color, theAlpha, drawflag);
391}
float drawsubpic(vector position, vector size, string pic, vector srcPosition, vector srcSize, vector rgb, float alpha, float flag)

References color, drawsubpic(), eX, eY, HUD_Scale(), HUD_Shift(), hud_skin_path, min(), precache_pic(), strcat(), TC, and vector.

Referenced by HUD_Score(), and HUD_Score_Rankings().

◆ HUD_Panel_DrawProgressBar()

void HUD_Panel_DrawProgressBar ( vector theOrigin,
vector theSize,
string pic,
float length_ratio,
bool vertical,
float baralign,
vector theColor,
float theAlpha,
int drawflag )

Definition at line 269 of file hud.qc.

270{
271 TC(bool, vertical); TC(int, drawflag);
272 if (!length_ratio || !theAlpha)
273 return;
274 if (length_ratio > 1)
275 length_ratio = 1;
276 if (baralign == 3)
277 {
278 if (length_ratio < -1)
279 length_ratio = -1;
280 }
281 else if (length_ratio < 0)
282 return;
283
284 theOrigin = HUD_Shift(theOrigin);
285 theSize = HUD_Scale(theSize);
286
287 vector square, width, height;
288 if (vertical)
289 {
290 pic = strcat(hud_skin_path, "/", pic, "_vertical");
291 if (precache_pic(pic) == "")
292 pic = "gfx/hud/default/progressbar_vertical";
293
294 if (baralign == 1) // bottom align
295 theOrigin.y += (1 - length_ratio) * theSize.y;
296 else if (baralign == 2) // center align
297 theOrigin.y += 0.5 * (1 - length_ratio) * theSize.y;
298 else if (baralign == 3) // center align, positive values down, negative up
299 {
300 theSize.y *= 0.5;
301 if (length_ratio > 0)
302 theOrigin.y += theSize.y;
303 else
304 {
305 theOrigin.y += (1 + length_ratio) * theSize.y;
306 length_ratio = -length_ratio;
307 }
308 }
309 theSize.y *= length_ratio;
310
311 width = eX * theSize.x;
312 height = eY * theSize.y;
313 if (theSize.y <= theSize.x * 2)
314 {
315 // button not high enough
316 // draw just upper and lower part then
317 square = eY * theSize.y * 0.5;
318 vector bH = eY * (0.25 * theSize.y / (theSize.x * 2));
319 drawsubpic(theOrigin, square + width, pic, '0 0 0', eX + bH, theColor, theAlpha, drawflag);
320 drawsubpic(theOrigin + square, square + width, pic, eY - bH, eX + bH, theColor, theAlpha, drawflag);
321 }
322 else
323 {
324 square = eY * theSize.x;
325 drawsubpic(theOrigin, width + square, pic, '0 0 0', '1 0.25 0', theColor, theAlpha, drawflag);
326 drawsubpic(theOrigin + square, theSize - 2 * square, pic, '0 0.25 0', '1 0.5 0', theColor, theAlpha, drawflag);
327 drawsubpic(theOrigin + height - square, width + square, pic, '0 0.75 0', '1 0.25 0', theColor, theAlpha, drawflag);
328 }
329 }
330 else
331 {
332 pic = strcat(hud_skin_path, "/", pic);
333 if (precache_pic(pic) == "")
334 pic = "gfx/hud/default/progressbar";
335
336 if (baralign == 1) // right align
337 theOrigin.x += (1 - length_ratio) * theSize.x;
338 else if (baralign == 2) // center align
339 theOrigin.x += 0.5 * (1 - length_ratio) * theSize.x;
340 else if (baralign == 3) // center align, positive values on the right, negative on the left
341 {
342 theSize.x *= 0.5;
343 if (length_ratio > 0)
344 theOrigin.x += theSize.x;
345 else
346 {
347 theOrigin.x += (1 + length_ratio) * theSize.x;
348 length_ratio = -length_ratio;
349 }
350 }
351 theSize.x *= length_ratio;
352
353 width = eX * theSize.x;
354 height = eY * theSize.y;
355 if (theSize.x <= theSize.y * 2)
356 {
357 // button not wide enough
358 // draw just left and right part then
359 square = eX * theSize.x * 0.5;
360 vector bW = eX * (0.25 * theSize.x / (theSize.y * 2));
361 drawsubpic(theOrigin, square + height, pic, '0 0 0', eY + bW, theColor, theAlpha, drawflag);
362 drawsubpic(theOrigin + square, square + height, pic, eX - bW, eY + bW, theColor, theAlpha, drawflag);
363 }
364 else
365 {
366 square = eX * theSize.y;
367 drawsubpic(theOrigin, height + square, pic, '0 0 0', '0.25 1 0', theColor, theAlpha, drawflag);
368 drawsubpic(theOrigin + square, theSize - 2 * square, pic, '0.25 0 0', '0.5 1 0', theColor, theAlpha, drawflag);
369 drawsubpic(theOrigin + width - square, height + square, pic, '0.75 0 0', '0.25 1 0', theColor, theAlpha, drawflag);
370 }
371 }
372}
float height
Definition bobbing.qc:3

References drawsubpic(), eX, eY, height, HUD_Scale(), HUD_Shift(), hud_skin_path, precache_pic(), strcat(), TC, and vector.

Referenced by Draw_ShowNames(), DrawAmmoItem(), DrawItemsTimeItem(), DrawNadeProgressBar(), HUD_HealthArmor(), HUD_Mod_NexBall(), HUD_Physics(), HUD_Powerups(), StrafeHUD_DrawStrafeHUD(), and StrafeHUD_DrawStrafeMeter().

◆ HUD_Panel_LoadCvars()

void HUD_Panel_LoadCvars ( )

Definition at line 215 of file hud.qc.

216{
217 // NOTE: in hud_configure mode cvars must be reloaded every frame
218 if (panel.update_time <= time)
219 {
220 panel_pos = stov(cvar_string(strcat("hud_panel_", panel.panel_name, "_pos")));
221 panel_size = stov(cvar_string(strcat("hud_panel_", panel.panel_name, "_size")));
223 panel_bg_str = cvar_string(strcat("hud_panel_", panel.panel_name, "_bg"));
224 panel_bg_color_str = cvar_string(strcat("hud_panel_", panel.panel_name, "_bg_color"));
225 panel_bg_color_team_str = cvar_string(strcat("hud_panel_", panel.panel_name, "_bg_color_team"));
226 panel_bg_alpha_str = cvar_string(strcat("hud_panel_", panel.panel_name, "_bg_alpha"));
227 panel_bg_border_str = cvar_string(strcat("hud_panel_", panel.panel_name, "_bg_border"));
228 panel_bg_padding_str = cvar_string(strcat("hud_panel_", panel.panel_name, "_bg_padding"));
230 if (panel.current_panel_bg != "0")
231 {
234 }
239 panel.current_panel_bg_alpha = panel_bg_alpha;
240 panel.current_panel_fg_alpha = panel_fg_alpha;
243 else
244 {
247 }
248 panel.current_panel_pos = panel_pos;
249 panel.current_panel_size = panel_size;
250 panel.current_panel_bg_border = panel_bg_border;
251 panel.current_panel_bg_color = panel_bg_color;
252 panel.current_panel_bg_color_team = panel_bg_color_team;
253 panel.current_panel_bg_padding = panel_bg_padding;
255 return;
256 }
257
258 panel_pos = panel.current_panel_pos;
259 panel_size = panel.current_panel_size;
260 panel_bg_alpha = panel.current_panel_bg_alpha * hud_fade_alpha * panel_fade_alpha;
261 panel_bg_border = panel.current_panel_bg_border;
262 panel_bg_color = panel.current_panel_bg_color;
263 panel_bg_color_team = panel.current_panel_bg_color_team;
264 panel_bg_padding = panel.current_panel_bg_padding;
265 panel_fg_alpha = panel.current_panel_fg_alpha * hud_fade_alpha * panel_fade_alpha;
266}
float panel_fade_alpha
Definition hud.qh:421
#define HUD_Panel_GetBg()
Definition hud.qh:294
#define HUD_Panel_GetPadding()
Definition hud.qh:390
#define HUD_Panel_GetColor()
Definition hud.qh:321
float autocvar_hud_panel_update_interval
Definition hud.qh:205
#define HUD_Panel_GetColorTeam()
Definition hud.qh:348
#define HUD_Panel_GetFgAlpha()
Definition hud.qh:374
#define HUD_Panel_UpdatePosSize_ForMenu()
Definition hud.qh:400
#define HUD_Panel_ScalePosSize()
Definition hud.qh:414
#define HUD_Panel_GetBorder()
Definition hud.qh:381
#define HUD_Panel_GetBgAlpha()
Definition hud.qh:357

References autocvar__hud_configure, autocvar_hud_panel_update_interval, cvar_string(), highlightedPanel, hud_configure_menu_open, hud_fade_alpha, HUD_Panel_GetBg, HUD_Panel_GetBgAlpha, HUD_Panel_GetBorder, HUD_Panel_GetColor, HUD_Panel_GetColorTeam, HUD_Panel_GetFgAlpha, HUD_Panel_GetPadding, HUD_Panel_ScalePosSize, HUD_Panel_UpdatePosSize_ForMenu, panel, panel_bg_alpha, panel_bg_alpha_str, panel_bg_border, panel_bg_border_str, panel_bg_color, panel_bg_color_str, panel_bg_color_team, panel_bg_color_team_str, panel_bg_padding, panel_bg_padding_str, panel_bg_str, panel_fade_alpha, panel_fg_alpha, panel_pos, panel_size, stov(), strcat(), and time.

Referenced by HUD_Ammo(), HUD_CenterPrint(), HUD_Chat(), HUD_Checkpoints(), HUD_EngineInfo(), HUD_HealthArmor(), HUD_InfoMessages(), HUD_ItemsTime(), HUD_MinigameBoard(), HUD_MinigameHelp(), HUD_MinigameMenu(), HUD_MinigameMenu_MouseInput(), HUD_MinigameStatus(), HUD_ModIcons(), HUD_Notify(), HUD_Physics(), HUD_Pickup(), HUD_Powerups(), HUD_PressedKeys(), HUD_QuickMenu(), HUD_RaceTimer(), HUD_Radar(), HUD_Radar_Mouse(), HUD_Score(), HUD_StrafeHUD(), HUD_Timer(), HUD_Vote(), HUD_Weapons(), MapVote_Draw(), QuickMenu_Mouse(), and Scoreboard_Draw().

◆ HUD_Radar_Clickable()

bool HUD_Radar_Clickable ( )

Definition at line 26 of file radar.qc.

27{
29}
bool hud_panel_radar_mouse
Definition hud.qh:71
bool hud_panel_radar_temp_hidden
Definition hud.qh:73

References hud_panel_radar_mouse, and hud_panel_radar_temp_hidden.

Referenced by HUD_CenterPrint(), HUD_Mouse(), HUD_WouldShowCursor(), Scoreboard_WouldDraw(), and View_Lock().

◆ HUD_Radar_Hide_Maximized()

void HUD_Radar_Hide_Maximized ( )

Definition at line 51 of file radar.qc.

52{
53 HUD_Radar_Show_Maximized(false, false);
54}
void HUD_Radar_Show_Maximized(bool doshow, bool clickable)
Definition radar.qc:31

References HUD_Radar_Show_Maximized().

Referenced by HUD_Radar_InputEvent(), HUD_Radar_Mouse(), and NET_HANDLE().

◆ HUD_Radar_InputEvent()

float HUD_Radar_InputEvent ( float bInputType,
float nPrimary,
float nSecondary )

References blink(), size, and vector.

Referenced by CSQC_InputEvent().

◆ HUD_Radar_Mouse()

void HUD_Radar_Mouse ( )

Definition at line 123 of file radar.qc.

124{
126 return;
127
129 {
131 return;
132 }
133
134 panel = HUD_PANEL(RADAR);
136
138 panel_size.x = bound(0.2, panel_size.x, 1) * vid_conwidth;
139 panel_size.y = bound(0.2, panel_size.y, 1) * vid_conheight;
140 panel_pos.x = (vid_conwidth - panel_size.x) * 0.5;
141 panel_pos.y = (vid_conheight - panel_size.y) * 0.5;
142
144 {
145 // click outside
146 if (mousepos.x < panel_pos.x || mousepos.x > panel_pos.x + panel_size.x
147 || mousepos.y < panel_pos.y || mousepos.y > panel_pos.y + panel_size.y)
148 {
150 return;
151 }
153 localcmd(sprintf("cmd ons_spawn %f %f %f", pos.x, pos.y, pos.z));
154
156 return;
157 }
158}
vector view_origin
Definition main.qh:109
bool mv_active
Definition mapvoting.qh:19
vector mousepos
Definition hud.qh:103
const int S_MOUSE1
Definition hud_config.qh:10
int mouseClicked
Definition hud_config.qh:13
const int S_MOUSE2
Definition hud_config.qh:11
void localcmd(string command,...)
void HUD_Radar_Hide_Maximized()
Definition radar.qc:51
vector autocvar_hud_panel_radar_maximized_size
Definition radar.qh:8
int scoreboard_ui_enabled
Definition scoreboard.qh:40
vector teamradar_texcoord_to_3dcoord(vector in, float oz)
Definition teamradar.qc:51
vector teamradar_2dcoord_to_texcoord(vector in)
Definition teamradar.qc:33

References autocvar_hud_panel_radar_maximized_size, bound(), HUD_PANEL, HUD_Panel_LoadCvars(), hud_panel_radar_mouse, HUD_Radar_Hide_Maximized(), intermission, localcmd(), mouseClicked, mousepos, mv_active, panel, panel_pos, panel_size, S_MOUSE1, S_MOUSE2, scoreboard_ui_enabled, teamradar_2dcoord_to_texcoord(), teamradar_texcoord_to_3dcoord(), vector, vid_conheight, vid_conwidth, and view_origin.

Referenced by HUD_Mouse().

◆ HUD_Reset()

void HUD_Reset ( )

Definition at line 555 of file hud.qc.

556{
557 // reset gametype specific icons
558 if (gametype.m_modicons_reset)
559 gametype.m_modicons_reset();
560}

References gametype.

Referenced by HUD_Main().

◆ HUD_Scale()

vector HUD_Scale ( vector v)

Definition at line 98 of file hud.qc.

99{
100 v.x = HUD_ScaleX(v.x);
101 v.y = HUD_ScaleY(v.y);
102 return v;
103}
#define HUD_ScaleX(f)
Definition hud.qh:15
#define HUD_ScaleY(f)
Definition hud.qh:16

References HUD_ScaleX, HUD_ScaleY, and vector.

Referenced by DrawCircleClippedPic(), drawpic_tiled(), drawstring_expanding(), HUD_Panel_DrawHighlight(), HUD_Panel_DrawProgressBar(), and HUD_Radar().

◆ HUD_Scale_Disable()

◆ HUD_Scale_Enable()

◆ HUD_Shift()

vector HUD_Shift ( vector v)

Definition at line 105 of file hud.qc.

106{
107 v.x = HUD_ShiftX(v.x);
108 v.y = HUD_ShiftY(v.y);
109 return v;
110}
#define HUD_ShiftY(f)
Definition hud.qh:18
#define HUD_ShiftX(f)
Definition hud.qh:17

References HUD_ShiftX, HUD_ShiftY, and vector.

Referenced by DrawCircleClippedPic(), drawpic_tiled(), HUD_Panel_DrawHighlight(), HUD_Panel_DrawProgressBar(), HUD_Radar(), StrafeHUD_DrawGradient(), and StrafeHUD_DrawStrafeArrow().

◆ HUD_WouldShowCursor()

bool HUD_WouldShowCursor ( )

Definition at line 663 of file hud.qc.

664{
666 return true;
667 if (mv_active && !isdemo())
668 return true;
669 //entity local_player = (csqcplayer ? csqcplayer : CSQCModel_server2csqc(player_localentnum - 1)); // TODO: doesn't use regular cursor handling
670 //if (local_player.viewloc && (local_player.viewloc.spawnflags & VIEWLOC_FREEAIM))
671 //return true;
673 return true;
675 return true;
676 if (QuickMenu_IsOpened())
677 return true;
678 return false;
679}
bool HUD_MinigameMenu_IsOpened()
bool HUD_Radar_Clickable()
Definition radar.qc:26
float isdemo()

References autocvar__hud_configure, HUD_MinigameMenu_IsOpened(), HUD_Radar_Clickable(), isdemo(), mv_active, and QuickMenu_IsOpened().

Referenced by HUD_Main().

◆ LoadMenuSkinValues()

void LoadMenuSkinValues ( )

Definition at line 42 of file hud.qc.

43{
44 int fh = -1;
45 if (cvar_string("menu_skin") != "")
46 {
47 draw_currentSkin = strcat("gfx/menu/", cvar_string("menu_skin"));
48 fh = fopen(strcat(draw_currentSkin, "/skinvalues.txt"), FILE_READ);
49 }
50 if (fh < 0 && cvar_defstring("menu_skin") != "")
51 {
52 cvar_set("menu_skin", cvar_defstring("menu_skin"));
53 draw_currentSkin = strcat("gfx/menu/", cvar_string("menu_skin"));
54 fh = fopen(strcat(draw_currentSkin, "/skinvalues.txt"), FILE_READ);
55 }
56 if (fh < 0)
57 {
58 draw_currentSkin = "gfx/menu/wickedx"; // default menu skin
59 fh = fopen(strcat(draw_currentSkin, "/skinvalues.txt"), FILE_READ);
60 }
61
62 draw_currentSkin = strzone(draw_currentSkin);
63
64 if (fh >= 0)
65 {
66 string s;
67 int n;
68 while ((s = fgets(fh)))
69 {
70 n = tokenize_console(s);
71 if (n < 2)
72 continue;
73 if (substring(argv(0), 0, 2) == "//")
74 continue;
75 if (argv(0) == "SIZE_CURSOR")
77 else if (argv(0) == "OFFSET_CURSOR")
79 }
80 fclose(fh);
81 }
82}
const float FILE_READ
#define argv_end_index
#define argv_start_index
string fgets(float fhandle)
void fclose(float fhandle)
string substring(string s, float start, float length)
float fopen(string filename, float mode)
const string cvar_defstring(string name)

References argv(), argv_end_index, argv_start_index, cvar_defstring(), cvar_set(), cvar_string(), fclose(), fgets(), FILE_READ, fopen(), OFFSET_CURSOR, SIZE_CURSOR, stov(), strcat(), strzone(), substring(), and tokenize_console.

Referenced by CSQC_Init().

◆ MakeRaceString()

string MakeRaceString ( int cp,
float mytime,
float theirtime,
float othertime,
float lapdelta,
string theirname )

Definition at line 22 of file racetimer.qc.

23{
24 TC(int, cp);
25 string lapstr = "", timestr = "", col = "^7", othercol = "^7", othertimestr = "";
26 if (theirname == "" || !autocvar_cl_race_cptimes_showself)
27 othertime = 0; // don't count personal time
28
29 if (theirtime == 0) // goal hit
30 {
31 if (mytime > 0)
32 {
33 timestr = strcat("+", ftos_decimals(+mytime, TIME_DECIMALS));
34 col = "^1";
35 }
36 else if (mytime == 0)
37 {
38 timestr = "+0.0";
39 col = "^3";
40 }
41 else
42 {
43 timestr = strcat("-", ftos_decimals(-mytime, TIME_DECIMALS));
44 col = "^2";
45 }
46
47 if (othertime > 0)
48 {
49 othertimestr = strcat("+", ftos_decimals(+othertime, TIME_DECIMALS));
50 othercol = "^1";
51 }
52 else if (othertime == 0)
53 {
54 othertimestr = "+0.0";
55 othercol = "^3";
56 }
57 else
58 {
59 othertimestr = strcat("-", ftos_decimals(-othertime, TIME_DECIMALS));
60 othercol = "^2";
61 }
62
63 if (lapdelta > 0)
64 {
65 lapstr = sprintf(_(" (-%dL)"), lapdelta);
66 col = "^2";
67 }
68 else if (lapdelta < 0)
69 {
70 lapstr = sprintf(_(" (+%dL)"), -lapdelta);
71 col = "^1";
72 }
73 }
74 else if (theirtime > 0) // anticipation
75 {
76 if (mytime >= theirtime)
77 timestr = strcat("+", ftos_decimals(mytime - theirtime, TIME_DECIMALS));
78 else
79 timestr = TIME_ENCODED_TOSTRING(TIME_ENCODE(theirtime), false);
80 col = "^3";
81 if (mytime >= othertime)
82 othertimestr = strcat("+", ftos_decimals(mytime - othertime, TIME_DECIMALS));
83 else
84 othertimestr = TIME_ENCODED_TOSTRING(TIME_ENCODE(othertime), false);
85 othercol = "^7";
86 }
87
88 string cpname;
89 if (cp == 254)
90 cpname = _("Start line");
91 else if (cp == 255)
92 cpname = _("Finish line");
93 else if (cp)
94 cpname = sprintf(_("Checkpoint %d"), cp);
95 else
96 cpname = _("Finish line");
97
98 if (theirname != "" && theirtime >= 0)
99 {
100 float namesize = autocvar_cl_race_cptimes_namesize * hud_fontsize.x;
101 theirname = textShortenToWidth(ColorTranslateRGB(theirname), namesize, hud_fontsize, stringwidth_colors);
102 }
103
104 if (theirtime < 0)
105 return strcat(col, cpname);
106 else if (theirname == "")
107 return strcat(col, sprintf("%s (%s)", cpname, timestr));
108 else if (othertime)
109 return strcat(col, sprintf("%s %s(%s)%s (%s %s)", cpname, othercol, othertimestr, col, timestr, strcat(theirname, col, lapstr)));
110 else
111 return strcat(col, sprintf("%s (%s %s)", cpname, timestr, strcat(theirname, col, lapstr)));
112}
vector hud_fontsize
Definition main.qh:77
bool autocvar_cl_race_cptimes_showself
Definition main.qh:30
string textShortenToWidth(string theText, float maxWidth, vector theFontSize, textLengthUpToWidth_widthFunction_t tw)
Definition util.qc:1071
#define TIME_ENCODE(t)
Definition util.qh:100
#define TIME_ENCODED_TOSTRING(n, compact)
Definition util.qh:96
const int TIME_DECIMALS
Definition util.qh:94
ERASEABLE string ColorTranslateRGB(string s)
Definition string.qh:196
ERASEABLE string ftos_decimals(float number, int decimals)
converts a number to a string with the indicated number of decimals
Definition string.qh:469
float stringwidth_colors(string s, vector theSize)
Definition string.qh:30

References autocvar_cl_race_cptimes_showself, ColorTranslateRGB(), ftos_decimals(), hud_fontsize, strcat(), stringwidth_colors(), TC, textShortenToWidth(), TIME_DECIMALS, TIME_ENCODE, and TIME_ENCODED_TOSTRING.

Referenced by HUD_RaceTimer().

◆ QuickMenu_IsOpened()

bool QuickMenu_IsOpened ( )

Definition at line 291 of file quickmenu.qc.

292{
293 return QuickMenu_Page_Entries > 0;
294}
int QuickMenu_Page_Entries
Definition quickmenu.qc:24

References QuickMenu_Page_Entries.

Referenced by HUD_Main(), HUD_Mouse(), HUD_WouldShowCursor(), LocalCommand_hud(), Scoreboard_WouldDraw(), and View_Lock().

◆ race_CheckName()

int race_CheckName ( string net_name)

Definition at line 18 of file cl_race.qc.

19{
20 int rank = 0;
21 string zoned_name = strzone(strdecolorize(net_name));
22 for (int i = RANKINGS_CNT - 1; i >= 0; --i)
23 if (strdecolorize(grecordholder[i]) == zoned_name)
24 {
25 rank = i + 1;
26 break;
27 }
28 strfree(zoned_name);
29 return rank;
30}
string grecordholder[RANKINGS_CNT]
Definition main.qh:81
const int RANKINGS_CNT
Definition constants.qh:31
#define strfree(this)
Definition string.qh:59

References grecordholder, RANKINGS_CNT, strfree, and strzone().

Referenced by HUD_Mod_Race().

Variable Documentation

◆ armor_beforedamage

int armor_beforedamage

Definition at line 245 of file hud.qh.

Referenced by HUD_HealthArmor().

◆ armor_damagetime

float armor_damagetime

Definition at line 244 of file hud.qh.

Referenced by HUD_HealthArmor().

◆ autocvar__hud_panelorder

string autocvar__hud_panelorder

Definition at line 189 of file hud.qh.

Referenced by HUD_Main(), and HUD_Panel_FirstInDrawQ().

◆ autocvar__menu_alpha

◆ autocvar_hud_cursormode

bool autocvar_hud_cursormode = true

Definition at line 191 of file hud.qh.

Referenced by HUD_Main(), HUD_Mouse(), MapVote_Init(), and View_Lock().

◆ autocvar_hud_dock

string autocvar_hud_dock

Definition at line 192 of file hud.qh.

Referenced by HUD_Main(), and HUD_Panel_InputEvent().

◆ autocvar_hud_dock_alpha

float autocvar_hud_dock_alpha

Definition at line 193 of file hud.qh.

Referenced by HUD_Main().

◆ autocvar_hud_dock_color

string autocvar_hud_dock_color

Definition at line 194 of file hud.qh.

Referenced by HUD_Main().

◆ autocvar_hud_dock_color_team

bool autocvar_hud_dock_color_team

Definition at line 195 of file hud.qh.

Referenced by HUD_Main().

◆ autocvar_hud_dynamic_follow

float autocvar_hud_dynamic_follow

Definition at line 209 of file hud.qh.

Referenced by Hud_Dynamic_Frame().

◆ autocvar_hud_dynamic_follow_scale

float autocvar_hud_dynamic_follow_scale

Definition at line 210 of file hud.qh.

Referenced by Hud_Dynamic_Frame().

◆ autocvar_hud_dynamic_follow_scale_xyz

vector autocvar_hud_dynamic_follow_scale_xyz

Definition at line 211 of file hud.qh.

Referenced by Hud_Dynamic_Frame().

◆ autocvar_hud_panel_bg

string autocvar_hud_panel_bg

Definition at line 196 of file hud.qh.

◆ autocvar_hud_panel_bg_alpha

float autocvar_hud_panel_bg_alpha

Definition at line 197 of file hud.qh.

Referenced by Vehicles_drawHUD().

◆ autocvar_hud_panel_bg_border

float autocvar_hud_panel_bg_border

Definition at line 198 of file hud.qh.

◆ autocvar_hud_panel_bg_color

vector autocvar_hud_panel_bg_color

Definition at line 199 of file hud.qh.

Referenced by Vehicles_drawHUD().

◆ autocvar_hud_panel_bg_color_team

float autocvar_hud_panel_bg_color_team

Definition at line 200 of file hud.qh.

Referenced by Vehicles_drawHUD().

◆ autocvar_hud_panel_bg_padding

float autocvar_hud_panel_bg_padding

Definition at line 201 of file hud.qh.

◆ autocvar_hud_panel_fg_alpha

float autocvar_hud_panel_fg_alpha

Definition at line 202 of file hud.qh.

Referenced by Draw_WaypointSprite(), turret_draw2d(), and Vehicles_drawHUD().

◆ autocvar_hud_panel_update_interval

float autocvar_hud_panel_update_interval

Definition at line 205 of file hud.qh.

Referenced by HUD_Panel_LoadCvars().

◆ autocvar_hud_progressbar_alpha

◆ autocvar_hud_skin

string autocvar_hud_skin

Definition at line 203 of file hud.qh.

Referenced by CSQC_Init(), HUD_Main(), and HUD_Panel_ExportCfg().

◆ autocvar_hud_speed_unit

int autocvar_hud_speed_unit

◆ BORDER_MULTIPLIER

const float BORDER_MULTIPLIER = 4

Definition at line 110 of file hud.qh.

Referenced by minigame_hud_simpleboard().

◆ chat_panel_modified

bool chat_panel_modified

Definition at line 74 of file hud.qh.

Referenced by HUD_Chat().

◆ chat_posy

float chat_posy

Definition at line 182 of file hud.qh.

Referenced by HUD_Chat(), and MapVote_Draw().

◆ chat_sizey

float chat_sizey

Definition at line 183 of file hud.qh.

Referenced by HUD_Chat(), and MapVote_Draw().

◆ cl_followmodel_ofs

vector cl_followmodel_ofs

Definition at line 218 of file hud.qh.

Referenced by calc_followmodel_ofs(), Hud_Dynamic_Frame(), and viewmodel_animate().

◆ cl_followmodel_time

float cl_followmodel_time

Definition at line 219 of file hud.qh.

Referenced by calc_followmodel_ofs().

◆ complain_weapon

entity complain_weapon

Definition at line 113 of file hud.qh.

Referenced by HUD_Weapons(), NET_HANDLE(), and Weapons_Draw().

◆ complain_weapon_time

float complain_weapon_time

Definition at line 115 of file hud.qh.

Referenced by HUD_Weapons(), NET_HANDLE(), and Weapons_Draw().

◆ complain_weapon_type

int complain_weapon_type

Definition at line 114 of file hud.qh.

Referenced by NET_HANDLE(), and Weapons_Draw().

◆ current_player

◆ health_beforedamage

int health_beforedamage

Definition at line 245 of file hud.qh.

Referenced by HUD_HealthArmor().

◆ health_damagetime

float health_damagetime

Definition at line 244 of file hud.qh.

Referenced by HUD_HealthArmor().

◆ highlightedAction

float highlightedAction

Definition at line 108 of file hud.qh.

Referenced by HUD_Panel_Highlight(), HUD_Panel_InputEvent(), and HUD_Panel_Mouse().

◆ highlightedPanel

◆ highlightedPanel_backup

entity highlightedPanel_backup

Definition at line 141 of file hud.qh.

Referenced by HUD_Panel_Arrow_Action(), HUD_Panel_InputEvent(), and HUD_Panel_Mouse().

◆ hud_draw_maximized

bool hud_draw_maximized

Definition at line 69 of file hud.qh.

Referenced by HUD_Chat(), HUD_Main(), HUD_QuickMenu(), HUD_Radar(), and Scoreboard_Draw().

◆ hud_dynamic_shake_factor

float hud_dynamic_shake_factor

Definition at line 214 of file hud.qh.

Referenced by HUD_Configure_Frame(), Hud_Dynamic_Frame(), Hud_Shake_Update(), and NET_HANDLE().

◆ hud_dynamic_shake_realofs

vector hud_dynamic_shake_realofs

Definition at line 213 of file hud.qh.

Referenced by Hud_Dynamic_Frame(), and Hud_Shake_Update().

◆ hud_dynamic_shake_time

float hud_dynamic_shake_time

Definition at line 215 of file hud.qh.

Referenced by Hud_Dynamic_Frame(), and Hud_Shake_Update().

◆ hud_fade_alpha

float hud_fade_alpha

Definition at line 134 of file hud.qh.

Referenced by HUD_Chat(), HUD_Main(), HUD_Panel_LoadCvars(), HUD_Vote(), and Vehicles_drawHUD().

◆ hud_panel_radar_bottom

float hud_panel_radar_bottom

Definition at line 72 of file hud.qh.

Referenced by HUD_CenterPrint().

◆ hud_panel_radar_maximized

bool hud_panel_radar_maximized

◆ hud_panel_radar_mouse

bool hud_panel_radar_mouse

◆ hud_panel_radar_temp_hidden

bool hud_panel_radar_temp_hidden

◆ hud_panelorder_prev

string hud_panelorder_prev

Definition at line 67 of file hud.qh.

Referenced by HUD_Main(), and HUD_Panel_FirstInDrawQ().

◆ hud_scale

◆ hud_scale_center

vector hud_scale_center

Definition at line 225 of file hud.qh.

Referenced by Hud_Dynamic_Frame().

◆ hud_scale_current

vector hud_scale_current = '1 1 0'

Definition at line 222 of file hud.qh.

Referenced by Hud_Dynamic_Frame(), and HUD_Scale_Enable().

◆ hud_shift

vector hud_shift

Definition at line 223 of file hud.qh.

Referenced by HUD_Scale_Disable(), and HUD_Scale_Enable().

◆ hud_shift_current

vector hud_shift_current = '0 0 0'

Definition at line 224 of file hud.qh.

Referenced by Hud_Dynamic_Frame(), and HUD_Scale_Enable().

◆ hud_skin_path

◆ hud_skin_prev

string hud_skin_prev

Definition at line 137 of file hud.qh.

Referenced by HUD_Main().

◆ hudShiftState

◆ last_activeweapon

Weapon last_activeweapon

Definition at line 121 of file hud.qh.

◆ last_switchweapon

Weapon last_switchweapon

Definition at line 120 of file hud.qh.

◆ mousepos

◆ myteamcolors

vector myteamcolors

Definition at line 139 of file hud.qh.

Referenced by HUD_Main(), and Vehicles_drawHUD().

◆ notify_attackers

string notify_attackers[NOTIFY_MAX_ENTRIES]

Definition at line 445 of file hud.qh.

Referenced by HUD_Notify(), and HUD_Notify_Push().

◆ notify_count

int notify_count

Definition at line 443 of file hud.qh.

Referenced by HUD_Notify(), and HUD_Notify_Push().

◆ NOTIFY_ICON_MARGIN

const float NOTIFY_ICON_MARGIN = 0.02

Definition at line 440 of file hud.qh.

Referenced by HUD_Notify().

◆ notify_icons

string notify_icons[NOTIFY_MAX_ENTRIES]

Definition at line 447 of file hud.qh.

Referenced by HUD_Notify(), and HUD_Notify_Push().

◆ notify_index

int notify_index

Definition at line 442 of file hud.qh.

Referenced by HUD_Notify(), and HUD_Notify_Push().

◆ NOTIFY_MAX_ENTRIES

const int NOTIFY_MAX_ENTRIES = 10

Definition at line 439 of file hud.qh.

Referenced by HUD_Notify(), and HUD_Notify_Push().

◆ notify_times

float notify_times[NOTIFY_MAX_ENTRIES]

Definition at line 444 of file hud.qh.

Referenced by HUD_Notify(), and HUD_Notify_Push().

◆ notify_victims

string notify_victims[NOTIFY_MAX_ENTRIES]

Definition at line 446 of file hud.qh.

Referenced by HUD_Notify(), and HUD_Notify_Push().

◆ OFFSET_CURSOR

vector OFFSET_CURSOR = '0 0 0'

Definition at line 6 of file hud.qh.

Referenced by draw_cursor_normal(), LoadMenuSkinValues(), and SKINVECTOR().

◆ old_p_armor

int old_p_armor

Definition at line 247 of file hud.qh.

Referenced by HUD_HealthArmor().

◆ old_p_armortime

float old_p_armortime

Definition at line 248 of file hud.qh.

Referenced by HUD_HealthArmor().

◆ old_p_health

int old_p_health

Definition at line 247 of file hud.qh.

Referenced by HUD_HealthArmor().

◆ old_p_healthtime

float old_p_healthtime

Definition at line 248 of file hud.qh.

Referenced by HUD_HealthArmor().

◆ panel

◆ panel_bg_alpha

◆ panel_bg_alpha_str

string panel_bg_alpha_str

Definition at line 171 of file hud.qh.

Referenced by HUD_Panel_LoadCvars().

◆ panel_bg_border

◆ panel_bg_border_str

string panel_bg_border_str

Definition at line 173 of file hud.qh.

Referenced by HUD_Panel_LoadCvars().

◆ panel_bg_color

vector panel_bg_color

Definition at line 165 of file hud.qh.

Referenced by HUD_Panel_LoadCvars(), minigame_hud_simpleboard(), and Scoreboard_Draw().

◆ panel_bg_color_str

string panel_bg_color_str

Definition at line 166 of file hud.qh.

Referenced by HUD_Panel_LoadCvars().

◆ panel_bg_color_team

float panel_bg_color_team

Definition at line 167 of file hud.qh.

Referenced by HUD_Panel_LoadCvars(), and Scoreboard_Draw().

◆ panel_bg_color_team_str

string panel_bg_color_team_str

Definition at line 168 of file hud.qh.

Referenced by HUD_Panel_LoadCvars().

◆ panel_bg_padding

◆ panel_bg_padding_str

string panel_bg_padding_str

Definition at line 175 of file hud.qh.

Referenced by HUD_Panel_LoadCvars().

◆ panel_bg_str

string panel_bg_str

Definition at line 164 of file hud.qh.

Referenced by HUD_Panel_LoadCvars().

◆ panel_click_distance

vector panel_click_distance

Definition at line 104 of file hud.qh.

Referenced by HUD_Panel_Highlight(), and HUD_Panel_Mouse().

◆ panel_click_resizeorigin

vector panel_click_resizeorigin

◆ PANEL_CONFIG_CANBEOFF

const int PANEL_CONFIG_CANBEOFF = 0x02

Definition at line 238 of file hud.qh.

Referenced by HUD_Panel_InputEvent().

◆ PANEL_CONFIG_MAIN

◆ PANEL_CONFIG_NO

const int PANEL_CONFIG_NO = 0x00

Definition at line 236 of file hud.qh.

◆ panel_configflags

int panel_configflags

Definition at line 235 of file hud.qh.

◆ panel_enabled

float panel_enabled

Definition at line 161 of file hud.qh.

Referenced by HUD_Panel_CheckMove(), and HUD_Panel_CheckResize().

◆ panel_fade_alpha

float panel_fade_alpha

Definition at line 421 of file hud.qh.

Referenced by HUD_ModIcons(), HUD_Panel_Draw(), HUD_Panel_LoadCvars(), and Scoreboard_Draw().

◆ panel_fg_alpha

float panel_fg_alpha

◆ panel_order

int panel_order[REGISTRY_MAX(hud_panels)]

◆ panel_pos

◆ panel_pos_backup

vector panel_pos_backup

Definition at line 142 of file hud.qh.

Referenced by HUD_Panel_Arrow_Action(), HUD_Panel_InputEvent(), and HUD_Panel_Mouse().

◆ PANEL_SHOW_MAINGAME

const int PANEL_SHOW_MAINGAME = BIT(0)

Definition at line 230 of file hud.qh.

Referenced by HUD_Panel_Draw().

◆ PANEL_SHOW_MAPVOTE

const int PANEL_SHOW_MAPVOTE = BIT(2)

Definition at line 232 of file hud.qh.

Referenced by HUD_Panel_Draw().

◆ PANEL_SHOW_MINIGAME

const int PANEL_SHOW_MINIGAME = BIT(1)

Definition at line 231 of file hud.qh.

Referenced by HUD_Panel_Draw().

◆ PANEL_SHOW_WITH_SB

const int PANEL_SHOW_WITH_SB = BIT(3)

Definition at line 233 of file hud.qh.

Referenced by HUD_Panel_Draw().

◆ panel_showflags

int panel_showflags

Definition at line 229 of file hud.qh.

◆ panel_size

vector panel_size

Definition at line 163 of file hud.qh.

Referenced by Checkpoints_Draw(), HUD_Ammo(), HUD_CenterPrint(), HUD_Chat(), HUD_Checkpoints(), HUD_Configure_PostDraw(), HUD_EngineInfo(), HUD_HealthArmor(), HUD_InfoMessages(), HUD_ItemsTime(), HUD_MinigameBoard(), HUD_MinigameHelp(), HUD_MinigameMenu(), HUD_MinigameMenu_MouseInput(), HUD_MinigameStatus(), HUD_ModIcons(), HUD_Notify(), HUD_Panel_Arrow_Action(), HUD_Panel_Check_Mouse_Pos(), HUD_Panel_CheckMove(), HUD_Panel_CheckResize(), HUD_Panel_Highlight(), HUD_Panel_HlBorder(), HUD_Panel_HlCenterLine(), HUD_Panel_InputEvent(), HUD_Panel_LoadCvars(), HUD_Panel_Mouse(), HUD_Panel_SetPos(), HUD_Physics(), HUD_Pickup(), HUD_Powerups(), HUD_PressedKeys(), HUD_QuickMenu(), HUD_Quickmenu_DrawEntry(), HUD_RaceTimer(), HUD_Radar(), HUD_Radar_Mouse(), HUD_Score(), HUD_StrafeHUD(), HUD_Timer(), HUD_Vote(), MapStats_DrawKeyValue(), MapVote_Draw(), QuickMenu_Mouse(), Scoreboard_AccuracyStats_Draw(), Scoreboard_Draw(), Scoreboard_DrawHeader(), Scoreboard_DrawItem(), Scoreboard_DrawOthers(), Scoreboard_FixColumnWidth(), Scoreboard_ItemStats_Draw(), Scoreboard_MakeTable(), Scoreboard_MapStats_Draw(), Scoreboard_Rankings_Draw(), StrafeHUD_AngleToOffset(), StrafeHUD_AngleToWidth(), StrafeHUD_CalculateTextIndicatorPosition(), StrafeHUD_DrawAngleIndicatorArrow(), StrafeHUD_DrawAngleIndicatorLine(), StrafeHUD_DrawDirectionIndicator(), StrafeHUD_DrawJumpHeight(), StrafeHUD_DrawSlickDetector(), StrafeHUD_DrawStartSpeed(), StrafeHUD_DrawStrafeEfficiency(), StrafeHUD_DrawStrafeHUD(), StrafeHUD_DrawStrafeMeter(), StrafeHUD_DrawTextIndicator(), StrafeHUD_DrawVerticalAngle(), StrafeHUD_ProjectOffset(), Weapons_Draw(), and Weapons_Fade().

◆ panel_size_backup

vector panel_size_backup

Definition at line 143 of file hud.qh.

Referenced by HUD_Panel_Arrow_Action(), HUD_Panel_InputEvent(), and HUD_Panel_Mouse().

◆ panel_size_copied

vector panel_size_copied

Definition at line 145 of file hud.qh.

Referenced by HUD_Panel_InputEvent().

◆ prev_armor

int prev_armor

Definition at line 243 of file hud.qh.

Referenced by HUD_HealthArmor().

◆ prev_health

int prev_health

Definition at line 243 of file hud.qh.

Referenced by HUD_HealthArmor(), and NET_HANDLE().

◆ prev_p_armor

int prev_p_armor

Definition at line 251 of file hud.qh.

Referenced by HUD_HealthArmor().

◆ prev_p_health

int prev_p_health

Definition at line 251 of file hud.qh.

Referenced by HUD_HealthArmor(), and NET_HANDLE().

◆ ps_primary

◆ ps_secondary

◆ radar_panel_modified

bool radar_panel_modified

Definition at line 75 of file hud.qh.

Referenced by HUD_Radar().

◆ resizeCorner

◆ S_ALT

◆ S_CTRL

◆ S_SHIFT

◆ S_TAB

const int S_TAB = 8

Definition at line 132 of file hud.qh.

Referenced by CSQC_InputEvent(), and HUD_Scoreboard_InputEvent().

◆ SIZE_CURSOR

vector SIZE_CURSOR = '32 32 0'

Definition at line 7 of file hud.qh.

Referenced by draw_cursor(), LoadMenuSkinValues(), and SKINVECTOR().

◆ teamnagger

int teamnagger

Definition at line 126 of file hud.qh.

Referenced by HUD_InfoMessages(), HUD_Timer(), and NET_HANDLE().

◆ timer

◆ ts_primary

◆ ts_secondary

int ts_secondary

Definition at line 118 of file hud.qh.

Referenced by Scoreboard_CompareTeamScores(), Scoreboard_Draw(), and Scoreboard_InitScores().

◆ vote_active

int vote_active

Definition at line 98 of file hud.qh.

Referenced by HUD_Vote(), LocalCommand_handlevote(), and NET_HANDLE().

◆ vote_alpha

float vote_alpha

Definition at line 100 of file hud.qh.

Referenced by HUD_Vote().

◆ vote_change

float vote_change

Definition at line 101 of file hud.qh.

Referenced by HUD_Vote(), and LocalCommand_handlevote().

◆ vote_highlighted

int vote_highlighted

Definition at line 96 of file hud.qh.

Referenced by HUD_Vote(), and NET_HANDLE().

◆ vote_needed

int vote_needed

Definition at line 95 of file hud.qh.

Referenced by HUD_Vote(), and NET_HANDLE().

◆ vote_nocount

int vote_nocount

Definition at line 94 of file hud.qh.

Referenced by HUD_Vote(), and NET_HANDLE().

◆ vote_prev

int vote_prev

Definition at line 99 of file hud.qh.

Referenced by HUD_Vote(), and LocalCommand_handlevote().

◆ vote_yescount

int vote_yescount

Definition at line 93 of file hud.qh.

Referenced by HUD_Vote(), and NET_HANDLE().

◆ weapon_accuracy

◆ weaponprevtime

float weaponprevtime

Definition at line 123 of file hud.qh.

Referenced by HUD_Weapons(), and Weapons_Fade().

◆ weapontime

float weapontime

Definition at line 122 of file hud.qh.

Referenced by HUD_Weapons(), NET_HANDLE(), View_CheckButtonStatus(), and Weapons_Fade().