]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Change key to change spectator camera mode from Backspace (drop weapon) to Right...
authorterencehill <piuntn@gmail.com>
Fri, 20 Sep 2024 16:43:14 +0000 (18:43 +0200)
committerterencehill <piuntn@gmail.com>
Fri, 20 Sep 2024 16:43:14 +0000 (18:43 +0200)
Right mouse button used to allow switching from spectator to observer but it's now redundant since F3 can do it

qcsrc/client/hud/panel/infomessages.qc
qcsrc/client/view.qc
qcsrc/common/mutators/mutator/overkill/oknex.qc
qcsrc/menu/xonotic/dialog_forfeit.qh
qcsrc/menu/xonotic/keybinder.qc
qcsrc/server/client.qc
qcsrc/server/client.qh

index 5866271ef97c6944f64fd22aaece9099bc765190..bea111f6e2725ff00f02beb9a4b70e4c5ec216a6 100644 (file)
@@ -112,7 +112,7 @@ void HUD_InfoMessages()
                                                if(spectatee_status == -1)
                                                        s = sprintf(_("^1Use ^3%s^1 or ^3%s^1 to change the speed"), getcommandkey(_("next weapon"), "weapnext"), getcommandkey(_("previous weapon"), "weapprev"));
                                                else if(!observe_blocked)
-                                                       s = sprintf(_("^1Press ^3%s^1 to observe, ^3%s^1 to change camera mode"), getcommandkey(_("secondary fire"), "+fire2"), getcommandkey(_("drop weapon"), "dropweapon"));
+                                                       s = sprintf(_("^1Press ^3%s^1 to observe, ^3%s^1 to change camera mode"), getcommandkey(_("observe"), "spec"), getcommandkey(_("secondary fire"), "+fire2"));
                                                else
                                                        s = sprintf(_("^1Press ^3%s^1 to change camera mode"), getcommandkey(_("drop weapon"), "dropweapon"));
                                                break;
index 261fd1b01149392e106e1b2e56b5bb15b6b1e5a2..09dc739799dbe92ca7cf48a9e560864b9faebc79 100644 (file)
@@ -603,7 +603,7 @@ bool View_SpectatorCamera()
                        {
                                if (!waiting_CAMERA_SPECTATOR_update)
                                {
-                                       Impulse_Send(IMP_weapon_drop); // switch to CAMERA_SPECTATOR 2
+                                       localcmd("\n+attack2; wait; -attack2\n"); // switch to CAMERA_SPECTATOR 2
                                        waiting_CAMERA_SPECTATOR_update = 1;
                                }
                        }
@@ -618,7 +618,7 @@ bool View_SpectatorCamera()
                        {
                                if (waiting_CAMERA_SPECTATOR_update != STAT(CAMERA_SPECTATOR))
                                {
-                                       Impulse_Send(IMP_weapon_drop); // switch to CAMERA_SPECTATOR (2 and) 0
+                                       localcmd("\n+attack2; wait; -attack2\n"); // switch to CAMERA_SPECTATOR (2 and) 0
                                        waiting_CAMERA_SPECTATOR_update = STAT(CAMERA_SPECTATOR);
                                }
                        }
index 2b205fea9ce966467d6bbc37adebdf5363415ced..325ccd4d72bdfe9785cc70b3cc1ecddd7e29e7d9 100644 (file)
@@ -358,7 +358,7 @@ METHOD(OverkillNex, wr_zoom, bool(entity thiswep, entity actor))
 
 METHOD(OverkillNex, wr_zoomdir, bool(entity thiswep))
 {
-    return button_attack2 && !WEP_CVAR(WEP_OVERKILL_NEX, secondary);
+       return button_attack2 && !WEP_CVAR(WEP_OVERKILL_NEX, secondary);
 }
 
 #endif
index 7e8ecb3b2380d6426954fa7e272a2526b8f7c862..55acbf6a3919735989f72d145c3d8a671714508a 100644 (file)
@@ -1,6 +1,6 @@
 #pragma once
 
-#include "dialog.qh"
+#include "rootdialog.qh"
 CLASS(XonoticForfeitDialog, XonoticRootDialog)
        METHOD(XonoticForfeitDialog, fill, void(entity));
        ATTRIB(XonoticForfeitDialog, title, string, _("Forfeit"));
