DDraceNetwork Docs
spectator.h
Go to the documentation of this file.
1/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
2/* If you are missing that file, acquire a complete release at teeworlds.com. */
3#ifndef GAME_CLIENT_COMPONENTS_SPECTATOR_H
4#define GAME_CLIENT_COMPONENTS_SPECTATOR_H
5#include <base/vmath.h>
6#include <engine/console.h>
7
9#include <game/client/ui.h>
10
11class CSpectator : public CComponent
12{
13 enum
14 {
17 };
18
21
24
26
28
29 bool CanChangeSpectator();
30 void SpectateNext(bool Reverse);
31
32 static void ConKeySpectator(IConsole::IResult *pResult, void *pUserData);
33 static void ConSpectate(IConsole::IResult *pResult, void *pUserData);
34 static void ConSpectateNext(IConsole::IResult *pResult, void *pUserData);
35 static void ConSpectatePrevious(IConsole::IResult *pResult, void *pUserData);
36 static void ConSpectateClosest(IConsole::IResult *pResult, void *pUserData);
37 static void ConMultiView(IConsole::IResult *pResult, void *pUserData);
38
39public:
40 CSpectator();
41 virtual int Sizeof() const override { return sizeof(*this); }
42
43 virtual void OnConsoleInit() override;
44 virtual bool OnCursorMove(float x, float y, IInput::ECursorType CursorType) override;
45 virtual bool OnInput(const IInput::CEvent &Event) override;
46 virtual void OnRender() override;
47 virtual void OnRelease() override;
48 virtual void OnReset() override;
49
50 void Spectate(int SpectatorId);
51 void SpectateClosest();
52
53 bool IsActive() const { return m_Active; }
54};
55
56#endif
Definition: component.h:20
Definition: spectator.h:12
bool m_Active
Definition: spectator.h:19
void Spectate(int SpectatorId)
Definition: spectator.cpp:609
static void ConSpectate(IConsole::IResult *pResult, void *pUserData)
Definition: spectator.cpp:89
virtual bool OnInput(const IInput::CEvent &Event) override
Definition: spectator.cpp:189
virtual int Sizeof() const override
Definition: spectator.h:41
@ MULTI_VIEW
Definition: spectator.h:15
@ NO_SELECTION
Definition: spectator.h:16
static void ConMultiView(IConsole::IResult *pResult, void *pUserData)
Definition: spectator.cpp:152
virtual void OnConsoleInit() override
Definition: spectator.cpp:169
static void ConSpectateNext(IConsole::IResult *pResult, void *pUserData)
Definition: spectator.cpp:98
virtual void OnRender() override
Definition: spectator.cpp:221
void SpectateClosest()
Definition: spectator.cpp:644
float m_MultiViewActivateDelay
Definition: spectator.h:27
static void ConSpectatePrevious(IConsole::IResult *pResult, void *pUserData)
Definition: spectator.cpp:107
virtual bool OnCursorMove(float x, float y, IInput::ECursorType CursorType) override
Definition: spectator.cpp:179
bool IsActive() const
Definition: spectator.h:53
CSpectator()
Definition: spectator.cpp:163
void SpectateNext(bool Reverse)
Definition: spectator.cpp:27
CUi::CTouchState m_TouchState
Definition: spectator.h:25
virtual void OnRelease() override
Definition: spectator.cpp:216
int m_SelectedSpectatorId
Definition: spectator.h:22
static void ConKeySpectator(IConsole::IResult *pResult, void *pUserData)
Definition: spectator.cpp:79
virtual void OnReset() override
Definition: spectator.cpp:602
bool CanChangeSpectator()
Definition: spectator.cpp:21
vec2 m_SelectorMouse
Definition: spectator.h:23
static void ConSpectateClosest(IConsole::IResult *pResult, void *pUserData)
Definition: spectator.cpp:116
bool m_WasActive
Definition: spectator.h:20
Definition: ui.h:327
Definition: console.h:45
Definition: input.h:24
ECursorType
Definition: input.h:39