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

summaryrefslogtreecommitdiff
path: root/source/frontend/StarTitleScreen.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2025-04-30 12:49:47 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2025-04-30 12:49:47 +1000
commitd3d4345e057d95d784e34be9b23e7fe07fb9a7c1 (patch)
treef59fa890e5be1d590e42a337448cecfc6b61850a /source/frontend/StarTitleScreen.cpp
parent86e229012f84744a1e878124d9a6e2991c0460bb (diff)
parent885502bf11057e7de961f178bc85ce93a9f40723 (diff)
Merge branch 'main' into pr/218
Diffstat (limited to 'source/frontend/StarTitleScreen.cpp')
-rw-r--r--source/frontend/StarTitleScreen.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/source/frontend/StarTitleScreen.cpp b/source/frontend/StarTitleScreen.cpp
index a32b51a..f1ffcd9 100644
--- a/source/frontend/StarTitleScreen.cpp
+++ b/source/frontend/StarTitleScreen.cpp
@@ -213,6 +213,15 @@ void TitleScreen::setMultiPlayerPassword(String password) {
m_password = std::move(password);
}
+bool TitleScreen::multiPlayerForceLegacy() const {
+ return m_forceLegacy;
+}
+
+void TitleScreen::setMultiPlayerForceLegacy(bool const& forceLegacy) {
+ m_multiPlayerMenu->fetchChild<ButtonWidget>("legacyCheckbox")->setChecked(forceLegacy);
+ m_forceLegacy = forceLegacy;
+}
+
void TitleScreen::initMainMenu() {
m_mainMenu = make_shared<Pane>();
auto backMenu = make_shared<Pane>();
@@ -347,7 +356,8 @@ void TitleScreen::initMultiPlayerMenu() {
{"address", multiPlayerAddress()},
{"account", multiPlayerAccount()},
{"port", multiPlayerPort()},
- //{"password", multiPlayerPassword()}
+ //{"password", multiPlayerPassword()},
+ {"forceLegacy",multiPlayerForceLegacy()}
};
auto serverList = m_serverSelectPane->fetchChild<ListWidget>("serverSelectArea.serverList");
@@ -384,6 +394,7 @@ void TitleScreen::initMultiPlayerMenu() {
setMultiPlayerPort(data.getString("port", ""));
setMultiPlayerAccount(data.getString("account", ""));
setMultiPlayerPassword(data.getString("password", ""));
+ setMultiPlayerForceLegacy(data.getBool("forceLegacy", false));
if (auto passwordWidget = m_multiPlayerMenu->fetchChild("password"))
passwordWidget->focus();
@@ -406,6 +417,10 @@ void TitleScreen::initMultiPlayerMenu() {
readerConnect.registerCallback("password", [=](Widget* obj) {
m_password = convert<TextBoxWidget>(obj)->getText().trim();
});
+
+ readerConnect.registerCallback("legacyCheckbox", [=](Widget* obj) {
+ m_forceLegacy = convert<ButtonWidget>(obj)->isChecked();
+ });
readerConnect.registerCallback("connect", [=](Widget*) {
switchState(TitleState::StartMultiPlayer);