diff options
Diffstat (limited to 'source/frontend/StarMainInterface.cpp')
-rw-r--r-- | source/frontend/StarMainInterface.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/source/frontend/StarMainInterface.cpp b/source/frontend/StarMainInterface.cpp index 320cd4f..2b2bb5f 100644 --- a/source/frontend/StarMainInterface.cpp +++ b/source/frontend/StarMainInterface.cpp @@ -169,11 +169,23 @@ MainInterface::MainInterface(UniverseClientPtr client, WorldPainterPtr painter, planetName->addChild("planetText", m_planetText); m_paneManager.registerPane(MainInterfacePanes::PlanetText, PaneLayer::Hud, planetName); - auto charSelectionMenu = make_shared<CharSelectionPane>(m_client->playerStorage(), [=]() {}, [=](PlayerPtr mainPlayer) { - m_client->playerStorage()->moveToFront(mainPlayer->uuid()); - m_client->switchPlayer(mainPlayer->uuid()); - m_paneManager.dismissRegisteredPane(MainInterfacePanes::CharacterSwap); }, [=](Uuid) {}); - charSelectionMenu->setAnchor(PaneAnchor::Center); + auto charSelectionMenu = make_shared<CharSelectionPane>(m_client->playerStorage(), [=]() {}, + [=](PlayerPtr mainPlayer) { + auto configuration = Root::singleton().configuration(); + if (configuration->get("characterSwapMovesToFront", false).toBool()) + m_client->playerStorage()->moveToFront(mainPlayer->uuid()); + if (configuration->get("characterSwapDismisses", false).toBool()) + m_paneManager.dismissRegisteredPane(MainInterfacePanes::CharacterSwap); + m_client->switchPlayer(mainPlayer->uuid()); + }, [=](Uuid) {}); + { + charSelectionMenu->setReadOnly(true); + charSelectionMenu->setAnchor(PaneAnchor::Center); + charSelectionMenu->unlockPosition(); + auto backgrounds = charSelectionMenu->getBG(); + backgrounds.header = std::move(backgrounds.body); + charSelectionMenu->setBG(backgrounds); + } m_paneManager.registerPane(MainInterfacePanes::CharacterSwap, PaneLayer::ModalWindow, charSelectionMenu); |