oUF

99.9k Downloads

[Bug] ClassIcons: Not updating max combo points for Rogues with Anticipation

Blazeflack opened this issue ยท 7 comments

commented

When you switch between Anticipation and any of the other talents on the row, the max amount of combo points is not updated for Rogues.

I removed my own modifications to the file to make sure this was an issue with the code in its default state.

commented

I made some modifications to try and fix this on my own, and while doing so I noticed the following:

  • PLAYER_TALENT_UPDATE triggers first, but at this point UnitPowerMax does not return the correct value for Combo Points.
  • UNIT_POWER_FREQUENT triggers next, and now UnitPowerMax returns the correct value.
  • When UNIT_POWER_FREQUENT triggers, the powerType is "ENERGY", so the Update will never happen because of the check at the top where it matches powerType to ClassPowerType.
commented

Works fine for me, are you sure you have updated oUF and have actually created up to 8 classicons in your layout?

Also, are you on the beta or on live?

On live UnitPowerMax('player', SPELL_POWER_COMBO_POINTS) displays 8 at the events mentioned, and UNIT_POWER_FREQUENT fires with the powerType 'COMBO_POINTS' just fine.

commented

I will double check this and get back to you.

commented

I replaced the entire contents of my classicons.lua file with the code taken from this repository.

When I change to/from the Anticipation talent on my rogue, I see the Update function fire twice, but it never gets past the initial check at the top.
Code:

    print("Update:", "event:", event, "unit:", unit, "powerType:", powerType)
    if(not (unit == 'player' and powerType == ClassPowerType)
        and not (unit == 'vehicle' and powerType == 'COMBO_POINTS')) then
        return
    end
    print("Update passed the 'return' check")

Result:

Update: event: UNIT_POWER_FREQUENT unit: player powerType: ENERGY
Update: event: UNIT_POWER_FREQUENT unit: player powerType: ENERGY
commented

Nothing will fire an update when you change talents (unless you went from Deeper Stratagem to Anticipation and you previously had 6 combo points, forcing an update due to change in max).

Only times a PTU will force an actual update is if the element gets disabled, and in such a case the event will be 'ClassPowerDisable', or when you enable the element. This only applies to classes that have specs that have different classicons.

The reason you're seeing the 'ENERGY' powerType is because you're switching to/from Vigor, which updates because of the same reasons as above, a change in the max.

commented

ClassIcons are not updating when the max power is changed, opened a PR to resolve this.

commented

Ahh yeah, That makes sense. Thank you.