]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Minor cleanup of client/defs.qh, move replicated cvars to a common location
authorMario <mario.mario@y7mail.com>
Sun, 2 Aug 2020 10:00:05 +0000 (20:00 +1000)
committerMario <mario.mario@y7mail.com>
Sun, 2 Aug 2020 10:00:05 +0000 (20:00 +1000)
19 files changed:
qcsrc/client/commands/cl_cmd.qc
qcsrc/client/csqcmodel_hooks.qc
qcsrc/client/defs.qh
qcsrc/client/hud/panel/powerups.qc
qcsrc/client/hud/panel/racetimer.qh
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/client/hud/panel/scoreboard.qh
qcsrc/client/main.qc
qcsrc/client/main.qh
qcsrc/client/mapvoting.qc
qcsrc/common/_mod.inc
qcsrc/common/_mod.qh
qcsrc/common/effects/qc/casings.qc
qcsrc/common/gamemodes/gamemode/nexball/cl_nexball.qh
qcsrc/common/replicate.qc [new file with mode: 0644]
qcsrc/common/replicate.qh [new file with mode: 0644]
qcsrc/server/client.qh
qcsrc/server/miscfunctions.qc
qcsrc/server/weapons/selection.qc

index 7735815d57f048e1c22920d2942ac984d19c2d8a..c21de4696d19af9dc8a56e9735a49f8aa530f1b8 100644 (file)
@@ -12,6 +12,7 @@
 #include <client/hud/_mod.qh>
 #include <client/hud/panel/quickmenu.qh>
 #include <client/hud/panel/radar.qh>
+#include <client/hud/panel/scoreboard.qh>
 #include "../main.qh"
 #include "../mapvoting.qh"
 #include "../miscfunctions.qh"
index 319784a4a50c7c3d635b153b5c5497c20b99feb2..c73b3ff421a90c9c477c5a16b2ef98ef009d8507 100644 (file)
@@ -2,6 +2,7 @@
 #include "autocvars.qh"
 #include "miscfunctions.qh"
 #include <client/mutators/_mod.qh>
+#include <client/main.qh>
 #include "player_skeleton.qh"
 #include "weapons/projectile.qh"
 #include <common/animdecide.qh>
index 0cf71294a78936db18f480c5af6eb4047468405c..0625c31ef82a1864133f36245632faa6f4330364 100644 (file)
@@ -2,9 +2,6 @@
 
 // Additional OPTIONAL Fields and Globals
 //float                intermission;
-float          scoreboard_showscores;
-.string                message;
-.float         renderflags;
 // float               coop;
 // float               deathmatch;
 
@@ -28,49 +25,6 @@ float                dmg_take;
 float vid_conheight;
 int binddb;
 
-// QUALIFYING
-float race_checkpoint;
-float race_time;
-float race_laptime;
-float race_checkpointtime;
-float race_previousbesttime;
-float race_mypreviousbesttime;
-string race_previousbestname;
-float race_nextcheckpoint;
-float race_nextbesttime;
-float race_mybesttime;
-string race_nextbestname;
-float race_penaltyaccumulator; // qualifying: total penalty time in tenths
-float race_penaltyeventtime; // time when the player got the penalty
-float race_penaltytime; // duration of penalty time, in tenths
-string race_penaltyreason; // reason for penalty
-float race_server_record; // server record
-float race_speedaward;
-string race_speedaward_holder;
-string race_speedaward_unit;
-float race_speedaward_alltimebest;
-string race_speedaward_alltimebest_holder;
-string race_speedaward_alltimebest_unit;
-
-// RACE
-float race_mycheckpoint;
-float race_mycheckpointtime;
-float race_mycheckpointdelta;
-float race_mycheckpointlapsdelta;
-string race_mycheckpointenemy;
-float race_othercheckpoint;
-float race_othercheckpointtime;
-float race_othercheckpointdelta;
-float race_othercheckpointlapsdelta;
-string race_othercheckpointenemy;
-float scoreboard_showscores_force;
-float race_status;
-string race_status_name;
-float race_myrank;
-
-// Nexball
-float nb_pb_period;
-
 // Spectating
 // -1 - observing
 // 0 - playing