index 9188263324a0b6a1b27441adf4c636122bcc95e8..47f7a3557991dbfd38c72e6d96a022afc9c5dd7c 100644 (file)
@@ -115,7 +115,7 @@ void KeyBinds_BuildList()
        KEYBIND_HEADER(_("Teamplay"));
        KEYBIND_DEF("team_auto"                             , _("auto-join team"));
        KEYBIND_DEF("team_selection_show"                   , _("team selection"));
-       KEYBIND_DEF("spec"                                  , _("spectate"));
+       KEYBIND_DEF("spec"                                  , _("observe"));
        KEYBIND_EMPTY_LINE();
 
        KEYBIND_HEADER(_("Misc"));
index bd7ab6a9bffd76218ea7ebeb451c3e2b053e92b2..b3d3dc8a79906204634b80a7435122f812adff96 100644 (file)
@@ -2429,23 +2429,28 @@ bool PlayerThink(entity this)
        return true;
 }
 
-.bool would_spectate;
+.int new_CAMERA_SPECTATOR;
 // merged SpectatorThink and ObserverThink (old names are here so you can grep for them)
 void ObserverOrSpectatorThink(entity this)
 {
        bool is_spec = IS_SPEC(this);
+
        if ( CS(this).impulse )
        {
                int r = MinigameImpulse(this, CS(this).impulse);
                if (!is_spec || r)
                        CS(this).impulse = 0;
+       }
 
-               if (is_spec && CS(this).impulse == IMP_weapon_drop.impulse)
+       if (is_spec)
+       {
+               if (PHYS_INPUT_BUTTON_ATCK2(this))
                {
-                       STAT(CAMERA_SPECTATOR, this) = (STAT(CAMERA_SPECTATOR, this) + 1) % 3;
-                       CS(this).impulse = 0;
-                       return;
+                       if (this.new_CAMERA_SPECTATOR == STAT(CAMERA_SPECTATOR, this))
+                               this.new_CAMERA_SPECTATOR = (STAT(CAMERA_SPECTATOR, this) + 1) % 3;
                }
+               else if (STAT(CAMERA_SPECTATOR, this) != this.new_CAMERA_SPECTATOR)
+                       STAT(CAMERA_SPECTATOR, this) = this.new_CAMERA_SPECTATOR;
        }
 
        if (frametime && autocvar_sv_show_entnum) show_entnum(this);
@@ -2490,13 +2495,6 @@ void ObserverOrSpectatorThink(entity this)
                                        PutClientInServer(this);
                                }
                                CS(this).impulse = 0;
-                       } else if(PHYS_INPUT_BUTTON_ATCK2(this)) {
-                               if(!observe_blocked_if_eliminated || !INGAME(this)) {
-                                       this.would_spectate = false;
-                                       this.flags &= ~FL_JUMPRELEASED;
-                                       TRANSMUTE(Observer, this);
-                                       PutClientInServer(this);
-                               }
                        } else if(!SpectateUpdate(this) && !SpectateNext(this)) {
                                PutObserverInServer(this, false, true);
                                this.would_spectate = true;
@@ -2510,7 +2508,7 @@ void ObserverOrSpectatorThink(entity this)
                        set_movetype(this, preferred_movetype);
                }
        } else { // jump pressed
-               if ((is_spec && !(PHYS_INPUT_BUTTON_ATCK(this) || PHYS_INPUT_BUTTON_ATCK2(this)))
+               if ((is_spec && !(PHYS_INPUT_BUTTON_ATCK(this)))
                        || (!is_spec && !(PHYS_INPUT_BUTTON_ATCK(this) || PHYS_INPUT_BUTTON_JUMP(this)))) {
                        this.flags |= FL_JUMPRELEASED;
                        // primary attack pressed
index 815e2639041f006759e05d0fd83cee3a5b7f8588..e9b5f63d6cd6af920fb2ec51b37bba93df6aef3f 100644 (file)
@@ -68,7 +68,7 @@ float autocvar_sv_player_scale;
 .float alivetime; // time of being alive
 
 .bool wasplayer;
-
+.bool would_spectate;
 .int spectatee_status;
 .bool zoomstate;