From: terencehill Date: Wed, 19 Sep 2018 22:10:20 +0000 (+0200) Subject: Switch to 3rd person mode camera for a moment when changing spectated player so to... X-Git-Tag: xonotic-v0.8.5~1845^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9f5050e0bb2ac3f17572fac6f98eded6c037b058;p=xonotic%2Fxonotic-data.pk3dir.git Switch to 3rd person mode camera for a moment when changing spectated player so to help recognizing players in a more intuitive way --- diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index 9c63f4312..065441870 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -411,6 +411,7 @@ float autocvar_cl_hitsound_min_pitch = 0.75; float autocvar_cl_hitsound_max_pitch = 1.5; float autocvar_cl_hitsound_nom_damage = 25; float autocvar_cl_hitsound_antispam_time; +int autocvar_cl_eventchase_spectated_change = 1; int autocvar_cl_eventchase_death = 1; float autocvar_cl_eventchase_distance = 140; bool autocvar_cl_eventchase_frozen = false; diff --git a/qcsrc/client/defs.qh b/qcsrc/client/defs.qh index 22cbc1a2d..5204e8f36 100644 --- a/qcsrc/client/defs.qh +++ b/qcsrc/client/defs.qh @@ -77,6 +77,7 @@ float nb_pb_period; // 0 - playing // >0 - id of spectated player float spectatee_status; +float spectatee_status_changed_time; // short mapname string shortmapname; diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 6844b1e07..955cfa7ff 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -528,6 +528,7 @@ NET_HANDLE(ENT_CLIENT_CLIENTDATA, bool isnew) race_laptime = 0; race_checkpointtime = 0; hud_dynamic_shake_factor = -1; + spectatee_status_changed_time = time; } if (autocvar_hud_panel_healtharmor_progressbar_gfx) { diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index ff9b47cbc..9e7ecb67c 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -827,6 +827,9 @@ bool WantEventchase(entity this) } else return true; } + if (spectatee_status > 0 && autocvar_cl_eventchase_spectated_change + && time <= spectatee_status_changed_time + 0.5) + return true; } return false; } diff --git a/xonotic-client.cfg b/xonotic-client.cfg index af69bbb21..ed81e0fb5 100644 --- a/xonotic-client.cfg +++ b/xonotic-client.cfg @@ -197,6 +197,7 @@ seta cl_hitsound_min_pitch 0.75 "minimum pitch of hit sound" seta cl_hitsound_max_pitch 1.5 "maximum pitch of hit sound" seta cl_hitsound_nom_damage 25 "damage amount at which hitsound bases pitch off" +seta cl_eventchase_spectated_change 1 "camera goes into 3rd person mode for a moment when changing spectated player" seta cl_eventchase_death 1 "camera goes into 3rd person mode when the player is dead; set to 2 to active the effect only when the corpse doesn't move anymore" seta cl_eventchase_frozen 0 "camera goes into 3rd person mode when the player is frozen" seta cl_eventchase_nexball 1 "camera goes into 3rd person mode when in nexball game-mode"