Xonotic
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)   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)   (f * hud_scale.x)
 
#define HUD_ScaleY(f)   (f * hud_scale.y)
 
#define HUD_ShiftX(f)   (f + hud_shift.x + hud_shift.z * (f - hud_scale_center.x))
 
#define HUD_ShiftY(f)   (f + hud_shift.y + hud_shift.z * (f - hud_scale_center.y))
 
#define REGISTER_HUD_PANEL(id, draw_func, configflags, showflags)   _REGISTER_HUD_PANEL(id, draw_func, draw_func##_Export, 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)
 
 REGISTER_HUD_PANEL (WEAPONS, HUD_Weapons, PANEL_CONFIG_MAIN|PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME) REGISTER_HUD_PANEL(AMMO
 
PANEL_CONFIG_MAIN PANEL_SHOW_MAINGAME REGISTER_HUD_PANEL (POWERUPS, HUD_Powerups, PANEL_CONFIG_MAIN|PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME) REGISTER_HUD_PANEL(HEALTHARMOR
 
PANEL_CONFIG_MAIN PANEL_SHOW_MAINGAME PANEL_CONFIG_MAIN PANEL_SHOW_MAINGAME REGISTER_HUD_PANEL (NOTIFY, HUD_Notify, PANEL_CONFIG_MAIN|PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME|PANEL_SHOW_MINIGAME|PANEL_SHOW_WITH_SB) REGISTER_HUD_PANEL(TIMER
 
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 REGISTER_HUD_PANEL (RADAR, HUD_Radar, PANEL_CONFIG_MAIN|PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME) REGISTER_HUD_PANEL(SCORE
 
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 REGISTER_HUD_PANEL (RACETIMER, HUD_RaceTimer, PANEL_CONFIG_MAIN|PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME) REGISTER_HUD_PANEL(VOTE
 
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 REGISTER_HUD_PANEL (MODICONS, HUD_ModIcons, PANEL_CONFIG_MAIN|PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME|PANEL_SHOW_WITH_SB) REGISTER_HUD_PANEL(PRESSEDKEYS
 
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 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) REGISTER_HUD_PANEL(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 REGISTER_HUD_PANEL (INFOMESSAGES, HUD_InfoMessages, PANEL_CONFIG_MAIN|PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME) REGISTER_HUD_PANEL(PHYSICS
 
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 REGISTER_HUD_PANEL (CENTERPRINT, HUD_CenterPrint, PANEL_CONFIG_MAIN|PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME|PANEL_SHOW_WITH_SB) REGISTER_HUD_PANEL(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 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 REGISTER_HUD_PANEL (MINIGAMESTATUS, HUD_MinigameStatus, PANEL_CONFIG_NO, PANEL_SHOW_MINIGAME|PANEL_SHOW_WITH_SB) REGISTER_HUD_PANEL(MINIGAMEHELP
 
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 REGISTER_HUD_PANEL (MINIGAMEMENU, HUD_MinigameMenu, PANEL_CONFIG_NO, PANEL_SHOW_MAINGAME|PANEL_SHOW_MINIGAME|PANEL_SHOW_WITH_SB) REGISTER_HUD_PANEL(MAPVOTE
 
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 REGISTER_HUD_PANEL (ITEMSTIME, HUD_ItemsTime, PANEL_CONFIG_MAIN|PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME) REGISTER_HUD_PANEL(QUICKMENU
 
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 REGISTER_HUD_PANEL (SCOREBOARD, Scoreboard_Draw, PANEL_CONFIG_NO, PANEL_SHOW_MAINGAME|PANEL_SHOW_MINIGAME|PANEL_SHOW_MAPVOTE|PANEL_SHOW_WITH_SB) REGISTER_HUD_PANEL(STRAFEHUD
 

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
 
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
 
 HUD_Ammo
 
bool hud_draw_maximized
 
float hud_dynamic_shake_factor
 
vector hud_dynamic_shake_realofs
 
float hud_dynamic_shake_time
 
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
 
float hud_fade_alpha
 
PANEL_CONFIG_MAIN PANEL_SHOW_MAINGAME HUD_HealthArmor
 
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 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
 
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
 
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
 
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
 
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
 
vector hud_scale
 
vector hud_scale_center
 
vector hud_scale_current = '1 1 0'
 
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
 
vector hud_shift
 
vector hud_shift_current = '0 0 0'
 
string hud_skin_path
 
string hud_skin_prev
 
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
 
PANEL_CONFIG_MAIN PANEL_SHOW_MAINGAME PANEL_CONFIG_MAIN PANEL_SHOW_MAINGAME HUD_Timer
 
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
 
int hudShiftState
 
Weapon last_activeweapon
 
Weapon last_switchweapon
 
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
 
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
 
vector SIZE_CURSOR = '32 32 0'
 
float teamnagger
 
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; \
}
int m_id
Definition: effect.qh:19
#define new_pure(class)
purely logical entities (.origin doesn't work)
Definition: oo.qh:62
#define HUD_PANEL(NAME)
Definition: hud.qh:51

Definition at line 36 of file hud.qh.

◆ HUD_PANEL

#define HUD_PANEL (   NAME)    HUD_PANEL_##NAME

◆ HUD_Panel_DrawBg

#define HUD_Panel_DrawBg ( )
Value:
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), \
); \
MACRO_END
float panel_bg_border
Definition: hud.qh:169
vector panel_size
Definition: hud.qh:160
vector HUD_Scale(vector v)
Definition: hud.qc:97
const float BORDER_MULTIPLIER
Definition: hud.qh:109
vector HUD_Shift(vector v)
Definition: hud.qc:104
float panel_bg_alpha
Definition: hud.qh:167
entity panel
Definition: hud.qh:144
vector panel_pos
Definition: hud.qh:159
if(IS_DEAD(this))
Definition: impulse.qc:92
vector panel_bg_color
Definition: hud.qh:162

Definition at line 54 of file hud.qh.

Referenced by HUD_Ammo(), HUD_Chat(), HUD_EngineInfo(), HUD_HealthArmor(), HUD_InfoMessages(), HUD_MinigameMenu(), HUD_ModIcons(), HUD_Notify(), HUD_Physics(), HUD_Powerups(), HUD_PressedKeys(), HUD_RaceTimer(), HUD_Radar(), HUD_Score(), HUD_StrafeHUD(), HUD_Weapons(), Item_ItemsTime_Allow(), Scoreboard_MakeTable(), Scoreboard_Rankings_Draw(), and ttt_next_match().

◆ HUD_Panel_GetBg

#define HUD_Panel_GetBg ( )
Value:
MACRO_BEGIN \
string panel_bg; \
panel_bg = "0"; \
} else { \
if (panel_bg_str == "") { \
panel_bg_str = autocvar_hud_panel_bg; \
} \
panel_bg = "0"; \
} else { \
panel_bg_alpha_str = "0"; \
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); \
MACRO_END
bool autocvar__hud_configure
Definition: hud_config.qh:3
string panel_bg_str
Definition: hud.qh:161
string hud_skin_path
Definition: hud.qh:133
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
string autocvar_hud_panel_bg
Definition: hud.qh:193
entity panel
Definition: hud.qh:144

Definition at line 286 of file hud.qh.

Referenced by HUD_Panel_LoadCvars().

◆ HUD_Panel_GetBgAlpha

#define HUD_Panel_GetBgAlpha ( )
Value:
panel_bg_alpha_str = ftos(autocvar_hud_panel_bg_alpha); \
} \
panel_bg_alpha = stof(panel_bg_alpha_str); \
if (!panel_enabled) \
panel_bg_alpha = 0.25; \
panel_bg_alpha = (1 - autocvar__menu_alpha) * max(cvar("hud_configure_bg_minalpha"), panel_bg_alpha) + autocvar__menu_alpha * panel_bg_alpha;\
else \
panel_bg_alpha = max(cvar("hud_configure_bg_minalpha"), panel_bg_alpha); \
} \
MACRO_END
string panel_bg_alpha_str
Definition: hud.qh:168
entity highlightedPanel
Definition: hud.qh:106
bool autocvar__hud_configure
Definition: hud_config.qh:3
float autocvar_hud_panel_bg_alpha
Definition: hud.qh:194
float autocvar__menu_alpha
Definition: hud.qh:184
float panel_bg_alpha
Definition: hud.qh:167
entity panel
Definition: hud.qh:144
float hud_configure_menu_open
Definition: hud_config.qh:21
if(IS_DEAD(this))
Definition: impulse.qc:92
float panel_enabled
Definition: hud.qh:158

Definition at line 346 of file hud.qh.

Referenced by HUD_Panel_LoadCvars().

◆ HUD_Panel_GetBorder

#define HUD_Panel_GetBorder ( )
Value:
panel_bg_border = autocvar_hud_panel_bg_border; \
} else { \
panel_bg_border = stof(panel_bg_border_str); \
} \
MACRO_END
string panel_bg_border_str
Definition: hud.qh:170
float autocvar_hud_panel_bg_border
Definition: hud.qh:195
if(IS_DEAD(this))
Definition: impulse.qc:92

Definition at line 370 of file hud.qh.

Referenced by HUD_Panel_LoadCvars().

◆ HUD_Panel_GetColor

#define HUD_Panel_GetColor ( )
Value:
panel_bg_color = '1 0 0' * panel_bg_color_team; \
else \
panel_bg_color = myteamcolors * panel_bg_color_team; \
panel_bg_color = '1 0 0' * panel_bg_color_team; \
} else { \
if (panel_bg_color_str == "") { \
panel_bg_color = autocvar_hud_panel_bg_color; \
} else { \
if (panel_bg_color_str == "shirt") { \
panel_bg_color = colormapPaletteColor(floor(entcs_GetClientColors(current_player) / 16), 0); \
} else if (panel_bg_color_str == "pants") { \
panel_bg_color = colormapPaletteColor(entcs_GetClientColors(current_player) % 16, 1); \
} else { \
panel_bg_color = stov(panel_bg_color_str); \
} \
} \
} \
MACRO_END
float current_player
Definition: hud.qh:182
const int NUM_SPECTATOR
Definition: teams.qh:23
float panel_bg_color_team
Definition: hud.qh:164
bool autocvar__hud_configure
Definition: hud_config.qh:3
vector myteamcolors
Definition: hud.qh:136
string panel_bg_color_str
Definition: hud.qh:163
float teamplay
Definition: progsdefs.qc:31
bool autocvar_hud_configure_teamcolorforced
Definition: hud_config.qh:7
if(IS_DEAD(this))
Definition: impulse.qc:92
vector autocvar_hud_panel_bg_color
Definition: hud.qh:196
#define colormapPaletteColor(c, isPants)
Definition: color.qh:5

Definition at line 312 of file hud.qh.

Referenced by HUD_Panel_LoadCvars().

◆ HUD_Panel_GetColorTeam

#define HUD_Panel_GetColorTeam ( )
Value:
panel_bg_color_team = autocvar_hud_panel_bg_color_team; \
} else { \
panel_bg_color_team = stof(panel_bg_color_team_str); \
} \
MACRO_END
string panel_bg_color_team_str
Definition: hud.qh:165
float autocvar_hud_panel_bg_color_team
Definition: hud.qh:197
if(IS_DEAD(this))
Definition: impulse.qc:92

Definition at line 336 of file hud.qh.

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; \
MACRO_END
float autocvar_hud_panel_fg_alpha
Definition: hud.qh:199
bool autocvar__hud_configure
Definition: hud_config.qh:3
float panel_enabled
Definition: hud.qh:158

Definition at line 363 of file hud.qh.

Referenced by HUD_Panel_LoadCvars().

◆ HUD_Panel_GetPadding

#define HUD_Panel_GetPadding ( )
Value:
panel_bg_padding = autocvar_hud_panel_bg_padding; \
} else { \
panel_bg_padding = stof(panel_bg_padding_str); \
} \
panel_bg_padding = min(min(panel_size.x, panel_size.y)/2 - 5, panel_bg_padding); \
MACRO_END
vector panel_size
Definition: hud.qh:160
string panel_bg_padding_str
Definition: hud.qh:172
float autocvar_hud_panel_bg_padding
Definition: hud.qh:198
if(IS_DEAD(this))
Definition: impulse.qc:92
float panel_bg_padding
Definition: hud.qh:171

Definition at line 380 of file hud.qh.

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)
const int PANEL_CONFIG_CANBEOFF
Definition: hud.qh:233
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
entity panel
Definition: hud.qh:144
float panel_enabled
Definition: hud.qh:158

Definition at line 413 of file hud.qh.

Referenced by HUD_Panel_Draw().

◆ HUD_Panel_ScalePosSize

#define HUD_Panel_ScalePosSize ( )
Value:
MACRO_BEGIN \
panel_pos.x *= vid_conwidth; panel_pos.y *= vid_conheight; \
panel_size.x *= vid_conwidth; panel_size.y *= vid_conheight; \
MACRO_END
float vid_conheight
vector panel_size
Definition: hud.qh:160
float vid_conwidth
vector panel_pos
Definition: hud.qh:159

Definition at line 405 of file hud.qh.

Referenced by HUD_Panel_LoadCvars().

◆ HUD_Panel_UpdatePosSize

#define HUD_Panel_UpdatePosSize ( )
Value:
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(); \
MACRO_END
entity highlightedPanel
Definition: hud.qh:106
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
entity panel
Definition: hud.qh:144
#define Hud_Panel_GetPanelEnabled()
Definition: hud.qh:413
float hud_configure_menu_open
Definition: hud_config.qh:21

Definition at line 417 of file hud.qh.

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; \
panel_pos = (1 - autocvar__menu_alpha) * panel_pos + (autocvar__menu_alpha) * new_pos; \
panel_size = (1 - autocvar__menu_alpha) * panel_size + (autocvar__menu_alpha) * new_size; \
MACRO_END
float vid_conheight
float panel_bg_border
Definition: hud.qh:169
vector panel_size
Definition: hud.qh:160
float vid_conwidth
float autocvar__menu_alpha
Definition: hud.qh:184
vector panel_pos
Definition: hud.qh:159
#define vec2(...)
Definition: vector.qh:90

Definition at line 391 of file hud.qh.

Referenced by HUD_Panel_LoadCvars().

◆ HUD_ScaleX

#define HUD_ScaleX (   f)    (f * hud_scale.x)

Definition at line 15 of file hud.qh.

Referenced by HUD_Scale().

◆ HUD_ScaleY

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

Definition at line 16 of file hud.qh.

Referenced by HUD_Scale().

◆ HUD_ShiftX

#define HUD_ShiftX (   f)    (f + hud_shift.x + hud_shift.z * (f - hud_scale_center.x))

Definition at line 17 of file hud.qh.

Referenced by HUD_Shift().

◆ HUD_ShiftY

#define HUD_ShiftY (   f)    (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 
)    _REGISTER_HUD_PANEL(id, draw_func, draw_func##_Export, configflags, showflags)

Definition at line 48 of file hud.qh.

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.

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

Referenced by draw_cursor_normal(), and HUD_Cursor_Show().

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 }
vector SIZE_CURSOR
Definition: hud.qh:7
string draw_currentSkin
Definition: util.qh:45
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
const float DRAWFLAG_NORMAL
Definition: csprogsdefs.qc:317
#define vec2(...)
Definition: vector.qh:90
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ draw_cursor_normal()

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

Definition at line 37 of file hud.qc.

References draw_cursor(), and OFFSET_CURSOR.

Referenced by HUD_Cursor_Show().

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
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DrawNumIcon()

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

◆ 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 398 of file hud.qc.

References 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().

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

◆ entityclass()

entityclass ( HUDPanel  )

◆ Hud_Dynamic_Frame()

void Hud_Dynamic_Frame ( )

Definition at line 595 of file hud.qc.

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, time, vector(), vid_conheight, and vid_conwidth.

Referenced by HUD_Draw().

596 {
597  vector ofs = '0 0 0';
598  hud_scale_current = '1 1 0';
599  hud_shift_current = '0 0 0';
600 
602  {
604  calc_followmodel_ofs(view);
609 
610  if (fabs(ofs.x) < 0.001) ofs.x = 0;
611  if (fabs(ofs.y) < 0.001) ofs.y = 0;
612  if (fabs(ofs.z) < 0.001) ofs.z = 0;
613  ofs.x = bound(-0.1, ofs.x, 0.1);
614  ofs.y = bound(-0.1, ofs.y, 0.1);
615  ofs.z = bound(-0.1, ofs.z, 0.1);
616 
617  hud_shift_current.x = ofs.y * vid_conwidth;
618  hud_shift_current.y = ofs.z * vid_conheight;
619  hud_shift_current.z = ofs.x;
620 
623  }
624 
626  {
627  static float old_health = 0;
628  float health = max(-1, STAT(HEALTH));
629  if(hud_dynamic_shake_factor == -1) // don't allow the effect for this frame
630  {
632  old_health = health;
633  }
634  else
635  {
636  float new_hud_dynamic_shake_factor = 0;
637  if (old_health - health >= autocvar_hud_dynamic_shake_damage_min
639  && old_health > 0 && !intermission)
640  {
642  new_hud_dynamic_shake_factor = (old_health - health - m) / (autocvar_hud_dynamic_shake_damage_max - m);
643  if(new_hud_dynamic_shake_factor >= 1)
644  new_hud_dynamic_shake_factor = 1;
645  if(new_hud_dynamic_shake_factor >= hud_dynamic_shake_factor)
646  {
647  hud_dynamic_shake_factor = new_hud_dynamic_shake_factor;
649  }
650  }
651  old_health = health;
653  if(!Hud_Shake_Update())
655  }
656 
658  {
661  }
662  }
663 
664  hud_scale_center.x = 0.5 * vid_conwidth;
666 
668 }
float vid_conheight
float autocvar_hud_dynamic_follow_scale
Definition: hud.qh:205
entity CSQCModel_server2csqc(int i)
Definition: cl_model.qc:314
vector autocvar_hud_dynamic_follow_scale_xyz
Definition: hud.qh:206
float autocvar_hud_dynamic_shake_damage_min
Definition: hud.qc:570
vector hud_dynamic_shake_realofs
Definition: hud.qh:208
vector hud_scale_current
Definition: hud.qh:217
entity() spawn
float intermission
Definition: csprogsdefs.qc:148
float hud_dynamic_shake_factor
Definition: hud.qh:209
void HUD_Scale_Disable()
Definition: hud.qc:83
float vid_conwidth
float autocvar_hud_dynamic_follow
Definition: hud.qh:204
vector hud_scale_center
Definition: hud.qh:220
void calc_followmodel_ofs(entity view)
Definition: view.qc:112
float player_localentnum
Definition: csprogsdefs.qc:19
float autocvar_hud_dynamic_shake_damage_max
Definition: hud.qc:569
vector(float skel, float bonenum) _skel_get_boneabs_hidden
vector cl_followmodel_ofs
Definition: hud.qh:213
float health
Definition: progsdefs.qc:137
float hud_dynamic_shake_time
Definition: hud.qh:210
bool Hud_Shake_Update()
Definition: hud.qc:574
vector hud_shift_current
Definition: hud.qh:219
float time
Definition: csprogsdefs.qc:16
float autocvar_hud_dynamic_shake
Definition: hud.qc:568
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HUD_Get_Num_Color()

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

Definition at line 123 of file hud.qc.

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

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

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
130  vector color;
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 -= color * f;
159  }
160  }
161 
162  return color;
163 }
vector color
ERASEABLE float blink(float base, float range, float freq)
Definition: util.qc:2044
#define CASE_COLOR_BETWEEN(min, max)
vector(float skel, float bonenum) _skel_get_boneabs_hidden
const float M_PI
Definition: csprogsdefs.qc:269
float time
Definition: csprogsdefs.qc:16
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HUD_GetFontsize()

