mirror of
https://github.com/brues-code/SuperCleveRoidMacros.git
synced 2026-09-16 03:38:00 +00:00
Add direct pfUI duration synchronization for combo spells
After analyzing pfUI's cooldown module, we need to directly sync combo durations to pfUI's libdebuff.objects storage: - Added SyncComboDurationToPfUI function to force-update pfUI's stored debuff duration after tracking combo spells - Called from UNIT_CASTEVENT handler after AddEffect - This ensures pfUI's cooldown display shows the correct combo duration (e.g., 28s for 5 CP Rip) instead of base 12s pfUI's cooldown module is just a display layer - it shows durations from pfUI.api.libdebuff.objects. By directly updating this storage, we ensure the correct duration is displayed regardless of timing.
This commit is contained in:
@@ -177,6 +177,27 @@ function Extension.HookPfUILibdebuff()
|
||||
return Extension.pfLibDebuffHooked or Extension.pfLibAddEffectHooked
|
||||
end
|
||||
|
||||
-- Synchronize combo durations to pfUI's libdebuff objects
|
||||
function Extension.SyncComboDurationToPfUI(guid, spellID, duration)
|
||||
if not pfUI or not pfUI.api or not pfUI.api.libdebuff then
|
||||
return
|
||||
end
|
||||
|
||||
-- Update pfUI's stored debuff duration
|
||||
local pflib = pfUI.api.libdebuff
|
||||
if pflib.objects and pflib.objects[guid] and pflib.objects[guid][spellID] then
|
||||
local old_duration = pflib.objects[guid][spellID].duration
|
||||
pflib.objects[guid][spellID].duration = duration
|
||||
|
||||
if CleveRoids.debug then
|
||||
DEFAULT_CHAT_FRAME:AddMessage(
|
||||
string.format("|cff00ffaa[pfUI Sync]|r Updated spell %d duration: %ds -> %ds",
|
||||
spellID, old_duration or 0, duration)
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Main compatibility check and setup
|
||||
function Extension.SetupCompatibility()
|
||||
Extension.pfUILoaded = (pfUI ~= nil)
|
||||
@@ -204,6 +225,9 @@ function Extension.OnLoad()
|
||||
Extension.DLOG("Extension pfUI Loaded.")
|
||||
Extension.HookMethod(CleveRoids, "GetFocusName", "FocusNameHook", true)
|
||||
|
||||
-- Export extension for external access
|
||||
CleveRoids.Compatibility_pfUI = Extension
|
||||
|
||||
-- Initial compatibility check
|
||||
Extension.SetupCompatibility()
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user