| 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_MOTD_H |
| 4 | #define GAME_CLIENT_COMPONENTS_MOTD_H |
| 5 | |
| 6 | #include <engine/shared/config.h> |
| 7 | #include <engine/textrender.h> |
| 8 | |
| 9 | #include <game/client/component.h> |
| 10 | |
| 11 | class CMotd : public CComponent |
| 12 | { |
| 13 | char m_aServerMotd[std::size(g_Config.m_SvMotd)]; |
| 14 | int64_t m_ServerMotdTime; |
| 15 | int64_t m_ServerMotdUpdateTime; |
| 16 | int m_RectQuadContainer = -1; |
| 17 | STextContainerIndex m_TextContainerIndex; |
| 18 | |
| 19 | public: |
| 20 | CMotd(); |
| 21 | int Sizeof() const override { return sizeof(*this); } |
| 22 | |
| 23 | const char *ServerMotd() const { return m_aServerMotd; } |
| 24 | int64_t ServerMotdUpdateTime() const { return m_ServerMotdUpdateTime; } |
| 25 | void Clear(); |
| 26 | bool IsActive() const; |
| 27 | |
| 28 | void OnRender() override; |
| 29 | void OnStateChange(int NewState, int OldState) override; |
| 30 | void OnWindowResize() override; |
| 31 | void OnMessage(int MsgType, void *pRawMsg) override; |
| 32 | bool OnInput(const IInput::CEvent &Event) override; |
| 33 | }; |
| 34 | |
| 35 | #endif |
| 36 | |