Performance update for nameplates: optimize update loop, combat detection and debuff rendering

- Decouple OnValueChanged from OnDataChanged to prevent expensive
  full updates on every HP tick

- Replace UnitAffectingCombat(guid) with GetUnitField(flags) bitcheck
  and add 0.2s per-GUID throttle cache for GetCombatStateColor

- Gate HP bar SetMinMaxValues/SetValue and text formatting behind
  hp/hpmax change detection

- Inline castbar update into per-plate OnUpdate loop, remove dedicated
  castbarFrame overhead

- Switch debuff slot cache from name-keyed to slot-index-keyed to fix
  timer reset bug when debuffs shift after expiry

- Add raidGuidCache (rebuilt on RAID_ROSTER_UPDATE/PARTY_MEMBERS_CHANGED)
  for O(1) offtank target-name lookup

- Add UNIT_FLAGS_GUID event support for instant combat flag notification
  (Nampower)

- Extract RebuildOfftanks() to ensure offtanks table is populated at
  startup, not only on config change

- Reuse childs table across scan ticks to reduce GC pressure

- Add zoominstant config option to skip zoom animation

- Add combatColorCache cleanup on plate hide and combat leave

Please report any bugs that appear after this change, since it is a huge change.
This commit is contained in:
Meow
2026-04-02 04:15:18 +02:00
parent 7dcac8104f
commit 136aca02c5
2 changed files with 527 additions and 748 deletions
+1 -1
View File
@@ -2935,7 +2935,7 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
CreateConfig(U["nameplates"], T["Always Show On Target Units"], C.nameplates, "target", "checkbox")
CreateConfig(U["nameplates"], T["Vertical Healthbar"], C.nameplates, "verticalhealth", "checkbox")
CreateConfig(nil, T["SuperWoW Settings"], nil, nil, "header")
CreateConfig(nil, T["Nampower Settings"], nil, nil, "header")
CreateConfig(U["nameplates"], T["Overwrite Border Color With Combat State"], C.nameplates, "outcombatstate", "checkbox")
CreateConfig(U["nameplates"], T["Overwrite Health Color With Combat State"], C.nameplates, "barcombatstate", "checkbox")
CreateConfig(U["nameplates"], T["Overwrite If Unit Is Attacking You"], C.nameplates, "ccombatthreat", "checkbox")
+526 -747
View File
File diff suppressed because it is too large Load Diff