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

Method DrawObjectHandlesTexture

src/GameObjects/GameObject.cpp:120–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118}
119
120void CGameObject::DrawObjectHandlesTexture()
121{
122 if (m_TextureObjectHandles.Texture == 0)
123 {
124 if (NPC)
125 {
126 GenerateObjectHandlesTexture(wstr_from(m_Name));
127 }
128 else
129 {
130 auto name = wstr_from(m_Name);
131 if (name.length() == 0u)
132 {
133 name = g_ClilocManager.Cliloc(g_Language)
134 ->GetW(1020000 + Graphic, true, g_Data.m_Static[Graphic].Name);
135 }
136 GenerateObjectHandlesTexture(name);
137 }
138 }
139
140 int x = DrawX - g_ObjectHandlesWidthOffset;
141 int y = DrawY;
142 if (NPC)
143 {
144 CGameCharacter *gc = (CGameCharacter *)this;
145 const AnimationState anim = { this->GetGraphicForAnimation(), 0, 0 };
146 const auto dims = g_AnimationManager.GetAnimationDimensions(
147 this->AnimIndex, anim, this->IsMounted(), this->IsCorpse());
148 x += gc->OffsetX;
149 y += gc->OffsetY - (gc->OffsetZ + dims.Height + dims.CenterY + s_objectHandleOffsetY);
150 }
151 else if (IsCorpse())
152 {
153 x += 20;
154 y -= g_Game.GetStaticArtDimension(Graphic).Height + s_bodyHandleOffsetY;
155 }
156 else
157 {
158 y -= g_Game.GetStaticArtDimension(Graphic).Height;
159 }
160
161 if (g_ConfigManager.ObjectHandlesNoBodies && IsCorpse())
162 {
163 }
164 else
165 {
166 m_TextureObjectHandles.Draw(x, y);
167 }
168}
169
170void CGameObject::SelectObjectHandlesTexture()
171{

Callers 1

DrawGameWindowMethod · 0.80

Calls 10

IsMountedMethod · 0.95
IsCorpseMethod · 0.95
wstr_fromFunction · 0.85
lengthMethod · 0.80
GetWMethod · 0.80
ClilocMethod · 0.80
GetStaticArtDimensionMethod · 0.80
DrawMethod · 0.45

Tested by

no test coverage detected