diff --git a/Compatibility/pfUI.lua b/Compatibility/pfUI.lua index 3dd0a0e..0aa8833 100644 --- a/Compatibility/pfUI.lua +++ b/Compatibility/pfUI.lua @@ -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 diff --git a/Utility.lua b/Utility.lua index 29b9719..81ed0ca 100644 --- a/Utility.lua +++ b/Utility.lua @@ -956,6 +956,12 @@ ev:SetScript("OnEvent", function() end lib:AddEffect(targetGUID, targetName, spellID, duration, 0, "player") + -- Sync combo duration to pfUI if it's loaded + if comboPoints and CleveRoids.Compatibility_pfUI and + CleveRoids.Compatibility_pfUI.SyncComboDurationToPfUI then + CleveRoids.Compatibility_pfUI.SyncComboDurationToPfUI(targetGUID, spellID, duration) + end + -- ALWAYS set up learning for combo spells (even if we have calculated duration) if comboPoints then lib.learnCastTimers[targetGUID] = lib.learnCastTimers[targetGUID] or {}