| 118 | } |
| 119 | |
| 120 | void 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 | |
| 170 | void CGameObject::SelectObjectHandlesTexture() |
| 171 | { |
no test coverage detected