mirror of
https://github.com/mt-mods/mail.git
synced 2025-07-09 16:10:30 -04:00
Add settings
This commit is contained in:
parent
a8632255b3
commit
d51b363cbc
16 changed files with 335 additions and 101 deletions
19
ui/inbox.lua
19
ui/inbox.lua
|
@ -1,10 +1,9 @@
|
|||
-- translation
|
||||
local S = minetest.get_translator("mail")
|
||||
|
||||
|
||||
function mail.show_inbox(name, sortfieldindex, sortdirection, filter)
|
||||
sortfieldindex = tonumber(sortfieldindex or mail.selected_idxs.sortfield[name]) or 3
|
||||
sortdirection = sortdirection or mail.selected_idxs.sortdirection[name] or "1"
|
||||
sortfieldindex = tonumber(sortfieldindex or mail.selected_idxs.sortfield[name]) or mail.get_setting(name, "defaultsortfield") or 3
|
||||
sortdirection = sortdirection or mail.selected_idxs.sortdirection[name] or tostring(mail.get_setting(name, "defaultsortdirection")) or "1"
|
||||
filter = filter or mail.selected_idxs.filter[name] or ""
|
||||
mail.selected_idxs.inbox[name] = mail.selected_idxs.inbox[name] or {}
|
||||
|
||||
|
@ -21,7 +20,7 @@ function mail.show_inbox(name, sortfieldindex, sortdirection, filter)
|
|||
button[6,5.55;2.5,0.5;markunread;]] .. S("Mark Unread") .. [[]
|
||||
button[6,6.8;2.5,0.5;contacts;]] .. S("Contacts") .. [[]
|
||||
button[6,7.6;2.5,0.5;maillists;]] .. S("Mail lists") .. [[]
|
||||
button[6,8.7;2.5,0.5;about;]] .. S("About") .. [[]
|
||||
button[6,8.7;2.5,0.5;options;]] .. S("Options") .. [[]
|
||||
button_exit[6,9.5;2.5,0.5;quit;]] .. S("Close") .. [[]
|
||||
|
||||
dropdown[0,8.4;2,0.5;sortfield;]] ..
|
||||
|
@ -58,28 +57,28 @@ function mail.show_inbox(name, sortfieldindex, sortdirection, filter)
|
|||
end
|
||||
end
|
||||
if selected_id > 0 then
|
||||
if not message.read then
|
||||
if not mail.player_in_list(name, message.to) then
|
||||
if not message.read and mail.get_setting(name, "unreadcolorenable") then
|
||||
if not mail.player_in_list(name, message.to) and mail.get_setting(name, "cccolorenable") then
|
||||
formspec[#formspec + 1] = ",#A39E5D"
|
||||
else
|
||||
formspec[#formspec + 1] = ",#A39E19"
|
||||
end
|
||||
else
|
||||
if not mail.player_in_list(name, message.to) then
|
||||
if not mail.player_in_list(name, message.to) and mail.get_setting(name, "cccolorenable") then
|
||||
formspec[#formspec + 1] = ",#899888"
|
||||
else
|
||||
formspec[#formspec + 1] = ",#466432"
|
||||
end
|
||||
end
|
||||
else
|
||||
if not message.read then
|
||||
if not mail.player_in_list(name, message.to) then
|
||||
if not message.read and mail.get_setting(name, "unreadcolorenable") then
|
||||
if not mail.player_in_list(name, message.to) and mail.get_setting(name, "cccolorenable") then
|
||||
formspec[#formspec + 1] = ",#FFD788"
|
||||
else
|
||||
formspec[#formspec + 1] = ",#FFD700"
|
||||
end
|
||||
else
|
||||
if not mail.player_in_list(name, message.to) then
|
||||
if not mail.player_in_list(name, message.to) and mail.get_setting(name, "cccolorenable") then
|
||||
formspec[#formspec + 1] = ",#CCCCDD"
|
||||
else
|
||||
formspec[#formspec + 1] = ","
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue