show Armor state as average %

This commit is contained in:
Alexander Weber 2017-04-02 21:18:40 +02:00
parent ac0c938162
commit 5b163a6311

View File

@ -114,7 +114,11 @@ local function update_page(state)
grouptext = "group:armor:"..k
end
if grouptext and v ~= 0 then
a_list:addItem(grouptext..": "..v)
if k == "state" then
a_list:addItem(grouptext..": "..tostring(math.floor((1 - v / armor.def[name].count / 65535) * 100 + 0.5)).." %")
else
a_list:addItem(grouptext..": "..v)
end
end
end
end