@@ -109,68 +63,6 @@ int w_deathtype;
 float w_issilent, w_random;
 vector w_org, w_backoff;
 
-float autoswitch;
-bool cvar_cl_allow_uid2name;
-bool cvar_cl_allow_uidranking;
-float cvar_cl_autoscreenshot;
-float cvar_cl_autotaunt;
-float cvar_cl_clippedspectating;
-int cvar_cl_gunalign;
-float cvar_cl_handicap;
-float cvar_cl_jetpack_jump;
-float cvar_cl_movement_track_canjump;
-float cvar_cl_noantilag;
-string cvar_cl_physics;
-float cvar_cl_voice_directional;
-float cvar_cl_voice_directional_taunt_attenuation;
-float cvar_cl_weaponimpulsemode;
-string cvar_g_xonoticversion;
-float cvar_cl_cts_noautoswitch;
-bool cvar_cl_weapon_switch_reload;
-bool cvar_cl_weapon_switch_fallback_to_impulse;
-
-REPLICATE(autoswitch, bool, "cl_autoswitch");
-REPLICATE(cvar_cl_allow_uid2name, bool, "cl_allow_uid2name");
-REPLICATE(cvar_cl_allow_uidranking, bool, "cl_allow_uidranking");
-REPLICATE(cvar_cl_autoscreenshot, int, "cl_autoscreenshot");
-REPLICATE(cvar_cl_autotaunt, float, "cl_autotaunt");
-REPLICATE(cvar_cl_clippedspectating, bool, "cl_clippedspectating");
-REPLICATE(cvar_cl_gunalign, int, "cl_gunalign");
-REPLICATE(cvar_cl_handicap, float, "cl_handicap");
-REPLICATE(cvar_cl_jetpack_jump, bool, "cl_jetpack_jump");
-REPLICATE(cvar_cl_movement_track_canjump, bool, "cl_movement_track_canjump");
-REPLICATE(cvar_cl_noantilag, bool, "cl_noantilag");
-REPLICATE(cvar_cl_physics, string, "cl_physics");
-REPLICATE(cvar_cl_voice_directional, int, "cl_voice_directional");
-REPLICATE(cvar_cl_voice_directional_taunt_attenuation, float, "cl_voice_directional_taunt_attenuation");
-REPLICATE(cvar_cl_weaponimpulsemode, int, "cl_weaponimpulsemode");
-REPLICATE(cvar_g_xonoticversion, string, "g_xonoticversion");
-REPLICATE(cvar_cl_cts_noautoswitch, bool, "cl_cts_noautoswitch");
-REPLICATE(cvar_cl_weapon_switch_reload, bool, "cl_weapon_switch_reload");
-REPLICATE(cvar_cl_weapon_switch_fallback_to_impulse, bool, "cl_weapon_switch_fallback_to_impulse");
-/*
-// cvar cl_newusekeysupported doesn't exist
-float cvar_cl_newusekeysupported;
-REPLICATE(cvar_cl_newusekeysupported, bool, "cl_newusekeysupported");
-*/
-string cvar_cl_allow_uidtracking;
-REPLICATE(cvar_cl_allow_uidtracking, string, "cl_allow_uidtracking");
-
-string cvar_cl_weaponpriority;
-REPLICATE(cvar_cl_weaponpriority, string, "cl_weaponpriority");
-
-string cvar_cl_weaponpriorities[10];
-REPLICATE(cvar_cl_weaponpriorities[0], string, "cl_weaponpriority0");
-REPLICATE(cvar_cl_weaponpriorities[1], string, "cl_weaponpriority1");
-REPLICATE(cvar_cl_weaponpriorities[2], string, "cl_weaponpriority2");
-REPLICATE(cvar_cl_weaponpriorities[3], string, "cl_weaponpriority3");
-REPLICATE(cvar_cl_weaponpriorities[4], string, "cl_weaponpriority4");
-REPLICATE(cvar_cl_weaponpriorities[5], string, "cl_weaponpriority5");
-REPLICATE(cvar_cl_weaponpriorities[6], string, "cl_weaponpriority6");
-REPLICATE(cvar_cl_weaponpriorities[7], string, "cl_weaponpriority7");
-REPLICATE(cvar_cl_weaponpriorities[8], string, "cl_weaponpriority8");
-REPLICATE(cvar_cl_weaponpriorities[9], string, "cl_weaponpriority9");
-
 float bgmtime;
 
 float vortex_charge_movingavg;
index 1662415edda0e77e51cbea992f25cbbb54ec96ff..fe591ff53c44dff1f652889c8b90ee111b472b5b 100644 (file)
@@ -4,6 +4,7 @@
 #include <client/defs.qh>
 #include <client/miscfunctions.qh>
 #include <common/items/_mod.qh>
+#include <common/util.qh>
 
 // Powerups (#2)
 
index 6db88c68b39ee50fce1f8acce9c778465a3223ae..27cf20e875fc3463e6c52b6fc8a232e2deefd38e 100644 (file)
@@ -1,2 +1,42 @@
 #pragma once
 #include "../panel.qh"
+
+// QUALIFYING
+float race_checkpoint;
+float race_time;
+float race_laptime;
+float race_checkpointtime;
+float race_previousbesttime;
+float race_mypreviousbesttime;
+string race_previousbestname;
+float race_nextcheckpoint;
+float race_nextbesttime;
+float race_mybesttime;
+string race_nextbestname;
+float race_penaltyaccumulator; // qualifying: total penalty time in tenths
+float race_penaltyeventtime; // time when the player got the penalty
+float race_penaltytime; // duration of penalty time, in tenths
+string race_penaltyreason; // reason for penalty
+float race_server_record; // server record
+float race_speedaward;
+string race_speedaward_holder;
+string race_speedaward_unit;
+float race_speedaward_alltimebest;
+string race_speedaward_alltimebest_holder;
+string race_speedaward_alltimebest_unit;
+
+// RACE
+float race_mycheckpoint;
+float race_mycheckpointtime;
+float race_mycheckpointdelta;
+float race_mycheckpointlapsdelta;
+string race_mycheckpointenemy;
+float race_othercheckpoint;
+float race_othercheckpointtime;
+float race_othercheckpointdelta;
+float race_othercheckpointlapsdelta;
+string race_othercheckpointenemy;
+float scoreboard_showscores_force;
+float race_status;
+string race_status_name;
+float race_myrank;
index 47e08cbd835be0905cdd6689fe292d6a21e36df8..59e8b101a04cfc20e714587390aa9d3e4358214f 100644 (file)
@@ -4,6 +4,7 @@
 #include <client/defs.qh>
 #include <client/main.qh>
 #include <client/miscfunctions.qh>
+#include <client/hud/panel/racetimer.qh>
 #include "quickmenu.qh"
 #include <common/ent_cs.qh>
 #include <common/constants.qh>
index f585b480fe70b119f2491c3df712d5475aa2f3b3..ded11c2606d412db930036a30ca011149a817215 100644 (file)
@@ -1,6 +1,8 @@
 #pragma once
 #include "../panel.qh"
 
+bool scoreboard_showscores;
+
 bool scoreboard_active;
 float scoreboard_fade_alpha;
 float scoreboard_acc_fade_alpha;
index 9660a8137f3822d2de2fb5bb19ca5d3b31809f0e..dd3b62b1d0998e36475a47133b992ebc91a1edfa 100644 (file)
@@ -20,6 +20,7 @@
 #include "weapons/projectile.qh"
 #include <common/deathtypes/all.qh>
 #include <common/items/_mod.qh>
+#include <common/gamemodes/gamemode/nexball/cl_nexball.qh>
 #include <common/mapinfo.qh>
 #include <common/minigames/cl_minigames.qh>
 #include <common/minigames/cl_minigames_hud.qh>
index 12fc6180a1f08e04db5f4df8ea46c6b4c08b996c..73359e7e127637cfcd3c23b77bccd97a76fad8ff 100644 (file)
@@ -57,6 +57,7 @@ STATIC_INIT(main)
 float drawframetime;
 vector view_origin, view_forward, view_right, view_up;
 
+.float renderflags; // engine field
 
 bool button_zoom;
 bool spectatorbutton_zoom;