vector HUD_GetFontsize ( string  cvarname)

Definition at line 111 of file hud.qc.

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

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

112 {
113  vector v;
114  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 }
vector(float skel, float bonenum) _skel_get_boneabs_hidden
vector v
Definition: ent_cs.qc:116
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HUD_GetRowCount()

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

Definition at line 165 of file hud.qc.

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

Referenced by HUD_Ammo(), HUD_Mod_CA_Draw(), HUD_Mod_Dom(), HUD_Score(), and Item_ItemsTime_Allow().

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) / 2), item_count);
170 }
#define TC(T, sym)
Definition: _all.inc:82
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HUD_GetTableSize_BestItemAR()

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

Definition at line 172 of file hud.qc.

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

173 {
174  TC(int, item_count);
175  float columns, rows;
176  float ratio, best_ratio = 0;
177  float best_columns = 1, best_rows = 1;
178  bool vertical = (psize.x / psize.y >= item_aspect);
179  if(vertical)
180  {
181  psize = eX * psize.y + eY * psize.x;
182  item_aspect = 1 / item_aspect;
183  }
184 
185  rows = ceil(sqrt(item_count));
186  columns = ceil(item_count/rows);
187  while(columns >= 1)
188  {
189  ratio = (psize.x/columns) / (psize.y/rows);
190  if(ratio > item_aspect)
191  ratio = item_aspect * item_aspect / ratio;
192 
193  if(ratio <= best_ratio)
194  break; // ratio starts decreasing by now, skip next configurations
195 
196  best_columns = columns;
197  best_rows = rows;
198  best_ratio = ratio;
199 
200  if(columns == 1)
201  break;
202 
203  --columns;
204  rows = ceil(item_count/columns);
205  }
206 
207  return (vertical) ? vec2(best_rows, best_columns) : vec2(best_columns, best_rows);
208 }
const vector eY
Definition: vector.qh:45
#define TC(T, sym)
Definition: _all.inc:82
const vector eX
Definition: vector.qh:44
#define vec2(...)
Definition: vector.qh:90
+ Here is the call graph for this function:

