fix ui recipe, add brewing message hovering over arrow

This commit is contained in:
tenplus1 2022-08-15 13:52:34 +01:00
parent fb69061010
commit 2fdaf907d9

View File

@ -56,7 +56,7 @@ if is_uninv then
unified_inventory.register_craft_type("barrel", { unified_inventory.register_craft_type("barrel", {
description = "Barrel", description = "Barrel",
icon = "wine_barrel.png", icon = "wine_barrel.png",
width = 1, width = 2,
height = 1 height = 1
}) })
end end
@ -397,7 +397,7 @@ end
-- Wine barrel formspec -- Wine barrel formspec
local function winebarrel_formspec(item_percent) local function winebarrel_formspec(item_percent, brewing)
return "size[8,9]" return "size[8,9]"
.. "list[current_name;src;1,1;2,1;]" .. "list[current_name;src;1,1;2,1;]"
@ -409,7 +409,7 @@ local function winebarrel_formspec(item_percent)
.. "listring[current_player;main]" .. "listring[current_player;main]"
.. "image[3.5,1;1,1;gui_furnace_arrow_bg.png^[lowpart:" .. "image[3.5,1;1,1;gui_furnace_arrow_bg.png^[lowpart:"
.. (item_percent) .. ":gui_furnace_arrow_fg.png^[transformR270]" .. (item_percent) .. ":gui_furnace_arrow_fg.png^[transformR270]"
.. "tooltip[3.5,1;1,1;" .. brewing .. "]"
end end
@ -433,7 +433,7 @@ minetest.register_node("wine:wine_barrel", {
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
meta:set_string("formspec", winebarrel_formspec(0)) meta:set_string("formspec", winebarrel_formspec(0, ""))
meta:set_string("infotext", S("Fermenting Barrel")) meta:set_string("infotext", S("Fermenting Barrel"))
meta:set_float("status", 0.0) meta:set_float("status", 0.0)
@ -534,6 +534,7 @@ minetest.register_node("wine:wine_barrel", {
-- the default stack, from which objects will be taken -- the default stack, from which objects will be taken
input_inventory = "dst", input_inventory = "dst",
connect_sides = { connect_sides = {
left = 1, right = 1, back = 1, left = 1, right = 1, back = 1,
front = 1, bottom = 1, top = 1} } end end)(), front = 1, bottom = 1, top = 1} } end end)(),
@ -599,7 +600,10 @@ minetest.register_node("wine:wine_barrel", {
if status < 100 then if status < 100 then
meta:set_string("infotext", S("Fermenting Barrel (@1% Done)", status)) meta:set_string("infotext", S("Fermenting Barrel (@1% Done)", status))
meta:set_float("status", status + 5) meta:set_float("status", status + 5)
meta:set_string("formspec", winebarrel_formspec(status))
local name = minetest.registered_items[recipe[2]].description or ""
meta:set_string("formspec", winebarrel_formspec(status, S("Brewing: @1", name)))
else else
inv:remove_item("src", recipe[1][1]) inv:remove_item("src", recipe[1][1])
@ -611,7 +615,7 @@ minetest.register_node("wine:wine_barrel", {
inv:add_item("dst", recipe[2]) inv:add_item("dst", recipe[2])
meta:set_float("status", 0,0) meta:set_float("status", 0,0)
meta:set_string("formspec", winebarrel_formspec(0)) meta:set_string("formspec", winebarrel_formspec(0, ""))
end end
if inv:is_empty("src") then if inv:is_empty("src") then