From 23201f3d70cf5e637372ad91fc1bc71526e15fb3 Mon Sep 17 00:00:00 2001 From: Openarl Date: Tue, 2 May 2017 23:26:19 +1000 Subject: [PATCH] Fix for excessive empty lines in stat box --- Modules/Build.lua | 15 ++++++++------- manifest.xml | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Modules/Build.lua b/Modules/Build.lua index 7507a751..38ca1c84 100644 --- a/Modules/Build.lua +++ b/Modules/Build.lua @@ -729,32 +729,33 @@ end -- Add stat list for given actor function buildMode:AddDisplayStatList(statList, actor) + local statBoxList = self.controls.statBox.list for index, statData in ipairs(statList) do if statData.stat then if not statData.flag or actor.mainSkill.skillFlags[statData.flag] then local statVal = actor.output[statData.stat] if statVal and ((statData.condFunc and statData.condFunc(statVal,actor.output)) or (not statData.condFunc and statVal ~= 0)) then - t_insert(self.controls.statBox.list, { + t_insert(statBoxList, { height = 16, "^7"..statData.label..":", string.format("%s%"..statData.fmt, statVal >= 0 and "^7" or data.colorCodes.NEGATIVE, statVal * ((statData.pc or statData.mod) and 100 or 1) - (statData.mod and 100 or 0)) }) end end - else - t_insert(self.controls.statBox.list, { height = 10 }) + elseif not statBoxList[#statBoxList] or statBoxList[#statBoxList][1] then + t_insert(statBoxList, { height = 10 }) end end end -- Build list of side bar stats function buildMode:RefreshStatList() - wipeTable(self.controls.statBox.list) + local statBoxList = wipeTable(self.controls.statBox.list) if self.calcsTab.mainEnv.minion then - t_insert(self.controls.statBox.list, { height = 18, "^7Minion:" }) + t_insert(statBoxList, { height = 18, "^7Minion:" }) self:AddDisplayStatList(self.minionDisplayStats, self.calcsTab.mainEnv.minion) - t_insert(self.controls.statBox.list, { height = 10 }) - t_insert(self.controls.statBox.list, { height = 18, "^7Player:" }) + t_insert(statBoxList, { height = 10 }) + t_insert(statBoxList, { height = 18, "^7Player:" }) end self:AddDisplayStatList(self.displayStats, self.calcsTab.mainEnv.player) end diff --git a/manifest.xml b/manifest.xml index 8ebda031..958f00d1 100644 --- a/manifest.xml +++ b/manifest.xml @@ -43,7 +43,7 @@ - +