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

summaryrefslogtreecommitdiff
path: root/source/frontend/StarTitleScreen.cpp
diff options
context:
space:
mode:
authorBottinator22 <bottinator22@gmail.com>2025-04-25 00:27:10 -0700
committerBottinator22 <bottinator22@gmail.com>2025-04-25 00:27:10 -0700
commit621864b9b00ba7a9ae0fceb0a7db3ace6d4906b9 (patch)
tree6e85c4e1980fb648772446c8f8db994e5a71fdc2 /source/frontend/StarTitleScreen.cpp
parent6369ba9ec72f097d8cc9ab06bed0c6816da516c8 (diff)
allow forcing legacy connections
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);