From: Mario Date: Sun, 2 Aug 2020 10:00:05 +0000 (+1000) Subject: Minor cleanup of client/defs.qh, move replicated cvars to a common location X-Git-Tag: xonotic-v0.8.5~798 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2d8c8577;p=xonotic%2Fxonotic-data.pk3dir.git Minor cleanup of client/defs.qh, move replicated cvars to a common location --- diff --git a/qcsrc/client/commands/cl_cmd.qc b/qcsrc/client/commands/cl_cmd.qc index 7735815d5..c21de4696 100644 --- a/qcsrc/client/commands/cl_cmd.qc +++ b/qcsrc/client/commands/cl_cmd.qc @@ -12,6 +12,7 @@ #include #include #include +#include #include "../main.qh" #include "../mapvoting.qh" #include "../miscfunctions.qh" diff --git a/qcsrc/client/csqcmodel_hooks.qc b/qcsrc/client/csqcmodel_hooks.qc index 319784a4a..c73b3ff42 100644 --- a/qcsrc/client/csqcmodel_hooks.qc +++ b/qcsrc/client/csqcmodel_hooks.qc @@ -2,6 +2,7 @@ #include "autocvars.qh" #include "miscfunctions.qh" #include +#include #include "player_skeleton.qh" #include "weapons/projectile.qh" #include diff --git a/qcsrc/client/defs.qh b/qcsrc/client/defs.qh index 0cf71294a..0625c31ef 100644 --- a/qcsrc/client/defs.qh +++ b/qcsrc/client/defs.qh @@ -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; diff --git a/qcsrc/client/hud/panel/powerups.qc b/qcsrc/client/hud/panel/powerups.qc index 1662415ed..fe591ff53 100644 --- a/qcsrc/client/hud/panel/powerups.qc +++ b/qcsrc/client/hud/panel/powerups.qc @@ -4,6 +4,7 @@ #include #include #include +#include // Powerups (#2) diff --git a/qcsrc/client/hud/panel/racetimer.qh b/qcsrc/client/hud/panel/racetimer.qh index 6db88c68b..27cf20e87 100644 --- a/qcsrc/client/hud/panel/racetimer.qh +++ b/qcsrc/client/hud/panel/racetimer.qh @@ -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; diff --git a/qcsrc/client/hud/panel/scoreboard.qc b/qcsrc/client/hud/panel/scoreboard.qc index 47e08cbd8..59e8b101a 100644 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@ -4,6 +4,7 @@ #include #include #include +#include #include "quickmenu.qh" #include #include diff --git a/qcsrc/client/hud/panel/scoreboard.qh b/qcsrc/client/hud/panel/scoreboard.qh index f585b480f..ded11c260 100644 --- a/qcsrc/client/hud/panel/scoreboard.qh +++ b/qcsrc/client/hud/panel/scoreboard.qh @@ -1,6 +1,8 @@ #pragma once #include "../panel.qh" +bool scoreboard_showscores; + bool scoreboard_active; float scoreboard_fade_alpha; float scoreboard_acc_fade_alpha; diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 9660a8137..dd3b62b1d 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -20,6 +20,7 @@ #include "weapons/projectile.qh" #include #include +#include #include #include #include diff --git a/qcsrc/client/main.qh b/qcsrc/client/main.qh index 12fc6180a..73359e7e1 100644 --- a/qcsrc/client/main.qh +++ b/qcsrc/client/main.qh @@ -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; diff --git a/qcsrc/client/mapvoting.qc b/qcsrc/client/mapvoting.qc index 2129b7802..91b076b25 100644 --- a/qcsrc/client/mapvoting.qc +++ b/qcsrc/client/mapvoting.qc @@ -7,6 +7,7 @@ #include "hud/panel/scoreboard.qh" #include +#include // MapVote (#21) diff --git a/qcsrc/common/_mod.inc b/qcsrc/common/_mod.inc index bc4b66aec..4a45c1edb 100644 --- a/qcsrc/common/_mod.inc +++ b/qcsrc/common/_mod.inc @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include diff --git a/qcsrc/common/_mod.qh b/qcsrc/common/_mod.qh index 7aadf6aa1..3433ebb4e 100644 --- a/qcsrc/common/_mod.qh +++ b/qcsrc/common/_mod.qh @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include diff --git a/qcsrc/common/effects/qc/casings.qc b/qcsrc/common/effects/qc/casings.qc index 68eccb461..f68b5af41 100644 --- a/qcsrc/common/effects/qc/casings.qc +++ b/qcsrc/common/effects/qc/casings.qc @@ -1,5 +1,6 @@ #include "casings.qh" +#include #include #ifdef CSQC diff --git a/qcsrc/common/gamemodes/gamemode/nexball/cl_nexball.qh b/qcsrc/common/gamemodes/gamemode/nexball/cl_nexball.qh index d0b3731bc..b92c27206 100644 --- a/qcsrc/common/gamemodes/gamemode/nexball/cl_nexball.qh +++ b/qcsrc/common/gamemodes/gamemode/nexball/cl_nexball.qh @@ -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 index 000000000..c9d495b1e --- /dev/null +++ b/qcsrc/common/replicate.qc @@ -0,0 +1 @@ +#include "replicate.qh" diff --git a/qcsrc/common/replicate.qh b/qcsrc/common/replicate.qh new file mode 100644 index 000000000..304cf389e --- /dev/null +++ b/qcsrc/common/replicate.qh @@ -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 diff --git a/qcsrc/server/client.qh b/qcsrc/server/client.qh index 8d4afe4ba..e7c9036c7 100644 --- a/qcsrc/server/client.qh +++ b/qcsrc/server/client.qh @@ -1,40 +1,11 @@ #pragma once #include "utils.qh" +#include #include -// 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; diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 45cb058d8..76dcf8491 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -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 */ diff --git a/qcsrc/server/weapons/selection.qc b/qcsrc/server/weapons/selection.qc index 17fd9e0e0..4a55dab29 100644 --- a/qcsrc/server/weapons/selection.qc +++ b/qcsrc/server/weapons/selection.qc @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include