MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / openCraftingWindow

Method openCraftingWindow

source/frontend/StarMainInterface.cpp:217–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

215}
216
217void 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
233void MainInterface::openMerchantWindow(Json const& config, EntityId sourceEntityId) {
234 if (m_merchantWindow && m_paneManager.isDisplayed(m_merchantWindow)) {

Callers

nothing calls this directly

Calls 8

dismissPaneMethod · 0.80
worldClientMethod · 0.80
mainPlayerMethod · 0.80
displayPaneMethod · 0.80
isDisplayedMethod · 0.45
sourceEntityIdMethod · 0.45
resetMethod · 0.45
clearSwapMethod · 0.45

Tested by

no test coverage detected