index 2129b7802735149564d8891117e29ed61db9ce4e..91b076b25ccb9b17b8aee2614452cf391907e8ec 100644 (file)
@@ -7,6 +7,7 @@
 #include "hud/panel/scoreboard.qh"
 
 #include <common/mapinfo.qh>
+#include <common/util.qh>
 
 // MapVote (#21)
 
index bc4b66aec1a9dfa7ee872e5f817d0b87c535d11c..4a45c1edb0123b87fa606dbf2d1d916a62df9717 100644 (file)
@@ -7,6 +7,7 @@
 #include <common/mapinfo.qc>
 #include <common/net_notice.qc>
 #include <common/playerstats.qc>
+#include <common/replicate.qc>
 #include <common/state.qc>
 #include <common/util.qc>
 #include <common/viewloc.qc>
index 7aadf6aa1de4a52a1668167702c37dd20f550bc2..3433ebb4e8ea1eabf3af227a2e7a76fe81c45a58 100644 (file)
@@ -8,6 +8,7 @@
 #include <common/net_notice.qh>
 #include <common/playerstats.qh>
 #include <common/state.qh>
+#include <common/replicate.qh>
 #include <common/util.qh>
 #include <common/viewloc.qh>
 #include <common/wepent.qh>
index 68eccb461227c1e7797adab66a7985b320ee1c31..f68b5af413f1b6ea082937444e70ba3a606a31ae 100644 (file)
@@ -1,5 +1,6 @@
 #include "casings.qh"
 
+#include <common/replicate.qh>
 #include <common/util.qh>
 
 #ifdef CSQC
index d0b3731bc57a550f8710143fbad36feabf6aadaa..b92c272063f99a88b6501671d2eb0ccffad9e971 100644 (file)
@@ -1,3 +1,5 @@
 #pragma once
 
 void HUD_Mod_NexBall(vector pos, vector mySize);
+
+float nb_pb_period;
diff --git a/qcsrc/common/replicate.qc b/qcsrc/common/replicate.qc
new file mode 100644 (file)
index 0000000..c9d495b
--- /dev/null
@@ -0,0 +1 @@
+#include "replicate.qh"
diff --git a/qcsrc/common/replicate.qh b/qcsrc/common/replicate.qh
new file mode 100644 (file)
index 0000000..304cf38
--- /dev/null
@@ -0,0 +1,103 @@
+#pragma once
+
+// TODO: sort/merge these!
+#if defined(CSQC)
+       float autoswitch;
+       bool cvar_cl_allow_uid2name;
+       float cvar_cl_allow_uidtracking;
+       bool cvar_cl_allow_uidranking;
+       float cvar_cl_autoscreenshot;
+       float cvar_cl_autotaunt;
+       float cvar_cl_clippedspectating;
+       int cvar_cl_gunalign;
+       float cvar_cl_handicap;
+       float cvar_cl_jetpack_jump;
+       float cvar_cl_movement_track_canjump;
+       float cvar_cl_noantilag;
+       string cvar_cl_physics;
+       float cvar_cl_voice_directional;
+       float cvar_cl_voice_directional_taunt_attenuation;
+       float cvar_cl_weaponimpulsemode;
+
+       string cvar_g_xonoticversion;
+       string cvar_cl_weaponpriority;
+       string cvar_cl_weaponpriorities[10];
+       float cvar_cl_cts_noautoswitch;
+       bool cvar_cl_weapon_switch_reload;
+       bool cvar_cl_weapon_switch_fallback_to_impulse;
+#elif defined(SVQC)
+       .float cvar_cl_handicap;
+       .int cvar_cl_gunalign;
+       .float cvar_cl_clippedspectating;
+       .float cvar_cl_autoscreenshot;
+       .float cvar_cl_jetpack_jump;
+       .float cvar_cl_movement_track_canjump;
+       //.float cvar_cl_newusekeysupported;
+       .float cvar_cl_cts_noautoswitch;
+       .bool cvar_cl_weapon_switch_reload;
+       .bool cvar_cl_weapon_switch_fallback_to_impulse;
+
+       .string cvar_g_xonoticversion;
+       .string cvar_cl_weaponpriority;
+       .string cvar_cl_weaponpriorities[10];
+       .float cvar_cl_noantilag;
+
+       // WEAPONTODO
+       .float autoswitch;
+       .float cvar_cl_weaponimpulsemode;
+
+       .float cvar_cl_allow_uid2name;
+       .float cvar_cl_allow_uidtracking;
+       .bool cvar_cl_allow_uidranking;
+
+       .string cvar_cl_physics;
+
+       // autotaunt system
+       .float cvar_cl_autotaunt;
+       .float cvar_cl_voice_directional;
+       .float cvar_cl_voice_directional_taunt_attenuation;
+#endif
+
+#ifdef GAMEQC
+REPLICATE(autoswitch, bool, "cl_autoswitch");
+REPLICATE(cvar_cl_allow_uid2name, bool, "cl_allow_uid2name");
+REPLICATE(cvar_cl_allow_uidranking, bool, "cl_allow_uidranking");
+REPLICATE(cvar_cl_autoscreenshot, int, "cl_autoscreenshot");
+REPLICATE(cvar_cl_autotaunt, float, "cl_autotaunt");
+REPLICATE(cvar_cl_clippedspectating, bool, "cl_clippedspectating");
+REPLICATE(cvar_cl_gunalign, int, "cl_gunalign");
+REPLICATE(cvar_cl_handicap, float, "cl_handicap");
+REPLICATE(cvar_cl_jetpack_jump, bool, "cl_jetpack_jump");
+REPLICATE(cvar_cl_movement_track_canjump, bool, "cl_movement_track_canjump");
+REPLICATE(cvar_cl_noantilag, bool, "cl_noantilag");
+REPLICATE(cvar_cl_physics, string, "cl_physics");
+REPLICATE(cvar_cl_voice_directional, int, "cl_voice_directional");
+REPLICATE(cvar_cl_voice_directional_taunt_attenuation, float, "cl_voice_directional_taunt_attenuation");
+REPLICATE(cvar_cl_weaponimpulsemode, int, "cl_weaponimpulsemode");
+REPLICATE(cvar_g_xonoticversion, string, "g_xonoticversion");
+REPLICATE(cvar_cl_cts_noautoswitch, bool, "cl_cts_noautoswitch");
+REPLICATE(cvar_cl_weapon_switch_reload, bool, "cl_weapon_switch_reload");
+REPLICATE(cvar_cl_weapon_switch_fallback_to_impulse, bool, "cl_weapon_switch_fallback_to_impulse");
+/*
+// cvar cl_newusekeysupported doesn't exist
+float cvar_cl_newusekeysupported;
+REPLICATE(cvar_cl_newusekeysupported, bool, "cl_newusekeysupported");
+*/
+#ifdef CSQC
+// handled specially on the server
+REPLICATE(cvar_cl_allow_uidtracking, float, "cl_allow_uidtracking");
+#endif
+
+REPLICATE(cvar_cl_weaponpriority, string, "cl_weaponpriority");
+
+REPLICATE(cvar_cl_weaponpriorities[0], string, "cl_weaponpriority0");
+REPLICATE(cvar_cl_weaponpriorities[1], string, "cl_weaponpriority1");
+REPLICATE(cvar_cl_weaponpriorities[2], string, "cl_weaponpriority2");
+REPLICATE(cvar_cl_weaponpriorities[3], string, "cl_weaponpriority3");
+REPLICATE(cvar_cl_weaponpriorities[4], string, "cl_weaponpriority4");
+REPLICATE(cvar_cl_weaponpriorities[5], string, "cl_weaponpriority5");
+REPLICATE(cvar_cl_weaponpriorities[6], string, "cl_weaponpriority6");
+REPLICATE(cvar_cl_weaponpriorities[7], string, "cl_weaponpriority7");
+REPLICATE(cvar_cl_weaponpriorities[8], string, "cl_weaponpriority8");
+REPLICATE(cvar_cl_weaponpriorities[9], string, "cl_weaponpriority9");
+#endif
index 8d4afe4ba6d21ee237dd527c5a5535c04e079832..e7c9036c73edd2a850b9db655b1f621389fb8da9 100644 (file)
@@ -1,40 +1,11 @@
 #pragma once
 
 #include "utils.qh"
+#include <common/replicate.qh>
 #include <common/sounds/all.qh>
 
