diff --git a/init.lua b/init.lua index 7fc6260..b50d44d 100644 --- a/init.lua +++ b/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 = {} } diff --git a/onjoin.lua b/onjoin.lua index e62ce1f..f7a45e2 100644 --- a/onjoin.lua +++ b/onjoin.lua @@ -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) diff --git a/ui/about.lua b/ui/about.lua index 2998e41..e3d20b5 100644 --- a/ui/about.lua +++ b/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) diff --git a/ui/contacts.lua b/ui/contacts.lua index bf5ae53..0ee5a29 100644 --- a/ui/contacts.lua +++ b/ui/contacts.lua @@ -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) diff --git a/ui/drafts.lua b/ui/drafts.lua index 6f164cc..082643a 100644 --- a/ui/drafts.lua +++ b/ui/drafts.lua @@ -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) diff --git a/ui/inbox.lua b/ui/inbox.lua index ddcf5e2..5c2c67e 100644 --- a/ui/inbox.lua +++ b/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 diff --git a/ui/maillists.lua b/ui/maillists.lua index 4182949..578f97a 100644 --- a/ui/maillists.lua +++ b/ui/maillists.lua @@ -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 } diff --git a/ui/message.lua b/ui/message.lua index 823735d..97426ce 100644 --- a/ui/message.lua +++ b/ui/message.lua @@ -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] diff --git a/ui/outbox.lua b/ui/outbox.lua index 84afeaf..57b6635 100644 --- a/ui/outbox.lua +++ b/ui/outbox.lua @@ -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 diff --git a/ui/select_contact.lua b/ui/select_contact.lua index 3f33bd3..4253bdf 100644 --- a/ui/select_contact.lua +++ b/ui/select_contact.lua @@ -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") .. [[] ]] diff --git a/ui/settings.lua b/ui/settings.lua index 878febd..faf22b5 100644 --- a/ui/settings.lua +++ b/ui/settings.lua @@ -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")) .. [[] diff --git a/ui/trash.lua b/ui/trash.lua index 28380cb..7601fba 100644 --- a/ui/trash.lua +++ b/ui/trash.lua @@ -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)