| 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_EMOTICON_H |
| 4 | #define GAME_CLIENT_COMPONENTS_EMOTICON_H |
| 5 | #include <base/vmath.h> |
| 6 | |
| 7 | #include <engine/console.h> |
| 8 | |
| 9 | #include <game/client/component.h> |
| 10 | #include <game/client/ui.h> |
| 11 | |
| 12 | class CEmoticon : public CComponent |
| 13 | { |
| 14 | bool m_WasActive; |
| 15 | bool m_Active; |
| 16 | |
| 17 | vec2 m_SelectorMouse; |
| 18 | int m_SelectedEmote; |
| 19 | int m_SelectedEyeEmote; |
| 20 | |
| 21 | CUi::CTouchState m_TouchState; |
| 22 | bool m_TouchPressedOutside; |
| 23 | |
| 24 | static void ConKeyEmoticon(IConsole::IResult *pResult, void *pUserData); |
| 25 | static void ConEmote(IConsole::IResult *pResult, void *pUserData); |
| 26 | |
| 27 | public: |
| 28 | CEmoticon(); |
| 29 | int Sizeof() const override { return sizeof(*this); } |
| 30 | |
| 31 | void OnReset() override; |
| 32 | void OnConsoleInit() override; |
| 33 | void OnRender() override; |
| 34 | void OnRelease() override; |
| 35 | bool OnCursorMove(float x, float y, IInput::ECursorType CursorType) override; |
| 36 | bool OnInput(const IInput::CEvent &Event) override; |
| 37 | |
| 38 | void Emote(int Emoticon); |
| 39 | void EyeEmote(int EyeEmote); |
| 40 | |
| 41 | bool IsActive() const { return m_Active; } |
| 42 | }; |
| 43 | |
| 44 | #endif |
| 45 | |