mirror of
https://github.com/mt-mods/pipeworks.git
synced 2025-06-29 14:50:41 +02:00
add I3 support + update to formspecs v2 (#22)
* add fs helper inv function * add fs helper prepends function * add trash can, vacuum tube, teleport tube. wielders, autocrafter, mesetube, injectors * fixed missed texture to make game agnostic * fix luacheck
This commit is contained in:
23
trashcan.lua
23
trashcan.lua
@ -20,13 +20,24 @@ minetest.register_node("pipeworks:trashcan", {
|
||||
},
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local size = "10.2,9"
|
||||
local list_background = ""
|
||||
if minetest.get_modpath("i3") then
|
||||
list_background = "style_type[box;colors=#666]box[4.5,2;1,1;]"
|
||||
end
|
||||
meta:set_string("formspec",
|
||||
"size[8,7]"..
|
||||
"item_image[0,0;1,1;pipeworks:trashcan]"..
|
||||
"label[1,0;"..S("Trash Can").."]"..
|
||||
"list[context;trash;3.5,1;1,1;]"..
|
||||
"list[current_player;main;0,3;8,4;]" ..
|
||||
"listring[]")
|
||||
"formspec_version[2]" ..
|
||||
"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_background..
|
||||
"list[context;trash;4.5,2;1,1;]"..
|
||||
--"list[current_player;main;0,3;8,4;]" ..
|
||||
pipeworks.fs_helpers.get_inv(4)..
|
||||
"listring[context;trash]"..
|
||||
"listring[current_player;main]"
|
||||
)
|
||||
meta:set_string("infotext", S("Trash Can"))
|
||||
meta:get_inventory():set_size("trash", 1)
|
||||
end,
|
||||
|
Reference in New Issue
Block a user