Mailbox: use minetest.colorize

NOTE: Minetest 0.4.14-git or 0.4.15 required
master
JP Guerrero 2016-12-03 12:52:47 +01:00
parent 0ddfea29d0
commit 7c5083aaaf
1 changed files with 5 additions and 10 deletions

View File

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