Fixed an issue with Min and Max spell values of nested spells

This commit is contained in:
Tercio Jose
2023-05-18 12:01:51 -03:00
parent 446c4e7a75
commit b235a3a547
3 changed files with 21 additions and 3 deletions
+1
View File
@@ -140,6 +140,7 @@
---@field SetPropagateKeyboardInput fun(self: frame, propagate: boolean)
---@field SetPropagateGamepadInput fun(self: frame, propagate: boolean)
---@field StartMoving fun(self: frame)
---@field IsMovable fun(self: frame) : boolean
---@field StartSizing fun(self: frame, point: "top"|"topright"|"right"|"bottomright"|"bottom"|"bottomleft"|"left"|"topleft")
---@field StopMovingOrSizing fun(self: frame)
---@field GetAttribute fun(self: frame, name: string) : any
+7
View File
@@ -105,6 +105,13 @@ Details.SpellTableMixin = {
for level, amount in pairs(value) do
targetTable[key][level] = (targetTable[key][level] or 0) + amount
end
elseif (key == "c_max" or key == "n_max") then
targetTable[key] = math.max(targetTable[key] or value, value)
elseif (key == "c_min" or key == "n_min") then
targetTable[key] = math.min(targetTable[key] or value, value)
else
targetTable[key] = (targetTable[key] or 0) + value
end
+13 -3
View File
@@ -2579,11 +2579,21 @@ local refreshSpellsFunc = function(scrollFrame, scrollData, offset, totalLines)
if (mainSpellBar) then
lineIndex = lineIndex + 1
local bIsMainLine = true
local bIsActorHeader = bkSpellData.bIsActorHeader
local spellTableIndex = 1
local spellBar = mainSpellBar
if (bkSpellData.bIsActorHeader) then
updateSpellBar(mainSpellBar, index, bkSpellData.actorName, combatObject, scrollFrame, headerTable, bkSpellData, 1, totalValue, topValue, bIsMainLine, keyToSort, spellTablesAmount)
local nameToUse = actorName
if (bIsActorHeader) then
nameToUse = bkSpellData.actorName
end
---@debug both calls are equal but the traceback will be different in case of an error
if (bIsActorHeader) then
updateSpellBar(spellBar, index, nameToUse, combatObject, scrollFrame, headerTable, bkSpellData, spellTableIndex, totalValue, topValue, bIsMainLine, keyToSort, spellTablesAmount)
else
updateSpellBar(mainSpellBar, index, actorName, combatObject, scrollFrame, headerTable, bkSpellData, 1, totalValue, topValue, bIsMainLine, keyToSort, spellTablesAmount)
--here
updateSpellBar(spellBar, index, nameToUse, combatObject, scrollFrame, headerTable, bkSpellData, spellTableIndex, totalValue, topValue, bIsMainLine, keyToSort, spellTablesAmount)
end
end
end