Change infotext

This commit is contained in:
Evert Prants 2018-06-20 21:58:41 +03:00
parent 0cd0e138ea
commit 3270034006
No known key found for this signature in database
GPG Key ID: 1688DA83D222D0B5
2 changed files with 13 additions and 12 deletions

@ -71,8 +71,14 @@ local function tank_on_timer(pos, elapsed)
meta:set_string("buffer_fluid", "") meta:set_string("buffer_fluid", "")
end end
local fluid_desc = "Empty"
if buffer.fluid ~= "" then
fluid_desc = fluid_lib.cleanse_node_description(buffer.fluid)
end
-- Update infotext -- Update infotext
meta:set_string("infotext", ("%s (%d/%d %s)"):format(ndef.description, buffer.amount, buffer.capacity, fluid_lib.unit)) meta:set_string("infotext", ("%s\nContains: %s (%d/%d %s)"):format(ndef.description, fluid_desc,
buffer.amount, buffer.capacity, fluid_lib.unit))
local param2 = math.min(percentile * 63, 63) local param2 = math.min(percentile * 63, 63)
@ -107,9 +113,6 @@ local function create_tank_node(tankname, def, fluid_name)
if fdef and fdef.tiles then if fdef and fdef.tiles then
special_tiles = fdef.tiles special_tiles = fdef.tiles
end end
local fluid_desc = fluid_lib.cleanse_node_description(fluid_name)
desc = desc .. " of "..fluid_desc
end end
minetest.register_node(tankname, { minetest.register_node(tankname, {
@ -188,10 +191,8 @@ function fluid_tanks.register_tank(tankname, def)
end end
end end
--minetest.after(0.2, function () fluid_tanks.register_tank("fluid_tanks:tank", {
fluid_tanks.register_tank("fluid_tanks:tank", { description = "Fluid Tank",
description = "Fluid Tank", capacity = 16000,
capacity = 16000, accepts = true,
accepts = true, })
})
--end)

@ -1,3 +1,3 @@
name = fluid_tanks name = fluid_tanks
description = API for fluid storage. description = API for fluid storage.
depends = bucket depends = fluid_lib,bucket