ME Drives: Show percent full in description
This commit is contained in:
parent
e0e5702053
commit
ad80c63682
@ -88,9 +88,12 @@ function microexpansion.cell_desc(inv, listname, spos)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Calculate Percentage
|
||||||
|
local percent = math.floor(items / max_items * 100)
|
||||||
|
|
||||||
-- Update description
|
-- Update description
|
||||||
meta:set_string("description", base_desc.."\n"..
|
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
|
-- Update stack
|
||||||
inv:set_stack(listname, spos, stack)
|
inv:set_stack(listname, spos, stack)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user