mirror of
https://github.com/theFox6/microexpansion.git
synced 2024-11-22 15:13:51 +01:00
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
|
||||
|
||||
-- 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
|
||||
|
Loading…
Reference in New Issue
Block a user