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)) 36 #define _REGISTER_HUD_PANEL(id, draw_func, export_func, configflags, showflags) \ 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; \ 48 #define REGISTER_HUD_PANEL(id, draw_func, configflags, showflags) \ 49 _REGISTER_HUD_PANEL(id, draw_func, draw_func##_Export, configflags, showflags) 51 #define HUD_PANEL(NAME) HUD_PANEL_##NAME 54 #define HUD_Panel_DrawBg() MACRO_BEGIN \ 55 if(panel.current_panel_bg != "0" && panel.current_panel_bg != "") \ 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) \ 90 string MakeRaceString(
int cp,
float mytime,
float theirtime,
float othertime,
float lapdelta,
string theirname);
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;
175 classfield(HUDPanel) .void(
int fh) panel_export;
254 REGISTER_HUD_PANEL(NOTIFY,
HUD_Notify, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_WITH_SB)
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)
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)
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)
286 #define HUD_Panel_GetBg() MACRO_BEGIN \ 288 if (!autocvar__hud_configure && panel_bg_str == "0") { \ 291 if (panel_bg_str == "") { \ 292 panel_bg_str = autocvar_hud_panel_bg; \ 294 if (panel_bg_str == "0" && !autocvar__hud_configure) { \ 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"); \ 308 strcpy(panel.current_panel_bg, panel_bg); \ 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; \ 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; \ 321 if (panel_bg_color_str == "") { \ 322 panel_bg_color = autocvar_hud_panel_bg_color; \ 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); \ 329 panel_bg_color = stov(panel_bg_color_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; \ 340 panel_bg_color_team = stof(panel_bg_color_team_str); \ 346 #define HUD_Panel_GetBgAlpha() MACRO_BEGIN \ 347 if (panel_bg_alpha_str == "") { \ 348 panel_bg_alpha_str = ftos(autocvar_hud_panel_bg_alpha); \ 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;\ 357 panel_bg_alpha = max(cvar("hud_configure_bg_minalpha"), panel_bg_alpha); \ 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; \ 370 #define HUD_Panel_GetBorder() MACRO_BEGIN \ 371 if (panel_bg_border_str == "") { \ 372 panel_bg_border = autocvar_hud_panel_bg_border; \ 374 panel_bg_border = stof(panel_bg_border_str); \ 380 #define HUD_Panel_GetPadding() MACRO_BEGIN \ 381 if (panel_bg_padding_str == "") { \ 382 panel_bg_padding = autocvar_hud_panel_bg_padding; \ 384 panel_bg_padding = stof(panel_bg_padding_str); \ 386 panel_bg_padding = min(min(panel_size.x, panel_size.y)/2 - 5, panel_bg_padding); \ 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) \ 396 new_size.x = max_panel_width; \ 397 new_size.y = panel_size.y * (new_size.x / panel_size.x); \ 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; \ 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; \ 413 #define Hud_Panel_GetPanelEnabled() \ 414 panel_enabled = ((panel.panel_configflags & PANEL_CONFIG_CANBEOFF) \ 415 ? cvar(strcat("hud_panel_", panel.panel_name)) : true) 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(); \ 425 panel_bg_border_str = cvar_string(strcat("hud_panel_", panel.panel_name, "_bg_border")); \ 426 HUD_Panel_GetBorder(); \
float cl_followmodel_time
bool radar_panel_modified
string notify_attackers[NOTIFY_MAX_ENTRIES]
float autocvar_hud_dynamic_follow_scale
void HUD_Panel_DrawProgressBar(vector theOrigin, vector theSize, string pic, float length_ratio, bool vertical, float baralign, vector theColor, float theAlpha, int drawflag)
const int PANEL_CONFIG_CANBEOFF
string panel_bg_alpha_str
bool hud_panel_radar_maximized
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
string panel_bg_color_team_str
float panel_bg_color_team
float HUD_GetRowCount(int item_count, vector size, float item_aspect)
float autocvar_hud_panel_bg_color_team
float HUD_Radar_InputEvent(float bInputType, float nPrimary, float nSecondary)
const int PANEL_SHOW_WITH_SB
ERASEABLE float blink(float base, float range, float freq)
vector autocvar_hud_dynamic_follow_scale_xyz
float autocvar_hud_panel_fg_alpha
string panel_bg_border_str
vector hud_dynamic_shake_realofs
bool autocvar_hud_dock_color_team
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
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
void draw_cursor(vector pos, vector ofs, string img, vector col, float a)
PANEL_CONFIG_MAIN PANEL_SHOW_MAINGAME HUD_HealthArmor
int panel_order[REGISTRY_MAX(hud_panels)]
float hud_dynamic_shake_factor
float autocvar_hud_dock_alpha
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
const int PANEL_CONFIG_MAIN
float autocvar_hud_panel_bg_alpha
void draw_cursor_normal(vector pos, vector col, float a)
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)
void LoadMenuSkinValues()
bool HUD_WouldShowCursor()
const int PANEL_SHOW_MINIGAME
vector panel_click_resizeorigin
float autocvar_hud_dynamic_follow
bool hud_panel_radar_temp_hidden
float notify_times[NOTIFY_MAX_ENTRIES]
#define REGISTER_REGISTRY(id)
bool hud_panel_radar_mouse
int race_CheckName(string net_name)
vector HUD_Scale(vector v)
bool HUD_Radar_Clickable()
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
#define REGISTRY_DEFINE_GET(id, null)
float autocvar__menu_alpha
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
float hud_panel_radar_bottom
string MakeRaceString(int cp, float mytime, float theirtime, float othertime, float lapdelta, string theirname)
const float BORDER_MULTIPLIER
void HUD_Panel_LoadCvars()
#define REGISTER_HUD_PANEL(id, draw_func, configflags, showflags)
float complain_weapon_time
PANEL_CONFIG_MAIN PANEL_SHOW_MAINGAME PANEL_CONFIG_MAIN PANEL_SHOW_MAINGAME HUD_Timer
float autocvar_hud_panel_bg_border
string autocvar_hud_panel_bg
const int NOTIFY_MAX_ENTRIES
string panel_bg_color_str
vector HUD_Shift(vector v)
string panel_bg_padding_str
PlayerScoreField ps_secondary
#define REGISTRY(id, max)
Declare a new registry.
void HUD_Panel_DrawHighlight(vector pos, vector mySize, vector color, float theAlpha, int drawflag)
float autocvar_hud_panel_bg_padding
const int PANEL_SHOW_MAINGAME
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
string notify_icons[NOTIFY_MAX_ENTRIES]
vector HUD_GetFontsize(string cvarname)
void HUD_ModIcons_SetFunc()
vector(float skel, float bonenum) _skel_get_boneabs_hidden
const float NOTIFY_ICON_MARGIN
vector panel_click_distance
const int PANEL_SHOW_MAPVOTE
void HUD_MinigameStatus()
vector cl_followmodel_ofs
bool QuickMenu_IsOpened()
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
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
float hud_dynamic_shake_time
string hud_panelorder_prev
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
entity highlightedPanel_backup
PlayerScoreField ps_primary
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
void HUD_Notify_Push(string icon, string attacker, string victim)
void HUD_Radar_Hide_Maximized()
string autocvar_hud_dock_color
float autocvar_hud_progressbar_alpha
string autocvar__hud_panelorder
float autocvar_hud_panel_update_interval
vector HUD_Get_Num_Color(float hp, float maxvalue, bool blink)
const int PANEL_CONFIG_NO
var void HUD_ModIcons_GameType(vector pos, vector size)
int weapon_accuracy[REGISTRY_MAX(Weapons)]
vector HUD_GetTableSize_BestItemAR(int item_count, vector psize, float item_aspect)
bool autocvar_hud_cursormode
vector autocvar_hud_panel_bg_color
string notify_victims[NOTIFY_MAX_ENTRIES]
classfield(HUDPanel) .string panel_name