Add settings

This commit is contained in:
Athozus 2023-05-04 12:14:18 +02:00
parent a8632255b3
commit d51b363cbc
No known key found for this signature in database
GPG key ID: B50895022E8484BF
16 changed files with 335 additions and 101 deletions

View file

@ -1,17 +1,21 @@
-- translation
local S = minetest.get_translator("mail")
local FORMNAME = "mail:about"
function mail.show_about(name)
local formspec = [[
size[10,6;]
tabheader[0.3,1;optionstab;]] .. S("Settings") .. "," .. S("About") .. [[;2;false;false]
button[9.35,0;0.75,0.5;back;X]
label[0,0;Mail]
label[0,0.4;Provided my mt-mods]
label[0,0.8;Version: 1.1.4]
label[0,1.4;Licenses:]
label[0.2,1.8;Expat (code), WTFPL (textures)]
label[0,2.4;https://github.com/mt-mods/mail]
label[0,2.8;https://content.minetest.net/packages/mt-mods/mail]
textarea[0.5,4.0;4,5.5;;Note;]] ..
label[0,0.8;Mail]
label[0,1.2;Provided my mt-mods]
label[0,1.6;Version: 1.2.0-dev]
label[0,2.2;Licenses:]
label[0.2,2.6;Expat (code), WTFPL (textures)]
label[0,3.2;https://github.com/mt-mods/mail]
label[0,3.6;https://content.minetest.net/packages/mt-mods/mail]
textarea[0.5,4.8;4,5.5;;Note;]] ..
[[NOTE: Communication using this system is NOT guaranteed to be private!]] ..
[[ Admins are able to view the messages of any player.]
@ -42,8 +46,17 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
return
end
local playername = player:get_player_name()
if fields.back then
local playername = player:get_player_name()
mail.show_mail_menu(playername)
elseif fields.optionstab == "1" then
mail.selected_idxs.optionstab[playername] = 1
mail.show_settings(playername)
elseif fields.optionstab == "2" then
mail.selected_idxs.optionstab[playername] = 2
mail.show_about(playername)
end
end)