Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/frontend/StarMainInterface.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2025-02-23 06:19:42 +1100
committerGitHub <noreply@github.com>2025-02-23 06:19:42 +1100
commit70e7b383902f0f5c16e47b20095953c7e0e1100b (patch)
treef999696f90f7b53f80eb0d0d411d076b0db5b197 /source/frontend/StarMainInterface.cpp
parent2aec6a1592122fdeb7b8ce2bc1402af184ee670f (diff)
parent61cefb79a1fb5ccf0be73aff23af5a6e79ad79c4 (diff)
Merge pull request #192 from KrashV/main
Create CharacterSwap pane
Diffstat (limited to 'source/frontend/StarMainInterface.cpp')
-rw-r--r--source/frontend/StarMainInterface.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/source/frontend/StarMainInterface.cpp b/source/frontend/StarMainInterface.cpp
index 8468f7f..2b2bb5f 100644
--- a/source/frontend/StarMainInterface.cpp
+++ b/source/frontend/StarMainInterface.cpp
@@ -57,6 +57,7 @@
#include "StarContainerInteractor.hpp"
#include "StarChatBubbleManager.hpp"
#include "StarNpc.hpp"
+#include "StarCharSelection.hpp"
namespace Star {
@@ -168,6 +169,26 @@ 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) {
+ 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);
+
m_nameplatePainter = make_shared<NameplatePainter>();
m_questIndicatorPainter = make_shared<QuestIndicatorPainter>(m_client);
m_chatBubbleManager = make_shared<ChatBubbleManager>();