mirror of
https://github.com/mt-mods/pipeworks.git
synced 2024-11-15 23:10:33 +01:00
make prepends a function
This commit is contained in:
parent
c188a18cba
commit
9bd59c9f51
10
common.lua
10
common.lua
|
@ -169,6 +169,16 @@ function fs_helpers.get_inv(y)
|
|||
return table.concat(fs, "")
|
||||
end
|
||||
|
||||
function fs_helpers.get_prepends(size)
|
||||
local prepend = ""
|
||||
|
||||
if minetest.get_modpath("i3") then
|
||||
prepend = "no_prepend[]bgcolor[black;neither]background9[0,0;"..size..";i3_bg_full.png;false;10]style_type[button;border=false;bgimg=[combine:16x16^[noalpha^[colorize:#6b6b6b]"
|
||||
end
|
||||
|
||||
return prepend
|
||||
end
|
||||
|
||||
---------
|
||||
-- Env --
|
||||
---------
|
||||
|
|
|
@ -20,14 +20,11 @@ minetest.register_node("pipeworks:trashcan", {
|
|||
},
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local prepend = ""
|
||||
if minetest.get_modpath("i3") then
|
||||
prepend = "no_prepend[]bgcolor[black;neither]background9[0,0;10.2,9;i3_bg_full.png;false;10]"
|
||||
end
|
||||
local size = "10.2,9"
|
||||
meta:set_string("formspec",
|
||||
"formspec_version[2]" ..
|
||||
"size[10.2,9]"..
|
||||
prepend ..
|
||||
"size["..size.."]"..
|
||||
pipeworks.fs_helpers.get_prepends(size) ..
|
||||
"item_image[0.5,0.5;1,1;pipeworks:trashcan]"..
|
||||
"label[1.5,1;"..S("Trash Can").."]"..
|
||||
"list[context;trash;4.5,2;1,1;]"..
|
||||
|
|
|
@ -39,14 +39,11 @@ if pipeworks.enable_mese_sand_tube then
|
|||
groups = {vacuum_tube = 1},
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local size = "6.0,2.4"
|
||||
meta:set_int("dist", 0)
|
||||
local prepend = ""
|
||||
if minetest.get_modpath("i3") then
|
||||
prepend = "no_prepend[]bgcolor[black;neither]background9[0,0;6.0,2.2;i3_bg_full.png;false;10]"
|
||||
end
|
||||
meta:set_string("formspec",
|
||||
"size[6.0,2.2]"..
|
||||
prepend ..
|
||||
"size["..size.."]"..
|
||||
pipeworks.fs_helpers.get_prepends(size) ..
|
||||
"image[0.2,0;1,1;pipeworks_mese_sand_tube_inv.png]"..
|
||||
"label[1.2,0.2;"..S("Adjustable Vacuuming Tube").."]"..
|
||||
"field[0.5,1.6;2.1,1;dist;"..S("Radius")..";${dist}]"..
|
||||
|
|
Loading…
Reference in New Issue
Block a user