Xonotic
modicons.qc
Go to the documentation of this file.
1 #include "modicons.qh"
2 
3 #include <client/draw.qh>
4 #include <common/ent_cs.qh>
7 #include <common/mapinfo.qh>
8 #include <common/scores.qh>
9 
10 // Mod icons (#10)
11 
12 void HUD_ModIcons_Export(int fh)
13 {
14  // allow saving cvars that aesthetically change the panel into hud skin files
15 
16  FOREACH(Gametypes, it.m_modicons_export, it.m_modicons_export(fh));
17 }
18 
20 {
21  HUD_ModIcons_GameType = gametype.m_modicons;
22 }
23 
24 float mod_alpha;
25 
27 {
29  {
30  if(!autocvar_hud_panel_modicons) return;
31  if(!HUD_ModIcons_GameType) return;
32  }
33 
35  mod_alpha = min(mod_alpha + frametime * 2, 1);
36  else
37  mod_alpha = max(mod_alpha - frametime * 2, 0);
38 
39  //if(mod_alpha <= 0)
40  // return;
43 
45 
48  else
50 
52 
54  {
55  panel_pos += '1 1 0' * panel_bg_padding;
56  panel_size -= '2 2 0' * panel_bg_padding;
57  }
58 
61  else
63 
65 }
#define draw_endBoldFont()
Definition: draw.qh:5
float mod_alpha
Definition: modicons.qc:24
bool autocvar_hud_panel_modicons_dynamichud
Definition: modicons.qh:5
bool autocvar__hud_configure
Definition: hud_config.qh:3
bool mod_active
Definition: modicons.qh:7
#define draw_beginBoldFont()
Definition: draw.qh:4
float panel_fade_alpha
Definition: hud.qh:410
vector panel_size
Definition: hud.qh:160
void HUD_Scale_Disable()
Definition: hud.qc:83
void HUD_ModIcons_Export(int fh)
Definition: modicons.qc:12
void HUD_Mod_CTF(vector pos, vector mySize)
Definition: cl_ctf.qc:21
#define HUD_Panel_DrawBg()
Definition: hud.qh:54
void HUD_ModIcons_SetFunc()
Definition: modicons.qc:19
void HUD_Scale_Enable()
Definition: hud.qc:90
float frametime
Definition: csprogsdefs.qc:17
entity gametype
Definition: main.qh:30
void HUD_ModIcons()
Definition: modicons.qc:26
vector panel_pos
Definition: hud.qh:159
bool autocvar_hud_panel_modicons
Definition: modicons.qh:4
#define FOREACH(list, cond, body)
Definition: iter.qh:19
var void HUD_ModIcons_GameType(vector pos, vector size)
void HUD_Panel_LoadCvars()
Definition: hud.qc:216
float panel_bg_padding
Definition: hud.qh:171