From e0a0c607e40d48099a37b2b1b9c643e744f739ee Mon Sep 17 00:00:00 2001 From: jp Date: Wed, 25 Nov 2015 11:57:53 +0100 Subject: [PATCH] Mailbox : fancier donators list --- mailbox.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mailbox.lua b/mailbox.lua index 8175117..f4de9a3 100644 --- a/mailbox.lua +++ b/mailbox.lua @@ -18,7 +18,7 @@ xdecor.register("mailbox", { meta:set_string("infotext", player_name.."'s Mailbox") local inv = meta:get_inventory() - inv:set_size("mailbox", 8*4) + inv:set_size("mailbox", 6*4) inv:set_size("drop", 1) end, on_rightclick = function(pos, _, clicker, _) @@ -50,7 +50,7 @@ xdecor.register("mailbox", { inv:remove_item("drop", stack) inv:add_item("mailbox", stack) - for i = 7, 2, -1 do + for i = 4, 2, -1 do meta:set_string("giver"..i, meta:get_string("giver"..(i-1))) meta:set_string("stack"..i, meta:get_string("stack"..(i-1))) end @@ -75,13 +75,13 @@ function mailbox.formspec(pos, owner, num) local giver = "" if num == 1 then - for i = 1, 7 do + for i = 1, 4 do if meta:get_string("giver"..i) ~= "" then - giver = giver..meta:get_string("giver"..i).." - "..meta:get_string("stack"..i).."," + giver = giver.."#FFFF00,"..meta:get_string("giver"..i)..",,\t"..meta:get_string("stack"..i).."," end end - return "size[13.5,9]"..xbg..default.get_hotbar_bg(2.75,5.25).. - "label[0,0;You have received...]label[8,0;Last donators :]box[8,0.75;5.35,3.9;#555555]textlist[8,0.75;5.35,3.9;givers;"..giver..";;true]list[nodemeta:"..spos..";mailbox;0,0.75;8,4;]list[current_player;main;2.75,5.25;8,4;]" + return "size[11,9]"..xbg..default.get_hotbar_bg(1.5,5.25).. + "label[0,0;You have received...]label[6,0;Last donators :]box[6,0.75;4.85,3.9;#555555]tablecolumns[color;text]tableoptions[background=#00000000;highlight=#00000000;border=false]table[6,0.75;4.85,4.4;givers;"..giver.."]list[nodemeta:"..spos..";mailbox;0,0.75;6,4;]list[current_player;main;1.5,5.25;8,4;]" else return "size[8,5]"..xbg..default.get_hotbar_bg(0,1.25).. "label[0.5,0;Send your goods\nto "..owner.." :]list[nodemeta:"..spos..";drop;3.5,0;1,1;]list[current_player;main;0,1.25;8,4;]"