mirror of
https://github.com/mt-mods/mail.git
synced 2025-04-30 08:21:44 -04:00
Store globally settings (type and default value)
This commit is contained in:
parent
2a18322cdb
commit
1c85da70c5
2 changed files with 15 additions and 14 deletions
14
init.lua
14
init.lua
|
@ -51,6 +51,20 @@ mail = {
|
|||
new = "#00F529"
|
||||
},
|
||||
|
||||
settings = {
|
||||
chat_notifications = { type = "bool", default = true },
|
||||
onjoin_notifications = { type = "bool", default = true },
|
||||
hud_notifications = { type = "bool", default = true },
|
||||
sound_notifications = { type = "bool", default = true },
|
||||
unreadcolorenable = { type = "bool", default = true },
|
||||
cccolorenable = { type = "bool", default = true },
|
||||
defaultsortfield = { type = "number", default = 3 },
|
||||
defaultsortdirection = { type = "number", default = 1 },
|
||||
trash_move_enable = { type = "bool", default = true },
|
||||
auto_marking_read = { type = "bool", default = true },
|
||||
date_format = { type = "string", default = "%Y-%m-%d %X" },
|
||||
},
|
||||
|
||||
message_drafts = {}
|
||||
}
|
||||
|
||||
|
|
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
Reference in a new issue