Flow unit frame auras: debuffs first on enemies, own size, spacing

Unit frame aura icons are placed by a layout pass after each aura
refresh instead of a fixed grid set at setup. Rows are as tall as
their largest icon, and the debuff block no longer uses the debuff
size to step past buff rows. (Closes #25)

- When buffs and debuffs share a corner, debuffs come first on
  neutral and hostile units.
- New Own Buff Size / Own Debuff Size (-1 = normal size) enlarge the
  player's auras, which C_UnitAuras already lists first.
- New Buff/Debuff X-Spacing and Y-Spacing set the gaps between icons
  and rows; the default of 1 keeps the old look.
- The selfdebuff tooltip remap is gone from unit frames and buffwatch:
  own auras lead the list, so the HARMFUL|PLAYER index is the HARMFUL
  index.
This commit is contained in:
Brues
2026-10-22 23:24:15 -05:00
parent 627ab8b437
commit df16988d3f
5 changed files with 111 additions and 147 deletions
+3 -34
View File
@@ -76,10 +76,6 @@ pfUI:RegisterModule("buffwatch", function ()
-- reusable GetAuraSlots buffer, filled once per RefreshBuffBarFrame
local auraSlots = {}
-- Separate buffer for the tooltip handler: OnEnter can fire while a refresh
-- is showing/hiding bars under the cursor, so it must not share the above.
local tooltipSlots = {}
-- Reads one aura by the slot id GetAuraSlots returned (nil slot -> nil).
local function GetBuffData(unit, slot)
local name, icon, count, dispelType, _, expirationTime = C_UnitAuras.UnitAuraBySlot(unit, slot)
@@ -116,36 +112,9 @@ pfUI:RegisterModule("buffwatch", function ()
local function StatusBarOnEnter()
GameTooltip:SetOwner(this, "NONE")
if this.unit == "player" then
GameTooltip:SetUnitAura("player", this.id, this.type)
elseif this.type == "HARMFUL" then
-- selfdebuff filters the displayed list to player-cast harmful auras, but
-- SetUnitAura's index has to be into the unfiltered HARMFUL list. Look up
-- the displayed aura via the PLAYER filter, then find its position in the
-- unfiltered list by name + sourceGUID.
--
-- The unfiltered list is NOT capped at 16: once a unit's 16 debuff slots
-- are full the server parks further debuffs in buff slots, and
-- C_UnitAuras reports those as harmful too. So enumerate what it has.
local config = this.parent and this.parent.config
if config and config.selfdebuff == "1" then
local ownAura = C_UnitAuras.GetAuraDataByIndex(this.unit, this.id, "HARMFUL|PLAYER")
if ownAura then
local n = ScanAuraSlots(this.unit, "HARMFUL", tooltipSlots)
for i = 1, n do
local check = C_UnitAuras.GetAuraDataBySlot(this.unit, tooltipSlots[i])
if check and check.name == ownAura.name and check.sourceGUID == ownAura.sourceGUID then
GameTooltip:SetUnitAura(this.unit, i, "HARMFUL")
break
end
end
end
else
GameTooltip:SetUnitAura(this.unit, this.id, "HARMFUL")
end
elseif this.type == "HELPFUL" then
GameTooltip:SetUnitAura(this.unit, this.id, "HELPFUL")
end
-- C_UnitAuras lists the player's own auras first, so the selfdebuff
-- (HARMFUL|PLAYER) list is a prefix of the HARMFUL list: same index.
GameTooltip:SetUnitAura(this.unit, this.id, this.type)
if IsShiftKeyDown() then
GameTooltip:AddLine(" ")