| 258 | } |
| 259 | |
| 260 | void CTextRenderer::Select(CGump *gump) |
| 261 | { |
| 262 | if (gump != nullptr) |
| 263 | { |
| 264 | CalculatePositions(true); |
| 265 | } |
| 266 | else |
| 267 | { |
| 268 | CalculateWorldPositions(true); |
| 269 | } |
| 270 | |
| 271 | int renderIndex = g_GameScreen.RenderIndex - 1; |
| 272 | if (renderIndex < 1) |
| 273 | { |
| 274 | renderIndex = 99; |
| 275 | } |
| 276 | |
| 277 | for (CRenderTextObject *item = m_DrawPointer; item != nullptr; item = item->m_PrevDraw) |
| 278 | { |
| 279 | if (!item->IsText()) |
| 280 | { |
| 281 | continue; |
| 282 | } |
| 283 | |
| 284 | CTextData &text = *(CTextData *)item; |
| 285 | if (text.Timer >= g_Ticks) |
| 286 | { |
| 287 | if (gump == nullptr && |
| 288 | (text.Owner == nullptr || text.Owner->UseInRender != renderIndex)) |
| 289 | { |
| 290 | continue; |
| 291 | } |
| 292 | |
| 293 | if (text.m_TextSprite.Select(text.RealDrawX, text.RealDrawY)) |
| 294 | { |
| 295 | g_SelectedObject.Init(item, gump); |
| 296 | } |
| 297 | } |
| 298 | } |
| 299 | } |
| 300 | |
| 301 | bool CTextRenderer::CalculateWorldPositions(bool noCalculate) |
| 302 | { |