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

summaryrefslogtreecommitdiff
path: root/source/frontend/StarMainInterface.cpp
diff options
context:
space:
mode:
authorWereTech <17415815+WereTech@users.noreply.github.com>2025-02-23 16:31:03 -0600
committerGitHub <noreply@github.com>2025-02-23 16:31:03 -0600
commit0245e639ecc51d948f0256eb4a773d42fbb8ade5 (patch)
tree7fc9b120efda129c09e522fc08af2d28e52d3eb6 /source/frontend/StarMainInterface.cpp
parent3108120076bad6b934c43526200f2beed4c96753 (diff)
parent5dda9f47306a6eea5eb4e676c68f81b8285d9dfe (diff)
Merge branch 'OpenStarbound:main' into main
Diffstat (limited to 'source/frontend/StarMainInterface.cpp')
-rw-r--r--source/frontend/StarMainInterface.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/source/frontend/StarMainInterface.cpp b/source/frontend/StarMainInterface.cpp
index 8468f7f..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"
@@ -57,6 +58,7 @@
#include "StarContainerInteractor.hpp"
#include "StarChatBubbleManager.hpp"
#include "StarNpc.hpp"
+#include "StarCharSelection.hpp"
namespace Star {
@@ -168,6 +170,29 @@ 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->switchPlayer(mainPlayer->uuid());
+ 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);
+ }, [=](Uuid) {});
+ 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<ButtonWidget>("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<NameplatePainter>();
m_questIndicatorPainter = make_shared<QuestIndicatorPainter>(m_client);
m_chatBubbleManager = make_shared<ChatBubbleManager>();