Commit Graph
7 Commits
Author SHA1 Message Date
Claude aedb2684b5 Add confirmation system to prevent pfUI from using evaluation-only tracking
Problem: Macro conditional evaluations create tracking entries, but
pfUI's AddEffect can fire during these evaluations (before actual cast),
causing it to use incorrect combo point data.

Flow before fix:
1. Macro evaluates [combo:>0] → TrackComboPointCast(0 CP, confirmed=false)
2. Macro evaluates again → TrackComboPointCast(1 CP, confirmed=false)
3. pfUI AddEffect fires → uses tracking (wrong timing!) ✗
4. SPELLCAST_START fires (actual cast)

Flow after fix:
1. Macro evaluates [combo:>0] → TrackComboPointCast(0 CP, confirmed=false)
2. Macro evaluates again → TrackComboPointCast(1 CP, confirmed=false)
3. SPELLCAST_START fires → sets confirmed=true ✓
4. pfUI AddEffect fires → only uses tracking if confirmed=true ✓

Changes:
- Added 'confirmed' field to tracking (default: false)
- SPELLCAST_START sets confirmed=true when spell actually casts
- pfUI AddEffect hook only uses tracking if confirmed=true
- Clear confirmed flag after use to prevent reuse
- Clear on failed/interrupted casts

Debug shows: "Ignoring X tracking (not confirmed - evaluation only)"
when preventing use of evaluation-only data.
2025-11-16 18:51:57 +00:00
Claude c9bd224c2b Fix pfUI AddEffect timing - use name-based tracking instead of ID
CRITICAL TIMING FIX: pfUI's AddEffect fires BEFORE UNIT_CASTEVENT!

Event sequence:
1. CastSpell → Extension hooks → name-based tracking stores 5 CP, 18s ✓
2. pfUI AddPending → GetDuration (base 10s)
3. SPELLCAST_STOP → pfUI AddEffect fires
4. Our AddEffect hook fires (ID tracking doesn't exist yet!) ✗
5. UNIT_CASTEVENT → ID-based tracking created ✓

Solution: Use name-based tracking (available at step 4) instead of
ID-based tracking (not created until step 5).

Changed pfUI AddEffect hook to:
- Use CleveRoids.ComboPointTracking[effect] (name-based)
- Check cast_time < 0.5s to ensure freshness
- This data exists when pfUI calls AddEffect

Now shows: "[pfUI AddEffect Hook] Overriding Rip duration to 18s"
Instead of: "[pfUI AddEffect Hook] Overriding Rip duration to 10s"
2025-11-16 18:41:39 +00:00
Claude 3e669a7b7a Fix pfUI integration - use unit names and spell names, not GUIDs/IDs
CRITICAL FIX: pfUI's libdebuff uses completely different data structures:
- Uses unit NAME (not GUID)
- Uses unit LEVEL as a key
- Uses spell NAME (effect, not ID)
- Storage: pflib.objects[unitName][unitLevel][effectName]

Fixed SyncComboDurationToPfUI:
- Convert GUID to unit name (check target, fallback to guidToName map)
- Get unit level from target or default to 0
- Convert spell ID to spell name using SpellInfo()
- Remove rank from spell name to match pfUI's format
- Search both specific level and level 0 (pfUI's fallback)

Fixed AddEffect hook:
- Updated parameters to match pfUI signature: (unit, unitlevel, effect, duration, caster)
- Check spell by name instead of ID
- Map spell name back to ID to find tracking data

This ensures pfUI's cooldown displays show correct combo durations.
2025-11-16 18:20:51 +00:00
Claude d6b4ae3d97 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.
2025-11-16 18:18:41 +00:00
Claude 60bf1741ed Add pfUI cooldown integration for combo-aware durations
Hook into pfUI.api.libdebuff to inject combo-based durations:
- Hook GetDuration: Returns learned combo durations for combo spells
- Hook AddEffect: Injects tracked combo durations when debuffs are applied

This ensures pfUI's cooldown module displays the correct duration
(e.g., 28s for 5 CP Rip instead of base 12s).

Debug messages show when pfUI hooks are triggered in debug mode.
2025-11-16 18:15:33 +00:00
Jrc13245 c65642a129 fix compatibility with pfui macrotweak 2025-11-12 16:33:54 -05:00
Jrc13245 fb359993b2 Initial Commit 2025-08-18 16:15:25 -04:00