◆ HUD_ItemsTime()

void HUD_ItemsTime ( )

Referenced by Item_ItemsTime_Allow().

+ Here is the caller graph for this function:

◆ HUD_Main()

void HUD_Main ( )

Definition at line 689 of file hud.qc.

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(), 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, 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.

690 {
691  int i;
692  if(hud_configure_menu_open == 1)
693  hud_fade_alpha = 1;
694  else
696 
697  if(myteam != prev_myteam)
698  {
699  myteamcolors = colormapPaletteColor(myteam, 1);
700  FOREACH(hud_panels, true, it.update_time = time);
701  prev_myteam = myteam;
702  }
703 
705 
706  if(scoreboard_fade_alpha == 1)
707  if(autocvar__menu_alpha == 1)
708  return;
709 
710  // Drawing stuff
712  {
715  }
716 
717  // draw the dock
718  if(autocvar_hud_dock != "" && autocvar_hud_dock != "0")
719  {
720  int f;
721  vector color;
722  float hud_dock_color_team = autocvar_hud_dock_color_team;
723  if((teamplay) && hud_dock_color_team) {
724  if(autocvar__hud_configure && myteam == NUM_SPECTATOR)
725  color = '1 0 0' * hud_dock_color_team;
726  else
727  color = myteamcolors * hud_dock_color_team;
728  }
729  else if(autocvar_hud_configure_teamcolorforced && autocvar__hud_configure && hud_dock_color_team) {
730  color = '1 0 0' * hud_dock_color_team;
731  }
732  else
733  {
734  string hud_dock_color = autocvar_hud_dock_color;
735  if(hud_dock_color == "shirt") {
736  f = entcs_GetClientColors(current_player);
737  color = colormapPaletteColor(floor(f / 16), 0);
738  }
739  else if(hud_dock_color == "pants") {
740  f = entcs_GetClientColors(current_player);
741  color = colormapPaletteColor(f % 16, 1);
742  }
743  else
744  color = stov(hud_dock_color);
745  }
746 
747  string pic;
749  if(precache_pic(pic) == "") {
750  pic = strcat(hud_skin_path, "/dock_medium");
751  if(precache_pic(pic) == "") {
752  pic = "gfx/hud/default/dock_medium";
753  }
754  }
755  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...
756  }
757 
758  // cache the panel order into the panel_order array
760  for(i = 0; i < REGISTRY_COUNT(hud_panels); ++i)
761  panel_order[i] = -1;
762  string s = "";
763  int p_num;
764  bool warning = false;
766  if (argc > REGISTRY_COUNT(hud_panels))
767  warning = true;
768  //first detect wrong/missing panel numbers
769  for(i = 0; i < REGISTRY_COUNT(hud_panels); ++i) {
770  p_num = stoi(argv(i));
771  if (p_num >= 0 && p_num < REGISTRY_COUNT(hud_panels)) { //correct panel number?
772  if (panel_order[p_num] == -1) //found for the first time?
773  s = strcat(s, ftos(p_num), " ");
774  panel_order[p_num] = 1; //mark as found
775  }
776  else
777  warning = true;
778  }
779  for(i = 0; i < REGISTRY_COUNT(hud_panels); ++i) {
780  if (panel_order[i] == -1) {
781  warning = true;
782  s = strcat(s, ftos(i), " "); //add missing panel number
783  }
784  }
785  if (warning)
786  LOG_TRACE("Automatically fixed wrong/missing panel numbers in _hud_panelorder");
787 
788  cvar_set("_hud_panelorder", s);
790 
791  //now properly set panel_order
792  tokenize_console(s);
793  for(i = 0; i < REGISTRY_COUNT(hud_panels); ++i) {
794  panel_order[i] = stof(argv(i));
795  }
796  }
797 
798  hud_draw_maximized = 0;
799  // draw panels in the order specified by panel_order array
800  for(i = REGISTRY_COUNT(hud_panels) - 1; i >= 0; --i)
801  HUD_Panel_Draw(REGISTRY_GET(hud_panels, panel_order[i]));
802 
803  HUD_Vehicle();
804 
805  hud_draw_maximized = 1; // panels that may be maximized must check this var
806  // draw maximized panels on top
808  HUD_Panel_Draw(HUD_PANEL(RADAR));
810  HUD_Panel_Draw(HUD_PANEL(CHAT));
811  if (QuickMenu_IsOpened())
812  HUD_Panel_Draw(HUD_PANEL(QUICKMENU));
813  HUD_Panel_Draw(HUD_PANEL(SCOREBOARD));
814 
815  int cursor_active_prev = cursor_active;
817  if (cursor_active_prev != cursor_active && autocvar_hud_cursormode)
818  {
819  setcursormode(cursor_active);
820  // cursor inactive this frame, will be set to 1 the next frame
821  if (cursor_active)
822  cursor_active = -1;
823  }
824 
825  if (intermission == 2)
826  HUD_Reset();
827 
829 
831 }
vector color
float vid_conheight
void HUD_Configure_Frame()
Definition: hud_config.qc:1063
bool hud_panel_radar_maximized
Definition: hud.qh:69
void HUD_Panel_Draw(entity panent)
Definition: hud.qc:511
float current_player
Definition: hud.qh:182
const int NUM_SPECTATOR
Definition: teams.qh:23
const vector eY
Definition: vector.qh:45
void HUD_Vehicle()
Definition: hud.qc:493
bool autocvar__hud_configure
Definition: hud_config.qh:3
bool autocvar_hud_dock_color_team
Definition: hud.qh:192
void HUD_Reset()
Definition: hud.qc:561
#define REGISTRY_GET(id, i)
Definition: registry.qh:43
bool hud_draw_maximized
Definition: hud.qh:68
int panel_order[REGISTRY_MAX(hud_panels)]
Definition: hud.qh:65
float intermission
Definition: csprogsdefs.qc:148
float autocvar_hud_dock_alpha
Definition: hud.qh:190
float vid_conwidth
bool HUD_WouldShowCursor()
Definition: hud.qc:670
#define strcpy(this, s)
Definition: string.qh:49
#define stoi(s)
Definition: int.qh:4
#define REGISTRY_COUNT(id)
Definition: registry.qh:18
string hud_skin_prev
Definition: hud.qh:134
string hud_skin_path
Definition: hud.qh:133
float autocvar__menu_alpha
Definition: hud.qh:184
int cursor_active
Definition: view.qh:108
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
vector myteamcolors
Definition: hud.qh:136
float prev_myteam
Definition: hud.qc:688
const float DRAWFLAG_NORMAL
Definition: csprogsdefs.qc:317
float teamplay
Definition: progsdefs.qc:31
string autocvar_hud_dock
Definition: hud.qh:189
void HUD_Configure_PostDraw()
Definition: hud_config.qc:1113
vector(float skel, float bonenum) _skel_get_boneabs_hidden
#define tokenize_console
Definition: dpextensions.qh:24
bool autocvar__con_chat_maximized
Definition: chat.qh:6
bool QuickMenu_IsOpened()
Definition: quickmenu.qc:244
const vector eX
Definition: vector.qh:44
#define LOG_TRACE(...)
Definition: log.qh:81
string hud_panelorder_prev
Definition: hud.qh:66
float hud_configure_prev
Definition: hud_config.qh:17
bool autocvar_hud_configure_teamcolorforced
Definition: hud_config.qh:7
float hud_configure_menu_open
Definition: hud_config.qh:21
float hud_fade_alpha
Definition: hud.qh:131
string autocvar_hud_skin
Definition: hud.qh:200
string autocvar_hud_dock_color
Definition: hud.qh:191
float time
Definition: csprogsdefs.qc:16
string autocvar__hud_panelorder
Definition: hud.qh:186
#define FOREACH(list, cond, body)
Definition: iter.qh:19
#define HUD_PANEL(NAME)
Definition: hud.qh:51
bool autocvar_hud_cursormode
Definition: hud.qh:188
#define colormapPaletteColor(c, isPants)
Definition: color.qh:5
float scoreboard_fade_alpha
Definition: scoreboard.qh:10
+ Here is the call graph for this function:

◆ HUD_ModIcons_GameType()

var void HUD_ModIcons_GameType ( vector  pos,
vector  size 
)

Referenced by HUD_ModIcons(), and HUD_ModIcons_SetFunc().

+ Here is the caller graph for this function:

◆ HUD_ModIcons_SetFunc()

void HUD_ModIcons_SetFunc ( )

Definition at line 19 of file modicons.qc.

References gametype, and HUD_ModIcons_GameType().

Referenced by NET_HANDLE().

20 {
21  HUD_ModIcons_GameType = gametype.m_modicons;
22 }
entity gametype
Definition: main.qh:30
var void HUD_ModIcons_GameType(vector pos, vector size)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HUD_Notify_Push()

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

Definition at line 19 of file notify.qc.

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_sprintf(), and minigame_prompt().

20 {
21  if (icon == "")
22  return;
23 
24  ++notify_count;
25  --notify_index;
26 
27  if (notify_index == -1)
29 
30  // Free old strings
32  strunzone(notify_attackers[notify_index]);
33 
34  if (notify_victims[notify_index])
35  strunzone(notify_victims[notify_index]);
36 
37  if (notify_icons[notify_index])
38  strunzone(notify_icons[notify_index]);
39 
40  // Allocate new strings
41  if (victim != "")
42  {
45  }
46  else
47  {
48  // In case of a notification without a victim, the attacker
49  // is displayed on the victim's side. Instead of special
50  // treatment later on, we can simply switch them here.
52  notify_victims[notify_index] = strzone(attacker);
53  }
54 
57 }
string notify_attackers[NOTIFY_MAX_ENTRIES]
Definition: hud.qh:435
string string_null
Definition: nil.qh:9
float notify_times[NOTIFY_MAX_ENTRIES]
Definition: hud.qh:434
const int NOTIFY_MAX_ENTRIES
Definition: hud.qh:429
string notify_icons[NOTIFY_MAX_ENTRIES]
Definition: hud.qh:437
float time
Definition: csprogsdefs.qc:16
int notify_index
Definition: hud.qh:432
string notify_victims[NOTIFY_MAX_ENTRIES]
Definition: hud.qh:436
int notify_count
Definition: hud.qh:433
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HUD_Panel_DrawHighlight()

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

Definition at line 377 of file hud.qc.

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

Referenced by HUD_Score(), and HUD_Score_Rankings().

378 {
379  TC(int, drawflag);
380  if(!theAlpha)
381  return;
382 
383  pos = HUD_Shift(pos);
384  mySize = HUD_Scale(mySize);
385 
386  string pic;
387  pic = strcat(hud_skin_path, "/num_leading");
388  if(precache_pic(pic) == "") {
389  pic = "gfx/hud/default/num_leading";
390  }
391 
392  drawsubpic(pos, eX * min(mySize.x * 0.5, mySize.y) + eY * mySize.y, pic, '0 0 0', '0.25 1 0', color, theAlpha, drawflag);
393  if(mySize.x/mySize.y > 2)
394  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);
395  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);
396 }
vector color
const vector eY
Definition: vector.qh:45
string hud_skin_path
Definition: hud.qh:133
vector HUD_Shift(vector v)
Definition: hud.qc:104
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
vector HUD_Scale(vector v)
Definition: hud.qc:97
#define TC(T, sym)
Definition: _all.inc:82
const vector eX
Definition: vector.qh:44
float drawsubpic(vector position, vector size, string pic, vector srcPosition, vector srcSize, vector rgb, float alpha, float flag)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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 270 of file hud.qc.

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

Referenced by Draw_ShowNames(), DrawAmmoItem(), DrawNadeProgressBar(), HUD_HealthArmor(), HUD_Mod_NexBall(), HUD_Panel_DrawStrafeHUD(), HUD_Physics(), HUD_Powerups(), HUD_StrafeHUD(), and Item_ItemsTime_Allow().

271 {
272  TC(bool, vertical); TC(int, drawflag);
273  if(!length_ratio || !theAlpha)
274  return;
275  if(length_ratio > 1)
276  length_ratio = 1;
277  if (baralign == 3)
278  {
279  if(length_ratio < -1)
280  length_ratio = -1;
281  }
282  else if(length_ratio < 0)
283  return;
284 
285  theOrigin = HUD_Shift(theOrigin);
286  theSize = HUD_Scale(theSize);
287 
288  vector square;
289  vector width, height;
290  if(vertical) {
291  pic = strcat(hud_skin_path, "/", pic, "_vertical");
292  if(precache_pic(pic) == "") {
293  pic = "gfx/hud/default/progressbar_vertical";
294  }
295 
296  if (baralign == 1) // bottom align
297  theOrigin.y += (1 - length_ratio) * theSize.y;
298  else if (baralign == 2) // center align
299  theOrigin.y += 0.5 * (1 - length_ratio) * theSize.y;
300  else if (baralign == 3) // center align, positive values down, negative up
301  {
302  theSize.y *= 0.5;
303  if (length_ratio > 0)
304  theOrigin.y += theSize.y;
305  else
306  {
307  theOrigin.y += (1 + length_ratio) * theSize.y;
308  length_ratio = -length_ratio;
309  }
310  }
311  theSize.y *= length_ratio;
312 
313  vector bH;
314  width = eX * theSize.x;
315  height = eY * theSize.y;
316  if(theSize.y <= theSize.x * 2)
317  {
318  // button not high enough
319  // draw just upper and lower part then
320  square = eY * theSize.y * 0.5;
321  bH = eY * (0.25 * theSize.y / (theSize.x * 2));
322  drawsubpic(theOrigin, square + width, pic, '0 0 0', eX + bH, theColor, theAlpha, drawflag);
323  drawsubpic(theOrigin + square, square + width, pic, eY - bH, eX + bH, theColor, theAlpha, drawflag);
324  }
325  else
326  {
327  square = eY * theSize.x;
328  drawsubpic(theOrigin, width + square, pic, '0 0 0', '1 0.25 0', theColor, theAlpha, drawflag);
329  drawsubpic(theOrigin + square, theSize - 2 * square, pic, '0 0.25 0', '1 0.5 0', theColor, theAlpha, drawflag);
330  drawsubpic(theOrigin + height - square, width + square, pic, '0 0.75 0', '1 0.25 0', theColor, theAlpha, drawflag);
331  }
332  } else {
333  pic = strcat(hud_skin_path, "/", pic);
334  if(precache_pic(pic) == "") {
335  pic = "gfx/hud/default/progressbar";
336  }
337 
338  if (baralign == 1) // right align
339  theOrigin.x += (1 - length_ratio) * theSize.x;
340  else if (baralign == 2) // center align
341  theOrigin.x += 0.5 * (1 - length_ratio) * theSize.x;
342  else if (baralign == 3) // center align, positive values on the right, negative on the left
343  {
344  theSize.x *= 0.5;
345  if (length_ratio > 0)
346  theOrigin.x += theSize.x;
347  else
348  {
349  theOrigin.x += (1 + length_ratio) * theSize.x;
350  length_ratio = -length_ratio;
351  }
352  }
353  theSize.x *= length_ratio;
354 
355  vector bW;
356  width = eX * theSize.x;
357  height = eY * theSize.y;
358  if(theSize.x <= theSize.y * 2)
359  {
360  // button not wide enough
361  // draw just left and right part then
362  square = eX * theSize.x * 0.5;
363  bW = eX * (0.25 * theSize.x / (theSize.y * 2));
364  drawsubpic(theOrigin, square + height, pic, '0 0 0', eY + bW, theColor, theAlpha, drawflag);
365  drawsubpic(theOrigin + square, square + height, pic, eX - bW, eY + bW, theColor, theAlpha, drawflag);
366  }
367  else
368  {
369  square = eX * theSize.y;
370  drawsubpic(theOrigin, height + square, pic, '0 0 0', '0.25 1 0', theColor, theAlpha, drawflag);
371  drawsubpic(theOrigin + square, theSize - 2 * square, pic, '0.25 0 0', '0.5 1 0', theColor, theAlpha, drawflag);
372  drawsubpic(theOrigin + width - square, height + square, pic, '0.75 0 0', '0.25 1 0', theColor, theAlpha, drawflag);
373  }
374  }
375 }
const vector eY
Definition: vector.qh:45
string hud_skin_path
Definition: hud.qh:133
vector HUD_Shift(vector v)
Definition: hud.qc:104
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
float height
Definition: jumppads.qh:12
vector HUD_Scale(vector v)
Definition: hud.qc:97
#define TC(T, sym)
Definition: _all.inc:82
vector(float skel, float bonenum) _skel_get_boneabs_hidden
const vector eX
Definition: vector.qh:44
float drawsubpic(vector position, vector size, string pic, vector srcPosition, vector srcSize, vector rgb, float alpha, float flag)
if(IS_DEAD(this))
Definition: impulse.qc:92
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HUD_Panel_LoadCvars()