-// replicated cvars TODO: needs better organisation!
-.float cvar_cl_handicap;
-.int cvar_cl_gunalign;
-.float cvar_cl_clippedspectating;
-.float cvar_cl_autoscreenshot;
-.float cvar_cl_jetpack_jump;
-.float cvar_cl_movement_track_canjump;
-.float cvar_cl_newusekeysupported;
-.float cvar_cl_cts_noautoswitch;
-.bool cvar_cl_weapon_switch_reload;
-.bool cvar_cl_weapon_switch_fallback_to_impulse;
-
-.string cvar_g_xonoticversion;
-.string cvar_cl_weaponpriority;
-.string cvar_cl_weaponpriorities[10];
-.float cvar_cl_noantilag;
-
 // WEAPONTODO
-.float autoswitch;
 .string weaponorder_byimpulse;
-.float cvar_cl_weaponimpulsemode;
-
-.float cvar_cl_allow_uid2name;
-.float cvar_cl_allow_uidtracking;
-.bool cvar_cl_allow_uidranking;
-
-.string cvar_cl_physics;
-
-// autotaunt system
-.float cvar_cl_autotaunt;
-.float cvar_cl_voice_directional;
-.float cvar_cl_voice_directional_taunt_attenuation;
 
 .entity clientdata;
 
index 45cb058d8c549c2c01982ce9424b69a99117dd7e..76dcf849130a36d22e72a0b7087ee7d9d347357d 100644 (file)
@@ -358,46 +358,6 @@ string W_FixWeaponOrder_ForceComplete_AndBuildImpulseList(entity this, string wo
        return o;
 }
 
-REPLICATE(autoswitch, bool, "cl_autoswitch");
-
-REPLICATE(cvar_cl_allow_uid2name, bool, "cl_allow_uid2name");
-
-REPLICATE(cvar_cl_allow_uidranking, bool, "cl_allow_uidranking");
-
-REPLICATE(cvar_cl_autoscreenshot, int, "cl_autoscreenshot");
-
-REPLICATE(cvar_cl_autotaunt, float, "cl_autotaunt");
-
-REPLICATE(cvar_cl_clippedspectating, bool, "cl_clippedspectating");
-
-REPLICATE(cvar_cl_handicap, float, "cl_handicap");
-
-REPLICATE(cvar_cl_gunalign, int, "cl_gunalign");
-
-REPLICATE(cvar_cl_jetpack_jump, bool, "cl_jetpack_jump");
-
-REPLICATE(cvar_cl_movement_track_canjump, bool, "cl_movement_track_canjump");
-
-REPLICATE(cvar_cl_newusekeysupported, bool, "cl_newusekeysupported");
-
-REPLICATE(cvar_cl_noantilag, bool, "cl_noantilag");
-
-REPLICATE(cvar_cl_physics, string, "cl_physics");
-
-REPLICATE(cvar_cl_voice_directional, int, "cl_voice_directional");
-
-REPLICATE(cvar_cl_voice_directional_taunt_attenuation, float, "cl_voice_directional_taunt_attenuation");
-
-REPLICATE(cvar_cl_weaponimpulsemode, int, "cl_weaponimpulsemode");
-
-REPLICATE(cvar_g_xonoticversion, string, "g_xonoticversion");
-
-REPLICATE(cvar_cl_cts_noautoswitch, bool, "cl_cts_noautoswitch");
-
-REPLICATE(cvar_cl_weapon_switch_reload, bool, "cl_weapon_switch_reload");
-
-REPLICATE(cvar_cl_weapon_switch_fallback_to_impulse, bool, "cl_weapon_switch_fallback_to_impulse");
-
 /**
  * @param f -1: cleanup, 0: request, 1: receive
  */
index 17fd9e0e0ab59ff19d53fbd642b9e954cb44ff87..4a55dab29adf2471e6546743ac4a8ab994e5c8cc 100644 (file)
@@ -8,6 +8,7 @@
 #include <common/util.qh>
 #include <common/items/item.qh>
 #include <common/weapons/_all.qh>
+#include <common/replicate.qh>
 #include <common/state.qh>
 #include <common/mapobjects/triggers.qh>
 #include <common/mutators/mutator/waypoints/waypointsprites.qh>