ddnet/src/game/client/components/nameplates.h

62 lines
1.5 KiB
C
Raw Normal View History

2010-11-20 10:37:14 +00:00
/* (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. */
2010-05-29 07:25:38 +00:00
#ifndef GAME_CLIENT_COMPONENTS_NAMEPLATES_H
#define GAME_CLIENT_COMPONENTS_NAMEPLATES_H
#include <game/client/component.h>
struct SPlayerNamePlate
{
SPlayerNamePlate()
{
Reset();
}
void Reset()
{
2019-07-13 10:25:54 +00:00
m_NameTextContainerIndex = m_ClanNameTextContainerIndex = m_AfkMarkContainerIndex = -1;
m_aName[0] = 0;
m_aClanName[0] = 0;
2019-07-13 10:25:54 +00:00
m_aAfkMark[0] = 0;
m_NameTextWidth = m_ClanNameTextWidth = m_AfkMarkWidth = 0.f;
m_NameTextFontSize = m_ClanNameTextFontSize = 0;
}
char m_aName[MAX_NAME_LENGTH];
float m_NameTextWidth;
int m_NameTextContainerIndex;
float m_NameTextFontSize;
char m_aClanName[MAX_CLAN_LENGTH];
float m_ClanNameTextWidth;
int m_ClanNameTextContainerIndex;
float m_ClanNameTextFontSize;
2019-07-13 10:25:54 +00:00
char m_aAfkMark[MAX_NAME_LENGTH];
float m_AfkMarkWidth;
int m_AfkMarkContainerIndex;
float m_AfkMarkFontSize;
};
2010-05-29 07:25:38 +00:00
class CNamePlates : public CComponent
{
void MapscreenToGroup(float CenterX, float CenterY, CMapItemGroup *pGroup);
2010-05-29 07:25:38 +00:00
void RenderNameplate(
const CNetObj_Character *pPrevChar,
const CNetObj_Character *pPlayerChar,
const CNetObj_PlayerInfo *pPlayerInfo
2010-05-29 07:25:38 +00:00
);
SPlayerNamePlate m_aNamePlates[MAX_CLIENTS];
class CPlayers* m_pPlayers;
void ResetNamePlates();
2010-05-29 07:25:38 +00:00
public:
virtual void OnWindowResize();
virtual void OnInit();
2010-05-29 07:25:38 +00:00
virtual void OnRender();
void SetPlayers(class CPlayers* pPlayers);
2010-05-29 07:25:38 +00:00
};
#endif