void HUD_Panel_LoadCvars ( )

Definition at line 216 of file hud.qc.

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_Chat(), HUD_EngineInfo(), HUD_HealthArmor(), HUD_InfoMessages(), HUD_MinigameBoard(), HUD_MinigameMenu(), HUD_MinigameMenu_MouseInput(), HUD_MinigameStatus(), HUD_ModIcons(), HUD_Notify(), HUD_Physics(), HUD_Powerups(), HUD_PressedKeys(), HUD_RaceTimer(), HUD_Radar(), HUD_Radar_Mouse(), HUD_Score(), HUD_StrafeHUD(), HUD_Timer(), HUD_Weapons(), Item_ItemsTime_Allow(), MapVote_Draw(), QuickMenu_Mouse(), and Scoreboard_Draw().

217 {
218  // NOTE: in hud_configure mode cvars must be reloaded every frame
219  if (panel.update_time <= time)
220  {
221  panel_pos = stov(cvar_string(strcat("hud_panel_", panel.panel_name, "_pos")));
222  panel_size = stov(cvar_string(strcat("hud_panel_", panel.panel_name, "_size")));
224  panel_bg_str = cvar_string(strcat("hud_panel_", panel.panel_name, "_bg"));
225  panel_bg_color_str = cvar_string(strcat("hud_panel_", panel.panel_name, "_bg_color"));
226  panel_bg_color_team_str = cvar_string(strcat("hud_panel_", panel.panel_name, "_bg_color_team"));
227  panel_bg_alpha_str = cvar_string(strcat("hud_panel_", panel.panel_name, "_bg_alpha"));
228  panel_bg_border_str = cvar_string(strcat("hud_panel_", panel.panel_name, "_bg_border"));
229  panel_bg_padding_str = cvar_string(strcat("hud_panel_", panel.panel_name, "_bg_padding"));
230  HUD_Panel_GetBg();
231  if (panel.current_panel_bg != "0")
232  {
235  }
240  panel.current_panel_bg_alpha = panel_bg_alpha;
241  panel.current_panel_fg_alpha = panel_fg_alpha;
244  else
245  {
248  }
249  panel.current_panel_pos = panel_pos;
250  panel.current_panel_size = panel_size;
251  panel.current_panel_bg_border = panel_bg_border;
252  panel.current_panel_bg_color = panel_bg_color;
253  panel.current_panel_bg_color_team = panel_bg_color_team;
254  panel.current_panel_bg_padding = panel_bg_padding;
256  return;
257  }
258 
259  panel_pos = panel.current_panel_pos;
260  panel_size = panel.current_panel_size;
261  panel_bg_alpha = panel.current_panel_bg_alpha * hud_fade_alpha * panel_fade_alpha;
262  panel_bg_border = panel.current_panel_bg_border;
263  panel_bg_color = panel.current_panel_bg_color;
264  panel_bg_color_team = panel.current_panel_bg_color_team;
265  panel_bg_padding = panel.current_panel_bg_padding;
266  panel_fg_alpha = panel.current_panel_fg_alpha * hud_fade_alpha * panel_fade_alpha;
267 }
float panel_bg_border
Definition: hud.qh:169
string panel_bg_alpha_str
Definition: hud.qh:168
float panel_fg_alpha
Definition: hud.qh:166
string panel_bg_color_team_str
Definition: hud.qh:165
float panel_bg_color_team
Definition: hud.qh:164
entity highlightedPanel
Definition: hud.qh:106
#define HUD_Panel_GetBg()
Definition: hud.qh:286
bool autocvar__hud_configure
Definition: hud_config.qh:3
string panel_bg_border_str
Definition: hud.qh:170
float panel_fade_alpha
Definition: hud.qh:410
vector panel_size
Definition: hud.qh:160
#define HUD_Panel_GetPadding()
Definition: hud.qh:380
#define HUD_Panel_GetColorTeam()
Definition: hud.qh:336
#define HUD_Panel_GetFgAlpha()
Definition: hud.qh:363
string panel_bg_str
Definition: hud.qh:161
#define HUD_Panel_GetBgAlpha()
Definition: hud.qh:346
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
string panel_bg_color_str
Definition: hud.qh:163
string panel_bg_padding_str
Definition: hud.qh:172
float panel_bg_alpha
Definition: hud.qh:167
entity panel
Definition: hud.qh:144
vector panel_pos
Definition: hud.qh:159
#define HUD_Panel_UpdatePosSize_ForMenu()
Definition: hud.qh:391
#define HUD_Panel_GetColor()
Definition: hud.qh:312
float hud_configure_menu_open
Definition: hud_config.qh:21
float hud_fade_alpha
Definition: hud.qh:131
#define HUD_Panel_ScalePosSize()
Definition: hud.qh:405
#define HUD_Panel_GetBorder()
Definition: hud.qh:370
float time
Definition: csprogsdefs.qc:16
float autocvar_hud_panel_update_interval
Definition: hud.qh:202
float panel_bg_padding
Definition: hud.qh:171
vector panel_bg_color
Definition: hud.qh:162
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HUD_Radar_Clickable()

bool HUD_Radar_Clickable ( )

Definition at line 25 of file radar.qc.

References hud_panel_radar_mouse, and hud_panel_radar_temp_hidden.

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

26 {
28 }
bool hud_panel_radar_temp_hidden
Definition: hud.qh:72
bool hud_panel_radar_mouse
Definition: hud.qh:70
+ Here is the caller graph for this function:

◆ HUD_Radar_Hide_Maximized()

void HUD_Radar_Hide_Maximized ( )

Definition at line 56 of file radar.qc.

References HUD_Radar_Show_Maximized().

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

57 {
58  HUD_Radar_Show_Maximized(false,false);
59 }
void HUD_Radar_Show_Maximized(bool doshow, bool clickable)
Definition: radar.qc:30
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HUD_Radar_InputEvent()

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

Referenced by CSQC_InputEvent().

+ Here is the caller graph for this function:

◆ HUD_Radar_Mouse()

void HUD_Radar_Mouse ( )

Definition at line 134 of file radar.qc.

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_size, S_MOUSE1, S_MOUSE2, teamradar_2dcoord_to_texcoord(), teamradar_texcoord_to_3dcoord(), vector(), vid_conheight, and vid_conwidth.

Referenced by HUD_Mouse().

