DDraceNetwork Docs
nameplates.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_NAMEPLATES_H
4#define GAME_CLIENT_COMPONENTS_NAMEPLATES_H
5#include <base/vmath.h>
6
8#include <engine/textrender.h>
9
11
14
15class CNamePlates;
16
18{
19public:
21 {
22 public:
24 {
25 Reset();
26 }
27 void Reset()
28 {
30 m_Id = -1;
31 m_aName[0] = '\0';
32 m_FriendMark = false;
33 m_FontSize = -INFINITY;
34 }
35 void Update(CNamePlates &This, int Id, const char *pName, bool FriendMark, float FontSize);
38 int m_Id;
41 };
43 {
44 public:
46 {
47 Reset();
48 }
49 void Reset()
50 {
52 m_aClan[0] = '\0';
53 m_FontSize = -INFINITY;
54 }
55 void Update(CNamePlates &This, const char *pClan, float FontSize);
59 };
61 {
62 public:
64 {
65 Reset();
66 }
67 void Reset()
68 {
70 m_Id = -1;
71 m_FontSize = -INFINITY;
72 }
73 void Update(CNamePlates &This, int Id, float FontSize);
75 int m_Id;
77 };
79 {
80 Reset();
81 }
82 void Reset()
83 {
84 m_Name.Reset();
85 m_Clan.Reset();
87 }
89 {
93 }
97};
98
99class CNamePlates : public CComponent
100{
104
106
107 void ResetNamePlates();
108
111 {
112 public:
116 float m_Alpha;
117 const char *m_pName;
121 const char *m_pClan;
133 };
134 void RenderNamePlate(CNamePlate &NamePlate, const CRenderNamePlateData &Data);
135
136public:
137 void RenderNamePlateGame(vec2 Position, const CNetObj_PlayerInfo *pPlayerInfo, float Alpha, bool ForceAlpha);
138 void RenderNamePlatePreview(vec2 Position);
139 virtual int Sizeof() const override { return sizeof(*this); }
140 virtual void OnWindowResize() override;
141 virtual void OnInit() override;
142 virtual void OnRender() override;
143};
144
145#endif
Definition: component.h:20
Definition: nameplates.h:43
float m_FontSize
Definition: nameplates.h:58
void Update(CNamePlates &This, const char *pClan, float FontSize)
Definition: nameplates.cpp:59
STextContainerIndex m_TextContainerIndex
Definition: nameplates.h:56
void Reset()
Definition: nameplates.h:49
CNamePlateClan()
Definition: nameplates.h:45
char m_aClan[MAX_CLAN_LENGTH]
Definition: nameplates.h:57
Definition: nameplates.h:61
CNamePlateHookWeakStrongId()
Definition: nameplates.h:63
STextContainerIndex m_TextContainerIndex
Definition: nameplates.h:74
float m_FontSize
Definition: nameplates.h:76
void Reset()
Definition: nameplates.h:67
int m_Id
Definition: nameplates.h:75
void Update(CNamePlates &This, int Id, float FontSize)
Definition: nameplates.cpp:79
Definition: nameplates.h:21
float m_FontSize
Definition: nameplates.h:40
void Reset()
Definition: nameplates.h:27
char m_aName[MAX_NAME_LENGTH]
Definition: nameplates.h:37
void Update(CNamePlates &This, int Id, const char *pName, bool FriendMark, float FontSize)
Definition: nameplates.cpp:17
CNamePlateName()
Definition: nameplates.h:23
bool m_FriendMark
Definition: nameplates.h:39
int m_Id
Definition: nameplates.h:38
STextContainerIndex m_TextContainerIndex
Definition: nameplates.h:36
Definition: nameplates.h:18
void Reset()
Definition: nameplates.h:82
CNamePlateClan m_Clan
Definition: nameplates.h:95
CNamePlateHookWeakStrongId m_WeakStrongId
Definition: nameplates.h:96
CNamePlateName m_Name
Definition: nameplates.h:94
CNamePlate()
Definition: nameplates.h:78
void DeleteTextContainers(ITextRender &TextRender)
Definition: nameplates.h:88
Definition: nameplates.h:111
int m_HookWeakStrongId
Definition: nameplates.h:131
bool m_ShowHookWeakStrong
Definition: nameplates.h:128
ColorRGBA m_Color
Definition: nameplates.h:114
ColorRGBA m_OutlineColor
Definition: nameplates.h:115
bool m_DirRight
Definition: nameplates.h:126
TRISTATE m_HookWeakStrong
Definition: nameplates.h:129
bool m_ShowDirection
Definition: nameplates.h:123
float m_Alpha
Definition: nameplates.h:116
bool m_DirJump
Definition: nameplates.h:125
bool m_ShowFriendMark
Definition: nameplates.h:118
const char * m_pName
Definition: nameplates.h:117
float m_FontSizeClan
Definition: nameplates.h:122
vec2 m_Position
Definition: nameplates.h:113
bool m_DirLeft
Definition: nameplates.h:124
float m_FontSizeHookWeakStrong
Definition: nameplates.h:132
float m_FontSizeDirection
Definition: nameplates.h:127
int m_ClientId
Definition: nameplates.h:119
float m_FontSize
Definition: nameplates.h:120
const char * m_pClan
Definition: nameplates.h:121
bool m_ShowHookWeakStrongId
Definition: nameplates.h:130
Definition: nameplates.h:100
virtual void OnInit() override
Definition: nameplates.cpp:446
void RenderNamePlate(CNamePlate &NamePlate, const CRenderNamePlateData &Data)
Definition: nameplates.cpp:101
int m_DirectionQuadContainerIndex
Definition: nameplates.h:109
virtual void OnWindowResize() override
Definition: nameplates.cpp:441
void ResetNamePlates()
Definition: nameplates.cpp:432
void RenderNamePlatePreview(vec2 Position)
Definition: nameplates.cpp:340
virtual int Sizeof() const override
Definition: nameplates.h:139
CNamePlate m_aNamePlates[MAX_CLIENTS]
Definition: nameplates.h:105
virtual void OnRender() override
Definition: nameplates.cpp:376
void RenderNamePlateGame(vec2 Position, const CNetObj_PlayerInfo *pPlayerInfo, float Alpha, bool ForceAlpha)
Definition: nameplates.cpp:214
Definition: color.h:210
Definition: textrender.h:314
virtual void DeleteTextContainer(STextContainerIndex &TextContainerIndex)=0
@ MAX_CLAN_LENGTH
Definition: protocol.h:98
@ MAX_CLIENTS
Definition: protocol.h:88
@ MAX_NAME_LENGTH
Definition: protocol.h:97
Definition: protocol.h:455
Definition: protocol.h:467
Definition: textrender.h:295
void Reset()
Definition: textrender.h:302
TRISTATE
Definition: types.h:7