Gametypes: propagate entity references, set limit to 24 due to use of bitflags
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / main.qh
1 #pragma once
2
3 #include <common/constants.qh>
4 #include <common/weapons/all.qh>
5
6 // --------------------------------------------------------------------------
7 // MENU Functionality
8
9 // --------------------------------------------------------------------------
10 // Onslaught
11
12 // Map coordinate base calculations need these
13 vector mi_center;
14 vector mi_scale;
15 // Minimap
16 string minimapname;
17
18 // --------------------------------------------------------------------------
19 // General stuff
20
21 float postinit;
22 entity gametype;
23
24 //float sorted_players;
25 //float sorted_teams;
26
27 // Defs
28 //.float ctf_state;
29 //.float health;
30
31 float FONT_USER = 8;
32
33
34 vector OFFSET_CURSOR = '0 0 0';
35 vector SIZE_CURSOR = '32 32 0';
36 void draw_cursor(vector pos, vector ofs, string img, vector col, float a);
37 void draw_cursor_normal(vector pos, vector col, float a);
38 void LoadMenuSkinValues();
39
40 // --------------------------------------------------------------------------
41 // Scoreboard stuff
42
43 const int MAX_HUD_FIELDS = MAX_SCORE;
44
45 PlayerScoreField hud_field[MAX_HUD_FIELDS + 1];
46 float hud_size[MAX_HUD_FIELDS + 1];
47 string hud_title[MAX_HUD_FIELDS + 1];
48 int hud_num_fields;
49
50 vector hud_fontsize;
51
52 float RANKINGS_RECEIVED_CNT;
53 string grecordholder[RANKINGS_CNT];
54 float grecordtime[RANKINGS_CNT];
55 //float csqc_flags;
56
57 entity playerslots[255]; // 255 is engine limit on maxclients
58 entity teamslots[17];    // 17 teams (including "spectator team")
59 .float gotscores;
60 .entity owner;
61 .float ready;
62 .float eliminated;
63
64 .void(entity) draw;
65 IntrusiveList g_drawables;
66 STATIC_INIT(g_drawables) { g_drawables = IL_NEW(); }
67 .void(entity) draw2d;
68 IntrusiveList g_drawables_2d;
69 STATIC_INIT(g_drawables_2d) { g_drawables_2d = IL_NEW(); }
70 .void(entity) entremove;
71 float drawframetime;
72 vector view_origin, view_forward, view_right, view_up;
73
74 IntrusiveList g_radarlinks;
75 STATIC_INIT(g_radarlinks) { g_radarlinks = IL_NEW(); }
76 IntrusiveList g_radaricons;
77 STATIC_INIT(g_radaricons) { g_radaricons = IL_NEW(); }
78
79 bool button_zoom;
80 bool spectatorbutton_zoom;
81 bool button_attack2;
82
83 Weapon activeweapon;
84 Weapon switchingweapon;
85 Weapon switchweapon;
86 float current_viewzoom;
87 float zoomin_effect;
88 float warmup_stage;
89
90 void Fog_Force();
91
92 string _getcommandkey(string text, string command, bool forcename);
93 #define getcommandkey(cmd_name, command) _getcommandkey(cmd_name, command, false)
94 #define getcommandkey_forcename(cmd_name, command) _getcommandkey(cmd_name, command, true)
95
96 string vote_called_vote;
97 float ready_waiting;
98 float ready_waiting_for_me;
99 float vote_waiting;
100 float vote_waiting_for_me;
101
102 float current_zoomfraction;
103
104 float cs_project_is_b0rked;
105 float vid_width, vid_height, vid_pixelheight;
106
107 float camera_active;            // Demo camera is active if set to true
108 float chase_active_backup;
109 float camera_roll;
110 vector camera_direction;
111
112 void centerprint_hud(string strMessage);
113 void centerprint_kill(float id);
114 void centerprint_generic(float new_id, string strMessage, float duration, float countdown_num);
115
116 const float ALPHA_MIN_VISIBLE = 0.003;
117
118 float armorblockpercent;
119
120 //hooks
121 int calledhooks;
122 const int HOOK_START =    1;
123 const int HOOK_END =      2;
124
125 .float ping, ping_packetloss, ping_movementloss;
126
127 float g_trueaim_minrange;
128
129 float hud;
130 float view_quality;
131
132 int num_spectators;
133 const int MAX_SPECTATORS = 7;
134 int spectatorlist[MAX_SPECTATORS];
135
136 int framecount;
137 .float health;
138
139 float GetSpeedUnitFactor(int speed_unit);
140 string GetSpeedUnit(int speed_unit);