From 5b163a63112c8a73f7fb883da543f47505354a18 Mon Sep 17 00:00:00 2001 From: Alexander Weber Date: Sun, 2 Apr 2017 21:18:40 +0200 Subject: [PATCH] show Armor state as average % --- player.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/player.lua b/player.lua index 351a8fa..a599dd3 100644 --- a/player.lua +++ b/player.lua @@ -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