MCPcopy Create free account
hub / github.com/crossuo/crossuo / UpdateTextCoordinates

Method UpdateTextCoordinates

src/GameObjects/GameCharacter.cpp:112–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112void CGameCharacter::UpdateTextCoordinates()
113{
114 CTextData *text = (CTextData *)m_TextControl->Last();
115
116 if (text == nullptr)
117 {
118 return;
119 }
120
121 const AnimationState anim = { this->GetGraphicForAnimation(), 0, 0 };
122 const auto dims = g_AnimationManager.GetAnimationDimensions(
123 this->AnimIndex, anim, this->IsMounted(), this->IsCorpse());
124 int offset = 0;
125
126 int x = DrawX + OffsetX;
127 int y = DrawY + (OffsetY - OffsetZ) - ((dims.Height + dims.CenterY) + 8);
128
129 if (g_ConfigManager.GetDrawStatusState() == DCSS_ABOVE ||
130 g_ConfigManager.AlwaysDisplayHumanoidsName == true)
131 {
132 y -= 14;
133 }
134
135 for (; text != nullptr; text = (CTextData *)text->m_Prev)
136 {
137 offset += text->m_TextSprite.Height;
138
139 text->RealDrawX = x - (text->m_TextSprite.Width / 2);
140 text->RealDrawY = y - offset;
141 }
142}
143
144void CGameCharacter::UpdateHitsTexture(uint8_t hits)
145{

Callers

nothing calls this directly

Calls 6

LastMethod · 0.80
IsMountedMethod · 0.80
IsCorpseMethod · 0.80
GetDrawStatusStateMethod · 0.80

Tested by

no test coverage detected