From 5dda9f47306a6eea5eb4e676c68f81b8285d9dfe Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Sun, 23 Feb 2025 09:03:38 +1100 Subject: add dismiss on swap checkbox --- source/frontend/StarMainInterface.cpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'source/frontend/StarMainInterface.cpp') diff --git a/source/frontend/StarMainInterface.cpp b/source/frontend/StarMainInterface.cpp index 033e1c9..e3b1860 100644 --- a/source/frontend/StarMainInterface.cpp +++ b/source/frontend/StarMainInterface.cpp @@ -27,6 +27,7 @@ #include "StarCanvasWidget.hpp" #include "StarLabelWidget.hpp" #include "StarItemSlotWidget.hpp" +#include "StarButtonWidget.hpp" #include "StarPlayer.hpp" #include "StarPlayerLog.hpp" #include "StarMonster.hpp" @@ -178,16 +179,19 @@ MainInterface::MainInterface(UniverseClientPtr client, WorldPainterPtr painter, if (configuration->get("characterSwapDismisses", false).toBool()) m_paneManager.dismissRegisteredPane(MainInterfacePanes::CharacterSwap); }, [=](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); + charSelectionMenu->setReadOnly(true); + charSelectionMenu->setAnchor(PaneAnchor::Center); + charSelectionMenu->unlockPosition(); + auto backgrounds = charSelectionMenu->getBG(); + backgrounds.header = std::move(backgrounds.body); + charSelectionMenu->setBG(backgrounds); + charSelectionMenu->findChild("toggleDismissLabel")->setVisibility(true); + auto toggleDismiss = charSelectionMenu->findChild("toggleDismissCheckbox"); + auto configuration = Root::singleton().configuration(); + toggleDismiss->setChecked(configuration->get("characterSwapDismisses", false).toBool()); + toggleDismiss->setVisibility(true); + + m_paneManager.registerPane(MainInterfacePanes::CharacterSwap, PaneLayer::Window, charSelectionMenu); m_nameplatePainter = make_shared(); m_questIndicatorPainter = make_shared(m_client); -- cgit v1.2.3