Store colors and use a lighter selection color
This commit is contained in:
parent
f5198b9187
commit
95475c7c59
13
init.lua
13
init.lua
@ -37,6 +37,19 @@ mail = {
|
||||
trash_move_enable = {}
|
||||
},
|
||||
|
||||
colors = {
|
||||
header = "#999",
|
||||
selected = "#72FF63",
|
||||
important = "#FFD700",
|
||||
additional = "#CCCCDD",
|
||||
imp_sel = "#B9EB32",
|
||||
add_sel = "#9FE6A0",
|
||||
imp_add = "#E6D26F",
|
||||
imp_add_sel = "#BFE16B",
|
||||
highlighted = "#466432",
|
||||
new = "#00F529"
|
||||
},
|
||||
|
||||
message_drafts = {}
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ minetest.register_on_joinplayer(function(player)
|
||||
|
||||
if unreadcount > 0 and mail.get_setting(name, "onjoin_notifications") then
|
||||
minetest.chat_send_player(name,
|
||||
minetest.colorize("#00f529", "(" .. unreadcount .. ") " .. S("You have mail! Type /mail to read")))
|
||||
minetest.colorize(mail.colors.new, "(" .. unreadcount .. ") " .. S("You have mail! Type /mail to read")))
|
||||
end
|
||||
end, player:get_player_name())
|
||||
end)
|
||||
|
42
ui/about.lua
42
ui/about.lua
@ -21,27 +21,27 @@ function mail.show_about(name)
|
||||
|
||||
tablecolumns[color;text;text]
|
||||
table[5,0.75;4.9,5.5;contributors;]] ..
|
||||
[[#999,]] .. S("Contributors") .. [[,,]] ..
|
||||
[[#FFD700,Cheapie,Initial idea/project,]] ..
|
||||
[[#FFF,Rubenwardy,Lua/UI improvements,]] ..
|
||||
[[#FFF,BuckarooBanzay,Clean-ups\, Refactoring,]] ..
|
||||
[[#FFF,Athozus,Boxes\, Maillists\, UI\, Settings,]] ..
|
||||
[[#FFF,fluxionary,Minor fixups,]] ..
|
||||
[[#FFF,SX,Various fixes\, UI,]] ..
|
||||
[[#FFF,Toby1710,UX fixes,]] ..
|
||||
[[#FFF,Peter Nerlich,CC\, BCC,]] ..
|
||||
[[#FFF,Niklp,German translation,]] ..
|
||||
[[#FFF,Emojigit,Traditional Chinese trans.,]] ..
|
||||
[[#FFF,Dennis Jenkins,UX fixes,]] ..
|
||||
[[#FFF,Thomas Rudin,Maintenance,]] ..
|
||||
[[#FFF,NatureFreshMilk,Maintenance,]] ..
|
||||
[[#FFF,imre84,UI fixes,]] ..
|
||||
[[#FFF,Chache,Spanish translation,]] ..
|
||||
[[#FFF,APercy,Brazilian Portuguese trans.,]] ..
|
||||
[[#FFF,Nuno Filipe Povoa,mail_notif.ogg,]] ..
|
||||
[[#FFF,TheTrueBeginner,Simplified Chinese trans.,]] ..
|
||||
[[#FFF,nyomi,Hungarian translation,]] ..
|
||||
[[#FFF,whosit,UI fixes]
|
||||
mail.colors.header .. [[,]] .. S("Contributors") .. [[,,]] ..
|
||||
mail.colors.important .. [[,Cheapie,Initial idea/project,]] ..
|
||||
[[,Rubenwardy,Lua/UI improvements,]] ..
|
||||
[[,BuckarooBanzay,Clean-ups\, Refactoring,]] ..
|
||||
[[,Athozus,Boxes\, Maillists\, UI\, Settings,]] ..
|
||||
[[,fluxionary,Minor fixups,]] ..
|
||||
[[,SX,Various fixes\, UI,]] ..
|
||||
[[,Toby1710,UX fixes,]] ..
|
||||
[[,Peter Nerlich,CC\, BCC,]] ..
|
||||
[[,Niklp,German translation,]] ..
|
||||
[[,Emojigit,Traditional Chinese trans.,]] ..
|
||||
[[,Dennis Jenkins,UX fixes,]] ..
|
||||
[[,Thomas Rudin,Maintenance,]] ..
|
||||
[[,NatureFreshMilk,Maintenance,]] ..
|
||||
[[,imre84,UI fixes,]] ..
|
||||
[[,Chache,Spanish translation,]] ..
|
||||
[[,APercy,Brazilian Portuguese trans.,]] ..
|
||||
[[,Nuno Filipe Povoa,mail_notif.ogg,]] ..
|
||||
[[,TheTrueBeginner,Simplified Chinese trans.,]] ..
|
||||
[[,nyomi,Hungarian translation,]] ..
|
||||
[[,whosit,UI fixes]
|
||||
]] .. mail.theme
|
||||
|
||||
minetest.show_formspec(name, FORMNAME, formspec)
|
||||
|
@ -9,7 +9,7 @@ local contacts_formspec = "size[8,9;]" .. mail.theme .. [[
|
||||
button[6,1.60;2,0.5;delete;]] .. S("Delete") .. [[]
|
||||
button[6,8.25;2,0.5;back;]] .. S("Back") .. [[]
|
||||
tablecolumns[color;text;text]
|
||||
table[0,0;5.75,9;contacts;#999,]] .. S("Name") .. "," .. S("Note")
|
||||
table[0,0;5.75,9;contacts;]] .. mail.colors.header .. "," .. S("Name") .. "," .. S("Note")
|
||||
|
||||
|
||||
function mail.show_contacts(name)
|
||||
|
@ -21,7 +21,7 @@ function mail.show_drafts(name)
|
||||
button_exit[6,9.5;2.5,0.5;quit;]] .. S("Close") .. [[]
|
||||
|
||||
tablecolumns[color;text;text]
|
||||
table[0,0.7;5.75,9.35;drafts;#999,]] .. S("To") .. "," .. S("Subject")
|
||||
table[0,0.7;5.75,9.35;drafts;]] .. mail.colors.header .. "," .. S("To") .. "," .. S("Subject")
|
||||
|
||||
local formspec = { drafts_formspec }
|
||||
local entry = mail.get_storage_entry(name)
|
||||
|
16
ui/inbox.lua
16
ui/inbox.lua
@ -48,7 +48,7 @@ function mail.show_inbox(name, sortfieldindex, sortdirection, filter)
|
||||
button[3.5,9.5;2.5,0.5;selectall;]] .. S("(Un)select all") .. [[]
|
||||
|
||||
tablecolumns[color;text;text]
|
||||
table[0,0.7;5.75,7.45;inbox;#999,]] .. S("From") .. "," .. S("Subject")
|
||||
table[0,0.7;5.75,7.45;inbox;]] .. mail.colors.header .. "," .. S("From") .. "," .. S("Subject")
|
||||
local formspec = { inbox_formspec }
|
||||
|
||||
mail.message_drafts[name] = nil
|
||||
@ -71,27 +71,27 @@ function mail.show_inbox(name, sortfieldindex, sortdirection, filter)
|
||||
if selected_id > 0 then
|
||||
if not message.read and unread_color_enable then
|
||||
if not mail.player_in_list(name, message.to) and cc_color_enable then
|
||||
formspec[#formspec + 1] = ",#A39E5D"
|
||||
formspec[#formspec + 1] = "," .. mail.colors.imp_add_sel
|
||||
else
|
||||
formspec[#formspec + 1] = ",#A39E19"
|
||||
formspec[#formspec + 1] = "," .. mail.colors.imp_sel
|
||||
end
|
||||
else
|
||||
if not mail.player_in_list(name, message.to) and cc_color_enable then
|
||||
formspec[#formspec + 1] = ",#899888"
|
||||
formspec[#formspec + 1] = "," .. mail.colors.add_sel
|
||||
else
|
||||
formspec[#formspec + 1] = ",#466432"
|
||||
formspec[#formspec + 1] = "," .. mail.colors.selected
|
||||
end
|
||||
end
|
||||
else
|
||||
if not message.read and unread_color_enable then
|
||||
if not mail.player_in_list(name, message.to) and cc_color_enable then
|
||||
formspec[#formspec + 1] = ",#FFD788"
|
||||
formspec[#formspec + 1] = "," .. mail.colors.imp_add
|
||||
else
|
||||
formspec[#formspec + 1] = ",#FFD700"
|
||||
formspec[#formspec + 1] = "," .. mail.colors.important
|
||||
end
|
||||
else
|
||||
if not mail.player_in_list(name, message.to) and cc_color_enable then
|
||||
formspec[#formspec + 1] = ",#CCCCDD"
|
||||
formspec[#formspec + 1] = "," .. mail.colors.additional
|
||||
else
|
||||
formspec[#formspec + 1] = ","
|
||||
end
|
||||
|
@ -9,7 +9,7 @@ local maillists_formspec = "size[8,9;]" .. mail.theme .. [[
|
||||
button[6,1.60;2,0.5;delete;]] .. S("Delete") .. [[]
|
||||
button[6,8.25;2,0.5;back;]] .. S("Back") .. [[]
|
||||
tablecolumns[color;text;text]
|
||||
table[0,0;5.75,9;maillists;#999,]] .. S("Name") .. "," .. S("Note")
|
||||
table[0,0;5.75,9;maillists;]] .. mail.colors.header .. "," .. S("Name") .. "," .. S("Note")
|
||||
|
||||
function mail.show_maillists(name)
|
||||
local formspec = { maillists_formspec }
|
||||
|
@ -9,7 +9,7 @@ function mail.show_message(name, id)
|
||||
local formspec = [[
|
||||
size[8,9]
|
||||
|
||||
box[0,0;7,1.9;#466432]
|
||||
box[0,0;7,1.9;]] .. mail.colors.highlighted .. [[]
|
||||
|
||||
button[7.25,0.15;0.75,0.5;back;X]
|
||||
|
||||
|
@ -46,7 +46,7 @@ function mail.show_outbox(name, sortfieldindex, sortdirection, filter)
|
||||
button[3.5,9.5;2.5,0.5;selectall;]] .. S("(Un)select all") .. [[]
|
||||
|
||||
tablecolumns[color;text;text]
|
||||
table[0,0.7;5.75,7.45;outbox;#999,]] .. S("To") .. "," .. S("Subject")
|
||||
table[0,0.7;5.75,7.45;outbox;]] .. mail.colors.header .. "," .. S("To") .. "," .. S("Subject")
|
||||
local formspec = { outbox_formspec }
|
||||
|
||||
mail.message_drafts[name] = nil
|
||||
@ -64,7 +64,7 @@ function mail.show_outbox(name, sortfieldindex, sortdirection, filter)
|
||||
end
|
||||
end
|
||||
if selected_id > 0 then
|
||||
formspec[#formspec + 1] = ",#466432"
|
||||
formspec[#formspec + 1] = "," .. mail.colors.selected
|
||||
else
|
||||
formspec[#formspec + 1] = ","
|
||||
end
|
||||
|
@ -5,15 +5,15 @@ local FORMNAME = "mail:selectcontact"
|
||||
|
||||
local select_contact_formspec = "size[8,9;]" .. mail.theme .. [[
|
||||
tablecolumns[color;text;text]
|
||||
table[0,0;3.5,9;contacts;#999,]] .. S("Name") .. "," .. S("Note") .. [[%s]
|
||||
table[0,0;3.5,9;contacts;]] .. mail.colors.header .. "," .. S("Name") .. "," .. S("Note") .. [[%s]
|
||||
button[3.55,2.00;1.75,0.5;toadd;→ ]] .. S("Add") .. [[]
|
||||
button[3.55,2.75;1.75,0.5;toremove;← ]] .. S("Remove") .. [[]
|
||||
button[3.55,6.00;1.75,0.5;ccadd;→ ]] .. S("Add") .. [[]
|
||||
button[3.55,6.75;1.75,0.5;ccremove;← ]] .. S("Remove") .. [[]
|
||||
tablecolumns[color;text;text]
|
||||
table[5.15,0.0;2.75,4.5;to;#999,]] .. S("To") .. ":," .. S("Note") .. [[%s]
|
||||
table[5.15,0.0;2.75,4.5;to;]] .. mail.colors.header .. "," .. S("To") .. ":," .. S("Note") .. [[%s]
|
||||
tablecolumns[color;text;text]
|
||||
table[5.15,4.6;2.75,4.5;cc;#999,]] .. S("CC") .. ":," .. S("Note") .. [[%s]
|
||||
table[5.15,4.6;2.75,4.5;cc;]] .. mail.colors.header .. "," .. S("CC") .. ":," .. S("Note") .. [[%s]
|
||||
button[3.55,8.25;1.75,0.5;back;]] .. S("Back") .. [[]
|
||||
]]
|
||||
|
||||
|
@ -9,7 +9,7 @@ function mail.show_settings(name)
|
||||
tabheader[0.3,1;optionstab;]] .. S("Settings") .. "," .. S("About") .. [[;1;false;false]
|
||||
button[9.35,0;0.75,0.5;back;X]
|
||||
|
||||
box[0,0.8;3,0.45;#466432]
|
||||
box[0,0.8;3,0.45;]] .. mail.colors.highlighted .. [[]
|
||||
label[0.2,0.8;]] .. S("Notifications") .. [[]
|
||||
checkbox[0,1.2;chat_notifications;]] .. S("Chat notifications") .. [[;]] ..
|
||||
tostring(mail.get_setting(name, "chat_notifications")) .. [[]
|
||||
@ -20,7 +20,7 @@ function mail.show_settings(name)
|
||||
checkbox[0,2.4;sound_notifications;]] .. S("Sound notifications") .. [[;]] ..
|
||||
tostring(mail.get_setting(name, "sound_notifications")) .. [[]
|
||||
|
||||
box[5,0.8;3,0.45;#466432]
|
||||
box[5,0.8;3,0.45;]] .. mail.colors.highlighted .. [[]
|
||||
label[5.2,0.8;]] .. S("Message list") .. [[]
|
||||
checkbox[5,1.2;unreadcolorenable;]] .. S("Show unread in different color") .. [[;]] ..
|
||||
tostring(mail.get_setting(name, "unreadcolorenable")) .. [[]
|
||||
@ -35,7 +35,7 @@ function mail.show_settings(name)
|
||||
S("Ascending") .. "," .. S("Descending") .. [[;]] ..
|
||||
tostring(mail.get_setting(name, "defaultsortdirection")) .. [[;true]
|
||||
|
||||
box[0,3.2;3,0.45;#466432]
|
||||
box[0,3.2;3,0.45;]] .. mail.colors.highlighted .. [[]
|
||||
label[0.2,3.2;]] .. S("Other") .. [[]
|
||||
checkbox[0,3.6;trash_move_enable;]] .. S("Move deleted messages to trash") .. [[;]] ..
|
||||
tostring(mail.get_setting(name, "trash_move_enable")) .. [[]
|
||||
|
@ -16,7 +16,7 @@ local trash_formspec = "size[8.5,10;]" .. mail.theme .. [[
|
||||
button_exit[6,9.5;2.5,0.5;quit;]] .. S("Close") .. [[]
|
||||
|
||||
tablecolumns[color;text;text]
|
||||
table[0,0.7;5.75,9.35;trash;#999,]] .. S("From/To") .. "," .. S("Subject")
|
||||
table[0,0.7;5.75,9.35;trash;]] .. mail.colors.header .. "," .. S("From/To") .. "," .. S("Subject")
|
||||
|
||||
|
||||
function mail.show_trash(name)
|
||||
|
Loading…
x
Reference in New Issue
Block a user