mirror of
https://github.com/mt-mods/mail.git
synced 2025-07-04 21:50:28 -04:00
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:
parent
fe533eeb4d
commit
e5996469fb
3 changed files with 179 additions and 114 deletions
15
storage.lua
15
storage.lua
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue