Mailbox: use minetest.colorize

NOTE: Minetest 0.4.14-git or 0.4.15 required
This commit is contained in:
JP Guerrero 2016-12-03 12:52:47 +01:00
parent 0ddfea29d0
commit 7c5083aaaf

View File

@ -16,15 +16,12 @@ local function img_col(stack)
end end
if def.tiles then if def.tiles then
local img local tile, img = def.tiles[1]
local tile = def.tiles[1]
if type(tile) == "table" then if type(tile) == "table" then
img = get_img(tile.name) img = get_img(tile.name)
elseif type(tile) == "string" then elseif type(tile) == "string" then
img = get_img(tile) img = get_img(tile)
end end
if img then return img end if img then return img end
end end
@ -56,18 +53,16 @@ function mailbox:formspec(pos, owner, num)
box[6,0.72;3.3,3.5;#555555] box[6,0.72;3.3,3.5;#555555]
listring[current_player;main] listring[current_player;main]
list[current_player;main;0.75,5.25;8,4;] list[current_player;main;0.75,5.25;8,4;]
tableoptions[background=#00000000;highlight=#00000000;border=false] ]] tableoptions[background=#00000000;highlight=#00000000;border=false] ]]..
.."tablecolumns[color;text;image,"..img.."0;color;text]".. "tablecolumns[color;text;image,"..img.."0;color;text]"..
"table[6,0.75;3.3,4;givers;"..giver.."]".. "table[6,0.75;3.3,4;givers;"..giver.."]"..
"list[nodemeta:"..spos..";mailbox;0,0.75;6,4;]".. "list[nodemeta:"..spos..";mailbox;0,0.75;6,4;]"..
"listring[nodemeta:"..spos..";mailbox]".. "listring[nodemeta:"..spos..";mailbox]"..
xbg..default.get_hotbar_bg(0.75,5.25) xbg..default.get_hotbar_bg(0.75,5.25)
else else
return [[ size[8,5] return [[ size[8,5]
list[current_player;main;0,1.25;8,4;] list[current_player;main;0,1.25;8,4;] ]]..
tablecolumns[color;text;color;text] "label[0,0;Send your goods to\n"..minetest.colorize("#FFFF00", owner).."]"..
tableoptions[background=#00000000;highlight=#00000000;border=false] ]]
.."table[0,0;3,1;sendform;#FFFFFF,Send your goods to,,,#FFFF00,"..owner.."]"..
"list[nodemeta:"..spos..";drop;3.5,0;1,1;]".. "list[nodemeta:"..spos..";drop;3.5,0;1,1;]"..
xbg..default.get_hotbar_bg(0,1.25) xbg..default.get_hotbar_bg(0,1.25)
end end