ME Drives: Show percent full in description

This commit is contained in:
octacian 2017-02-24 16:26:45 -08:00
parent e0e5702053
commit ad80c63682
1 changed files with 4 additions and 1 deletions

View File

@ -88,9 +88,12 @@ function microexpansion.cell_desc(inv, listname, spos)
end
end
-- Calculate Percentage
local percent = math.floor(items / max_items * 100)
-- Update description
meta:set_string("description", base_desc.."\n"..
minetest.colorize("grey", tostring(items).."/"..tostring(max_items).." Items"))
minetest.colorize("grey", tostring(items).."/"..tostring(max_items).." Items ("..tostring(percent).."%)"))
-- Update stack
inv:set_stack(listname, spos, stack)
end