Fix for excessive empty lines in stat box

This commit is contained in:
Openarl
2017-05-02 23:26:19 +10:00
parent d5e1c1b01c
commit 23201f3d70
2 changed files with 9 additions and 8 deletions

View File

@@ -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