| 215 | } |
| 216 | |
| 217 | void MainInterface::openCraftingWindow(Json const& config, EntityId sourceEntityId) { |
| 218 | if (m_craftingWindow && m_paneManager.isDisplayed(m_craftingWindow)) { |
| 219 | m_paneManager.dismissPane(m_craftingWindow); |
| 220 | if (sourceEntityId != NullEntityId && m_craftingWindow->sourceEntityId() == sourceEntityId) { |
| 221 | m_craftingWindow.reset(); |
| 222 | return; |
| 223 | } |
| 224 | } |
| 225 | |
| 226 | m_craftingWindow = make_shared<CraftingPane>(m_client->worldClient(), m_client->mainPlayer(), config, sourceEntityId); |
| 227 | m_paneManager.displayPane(PaneLayer::Window, m_craftingWindow, [this](PanePtr const&) { |
| 228 | if (auto player = m_client->mainPlayer()) |
| 229 | player->clearSwap(); |
| 230 | }); |
| 231 | } |
| 232 | |
| 233 | void MainInterface::openMerchantWindow(Json const& config, EntityId sourceEntityId) { |
| 234 | if (m_merchantWindow && m_paneManager.isDisplayed(m_merchantWindow)) { |
nothing calls this directly
no test coverage detected