@@ -2300,9 +2300,9 @@ function CompareTabClass:LayoutCalcsSkillControls(vp, compareEntry)
23002300 local textLinesHeight = 2 -- padding before text
23012301 local primaryEnv = self .primaryBuild .calcsTab and self .primaryBuild .calcsTab .calcsEnv
23022302 local compareEnv = compareEntry .calcsTab and compareEntry .calcsTab .calcsEnv
2303- local pOutput = primaryEnv and primaryEnv .player and primaryEnv .player .output
2304- local cOutput = compareEnv and compareEnv .player and compareEnv .player .output
2305- if pOutput or cOutput then
2303+ local primaryOutput = primaryEnv and primaryEnv .player and primaryEnv .player .output
2304+ local compareOutput = compareEnv and compareEnv .player and compareEnv .player .output
2305+ if primaryOutput or compareOutput then
23062306 local wrapWidth = colWidth - 8
23072307 local infoLabels = {
23082308 BuffList = " Aura/Buff Skills" ,
@@ -2311,13 +2311,13 @@ function CompareTabClass:LayoutCalcsSkillControls(vp, compareEntry)
23112311 }
23122312 local infoKeys = { " BuffList" , " CombatList" , " CurseList" }
23132313 for _ , key in ipairs (infoKeys ) do
2314- local pVal = pOutput and pOutput [key ]
2315- local cVal = cOutput and cOutput [key ]
2316- if (pVal and pVal ~= " " ) or (cVal and cVal ~= " " ) then
2314+ local primaryValue = primaryOutput and primaryOutput [key ]
2315+ local compareValue = compareOutput and compareOutput [key ]
2316+ if (primaryValue and primaryValue ~= " " ) or (compareValue and compareValue ~= " " ) then
23172317 local label = infoLabels [key ]
2318- local pLines = (pVal and pVal ~= " " ) and # wrapInfoLine (label .. " : " .. pVal , wrapWidth ) or 0
2319- local cLines = (cVal and cVal ~= " " ) and # wrapInfoLine (label .. " : " .. cVal , wrapWidth ) or 0
2320- textLinesHeight = textLinesHeight + m_max (pLines , cLines , 1 ) * 18
2318+ local primaryLineCount = (primaryValue and primaryValue ~= " " ) and # wrapInfoLine (label .. " : " .. primaryValue , wrapWidth ) or 0
2319+ local compareLineCount = (compareValue and compareValue ~= " " ) and # wrapInfoLine (label .. " : " .. compareValue , wrapWidth ) or 0
2320+ textLinesHeight = textLinesHeight + m_max (primaryLineCount , compareLineCount , 1 ) * 18
23212321 end
23222322 end
23232323 end
@@ -4405,10 +4405,10 @@ function CompareTabClass:DrawCalcsSkillHeader(vp, compareEntry, headerHeight, pr
44054405
44064406 -- Text info lines (Aura/Buffs, Combat Buffs, Curses)
44074407 local textY = m_max (leftY , rightY ) + 2
4408- local pOutput = primaryEnv .player and primaryEnv .player .output
4409- local cOutput = compareEnv .player and compareEnv .player .output
4408+ local primaryOutput = primaryEnv .player and primaryEnv .player .output
4409+ local compareOutput = compareEnv .player and compareEnv .player .output
44104410 self .calcsSkillHeaderHover = nil -- Reset hover state
4411- if pOutput or cOutput then
4411+ if primaryOutput or compareOutput then
44124412 local cursorX , cursorY = GetCursorPos ()
44134413 local wrapWidth = colWidth - 8
44144414 local infoLines = {
@@ -4417,42 +4417,42 @@ function CompareTabClass:DrawCalcsSkillHeader(vp, compareEntry, headerHeight, pr
44174417 { label = " Curses/Debuffs" , key = " CurseList" , breakdown = " SkillDebuffs" },
44184418 }
44194419 for _ , info in ipairs (infoLines ) do
4420- local pVal = pOutput and pOutput [info .key ]
4421- local cVal = cOutput and cOutput [info .key ]
4422- if (pVal and pVal ~= " " ) or (cVal and cVal ~= " " ) then
4423- local pLines = (pVal and pVal ~= " " ) and wrapInfoLine (info .label .. " : " .. pVal , wrapWidth ) or {}
4424- local cLines = (cVal and cVal ~= " " ) and wrapInfoLine (info .label .. " : " .. cVal , wrapWidth ) or {}
4425- local pH = # pLines * 18
4426- local cH = # cLines * 18
4427- local rowH = m_max (pH , cH , 18 )
4420+ local primaryValue = primaryOutput and primaryOutput [info .key ]
4421+ local compareValue = compareOutput and compareOutput [info .key ]
4422+ if (primaryValue and primaryValue ~= " " ) or (compareValue and compareValue ~= " " ) then
4423+ local primaryLines = (primaryValue and primaryValue ~= " " ) and wrapInfoLine (info .label .. " : " .. primaryValue , wrapWidth ) or {}
4424+ local compareLines = (compareValue and compareValue ~= " " ) and wrapInfoLine (info .label .. " : " .. compareValue , wrapWidth ) or {}
4425+ local primaryHeight = # primaryLines * 18
4426+ local compareHeight = # compareLines * 18
4427+ local rowH = m_max (primaryHeight , compareHeight , 18 )
44284428 -- Check hover per-side for lines that have breakdown data
44294429 if info .breakdown and cursorY >= textY and cursorY < textY + rowH then
4430- local onLeft = cursorX >= leftX and cursorX < rightX and pH > 0 and cursorY < textY + pH
4431- local onRight = cursorX >= rightX and cursorX < vp .x + vp .width and cH > 0 and cursorY < textY + cH
4430+ local onLeft = cursorX >= leftX and cursorX < rightX and primaryHeight > 0 and cursorY < textY + primaryHeight
4431+ local onRight = cursorX >= rightX and cursorX < vp .x + vp .width and compareHeight > 0 and cursorY < textY + compareHeight
44324432 if onLeft then
44334433 SetDrawColor (0.15 , 0.25 , 0.15 )
4434- DrawImage (nil , leftX , textY , colWidth , pH )
4434+ DrawImage (nil , leftX , textY , colWidth , primaryHeight )
44354435 self .calcsSkillHeaderHover = {
44364436 breakdown = info .breakdown ,
44374437 label = info .label ,
44384438 build = self .primaryBuild ,
4439- x = leftX , y = textY , w = colWidth , h = pH ,
4439+ x = leftX , y = textY , w = colWidth , h = primaryHeight ,
44404440 }
44414441 elseif onRight then
44424442 SetDrawColor (0.15 , 0.25 , 0.15 )
4443- DrawImage (nil , rightX , textY , colWidth , cH )
4443+ DrawImage (nil , rightX , textY , colWidth , compareHeight )
44444444 self .calcsSkillHeaderHover = {
44454445 breakdown = info .breakdown ,
44464446 label = info .label ,
44474447 build = compareEntry ,
4448- x = rightX , y = textY , w = colWidth , h = cH ,
4448+ x = rightX , y = textY , w = colWidth , h = compareHeight ,
44494449 }
44504450 end
44514451 end
4452- for i , line in ipairs (pLines ) do
4452+ for i , line in ipairs (primaryLines ) do
44534453 DrawString (leftX , textY + 1 + (i - 1 ) * 18 , " LEFT" , 14 , " VAR" , " ^7" .. line )
44544454 end
4455- for i , line in ipairs (cLines ) do
4455+ for i , line in ipairs (compareLines ) do
44564456 DrawString (rightX , textY + 1 + (i - 1 ) * 18 , " LEFT" , 14 , " VAR" , " ^7" .. line )
44574457 end
44584458 textY = textY + rowH
@@ -4661,11 +4661,11 @@ function CompareTabClass:DrawCalcs(vp, compareEntry)
46614661 if subSec .data and subSec .data .extra then
46624662 local extraTextW = DrawStringWidth (16 , " VAR BOLD" , subSec .label .. " :" )
46634663 local extraX = x + 3 + extraTextW + 8
4664- local ok1 , pExtra = pcall (formatCalcStr , subSec .data .extra , primaryActor )
4665- local ok2 , cExtra = pcall (formatCalcStr , subSec .data .extra , compareActor )
4666- if ok1 and ok2 then
4664+ local primaryExtraOk , primaryExtraText = pcall (formatCalcStr , subSec .data .extra , primaryActor )
4665+ local compareExtraOk , compareExtraText = pcall (formatCalcStr , subSec .data .extra , compareActor )
4666+ if primaryExtraOk and compareExtraOk then
46674667 DrawString (extraX , lineY + 3 , " LEFT" , 16 , " VAR" ,
4668- colorCodes .POSITIVE .. pExtra .. " ^8| " .. colorCodes .WARNING .. cExtra )
4668+ colorCodes .POSITIVE .. primaryExtraText .. " ^8| " .. colorCodes .WARNING .. compareExtraText )
46694669 end
46704670 end
46714671 -- Separator below header
0 commit comments