135 {
136  if ( !hud_panel_radar_mouse ) return;
137  if(mv_active) return;
138 
139  if ( intermission )
140  {
142  return;
143  }
144 
145  if(mouseClicked & S_MOUSE2)
146  {
148  return;
149  }
150 
151  panel = HUD_PANEL(RADAR);
153 
154 
156  panel_size_x = bound(0.2, panel_size_x, 1) * vid_conwidth;
157  panel_size_y = bound(0.2, panel_size_y, 1) * vid_conheight;
158  panel_pos_x = (vid_conwidth - panel_size_x) / 2;
159  panel_pos_y = (vid_conheight - panel_size_y) / 2;
160 
161  if(mouseClicked & S_MOUSE1)
162  {
163  // click outside
164  if ( mousepos_x < panel_pos_x || mousepos_x > panel_pos_x + panel_size_x ||
165  mousepos_y < panel_pos_y || mousepos_y > panel_pos_y + panel_size_y )
166  {
168  return;
169  }
171  localcmd(sprintf("cmd ons_spawn %f %f %f",pos_x,pos_y,pos_z));
172 
174  return;
175  }
176 }
float vid_conheight
vector panel_size
Definition: hud.qh:160
float intermission
Definition: csprogsdefs.qc:148
float vid_conwidth
float mv_active
Definition: mapvoting.qh:19
vector autocvar_hud_panel_radar_maximized_size
Definition: radar.qh:8
vector teamradar_2dcoord_to_texcoord(vector in)
Definition: teamradar.qc:33
int mouseClicked
Definition: hud_config.qh:12
bool hud_panel_radar_mouse
Definition: hud.qh:70
entity panel
Definition: hud.qh:144
vector(float skel, float bonenum) _skel_get_boneabs_hidden
void HUD_Radar_Hide_Maximized()
Definition: radar.qc:56
vector teamradar_texcoord_to_3dcoord(vector in, float oz)
Definition: teamradar.qc:51
vector mousepos
Definition: hud.qh:102
const int S_MOUSE2
Definition: hud_config.qh:10
const int S_MOUSE1
Definition: hud_config.qh:9
#define HUD_PANEL(NAME)
Definition: hud.qh:51
void HUD_Panel_LoadCvars()
Definition: hud.qc:216
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HUD_Reset()

void HUD_Reset ( )

Definition at line 561 of file hud.qc.

References gametype.

Referenced by HUD_Main().

562 {
563  // reset gametype specific icons
564  if(gametype.m_modicons_reset)
565  gametype.m_modicons_reset();
566 }
entity gametype
Definition: main.qh:30
+ Here is the caller graph for this function:

◆ HUD_Scale()

vector HUD_Scale ( vector  v)

Definition at line 97 of file hud.qc.

References HUD_ScaleX, HUD_ScaleY, and v.

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

98 {
99  v.x = HUD_ScaleX(v.x);
100  v.y = HUD_ScaleY(v.y);
101  return v;
102 }
#define HUD_ScaleX(f)
Definition: hud.qh:15
vector v
Definition: ent_cs.qc:116
#define HUD_ScaleY(f)
Definition: hud.qh:16
+ Here is the caller graph for this function:

◆ HUD_Scale_Disable()

void HUD_Scale_Disable ( )

Definition at line 83 of file hud.qc.

References drawfontscale, hud_scale, and hud_shift.

Referenced by CSQC_UpdateView(), HUD_Ammo(), HUD_Chat(), Hud_Dynamic_Frame(), HUD_EngineInfo(), HUD_HealthArmor(), HUD_InfoMessages(), HUD_MinigameMenu(), HUD_MinigameStatus(), HUD_ModIcons(), HUD_Notify(), HUD_Physics(), HUD_Powerups(), HUD_PressedKeys(), HUD_RaceTimer(), HUD_Radar(), HUD_Score(), HUD_StrafeHUD(), HUD_Timer(), HUD_Weapons(), MapVote_Draw(), and Scoreboard_Draw().

84 {
85  hud_scale = '1 1 0';
86  hud_shift = '0 0 0';
88 }
vector hud_scale
Definition: hud.qh:216
vector drawfontscale
Definition: draw.qh:3
vector hud_shift
Definition: hud.qh:218
+ Here is the caller graph for this function:

◆ HUD_Scale_Enable()

void HUD_Scale_Enable ( )

Definition at line 90 of file hud.qc.

References drawfontscale, hud_scale, hud_scale_current, hud_shift, and hud_shift_current.

Referenced by HUD_Ammo(), HUD_Draw(), HUD_EngineInfo(), HUD_HealthArmor(), HUD_InfoMessages(), HUD_ModIcons(), HUD_Notify(), HUD_Physics(), HUD_Powerups(), HUD_PressedKeys(), HUD_RaceTimer(), HUD_Radar(), HUD_Score(), HUD_StrafeHUD(), HUD_Timer(), HUD_Weapons(), Item_ItemsTime_Allow(), and Scoreboard_Draw().

91 {
95 }
vector hud_scale
Definition: hud.qh:216
vector hud_scale_current
Definition: hud.qh:217
vector drawfontscale
Definition: draw.qh:3
vector hud_shift
Definition: hud.qh:218
vector hud_shift_current
Definition: hud.qh:219
+ Here is the caller graph for this function:

◆ HUD_Shift()

vector HUD_Shift ( vector  v)

Definition at line 104 of file hud.qc.

References HUD_ShiftX, HUD_ShiftY, and v.

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

105 {
106  v.x = HUD_ShiftX(v.x);
107  v.y = HUD_ShiftY(v.y);
108  return v;
109 }
#define HUD_ShiftX(f)
Definition: hud.qh:17
vector v
Definition: ent_cs.qc:116
#define HUD_ShiftY(f)
Definition: hud.qh:18
+ Here is the caller graph for this function:

◆ HUD_WouldShowCursor()

bool HUD_WouldShowCursor ( )

Definition at line 670 of file hud.qc.

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

Referenced by HUD_Main().

671 {
673  return true;
674  if(mv_active)
675  return true;
676  //entity local_player = ((csqcplayer) ? csqcplayer : CSQCModel_server2csqc(player_localentnum - 1)); // TODO: doesn't use regular cursor handling
677  //if(local_player.viewloc && (local_player.viewloc.spawnflags & VIEWLOC_FREEAIM))
678  //return true;
679  if(HUD_Radar_Clickable())
680  return true;
682  return true;
683  if(QuickMenu_IsOpened())
684  return true;
685  return false;
686 }
bool HUD_MinigameMenu_IsOpened()
bool autocvar__hud_configure
Definition: hud_config.qh:3
float mv_active
Definition: mapvoting.qh:19
bool HUD_Radar_Clickable()
Definition: radar.qc:25
bool QuickMenu_IsOpened()
Definition: quickmenu.qc:244
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LoadMenuSkinValues()

void LoadMenuSkinValues ( )

Definition at line 42 of file hud.qc.

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

Referenced by CSQC_Init().

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/default";
59  fh = fopen(strcat(draw_currentSkin, "/skinvalues.txt"), FILE_READ);
60  }
61 
63 
64  if(fh >= 0)
65  {
66  string s;
67  while((s = fgets(fh)))
68  {
69  int n = tokenize_console(s);
70  if (n < 2)
71  continue;
72  if(substring(argv(0), 0, 2) == "//")
73  continue;
74  if(argv(0) == "SIZE_CURSOR")
76  else if(argv(0) == "OFFSET_CURSOR")
78  }
79  fclose(fh);
80  }
81 }
vector SIZE_CURSOR
Definition: hud.qh:7
string draw_currentSkin
Definition: util.qh:45
const float FILE_READ
Definition: csprogsdefs.qc:231
#define argv_end_index
Definition: dpextensions.qh:30
#define argv_start_index
Definition: dpextensions.qh:27
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
#define tokenize_console
Definition: dpextensions.qh:24
vector OFFSET_CURSOR
Definition: hud.qh:6
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MakeRaceString()

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

Definition at line 13 of file racetimer.qc.

References autocvar_cl_race_cptimes_showself, ftos_decimals(), strcat(), TC, and TIME_DECIMALS.

14 {
15  TC(int, cp);
16  string cpname, lapstr = "", timestr = "", col = "^7", othercol = "^7", othertimestr = "";
17  if(theirname == "" || !autocvar_cl_race_cptimes_showself)
18  othertime = 0; // don't count personal time
19 
20  if(theirtime == 0) // goal hit
21  {
22  if(mytime > 0)
23  {
24  timestr = strcat("+", ftos_decimals(+mytime, TIME_DECIMALS));
25  col = "^1";
26  }
27  else if(mytime == 0)
28  {
29  timestr = "+0.0";
30  col = "^3";
31  }
32  else
33  {
34  timestr = strcat("-", ftos_decimals(-mytime, TIME_DECIMALS));
35  col = "^2";
36  }
37 
38  if(othertime > 0)
39  {
40  othertimestr = strcat("+", ftos_decimals(+othertime, TIME_DECIMALS));
41  othercol = "^1";
42  }
43  else if(othertime == 0)
44  {
45  othertimestr = "+0.0";
46  othercol = "^3";
47  }
48  else
49  {
50  othertimestr = strcat("-", ftos_decimals(-othertime, TIME_DECIMALS));
51  othercol = "^2";
52  }
53 
54  if(lapdelta > 0)
55  {
56  lapstr = sprintf(_(" (-%dL)"), lapdelta);
57  col = "^2";
58  }
59  else if(lapdelta < 0)
60  {
61  lapstr = sprintf(_(" (+%dL)"), -lapdelta);
62  col = "^1";
63  }
64  }
65  else if(theirtime > 0) // anticipation
66  {
67  if(mytime >= theirtime)
68  timestr = strcat("+", ftos_decimals(mytime - theirtime, TIME_DECIMALS));
69  else
70  timestr = TIME_ENCODED_TOSTRING(TIME_ENCODE(theirtime));
71  col = "^3";
72  if(mytime >= othertime)
73  othertimestr = strcat("+", ftos_decimals(mytime - othertime, TIME_DECIMALS));
74  else
75  othertimestr = TIME_ENCODED_TOSTRING(TIME_ENCODE(othertime));
76  othercol = "^7";
77  }
78 
79  if(cp == 254)
80  cpname = _("Start line");
81  else if(cp == 255)
82  cpname = _("Finish line");
83  else if(cp)
84  cpname = sprintf(_("Intermediate %d"), cp);
85  else
86  cpname = _("Finish line");
87 
88  if(theirtime < 0)
89  return strcat(col, cpname);
90  else if(theirname == "")
91  return strcat(col, sprintf("%s (%s)", cpname, timestr));
92  else if(othertime)
93  return strcat(col, sprintf("%s %s(%s)%s (%s %s)", cpname, othercol, othertimestr, col, timestr, strcat(ColorTranslateRGB(theirname), col, lapstr)));
94  else
95  return strcat(col, sprintf("%s (%s %s)", cpname, timestr, strcat(ColorTranslateRGB(theirname), col, lapstr)));
96 }
ERASEABLE string ftos_decimals(float number, int decimals)
converts a number to a string with the indicated number of decimals
Definition: string.qh:450
#define TIME_ENCODED_TOSTRING(n)
Definition: util.qh:57
#define TIME_ENCODE(t)
Definition: util.qh:61
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
ERASEABLE string ColorTranslateRGB(string s)
Definition: string.qh:177
#define TC(T, sym)
Definition: _all.inc:82
const int TIME_DECIMALS
Definition: util.qh:55
bool autocvar_cl_race_cptimes_showself
Definition: main.qh:21
+ Here is the call graph for this function:

