Add max buffs and max debuffs settings
- /tfb buffs 0-32 and /tfb debuffs 0-16, plus two options-panel sliders. - Saved settings are validated and reset when out of range. - A lowered debuff limit hides extra debuffs instead of spilling them into the buff row; the buff limit applies to spilled debuffs too. - Works on the native and ClassicAPI paths and with test mode. - Bump to 0.9.6; tests now 23 scenarios. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019W3rwutyoLNHxXPycYWSMc
This commit is contained in:
+11
-4
@@ -244,6 +244,8 @@ end
|
||||
-- Stock 1.12 path: UnitBuff/UnitDebuff, no timing data.
|
||||
function TargetFrameBuff_UpdateNative()
|
||||
local button, buff, i;
|
||||
local maxBuffs = TargetFrameBuff_Setting("maxBuffs");
|
||||
local maxDebuffs = TargetFrameBuff_Setting("maxDebuffs");
|
||||
for i=1, TARGETFRAMEBUFF_MAX_TARGET_BUFFS do
|
||||
if (lTestMode) then
|
||||
buff = nil;
|
||||
@@ -252,7 +254,7 @@ function TargetFrameBuff_UpdateNative()
|
||||
buff = UnitBuff("target", i);
|
||||
end
|
||||
button = lBuffButtons[i];
|
||||
if (buff) then
|
||||
if (buff and i <= maxBuffs) then
|
||||
getglobal("TargetFrameBuff"..i.."Icon"):SetTexture(buff);
|
||||
button:Show();
|
||||
button.id = i;
|
||||
@@ -274,7 +276,7 @@ function TargetFrameBuff_UpdateNative()
|
||||
debuff, debuffApplications, debuffType = UnitDebuff("target", i);
|
||||
end
|
||||
button = lDebuffButtons[i];
|
||||
if (debuff) then
|
||||
if (debuff and i <= maxDebuffs) then
|
||||
TargetFrameBuff_ColorBorder(i, debuffType);
|
||||
TargetFrameBuff_SetCount(i, debuffApplications);
|
||||
getglobal("TargetFrameDebuff"..i.."Icon"):SetTexture(debuff);
|
||||
@@ -390,6 +392,8 @@ function TargetFrameBuff_UpdateClassicAPI()
|
||||
local pass, filter, slots, n, index, token;
|
||||
local name, icon, count, dispelType, duration, expiration, source, removable;
|
||||
local batched = C_UnitAuras.GetAuraSlots and C_UnitAuras.UnitAuraBySlot;
|
||||
local maxBuffs = TargetFrameBuff_Setting("maxBuffs");
|
||||
local maxDebuffs = TargetFrameBuff_Setting("maxDebuffs");
|
||||
for pass = 1, 2 do
|
||||
if (pass == 1) then
|
||||
filter, slots = "HELPFUL", lHelpfulSlots;
|
||||
@@ -412,12 +416,15 @@ function TargetFrameBuff_UpdateClassicAPI()
|
||||
name, icon, count, dispelType, duration, expiration, source, removable = C_UnitAuras.UnitAura("target", index, filter);
|
||||
end
|
||||
if (not name and not icon) then break; end
|
||||
if (pass == 2 and index <= TARGETFRAMEBUFF_MAX_TARGET_DEBUFFS) then
|
||||
if (pass == 2 and index <= maxDebuffs and index <= TARGETFRAMEBUFF_MAX_TARGET_DEBUFFS) then
|
||||
numDebuffs = index;
|
||||
TargetFrameBuff_ColorBorder(index, dispelType);
|
||||
TargetFrameBuff_SetCount(index, count);
|
||||
TargetFrameBuff_ShowAura(lDebuffButtons[index], filter, index, icon, count, dispelType, duration, expiration, removable);
|
||||
elseif (numBuffs < TARGETFRAMEBUFF_MAX_TARGET_BUFFS) then
|
||||
elseif (pass == 2 and maxDebuffs < TARGETFRAMEBUFF_MAX_TARGET_DEBUFFS) then
|
||||
-- A lowered debuff limit means no debuffs spill into the buff row.
|
||||
break;
|
||||
elseif (numBuffs < maxBuffs) then
|
||||
numBuffs = numBuffs + 1;
|
||||
TargetFrameBuff_ShowAura(lBuffButtons[numBuffs], filter, index, icon, count, dispelType, duration, expiration, removable);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user