From 7f25441dd618fb80a203291d9647f4b8bc46226d Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 5 Aug 2016 04:47:38 +0200 Subject: Improve liquids display --- init.lua | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/init.lua b/init.lua index 629ace5..34680e7 100644 --- a/init.lua +++ b/init.lua @@ -217,24 +217,28 @@ doc.new_category("nodes", { formstring = formstring .. toolcaps_to_text(data.def.tool_capabilities) .. "\n" formstring = formstring .. "Collidable: "..yesno(data.def.walkable).. "\n" + if data.def.pointable == true then + formstring = formstring .. "Pointable: Yes\n" + elseif liquid then + formstring = formstring .. "Pointable: Only by special items\n" + else + formstring = formstring .. "Pointable: No\n" + end local liquid if data.def.liquidtype ~= "none" then liquid = true else liquid = false end - formstring = formstring .. "Liquid: "..yesno(liquid).. "\n" if liquid then + formstring = formstring .. "This block is a liquid with these properties:\n" local range, renew, viscos if data.def.liquid_range then range = data.def.liquid_range else range = 8 end if data.def.liquid_renewable ~= nil then renew = data.def.liquid_renewable else renew = true end if data.def.liquid_viscosity then viscos = data.def.liquid_viscosity else viscos = 0 end - formstring = formstring .. "Liquid range: "..range.. "\n" - formstring = formstring .. "Liquid viscosity: "..viscos.. "\n" - formstring = formstring .. "Renewable liquid: "..yesno(renew).. "\n" - end - if data.def.pointable == true then - formstring = formstring .. "Pointable: Yes\n" - elseif liquid then - formstring = formstring .. "Pointable: Only by special items\n" - else - formstring = formstring .. "Pointable: No\n" + if range == 0 then + formstring = formstring .. "- Flowing range: 0 (no flowing)\n" + else + formstring = formstring .. "- Flowing range: "..range.. "\n" + end + formstring = formstring .. "- Viscosity: "..viscos.. "\n" + formstring = formstring .. "- Renewable: "..yesno(renew).. "\n" end formstring = formstring .. "\n" -- cgit v1.2.3