Reworked settings (#111)

* Store globally settings (type and default value)

* Add settings groups

* Generate settings pages with global storage

Add saving, generate selection idxs from settings list, order settings via index value in each group of settings

* Rewrite setting store

No code change, only format

Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com>

* Remove tabs from settings groups

Use spaces instead

Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com>

* Use table.copy() minetest api function

* Better formatting for setting tooltip

Using inline instead of multiples lines to add tooltip attached to setting into formspec

Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com>

---------

Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com>
This commit is contained in:
Athozus 2023-09-14 20:35:30 +02:00 committed by GitHub
parent fe533eeb4d
commit e5996469fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 179 additions and 114 deletions

View file

@ -394,20 +394,7 @@ function mail.extractMaillists(receivers_string, maillists_owner)
end
function mail.get_setting_default_value(setting_name)
local default_values = {
chat_notifications = true,
onjoin_notifications = true,
hud_notifications = true,
sound_notifications = true,
unreadcolorenable = true,
cccolorenable = true,
defaultsortfield = 3,
defaultsortdirection = 1,
trash_move_enable = true,
auto_marking_read = true,
date_format = "%Y-%m-%d %X",
}
return default_values[setting_name]
return mail.settings[setting_name].default
end
function mail.get_setting(playername, setting_name)