2011-03-10 09:08:14 +00:00
|
|
|
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
|
|
|
|
/* If you are missing that file, acquire a complete release at teeworlds.com. */
|
|
|
|
#ifndef GAME_CLIENT_COMPONENTS_SPECTATOR_H
|
|
|
|
#define GAME_CLIENT_COMPONENTS_SPECTATOR_H
|
|
|
|
#include <base/vmath.h>
|
|
|
|
|
|
|
|
#include <game/client/component.h>
|
|
|
|
|
|
|
|
class CSpectator : public CComponent
|
|
|
|
{
|
|
|
|
enum
|
|
|
|
{
|
2020-09-26 19:41:58 +00:00
|
|
|
NO_SELECTION = -3,
|
2011-03-10 09:08:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
bool m_Active;
|
|
|
|
bool m_WasActive;
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2011-03-10 09:08:14 +00:00
|
|
|
int m_SelectedSpectatorID;
|
|
|
|
vec2 m_SelectorMouse;
|
|
|
|
|
2021-10-23 11:48:21 +00:00
|
|
|
float m_OldMouseX;
|
|
|
|
float m_OldMouseY;
|
|
|
|
|
2020-09-26 20:01:12 +00:00
|
|
|
bool CanChangeSpectator();
|
|
|
|
void SpectateNext(bool Reverse);
|
|
|
|
|
2011-08-13 00:11:06 +00:00
|
|
|
static void ConKeySpectator(IConsole::IResult *pResult, void *pUserData);
|
|
|
|
static void ConSpectate(IConsole::IResult *pResult, void *pUserData);
|
|
|
|
static void ConSpectateNext(IConsole::IResult *pResult, void *pUserData);
|
|
|
|
static void ConSpectatePrevious(IConsole::IResult *pResult, void *pUserData);
|
2020-03-31 06:03:25 +00:00
|
|
|
static void ConSpectateClosest(IConsole::IResult *pResult, void *pUserData);
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2011-03-10 09:08:14 +00:00
|
|
|
public:
|
|
|
|
CSpectator();
|
2022-01-31 02:11:47 +00:00
|
|
|
virtual int Sizeof() const override { return sizeof(*this); }
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2022-01-30 23:43:56 +00:00
|
|
|
virtual void OnConsoleInit() override;
|
2022-06-06 20:03:24 +00:00
|
|
|
virtual bool OnCursorMove(float x, float y, IInput::ECursorType CursorType) override;
|
2022-01-30 23:43:56 +00:00
|
|
|
virtual void OnRender() override;
|
|
|
|
virtual void OnRelease() override;
|
|
|
|
virtual void OnReset() override;
|
2011-03-10 09:08:14 +00:00
|
|
|
|
|
|
|
void Spectate(int SpectatorID);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|