◆ QuickMenu_IsOpened()

bool QuickMenu_IsOpened ( )

Definition at line 244 of file quickmenu.qc.

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

245 {
246  return (QuickMenu_Page_Entries > 0);
247 }
int QuickMenu_Page_Entries
Definition: quickmenu.qc:23
+ Here is the caller graph for this function:

◆ race_CheckName()

int race_CheckName ( string  net_name)

Definition at line 17 of file cl_race.qc.

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

18 {
19  int rank = 0;
20  string zoned_name = strzone(strdecolorize(entcs_GetName(player_localnum)));
21  for (int i = RANKINGS_CNT - 1; i >= 0; --i)
22  if (strdecolorize(grecordholder[i]) == zoned_name)
23  {
24  rank = i + 1;
25  break;
26  }
27  strfree(zoned_name);
28  return rank;
29 }
string grecordholder[RANKINGS_CNT]
Definition: main.qh:67
#define strfree(this)
Definition: string.qh:56
float player_localnum
Definition: csprogsdefs.qc:20
+ Here is the call graph for this function:

◆ REGISTER_HUD_PANEL() [1/13]

REGISTER_HUD_PANEL ( WEAPONS  ,
HUD_Weapons  ,
PANEL_CONFIG_MAIN PANEL_CONFIG_CANBEOFF,
PANEL_SHOW_MAINGAME   
)

◆ REGISTER_HUD_PANEL() [2/13]

PANEL_CONFIG_MAIN PANEL_SHOW_MAINGAME REGISTER_HUD_PANEL ( POWERUPS  ,
HUD_Powerups  ,
PANEL_CONFIG_MAIN PANEL_CONFIG_CANBEOFF,
PANEL_SHOW_MAINGAME   
)

◆ REGISTER_HUD_PANEL() [3/13]

PANEL_CONFIG_MAIN PANEL_SHOW_MAINGAME PANEL_CONFIG_MAIN PANEL_SHOW_MAINGAME REGISTER_HUD_PANEL ( NOTIFY  ,
HUD_Notify  ,
PANEL_CONFIG_MAIN PANEL_CONFIG_CANBEOFF,
PANEL_SHOW_MAINGAME|PANEL_SHOW_MINIGAME PANEL_SHOW_WITH_SB 
)

◆ REGISTER_HUD_PANEL() [4/13]

◆ REGISTER_HUD_PANEL() [5/13]

◆ REGISTER_HUD_PANEL() [6/13]

◆ REGISTER_HUD_PANEL() [7/13]

◆ REGISTER_HUD_PANEL() [8/13]

◆ REGISTER_HUD_PANEL() [9/13]

◆ REGISTER_HUD_PANEL() [10/13]

◆ REGISTER_HUD_PANEL() [11/13]

◆ REGISTER_HUD_PANEL() [12/13]

◆ REGISTER_HUD_PANEL() [13/13]

Variable Documentation

◆ armor_beforedamage

int armor_beforedamage

Definition at line 240 of file hud.qh.

Referenced by HUD_HealthArmor().

◆ armor_damagetime

float armor_damagetime

Definition at line 239 of file hud.qh.

Referenced by HUD_HealthArmor().

◆ autocvar__hud_panelorder

string autocvar__hud_panelorder

Definition at line 186 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 188 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 189 of file hud.qh.

Referenced by HUD_Main(), and HUD_Panel_InputEvent().

◆ autocvar_hud_dock_alpha

float autocvar_hud_dock_alpha

Definition at line 190 of file hud.qh.

Referenced by HUD_Main().

◆ autocvar_hud_dock_color

string autocvar_hud_dock_color

Definition at line 191 of file hud.qh.

Referenced by HUD_Main().

◆ autocvar_hud_dock_color_team

bool autocvar_hud_dock_color_team

Definition at line 192 of file hud.qh.

Referenced by HUD_Main().

◆ autocvar_hud_dynamic_follow

float autocvar_hud_dynamic_follow

Definition at line 204 of file hud.qh.

Referenced by Hud_Dynamic_Frame().

◆ autocvar_hud_dynamic_follow_scale

float autocvar_hud_dynamic_follow_scale

Definition at line 205 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 206 of file hud.qh.

Referenced by Hud_Dynamic_Frame().

◆ autocvar_hud_panel_bg

string autocvar_hud_panel_bg

Definition at line 193 of file hud.qh.

◆ autocvar_hud_panel_bg_alpha

float autocvar_hud_panel_bg_alpha

Definition at line 194 of file hud.qh.

Referenced by Vehicles_drawHUD().

◆ autocvar_hud_panel_bg_border

float autocvar_hud_panel_bg_border

Definition at line 195 of file hud.qh.

◆ autocvar_hud_panel_bg_color

vector autocvar_hud_panel_bg_color

Definition at line 196 of file hud.qh.

Referenced by Vehicles_drawHUD().

◆ autocvar_hud_panel_bg_color_team

float autocvar_hud_panel_bg_color_team

Definition at line 197 of file hud.qh.

Referenced by Vehicles_drawHUD().

◆ autocvar_hud_panel_bg_padding

float autocvar_hud_panel_bg_padding

Definition at line 198 of file hud.qh.

◆ autocvar_hud_panel_fg_alpha

float autocvar_hud_panel_fg_alpha

Definition at line 199 of file hud.qh.

Referenced by turret_draw2d(), and Vehicles_drawHUD().

◆ autocvar_hud_panel_update_interval

float autocvar_hud_panel_update_interval

Definition at line 202 of file hud.qh.

Referenced by HUD_Panel_LoadCvars().

◆ autocvar_hud_progressbar_alpha

◆ autocvar_hud_skin

string autocvar_hud_skin

Definition at line 200 of file hud.qh.

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

◆ BORDER_MULTIPLIER

const float BORDER_MULTIPLIER = 4

Definition at line 109 of file hud.qh.

Referenced by minigame_hud_simpleboard().

◆ chat_panel_modified

bool chat_panel_modified

Definition at line 73 of file hud.qh.

Referenced by HUD_Chat().

◆ chat_posy

float chat_posy

Definition at line 179 of file hud.qh.

Referenced by HUD_Chat(), and MapVote_Draw().

◆ chat_sizey

float chat_sizey

Definition at line 180 of file hud.qh.

Referenced by HUD_Chat(), and MapVote_Draw().

◆ cl_followmodel_ofs

vector cl_followmodel_ofs

Definition at line 213 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 214 of file hud.qh.

Referenced by calc_followmodel_ofs().

◆ complain_weapon

entity complain_weapon

Definition at line 112 of file hud.qh.

Referenced by HUD_Weapons(), and NET_HANDLE().

◆ complain_weapon_time

float complain_weapon_time

Definition at line 114 of file hud.qh.

Referenced by HUD_Weapons(), and NET_HANDLE().

◆ complain_weapon_type

int complain_weapon_type

Definition at line 113 of file hud.qh.

Referenced by HUD_Weapons(), and NET_HANDLE().

◆ current_player

float current_player

◆ health_beforedamage

int health_beforedamage

Definition at line 240 of file hud.qh.

Referenced by HUD_HealthArmor().

◆ health_damagetime

float health_damagetime

Definition at line 239 of file hud.qh.

Referenced by HUD_HealthArmor().

◆ highlightedAction

float highlightedAction

Definition at line 107 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 138 of file hud.qh.

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

◆ HUD_Ammo

HUD_Ammo

Definition at line 251 of file hud.qh.

◆ hud_draw_maximized

bool hud_draw_maximized

Definition at line 68 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 209 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 208 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 210 of file hud.qh.

Referenced by Hud_Dynamic_Frame(), and Hud_Shake_Update().

◆ HUD_EngineInfo

◆ hud_fade_alpha

float hud_fade_alpha

Definition at line 131 of file hud.qh.

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

◆ HUD_HealthArmor

Definition at line 253 of file hud.qh.

