DDraceNetwork Docs
infomessages.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_INFOMESSAGES_H
4#define GAME_CLIENT_COMPONENTS_INFOMESSAGES_H
5#include <engine/textrender.h>
7
10{
13
14 enum
15 {
18 };
19
20 enum EType
21 {
24 };
25
26 struct CInfoMsg
27 {
29 int m_Tick;
30
33 char m_aVictimName[64];
37 char m_aKillerName[64];
40
41 // kill msg
43 int m_ModeSpecial; // for CTF, if the guy is carrying a flag for example
46
47 // finish msg
48 int m_Diff;
49 char m_aTimeText[32];
50 char m_aDiffText[32];
54 };
55
58
60 void AddInfoMsg(const CInfoMsg &InfoMsg);
61 void RenderKillMsg(const CInfoMsg &InfoMsg, float x, float y);
62 void RenderFinishMsg(const CInfoMsg &InfoMsg, float x, float y);
63
64 void OnTeamKillMessage(const struct CNetMsg_Sv_KillMsgTeam *pMsg);
65 void OnKillMessage(const struct CNetMsg_Sv_KillMsg *pMsg);
66 void OnRaceFinishMessage(const struct CNetMsg_Sv_RaceFinish *pMsg);
67
69 void DeleteTextContainers(CInfoMsg &InfoMsg);
70
71public:
72 virtual int Sizeof() const override { return sizeof(*this); }
73 virtual void OnWindowResize() override;
74 virtual void OnRefreshSkins() override;
75 virtual void OnReset() override;
76 virtual void OnRender() override;
77 virtual void OnMessage(int MsgType, void *pRawMsg) override;
78 virtual void OnInit() override;
79};
80
81#endif
Definition: component.h:20
Definition: infomessages.h:10
void RenderKillMsg(const CInfoMsg &InfoMsg, float x, float y)
Definition: infomessages.cpp:285
virtual void OnMessage(int MsgType, void *pRawMsg) override
Definition: infomessages.cpp:192
@ MAX_KILLMSG_TEAM_MEMBERS
Definition: infomessages.h:17
@ MAX_INFOMSGS
Definition: infomessages.h:16
void OnRaceFinishMessage(const struct CNetMsg_Sv_RaceFinish *pMsg)
Definition: infomessages.cpp:262
void RenderFinishMsg(const CInfoMsg &InfoMsg, float x, float y)
Definition: infomessages.cpp:380
EType
Definition: infomessages.h:21
@ TYPE_KILL
Definition: infomessages.h:22
@ TYPE_FINISH
Definition: infomessages.h:23
void CreateTextContainersIfNotCreated(CInfoMsg &InfoMsg)
Definition: infomessages.cpp:135
void OnTeamKillMessage(const struct CNetMsg_Sv_KillMsgTeam *pMsg)
Definition: infomessages.cpp:211
virtual void OnInit() override
Definition: infomessages.cpp:47
virtual void OnRefreshSkins() override
Definition: infomessages.cpp:463
void DeleteTextContainers(CInfoMsg &InfoMsg)
Definition: infomessages.cpp:39
void AddInfoMsg(const CInfoMsg &InfoMsg)
Definition: infomessages.cpp:110
int m_SpriteQuadContainerIndex
Definition: infomessages.h:11
virtual void OnWindowResize() override
Definition: infomessages.cpp:21
virtual void OnRender() override
Definition: infomessages.cpp:422
CInfoMsg CreateInfoMsg(EType Type)
Definition: infomessages.cpp:76
void OnKillMessage(const struct CNetMsg_Sv_KillMsg *pMsg)
Definition: infomessages.cpp:241
int m_QuadOffsetRaceFlag
Definition: infomessages.h:12
virtual void OnReset() override
Definition: infomessages.cpp:29
CInfoMsg m_aInfoMsgs[MAX_INFOMSGS]
Definition: infomessages.h:56
int m_InfoMsgCurrent
Definition: infomessages.h:57
virtual int Sizeof() const override
Definition: infomessages.h:72
Definition: render.h:34
Definition: infomessages.h:27
int m_VictimDDTeam
Definition: infomessages.h:32
int m_TeamSize
Definition: infomessages.h:45
char m_aDiffText[32]
Definition: infomessages.h:50
int m_Weapon
Definition: infomessages.h:42
STextContainerIndex m_DiffTextContainerIndex
Definition: infomessages.h:52
char m_aTimeText[32]
Definition: infomessages.h:49
char m_aKillerName[64]
Definition: infomessages.h:37
EType m_Type
Definition: infomessages.h:28
STextContainerIndex m_KillerTextContainerIndex
Definition: infomessages.h:38
bool m_RecordPersonal
Definition: infomessages.h:53
STextContainerIndex m_TimeTextContainerIndex
Definition: infomessages.h:51
CTeeRenderInfo m_aVictimRenderInfo[MAX_KILLMSG_TEAM_MEMBERS]
Definition: infomessages.h:35
int m_Diff
Definition: infomessages.h:48
CTeeRenderInfo m_KillerRenderInfo
Definition: infomessages.h:39
int m_aVictimIds[MAX_KILLMSG_TEAM_MEMBERS]
Definition: infomessages.h:31
int m_KillerId
Definition: infomessages.h:36
STextContainerIndex m_VictimTextContainerIndex
Definition: infomessages.h:34
int m_ModeSpecial
Definition: infomessages.h:43
int m_Tick
Definition: infomessages.h:29
int m_FlagCarrierBlue
Definition: infomessages.h:44
char m_aVictimName[64]
Definition: infomessages.h:33
Definition: protocol.h:1191
Definition: protocol.h:709
Definition: textrender.h:293