| 1553 | } |
| 1554 | |
| 1555 | bool MainInterface::overlayClick(Vec2I const& mousePos, MouseButton) { |
| 1556 | PolyI mainBarPoly = m_config->mainBarPoly; |
| 1557 | Vec2I barPos = mainBarPosition(); |
| 1558 | mainBarPoly.translate(barPos); |
| 1559 | mainBarPoly.scale(interfaceScale(), barPos); |
| 1560 | |
| 1561 | if (overButton(m_config->mainBarInventoryButtonPoly, mousePos)) { |
| 1562 | m_paneManager.toggleRegisteredPane(MainInterfacePanes::Inventory); |
| 1563 | return true; |
| 1564 | } |
| 1565 | |
| 1566 | if (overButton(m_config->mainBarCraftButtonPoly, mousePos)) { |
| 1567 | togglePlainCraftingWindow(); |
| 1568 | return true; |
| 1569 | } |
| 1570 | |
| 1571 | if (overButton(m_config->mainBarCodexButtonPoly, mousePos)) { |
| 1572 | m_paneManager.toggleRegisteredPane(MainInterfacePanes::Codex); |
| 1573 | return true; |
| 1574 | } |
| 1575 | |
| 1576 | if (overButton(m_config->mainBarDeployButtonPoly, mousePos)) { |
| 1577 | if (m_client->canBeamDown(true)) |
| 1578 | warpToOrbitedWorld(true); |
| 1579 | else if (m_client->canBeamUp()) |
| 1580 | warpToOwnShip(); |
| 1581 | return true; |
| 1582 | } |
| 1583 | |
| 1584 | if (overButton(m_config->mainBarBeamButtonPoly, mousePos)) { |
| 1585 | if (m_client->canBeamDown()) |
| 1586 | warpToOrbitedWorld(); |
| 1587 | return true; |
| 1588 | } |
| 1589 | |
| 1590 | if (overButton(m_config->mainBarQuestLogButtonPoly, mousePos)) { |
| 1591 | m_paneManager.toggleRegisteredPane(MainInterfacePanes::QuestLog); |
| 1592 | return true; |
| 1593 | } |
| 1594 | |
| 1595 | if (overButton(m_config->mainBarMmUpgradeButtonPoly, mousePos)) { |
| 1596 | if (m_client->mainPlayer()->inventory()->essentialItem(EssentialItem::BeamAxe)) |
| 1597 | m_paneManager.toggleRegisteredPane(MainInterfacePanes::MmUpgrade); |
| 1598 | return true; |
| 1599 | } |
| 1600 | |
| 1601 | if (overButton(m_config->mainBarCollectionsButtonPoly, mousePos)) { |
| 1602 | m_paneManager.toggleRegisteredPane(MainInterfacePanes::Collections); |
| 1603 | return true; |
| 1604 | } |
| 1605 | |
| 1606 | return false; |
| 1607 | } |
| 1608 | |
| 1609 | void MainInterface::displayScriptPane(ScriptPanePtr& scriptPane, EntityId sourceEntity) { |
| 1610 | // keep any number of script panes open with null source entities |
nothing calls this directly
no test coverage detected