Skip to content

Commit

Permalink
- increased auras offset if highlighting TipTac developer
Browse files Browse the repository at this point in the history
  • Loading branch information
frozn committed May 25, 2024
1 parent 54e5ba5 commit 15b9d2a
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions TipTac/modules/ttAuras.lua
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,19 @@ function ttAuras:SetupTipsAuras(tip)
local auraCount, lastAura;

if (cfg.showBuffs) then
auraCount, lastAura = self:DisplayTipsAuras(tip, unitRecord, "HELPFUL", currentAuraCount + 1);
auraCount, lastAura = self:DisplayTipsAuras(tip, currentDisplayParams, "HELPFUL", currentAuraCount + 1);
currentAuraCount = currentAuraCount + auraCount;
end
if (cfg.showDebuffs) then
auraCount, lastAura = self:DisplayTipsAuras(tip, unitRecord, "HARMFUL", currentAuraCount + 1);
auraCount, lastAura = self:DisplayTipsAuras(tip, currentDisplayParams, "HARMFUL", currentAuraCount + 1);
currentAuraCount = currentAuraCount + auraCount;
end
end

-- display tip's buffs and debuffs
function ttAuras:DisplayTipsAuras(tip, unitRecord, auraType, startingAuraFrameIndex, lastAura)
function ttAuras:DisplayTipsAuras(tip, currentDisplayParams, auraType, startingAuraFrameIndex, lastAura)
local unitRecord = currentDisplayParams.unitRecord;

-- queries auras of the specific auraType, sets up the aura frame and anchors it in the desired place.
local aurasPerRow = floor((tip:GetWidth() - 4) / (cfg.auraSize + 2)); -- auras we can fit into one row based on the current size of the tooltip
local xOffsetBasis = (auraType == "HELPFUL" and 1 or -1); -- is +1 or -1 based on horz anchoring
Expand Down Expand Up @@ -171,6 +173,16 @@ function ttAuras:DisplayTipsAuras(tip, unitRecord, auraType, startingAuraFrameIn
local x = (xOffsetBasis * 2);
local y = (cfg.auraSize + 2) * floor((auraFrameIndex - 1) / aurasPerRow) + 1 + cfg.auraOffset;

if (cfg.aurasAtBottom) then
if (currentDisplayParams.isSetBottomOverlayToHighlightTipTacDeveloper) then
y = y + (math.max(4 - cfg.auraOffset, 0));
end
else
if (currentDisplayParams.isSetTopOverlayToHighlightTipTacDeveloper) then
y = y + (math.max(9 - cfg.auraOffset, 0));
end
end

y = (cfg.aurasAtBottom and -y or y);

aura:SetPoint(anchor1, tip, anchor2, x, y);
Expand Down

0 comments on commit 15b9d2a

Please sign in to comment.