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