summaryrefslogtreecommitdiff
path: root/src/client/game.cpp
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2022-06-05 16:47:38 +0100
committerGitHub <noreply@github.com>2022-06-05 17:47:38 +0200
commit03d86ea0b4900cd0394649597d278d465512d629 (patch)
treed2e5414acea951ea42400b5a87b5ee9a8296a3f3 /src/client/game.cpp
parent21323ef1ff02dd714330a8c9d8235f047e1dacf8 (diff)
downloadminetest-03d86ea0b4900cd0394649597d278d465512d629.tar.gz
minetest-03d86ea0b4900cd0394649597d278d465512d629.tar.bz2
minetest-03d86ea0b4900cd0394649597d278d465512d629.zip
Add register dialog to separate login/register (#12185)
New users find Minetest's account system confusing. This change moves username/password to a new dialog, with login and register buttons added to the Join Game tab. The old registration confirmation dialog is removed in favour of the new dialog. Fixes #8138
Diffstat (limited to 'src/client/game.cpp')
-rw-r--r--src/client/game.cpp34
1 files changed, 11 insertions, 23 deletions
diff --git a/src/client/game.cpp b/src/client/game.cpp
index d6e0cc8b8..441054631 100644
--- a/src/client/game.cpp
+++ b/src/client/game.cpp
@@ -43,7 +43,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "gameparams.h"
#include "gettext.h"
#include "gui/guiChatConsole.h"
-#include "gui/guiConfirmRegistration.h"
#include "gui/guiFormSpecMenu.h"
#include "gui/guiKeyChangeMenu.h"
#include "gui/guiPasswordChange.h"
@@ -1480,7 +1479,8 @@ bool Game::connectToServer(const GameStartData &start_data,
start_data.password, start_data.address,
*draw_control, texture_src, shader_src,
itemdef_manager, nodedef_manager, sound, eventmgr,
- m_rendering_engine, connect_address.isIPv6(), m_game_ui.get());
+ m_rendering_engine, connect_address.isIPv6(), m_game_ui.get(),
+ start_data.allow_login_or_register);
client->migrateModStorage();
} catch (const BaseException &e) {
*error_message = fmtgettext("Error creating client: %s", e.what());
@@ -1543,28 +1543,16 @@ bool Game::connectToServer(const GameStartData &start_data,
break;
}
- if (client->m_is_registration_confirmation_state) {
- if (registration_confirmation_shown) {
- // Keep drawing the GUI
- m_rendering_engine->draw_menu_scene(guienv, dtime, true);
- } else {
- registration_confirmation_shown = true;
- (new GUIConfirmRegistration(guienv, guienv->getRootGUIElement(), -1,
- &g_menumgr, client, start_data.name, start_data.password,
- connection_aborted, texture_src))->drop();
- }
- } else {
- wait_time += dtime;
- // Only time out if we aren't waiting for the server we started
- if (!start_data.address.empty() && wait_time > 10) {
- *error_message = gettext("Connection timed out.");
- errorstream << *error_message << std::endl;
- break;
- }
-
- // Update status
- showOverlayMessage(N_("Connecting to server..."), dtime, 20);
+ wait_time += dtime;
+ // Only time out if we aren't waiting for the server we started
+ if (!start_data.address.empty() && wait_time > 10) {
+ *error_message = gettext("Connection timed out.");
+ errorstream << *error_message << std::endl;
+ break;
}
+
+ // Update status
+ showOverlayMessage(N_("Connecting to server..."), dtime, 20);
}
} catch (con::PeerNotFoundException &e) {
// TODO: Should something be done here? At least an info/error