2024-10-28 15:57:39 +01:00
|
|
|
// Luanti
|
|
|
|
// SPDX-License-Identifier: LGPL-2.1-or-later
|
|
|
|
// Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
|
2011-01-23 17:29:15 +02:00
|
|
|
|
2017-08-17 22:19:39 +02:00
|
|
|
#pragma once
|
2011-01-23 17:29:15 +02:00
|
|
|
|
2022-06-05 16:47:38 +01:00
|
|
|
#include "gameparams.h"
|
2011-01-23 17:29:15 +02:00
|
|
|
#include <string>
|
2013-03-30 18:09:38 +01:00
|
|
|
|
2015-07-17 16:40:41 +02:00
|
|
|
struct MainMenuDataForScript {
|
|
|
|
|
2017-08-18 07:44:42 +02:00
|
|
|
MainMenuDataForScript() = default;
|
2015-07-17 16:40:41 +02:00
|
|
|
|
|
|
|
// Whether the server has requested a reconnect
|
2017-06-17 19:11:28 +02:00
|
|
|
bool reconnect_requested = false;
|
|
|
|
std::string errormessage = "";
|
2013-05-11 16:08:01 +02:00
|
|
|
};
|
|
|
|
|
2025-04-01 07:55:47 -04:00
|
|
|
// TODO: unify with GameStartData
|
2015-07-17 16:40:41 +02:00
|
|
|
struct MainMenuData {
|
2011-04-24 15:37:41 +03:00
|
|
|
// Client options
|
2012-12-25 12:20:51 +01:00
|
|
|
std::string servername;
|
|
|
|
std::string serverdescription;
|
2025-04-01 07:55:47 -04:00
|
|
|
// If empty, we're hosting a server.
|
|
|
|
// This may or may not be in "simple singleplayer mode".
|
2013-06-23 18:30:21 +02:00
|
|
|
std::string address;
|
|
|
|
std::string port;
|
|
|
|
std::string name;
|
|
|
|
std::string password;
|
2015-07-17 16:40:41 +02:00
|
|
|
// Whether to reconnect
|
2017-06-17 19:11:28 +02:00
|
|
|
bool do_reconnect = false;
|
2013-06-23 18:30:21 +02:00
|
|
|
|
2011-04-24 15:37:41 +03:00
|
|
|
// Server options
|
2017-06-17 19:11:28 +02:00
|
|
|
int selected_world = 0;
|
2025-04-01 07:55:47 -04:00
|
|
|
// If true, we're hosting a server and *are* in "simple singleplayer mode".
|
2017-06-17 19:11:28 +02:00
|
|
|
bool simple_singleplayer_mode = false;
|
2012-12-25 12:20:51 +01:00
|
|
|
|
2015-07-17 16:40:41 +02:00
|
|
|
// Data to be passed to the script
|
|
|
|
MainMenuDataForScript script_data;
|
|
|
|
|
2022-06-05 16:47:38 +01:00
|
|
|
ELoginRegister allow_login_or_register = ELoginRegister::Any;
|
|
|
|
|
2017-08-18 07:44:42 +02:00
|
|
|
MainMenuData() = default;
|
2011-01-23 17:29:15 +02:00
|
|
|
};
|