From ee2f625754ca9f01be6732550f16098c5afa704a Mon Sep 17 00:00:00 2001 From: oy Date: Thu, 10 Mar 2011 10:08:14 +0100 Subject: added extended spectator mode. Closes #28 --- src/game/client/components/spectator.h | 37 ++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/game/client/components/spectator.h (limited to 'src/game/client/components/spectator.h') diff --git a/src/game/client/components/spectator.h b/src/game/client/components/spectator.h new file mode 100644 index 00000000..607780f5 --- /dev/null +++ b/src/game/client/components/spectator.h @@ -0,0 +1,37 @@ +/* (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 + +#include + +class CSpectator : public CComponent +{ + enum + { + NO_SELECTION=-2, + }; + + bool m_Active; + bool m_WasActive; + + int m_SelectedSpectatorID; + vec2 m_SelectorMouse; + + static void ConKeySpectator(IConsole::IResult *pResult, void *pUserData); + static void ConSpectate(IConsole::IResult *pResult, void *pUserData); + +public: + CSpectator(); + + virtual void OnConsoleInit(); + virtual bool OnMouseMove(float x, float y); + virtual void OnRender(); + virtual void OnRelease(); + virtual void OnReset(); + + void Spectate(int SpectatorID); +}; + +#endif -- cgit 1.4.1