From d6b4ae3d97387b00d000d12e7317828b27b6ea48 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 16 Nov 2025 18:18:41 +0000 Subject: [PATCH] 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. --- Compatibility/pfUI.lua | 24 ++++++++++++++++++++++++ Utility.lua | 6 ++++++ 2 files changed, 30 insertions(+) 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 {}