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
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
@ MULTI_VIEW
Definition: spectator.h:15
@ NO_SELECTION
Definition: spectator.h:16
void Spectate(int SpectatorId)
Definition: spectator.cpp:595
static void ConSpectate(IConsole::IResult *pResult, void *pUserData)
Definition: spectator.cpp:96
virtual bool OnInput(const IInput::CEvent &Event) override
Definition: spectator.cpp:166
virtual int Sizeof() const override
Definition: spectator.h:41
bool CanChangeSpectatorId()
Definition: spectator.cpp:21
static void ConMultiView(IConsole::IResult *pResult, void *pUserData)
Definition: spectator.cpp:129
virtual void OnConsoleInit() override
Definition: spectator.cpp:146
static void ConSpectateNext(IConsole::IResult *pResult, void *pUserData)
Definition: spectator.cpp:105
virtual void OnRender() override
Definition: spectator.cpp:207
void SpectateClosest()
Definition: spectator.cpp:630
float m_MultiViewActivateDelay
Definition: spectator.h:27
static void ConSpectatePrevious(IConsole::IResult *pResult, void *pUserData)
Definition: spectator.cpp:114
virtual bool OnCursorMove(float x, float y, IInput::ECursorType CursorType) override
Definition: spectator.cpp:156
bool IsActive() const
Definition: spectator.h:53
CSpectator()
Definition: spectator.cpp:140
void SpectateNext(bool Reverse)
Definition: spectator.cpp:34
CUi::CTouchState m_TouchState
Definition: spectator.h:25
virtual void OnRelease() override
Definition: spectator.cpp:202
int m_SelectedSpectatorId
Definition: spectator.h:22
static void ConKeySpectator(IConsole::IResult *pResult, void *pUserData)
Definition: spectator.cpp:86
virtual void OnReset() override
Definition: spectator.cpp:588
vec2 m_SelectorMouse
Definition: spectator.h:23
static void ConSpectateClosest(IConsole::IResult *pResult, void *pUserData)
Definition: spectator.cpp:123
bool m_WasActive
Definition: spectator.h:20
Definition: ui.h:327
Definition: console.h:47
Definition: input.h:22
ECursorType
Definition: input.h:37