Right mouse button used to allow switching from spectator to observer but it's now redundant since F3 can do it
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;
{
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;
}
}
{
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);
}
}
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
#pragma once
-#include "dialog.qh"
+#include "rootdialog.qh"
CLASS(XonoticForfeitDialog, XonoticRootDialog)
METHOD(XonoticForfeitDialog, fill, void(entity));
ATTRIB(XonoticForfeitDialog, title, string, _("Forfeit"));
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"));
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);
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;
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
.float alivetime; // time of being alive
.bool wasplayer;
-
+.bool would_spectate;
.int spectatee_status;
.bool zoomstate;