diff options
author | rubenwardy <rw@rubenwardy.com> | 2022-06-05 16:47:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-05 17:47:38 +0200 |
commit | 03d86ea0b4900cd0394649597d278d465512d629 (patch) | |
tree | d2e5414acea951ea42400b5a87b5ee9a8296a3f3 /src/script/lua_api | |
parent | 21323ef1ff02dd714330a8c9d8235f047e1dacf8 (diff) | |
download | minetest-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/script/lua_api')
-rw-r--r-- | src/script/lua_api/l_mainmenu.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/script/lua_api/l_mainmenu.cpp b/src/script/lua_api/l_mainmenu.cpp index 4d9fa5b14..f7b2393fb 100644 --- a/src/script/lua_api/l_mainmenu.cpp +++ b/src/script/lua_api/l_mainmenu.cpp @@ -139,6 +139,14 @@ int ModApiMainMenu::l_start(lua_State *L) data->password = getTextData(L,"password"); data->address = getTextData(L,"address"); data->port = getTextData(L,"port"); + + const auto val = getTextData(L, "allow_login_or_register"); + if (val == "login") + data->allow_login_or_register = ELoginRegister::Login; + else if (val == "register") + data->allow_login_or_register = ELoginRegister::Register; + else + data->allow_login_or_register = ELoginRegister::Any; } data->serverdescription = getTextData(L,"serverdescription"); data->servername = getTextData(L,"servername"); |