X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fhud%2Fhud.qh;h=0eb81916cec1562540c718b4589fb0a2c7dd640d;hb=d77d35f12d537628d021b946d5fd6aa20734042d;hp=1021d7067e06f3db382643a172be9a6463bd3999;hpb=90d9f7c775306324957323d53d5a4ad995d999e3;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/hud/hud.qh b/qcsrc/client/hud/hud.qh index 1021d7067..0eb81916c 100644 --- a/qcsrc/client/hud/hud.qh +++ b/qcsrc/client/hud/hud.qh @@ -9,6 +9,18 @@ void draw_cursor(vector pos, vector ofs, string img, vector col, float a); void draw_cursor_normal(vector pos, vector col, float a); void LoadMenuSkinValues(); +void HUD_Scale_Disable(); +void HUD_Scale_Enable(); + +#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)) +vector HUD_Scale(vector v); +vector HUD_Shift(vector v); + +vector HUD_GetFontsize(string cvarname); + void Hud_Dynamic_Frame(); bool HUD_Radar_Clickable(); @@ -66,8 +78,8 @@ void HUD_Radar_Hide_Maximized(); float HUD_GetRowCount(int item_count, vector size, float item_aspect); vector HUD_Get_Num_Color(float hp, float maxvalue, bool blink); -void DrawNumIcon(vector myPos, vector mySize, float theTime, string icon, bool vertical, bool icon_right_align, vector color, float theAlpha); -void DrawNumIcon_expanding(vector myPos, vector mySize, float theTime, string icon, bool vertical, int icon_right_align, vector color, float theAlpha, float fadelerp); +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); void HUD_Panel_DrawHighlight(vector pos, vector mySize, vector color, float theAlpha, int drawflag); vector HUD_GetTableSize_BestItemAR(int item_count, vector psize, float item_aspect); @@ -95,7 +107,6 @@ entity highlightedPanel; float highlightedAction; // 0 = nothing, 1 = move, 2 = resize const float BORDER_MULTIPLIER = 4; -float scoreboard_bottom; int weapon_accuracy[REGISTRY_MAX(Weapons)]; entity complain_weapon; @@ -110,12 +121,14 @@ int ts_primary, ts_secondary; float weapontime; float weaponprevtime; +float timer; float teamnagger; int hudShiftState; const int S_SHIFT = 1; const int S_CTRL = 2; const int S_ALT = 4; +const int S_TAB = 8; float hud_fade_alpha; @@ -170,6 +183,26 @@ float chat_sizey; float current_player; +float autocvar__menu_alpha; // updated by the menu VM, useful to tell when the menu is being drawn + +string autocvar__hud_panelorder; + +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; +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; +string autocvar_hud_skin; +float autocvar_hud_progressbar_alpha; +float autocvar_hud_panel_update_interval; + float autocvar_hud_dynamic_follow; float autocvar_hud_dynamic_follow_scale; vector autocvar_hud_dynamic_follow_scale_xyz; @@ -220,7 +253,7 @@ REGISTER_HUD_PANEL(WEAPONS, HUD_Weapons, PANEL_CONFIG_MAIN | PANE REGISTER_HUD_PANEL(AMMO, HUD_Ammo, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // AMMO REGISTER_HUD_PANEL(POWERUPS, HUD_Powerups, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // POWERUPS REGISTER_HUD_PANEL(HEALTHARMOR, HUD_HealthArmor, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // HEALTHARMOR -REGISTER_HUD_PANEL(NOTIFY, HUD_Notify, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME ) // NOTIFY +REGISTER_HUD_PANEL(NOTIFY, HUD_Notify, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_WITH_SB) // NOTIFY REGISTER_HUD_PANEL(TIMER, HUD_Timer, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_WITH_SB) // TIMER REGISTER_HUD_PANEL(RADAR, HUD_Radar, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // RADAR REGISTER_HUD_PANEL(SCORE, HUD_Score, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME ) // SCORE @@ -241,6 +274,8 @@ REGISTER_HUD_PANEL(MAPVOTE, MapVote_Draw, PANEL_CONFIG_NO REGISTER_HUD_PANEL(ITEMSTIME, HUD_ItemsTime, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // ITEMSTIME REGISTER_HUD_PANEL(QUICKMENU, HUD_QuickMenu, PANEL_CONFIG_MAIN , PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME ) // QUICKMENU REGISTER_HUD_PANEL(SCOREBOARD, Scoreboard_Draw, PANEL_CONFIG_NO , PANEL_SHOW_MAINGAME | PANEL_SHOW_MINIGAME | PANEL_SHOW_MAPVOTE | PANEL_SHOW_WITH_SB) // SCOREBOARD +REGISTER_HUD_PANEL(STRAFEHUD, HUD_StrafeHUD, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // STRAFEHUD +REGISTER_HUD_PANEL(PICKUP, HUD_Pickup, PANEL_CONFIG_MAIN | PANEL_CONFIG_CANBEOFF, PANEL_SHOW_MAINGAME ) // PICKUP // always add new panels to the end of list // Because calling lots of functions in QC apparently cuts fps in half on many machines: