Generate item slot images on the fly

This commit is contained in:
Wuzzy 2020-03-24 18:48:14 +01:00
parent 3cf32c38c5
commit 7243a25fe6
31 changed files with 76 additions and 11 deletions

View file

@ -1,4 +1,5 @@
mcl_init
mcl_formspec
mcl_core
mcl_sounds
mcl_craftguide

View file

@ -7,14 +7,18 @@ local S = minetest.get_translator("mcl_furnaces")
local function active_formspec(fuel_percent, item_percent)
return "size[9,8.75]"..
"background[-0.19,-0.25;9.41,9.49;crafting_inventory_furnace.png]"..
"label[0,4;"..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)..
"label[2.75,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Furnace"))).."]"..
"list[current_name;src;2.75,0.5;1,1;]"..
mcl_formspec.get_itemslot_bg(2.75,0.5,1,1)..
"list[current_name;fuel;2.75,2.5;1,1;]"..
mcl_formspec.get_itemslot_bg(2.75,2.5,1,1)..
"list[current_name;dst;5.75,1.5;1,1;]"..
mcl_formspec.get_itemslot_bg(5.75,2.5,1,1)..
"image[2.75,1.5;1,1;default_furnace_fire_bg.png^[lowpart:"..
(100-fuel_percent)..":default_furnace_fire_fg.png]"..
"image[4.1,1.5;1.5,1;gui_furnace_arrow_bg.png^[lowpart:"..
@ -30,14 +34,18 @@ local function active_formspec(fuel_percent, item_percent)
end
local inactive_formspec = "size[9,8.75]"..
"background[-0.19,-0.25;9.41,9.49;crafting_inventory_furnace.png]"..
"label[0,4;"..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)..
"label[2.75,0;"..minetest.formspec_escape(minetest.colorize("#313131", S("Furnace"))).."]"..
"list[current_name;src;2.75,0.5;1,1;]"..
mcl_formspec.get_itemslot_bg(2.75,0.5,1,1)..
"list[current_name;fuel;2.75,2.5;1,1;]"..
mcl_formspec.get_itemslot_bg(2.75,2.5,1,1)..
"list[current_name;dst;5.75,1.5;1,1;]"..
mcl_formspec.get_itemslot_bg(5.75,1.5,1,1)..
"image[2.75,1.5;1,1;default_furnace_fire_bg.png]"..
"image[4.1,1.5;1.5,1;gui_furnace_arrow_bg.png^[transformR270]"..
"image_button[8,0;1,1;craftguide_book.png;craftguide;]"..

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB