| 1457 | } |
| 1458 | |
| 1459 | void MainInterface::updateCursor() { |
| 1460 | Maybe<String> cursorOverride = m_actionBar->cursorOverride(m_cursorScreenIPos); |
| 1461 | |
| 1462 | if (!cursorOverride) { |
| 1463 | if (auto pane = m_paneManager.getPaneAt(m_cursorScreenIPos / interfaceScale())) { |
| 1464 | cursorOverride = cursorOverride.orMaybe(pane->cursorOverride(m_cursorScreenIPos / interfaceScale())); |
| 1465 | } else { |
| 1466 | auto player = m_client->mainPlayer(); |
| 1467 | if (auto anchorState = m_client->mainPlayer()->loungingIn()) { |
| 1468 | if (auto loungeable = m_client->worldClient()->get<LoungeableEntity>(anchorState->entityId)) { |
| 1469 | if (auto loungeAnchor = loungeable->loungeAnchor(anchorState->positionIndex)) |
| 1470 | cursorOverride = cursorOverride.orMaybe(loungeAnchor->cursorOverride); |
| 1471 | } |
| 1472 | } |
| 1473 | if (!cursorOverride) { |
| 1474 | for (auto item : {player->primaryHandItem(), player->altHandItem()}) { |
| 1475 | if (auto activeItem = as<ActiveItem>(item)) { |
| 1476 | if (auto cursor = activeItem->cursor()) { |
| 1477 | cursorOverride = cursor; |
| 1478 | break; |
| 1479 | } |
| 1480 | } else if (auto inspectionTool = as<InspectionTool>(item)) { |
| 1481 | cursorOverride = String("/cursors/inspect.cursor"); |
| 1482 | break; |
| 1483 | } |
| 1484 | } |
| 1485 | } |
| 1486 | } |
| 1487 | } |
| 1488 | |
| 1489 | if (cursorOverride) |
| 1490 | m_cursor.setCursor(cursorOverride.take()); |
| 1491 | else |
| 1492 | m_cursor.resetCursor(); |
| 1493 | } |
| 1494 | |
| 1495 | void MainInterface::renderCursor() { |
| 1496 | // if we're currently playing a cinematic, we should not render the mouse. |
nothing calls this directly
no test coverage detected