]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/client/main.qh
Transifex autosync
[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 bool autocvar_cl_db_saveasdump;
7 bool autocvar_cl_spawn_event_particles;
8 bool autocvar_cl_spawn_event_sound = 1;
9 // float autocvar_cl_spawn_point_model;
10 bool autocvar_cl_spawn_point_particles;
11 float autocvar_cl_spawn_point_dist_max = 1200;
12 bool autocvar_cl_unpress_zoom_on_spawn = true;
13 bool autocvar_cl_unpress_zoom_on_death = true;
14 bool autocvar_cl_unpress_zoom_on_weapon_switch = true;
15 bool autocvar_cl_unpress_attack_on_weapon_switch = false;
16 bool autocvar_hud_showbinds;
17 bool autocvar_hud_showbinds_limit;
18 bool autocvar__hud_showbinds_reload;
19 bool autocvar_developer_csqcentities;
20 bool autocvar_cl_race_cptimes_onlyself; // TODO: move to race gamemode
21 bool autocvar_cl_race_cptimes_showself = false;
22 bool autocvar_cl_welcome = true;
23 bool autocvar_menu_gamemenu = true;
24
25 // Map coordinate base calculations need these
26 vector mi_center;
27 vector mi_scale;
28 // Minimap
29 string minimapname;
30
31 bool postinit;
32 entity gametype;
33 string gametype_custom_name;
34 // temporary hack
35 #define ISGAMETYPE(NAME) (gametype == MAPINFO_TYPE_##NAME)
36
37 float FONT_USER = 8;
38
39
40 void PostInit();
41
42 void Ent_Remove(entity this);
43
44 void Gamemode_Init();
45
46 entity players;
47 entity teams;
48 float team_count; // real teams
49
50 void AuditLists();
51
52 float RegisterPlayer(entity player);
53
54 void RemovePlayer(entity player);
55
56 void MoveToLast(entity e);
57
58 float RegisterTeam(entity Team);
59
60 void RemoveTeam(entity Team);
61
62 entity GetTeam(int Team, bool add);
63
64 bool SetTeam(entity pl, int Team);
65
66 vector hud_fontsize;
67
68 float RANKINGS_RECEIVED_CNT;
69 float RANKINGS_DISPLAY_CNT;
70 string grecordholder[RANKINGS_CNT];
71 float grecordtime[RANKINGS_CNT];
72
73 entity playerslots[255]; // 255 is engine limit on maxclients
74 entity teamslots[17];    // 17 teams (including "spectator team")
75 .bool gotscores;
76 .entity owner;
77 .bool ready;
78 .bool eliminated;
79
80 IntrusiveList g_drawables;
81 IntrusiveList g_drawables_2d;
82 IntrusiveList g_damagetext;
83 IntrusiveList g_radarlinks;
84 IntrusiveList g_radaricons;
85 STATIC_INIT(main)
86 {
87         g_drawables = IL_NEW();
88         g_drawables_2d = IL_NEW();
89         g_damagetext = IL_NEW();
90         g_radarlinks = IL_NEW();
91         g_radaricons = IL_NEW();
92 }
93
94 .void(entity) draw;
95 .void(entity) draw2d;
96 .void(entity) entremove;
97 float drawframetime;
98 vector view_origin, view_forward, view_right, view_up;
99
100 .float renderflags; // engine field
101
102 bool button_zoom;
103 bool spectatorbutton_zoom;
104 bool observe_blocked;
105 bool button_attack2;
106
107 float current_viewzoom;
108 float zoomin_effect;
109 bool warmup_stage;
110
111 bool campaign;
112 string hostname;
113 string welcome_msg;
114 int srv_minplayers;
115 int srv_maxplayers;
116 float welcome_msg_menu_check_maxtime;
117 void Welcome_Message_Show_Try();
118
119 void Fog_Force();
120
121 string _getcommandkey(string text, string command, bool forcename);
122 #define getcommandkey(cmd_name, command) _getcommandkey(cmd_name, command, false)
123 #define getcommandkey_forcename(cmd_name, command) _getcommandkey(cmd_name, command, true)
124
125 void Release_Common_Keys();
126
127 string vote_called_vote;
128 bool ready_waiting;
129 bool ready_waiting_for_me;
130 bool vote_waiting;
131 bool vote_waiting_for_me;
132
133 float current_zoomfraction;
134
135 int vid_width, vid_height;
136 float vid_pixelheight;
137
138 float camera_active;            // Demo camera is active if set to true
139 float chase_active_backup;
140 float camera_roll;
141 vector camera_direction;
142
143 const float ALPHA_MIN_VISIBLE = 0.003;
144
145 float armorblockpercent;
146 float damagepush_speedfactor;
147
148 //hooks
149 int calledhooks;
150 const int HOOK_START =    1;
151 const int HOOK_END =      2;
152
153 .float ping, ping_packetloss, ping_movementloss;
154
155 float g_trueaim_minrange;
156
157 int hud;
158 float view_quality;
159
160 int num_spectators;
161 const int MAX_SPECTATORS = 7;
162 int spectatorlist[MAX_SPECTATORS];
163
164 int framecount;
165
166 float GetSpeedUnitFactor(int speed_unit);
167 string GetSpeedUnit(int speed_unit);
168
169 .int enttype; // entity type sent from server
170 .int sv_entnum; // entity number sent from server
171
172 .int team;
173 .int team_size;
174
175 int binddb;
176
177 // Spectating
178 // -1 - observing
179 // 0 - playing
180 // >0 - id of spectated player
181 float spectatee_status;
182 float spectatee_status_changed_time;
183
184 #define player_currententnum (spectatee_status > 0 ? spectatee_status : player_localnum + 1)
185
186 // database for misc stuff
187 int tempdb;
188 int ClientProgsDB;
189 vector hook_shotorigin[4]; // WEAPONTODO
190 vector lightning_shotorigin[4]; // TODO: unused
191
192 float serverprevtime, serverdeltatime;
193
194 float ticrate;
195
196 int serverflags;