1
0
Fork 0

Use `table.concat` for formspec generation

bambootoo
AFCMS 2022-11-13 22:24:24 +01:00
parent c49f000894
commit 9cc63ed716
No known key found for this signature in database
GPG Key ID: 8720389A25B652E3
1 changed files with 15 additions and 11 deletions

View File

@ -1,4 +1,6 @@
local S = minetest.get_translator(minetest.get_current_modname()) local S = minetest.get_translator(minetest.get_current_modname())
local F = minetest.formspec_escape
local C = minetest.colorize
local LOGGING_ON = minetest.settings:get_bool("mcl_logging_hoppers", false) local LOGGING_ON = minetest.settings:get_bool("mcl_logging_hoppers", false)
local function mcl_log(message) local function mcl_log(message)
@ -9,17 +11,19 @@ end
--[[ BEGIN OF NODE DEFINITIONS ]] --[[ BEGIN OF NODE DEFINITIONS ]]
local mcl_hoppers_formspec = "size[9,7]" .. local mcl_hoppers_formspec = table.concat({
"label[2,0;" .. minetest.formspec_escape(minetest.colorize("#313131", S("Hopper"))) .. "]" .. "size[9,7]",
"list[context;main;2,0.5;5,1;]" .. "label[2,0;" .. F(C("#313131", S("Hopper"))) .. "]",
mcl_formspec.get_itemslot_bg(2, 0.5, 5, 1) .. "list[context;main;2,0.5;5,1;]",
"label[0,2;" .. minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))) .. "]" .. mcl_formspec.get_itemslot_bg(2, 0.5, 5, 1),
"list[current_player;main;0,2.5;9,3;9]" .. "label[0,2;" .. F(C("#313131", S("Inventory"))) .. "]",
mcl_formspec.get_itemslot_bg(0, 2.5, 9, 3) .. "list[current_player;main;0,2.5;9,3;9]",
"list[current_player;main;0,5.74;9,1;]" .. mcl_formspec.get_itemslot_bg(0, 2.5, 9, 3),
mcl_formspec.get_itemslot_bg(0, 5.74, 9, 1) .. "list[current_player;main;0,5.74;9,1;]",
"listring[context;main]" .. mcl_formspec.get_itemslot_bg(0, 5.74, 9, 1),
"listring[current_player;main]" "listring[context;main]",
"listring[current_player;main]",
})
-- Downwards hopper (base definition) -- Downwards hopper (base definition)