diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2025-02-23 06:19:13 +1100 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2025-02-23 06:19:13 +1100 |
commit | 61cefb79a1fb5ccf0be73aff23af5a6e79ad79c4 (patch) | |
tree | 80a4da5755e0f2c9d1ddad5e81ce8e35e82122f5 /source/frontend/StarMainInterface.cpp | |
parent | d0b15c335d9bf8b915e82d230a757671180bf80a (diff) |
remove unusable buttons, make configurable and draggable
[skip ci]
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); |