◆ HUD_MinigameBoard

◆ HUD_MinigameHelp

◆ hud_panel_radar_bottom

float hud_panel_radar_bottom

Definition at line 71 of file hud.qh.

◆ hud_panel_radar_maximized

bool hud_panel_radar_maximized

◆ 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 66 of file hud.qh.

Referenced by HUD_Main(), and HUD_Panel_FirstInDrawQ().

◆ HUD_Physics

◆ HUD_PressedKeys

◆ HUD_QuickMenu

◆ hud_scale

◆ hud_scale_center

vector hud_scale_center

Definition at line 220 of file hud.qh.

Referenced by Hud_Dynamic_Frame().

◆ hud_scale_current

vector hud_scale_current = '1 1 0'

Definition at line 217 of file hud.qh.

Referenced by Hud_Dynamic_Frame(), and HUD_Scale_Enable().

◆ HUD_Score

◆ hud_shift

vector hud_shift

Definition at line 218 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 219 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 134 of file hud.qh.

Referenced by HUD_Main().

◆ HUD_StrafeHUD

◆ HUD_Timer

◆ HUD_Vote

◆ hudShiftState

◆ last_activeweapon

Weapon last_activeweapon

Definition at line 120 of file hud.qh.

◆ last_switchweapon

Weapon last_switchweapon

Definition at line 119 of file hud.qh.

◆ MapVote_Draw

◆ mousepos

◆ myteamcolors

vector myteamcolors

Definition at line 136 of file hud.qh.

Referenced by HUD_Main(), and Vehicles_drawHUD().

◆ notify_attackers

string notify_attackers[NOTIFY_MAX_ENTRIES]

Definition at line 435 of file hud.qh.

Referenced by HUD_Notify_Push().

◆ notify_count

int notify_count

Definition at line 433 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 430 of file hud.qh.

Referenced by HUD_Notify().

◆ notify_icons

string notify_icons[NOTIFY_MAX_ENTRIES]

Definition at line 437 of file hud.qh.

Referenced by HUD_Notify_Push().

◆ notify_index

int notify_index

Definition at line 432 of file hud.qh.

Referenced by HUD_Notify(), and HUD_Notify_Push().

◆ NOTIFY_MAX_ENTRIES

const int NOTIFY_MAX_ENTRIES = 10

Definition at line 429 of file hud.qh.

Referenced by HUD_Notify(), and HUD_Notify_Push().

◆ notify_times

float notify_times[NOTIFY_MAX_ENTRIES]

Definition at line 434 of file hud.qh.

Referenced by HUD_Notify_Push().

◆ notify_victims

string notify_victims[NOTIFY_MAX_ENTRIES]

Definition at line 436 of file hud.qh.

Referenced by HUD_Notify_Push().

◆ OFFSET_CURSOR

vector OFFSET_CURSOR = '0 0 0'

Definition at line 6 of file hud.qh.

Referenced by draw_cursor_normal(), and LoadMenuSkinValues().

◆ old_p_armor

int old_p_armor

Definition at line 242 of file hud.qh.

Referenced by HUD_HealthArmor().

◆ old_p_armortime

float old_p_armortime

Definition at line 243 of file hud.qh.

Referenced by HUD_HealthArmor().

◆ old_p_health

int old_p_health

Definition at line 242 of file hud.qh.

Referenced by HUD_HealthArmor().

◆ old_p_healthtime

float old_p_healthtime

Definition at line 243 of file hud.qh.

Referenced by HUD_HealthArmor().

◆ panel

◆ panel_bg_alpha

float panel_bg_alpha

◆ panel_bg_alpha_str

string panel_bg_alpha_str

Definition at line 168 of file hud.qh.

Referenced by HUD_Panel_LoadCvars().

◆ panel_bg_border

◆ panel_bg_border_str

string panel_bg_border_str

Definition at line 170 of file hud.qh.

Referenced by HUD_Panel_LoadCvars().

◆ panel_bg_color

vector panel_bg_color

Definition at line 162 of file hud.qh.

Referenced by HUD_Panel_LoadCvars(), and minigame_hud_simpleboard().

◆ panel_bg_color_str

string panel_bg_color_str

Definition at line 163 of file hud.qh.

Referenced by HUD_Panel_LoadCvars().

◆ panel_bg_color_team

float panel_bg_color_team

Definition at line 164 of file hud.qh.

Referenced by HUD_Panel_LoadCvars().

◆ panel_bg_color_team_str

string panel_bg_color_team_str

Definition at line 165 of file hud.qh.

Referenced by HUD_Panel_LoadCvars().

◆ panel_bg_padding

◆ panel_bg_padding_str

string panel_bg_padding_str

Definition at line 172 of file hud.qh.

Referenced by HUD_Panel_LoadCvars().

◆ panel_bg_str

string panel_bg_str

Definition at line 161 of file hud.qh.

Referenced by HUD_Panel_LoadCvars().

◆ panel_click_distance

vector panel_click_distance

Definition at line 103 of file hud.qh.

Referenced by HUD_Panel_Highlight(), and HUD_Panel_Mouse().

◆ panel_click_resizeorigin

vector panel_click_resizeorigin

◆ PANEL_CONFIG_CANBEOFF

◆ PANEL_CONFIG_MAIN

◆ PANEL_CONFIG_NO

◆ panel_configflags

int panel_configflags

Definition at line 230 of file hud.qh.

◆ panel_enabled

float panel_enabled

Definition at line 158 of file hud.qh.

Referenced by HUD_Panel_CheckMove(), and HUD_Panel_CheckResize().

◆ panel_fade_alpha

float panel_fade_alpha

Definition at line 410 of file hud.qh.

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

◆ panel_fg_alpha

◆ panel_order

int panel_order[REGISTRY_MAX(hud_panels)]

◆ panel_pos

◆ panel_pos_backup

vector panel_pos_backup

Definition at line 139 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 225 of file hud.qh.

Referenced by HUD_Panel_Draw().

◆ PANEL_SHOW_MAPVOTE

const int PANEL_SHOW_MAPVOTE = BIT(2)

Definition at line 227 of file hud.qh.

Referenced by HUD_Panel_Draw().

◆ PANEL_SHOW_MINIGAME

const int PANEL_SHOW_MINIGAME = BIT(1)

Definition at line 226 of file hud.qh.

Referenced by HUD_Panel_Draw().

◆ PANEL_SHOW_WITH_SB

const int PANEL_SHOW_WITH_SB = BIT(3)

Definition at line 228 of file hud.qh.

Referenced by HUD_Panel_Draw().

◆ panel_showflags

int panel_showflags

Definition at line 224 of file hud.qh.

◆ panel_size

◆ panel_size_backup

vector panel_size_backup

Definition at line 140 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 142 of file hud.qh.

Referenced by HUD_Panel_InputEvent().

◆ prev_armor

int prev_armor

Definition at line 238 of file hud.qh.

Referenced by HUD_HealthArmor().

◆ prev_health

int prev_health

Definition at line 238 of file hud.qh.

Referenced by HUD_HealthArmor(), and NET_HANDLE().

◆ prev_p_armor

int prev_p_armor

Definition at line 246 of file hud.qh.

Referenced by HUD_HealthArmor().

◆ prev_p_health

int prev_p_health

Definition at line 246 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 74 of file hud.qh.

Referenced by HUD_Radar().

◆ resizeCorner

◆ S_ALT

◆ S_CTRL

◆ S_SHIFT

◆ SIZE_CURSOR

vector SIZE_CURSOR = '32 32 0'

Definition at line 7 of file hud.qh.

Referenced by draw_cursor(), and LoadMenuSkinValues().

◆ teamnagger

float teamnagger

Definition at line 124 of file hud.qh.

Referenced by NET_HANDLE().

◆ ts_primary

int ts_primary

Definition at line 117 of file hud.qh.

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

◆ ts_secondary

int ts_secondary

Definition at line 117 of file hud.qh.

Referenced by Scoreboard_CompareTeamScores(), and Scoreboard_InitScores().

◆ vote_active

int vote_active

Definition at line 97 of file hud.qh.

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

◆ vote_alpha

float vote_alpha

Definition at line 99 of file hud.qh.

◆ vote_change

float vote_change

Definition at line 100 of file hud.qh.

Referenced by LocalCommand_handlevote().

◆ vote_highlighted

int vote_highlighted

Definition at line 95 of file hud.qh.

Referenced by NET_HANDLE().

◆ vote_needed

int vote_needed

Definition at line 94 of file hud.qh.

Referenced by NET_HANDLE().

◆ vote_nocount

int vote_nocount

Definition at line 93 of file hud.qh.

Referenced by HUD_Vote(), and NET_HANDLE().

◆ vote_prev

int vote_prev

Definition at line 98 of file hud.qh.

Referenced by LocalCommand_handlevote().

◆ vote_yescount

int vote_yescount

Definition at line 92 of file hud.qh.

Referenced by HUD_Vote(), and NET_HANDLE().

◆ weapon_accuracy

int weapon_accuracy[REGISTRY_MAX(Weapons)]

◆ weaponprevtime

float weaponprevtime

Definition at line 122 of file hud.qh.

Referenced by HUD_Weapons().

◆ weapontime

float weapontime

Definition at line 121 of file hud.qh.

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