Generate item slot images on the fly
This commit is contained in:
parent
3cf32c38c5
commit
7243a25fe6
31 changed files with 76 additions and 11 deletions
|
@ -1,4 +1,5 @@
|
|||
mcl_init
|
||||
mcl_formspec
|
||||
mcl_core
|
||||
mcl_sounds
|
||||
mcl_end
|
||||
|
|
|
@ -183,12 +183,14 @@ minetest.register_node("mcl_chests:"..basename, {
|
|||
minetest.show_formspec(clicker:get_player_name(),
|
||||
"mcl_chests:"..canonical_basename.."_"..pos.x.."_"..pos.y.."_"..pos.z,
|
||||
"size[9,8.75]"..
|
||||
"background[-0.19,-0.25;9.41,10.48;mcl_chests_inventory_chest.png]"..
|
||||
"label[0,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Chest"))).."]"..
|
||||
"list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;0,0.5;9,3;]"..
|
||||
mcl_formspec.get_itemslot_bg(0,0.5,9,3)..
|
||||
"label[0,4.0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]"..
|
||||
"list[current_player;main;0,4.5;9,3;9]"..
|
||||
mcl_formspec.get_itemslot_bg(0,4.5,9,3)..
|
||||
"list[current_player;main;0,7.74;9,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(0,7.74,9,1)..
|
||||
"listring[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main]"..
|
||||
"listring[current_player;main]")
|
||||
|
||||
|
@ -317,13 +319,16 @@ minetest.register_node("mcl_chests:"..basename.."_left", {
|
|||
minetest.show_formspec(clicker:get_player_name(),
|
||||
"mcl_chests:"..canonical_basename.."_"..pos.x.."_"..pos.y.."_"..pos.z,
|
||||
"size[9,11.5]"..
|
||||
"background[-0.19,-0.25;9.41,12.5;mcl_chests_inventory_chest_large.png]"..
|
||||
"label[0,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Large Chest"))).."]"..
|
||||
"list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;0,0.5;9,3;]"..
|
||||
mcl_formspec.get_itemslot_bg(0,0.5,9,3)..
|
||||
"list[nodemeta:"..pos_other.x..","..pos_other.y..","..pos_other.z..";main;0,3.5;9,3;]"..
|
||||
mcl_formspec.get_itemslot_bg(0,3.5,9,3)..
|
||||
"label[0,7;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]"..
|
||||
"list[current_player;main;0,7.5;9,3;9]"..
|
||||
mcl_formspec.get_itemslot_bg(0,7.5,9,3)..
|
||||
"list[current_player;main;0,10.75;9,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(0,10.75,9,1)..
|
||||
-- BEGIN OF LISTRING WORKAROUND
|
||||
"listring[current_player;main]"..
|
||||
"listring[nodemeta:"..pos.x..","..pos.y..","..pos.z..";input]"..
|
||||
|
@ -452,13 +457,16 @@ minetest.register_node("mcl_chests:"..basename.."_right", {
|
|||
"mcl_chests:"..canonical_basename.."_"..pos.x.."_"..pos.y.."_"..pos.z,
|
||||
|
||||
"size[9,11.5]"..
|
||||
"background[-0.19,-0.25;9.41,12.5;mcl_chests_inventory_chest_large.png]"..
|
||||
"label[0,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Large Chest"))).."]"..
|
||||
"list[nodemeta:"..pos_other.x..","..pos_other.y..","..pos_other.z..";main;0,0.5;9,3;]"..
|
||||
mcl_formspec.get_itemslot_bg(0,0.5,9,3)..
|
||||
"list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;0,3.5;9,3;]"..
|
||||
mcl_formspec.get_itemslot_bg(0,3.5,9,3)..
|
||||
"label[0,7;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]"..
|
||||
"list[current_player;main;0,7.5;9,3;9]"..
|
||||
mcl_formspec.get_itemslot_bg(0,7.5,9,3)..
|
||||
"list[current_player;main;0,10.75;9,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(0,10.75,9,1)..
|
||||
-- BEGIN OF LISTRING WORKAROUND
|
||||
"listring[current_player;main]"..
|
||||
"listring[nodemeta:"..pos.x..","..pos.y..","..pos.z..";input]"..
|
||||
|
@ -662,12 +670,14 @@ minetest.register_node("mcl_chests:ender_chest", {
|
|||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec",
|
||||
"size[9,8.75]"..
|
||||
"background[-0.19,-0.25;9.41,10.48;mcl_chests_inventory_chest.png]"..
|
||||
"label[0,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Ender Chest"))).."]"..
|
||||
"list[current_player;enderchest;0,0.5;9,3;]"..
|
||||
mcl_formspec.get_itemslot_bg(0,0.5,9,3)..
|
||||
"label[0,4.0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]"..
|
||||
"list[current_player;main;0,4.5;9,3;9]"..
|
||||
mcl_formspec.get_itemslot_bg(0,4.5,9,3)..
|
||||
"list[current_player;main;0,7.74;9,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(0,7.74,9,1)..
|
||||
"listring[current_player;enderchest]"..
|
||||
"listring[current_player;main]")
|
||||
end,
|
||||
|
@ -783,12 +793,14 @@ for color, desc in pairs(boxtypes) do
|
|||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec",
|
||||
"size[9,8.75]"..
|
||||
"background[-0.19,-0.25;9.41,10.48;mcl_chests_inventory_chest.png]"..
|
||||
"label[0,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Shulker Box"))).."]"..
|
||||
"list[current_name;main;0,0.5;9,3;]"..
|
||||
mcl_formspec.get_itemslot_bg(0,0.5,9,3)..
|
||||
"label[0,4.0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Inventory"))).."]"..
|
||||
"list[current_player;main;0,4.5;9,3;9]"..
|
||||
mcl_formspec.get_itemslot_bg(0,4.5,9,3)..
|
||||
"list[current_player;main;0,7.74;9,1;]"..
|
||||
mcl_formspec.get_itemslot_bg(0,7.74,9,1)..
|
||||
"listring[current_name;main]"..
|
||||
"listring[current_player;main]")
|
||||
local inv = meta:get_inventory()
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.5 KiB |
Loading…
Add table
Add a link
Reference in a new issue