This displays the Vigor charges for the player whenever they're on a Dragonriding mount (which is detected via explicit buff ID scanning from a hardcoded list...I'd like to make that more robust so I don't have to keep up with new mounts being added, but I'm not sure how to do it another way just yet). The Alternate Power bar is hidden if the Vigor module is enabled so that we don't end up with duplicate Vigor trackers (although right now it flashes on the screen before the mount buff is detected, so I'd also like to fix that...).
I've effectively had to implement my own Vigor module from scratch by poking into the internals of the Vigor widget by its ID in order to determine the recharge amount on the final Vigor charge because there's currently no API to get this information otherwise. Hopefully this gets added; if it does, I'll happily rip out this widget inspection junk. Aside from the partial charge stuff, this is just a skinned version of an Alternate Power indicator that only shows when the user is on a dragonriding mount. ClassPowerCounter doesn't sound like a particularly appropriate base class for this, but since Vigor is implemented as Alternate Power, it worked out nicely.
This isn't used anywhere else, so there's no reason for it to pollute the global namespace. And being local now, it also doesn't need the IceHUD prefix on its name.
This has been tested on Classic with a Rogue up to level 5 using various modules and casually checked against a few level 1 classes. I'm sure there's a lot more to do here. I also made sure to test on Live.
Where possible I tried to check for API availability rather than specific client versions or program IDs. There are many cases where that's impractical, however, so version/program ID checks were used.
This was tested with:
* Ace3 @r1225
* AceGUI-3.0-SharedMediaWidgets @r61
* LibDBIcon-1.0 @v8.2.0
* LibDogTag-3.0 @v80200.1
* LibDogTag-Unit-3.0 @v80200.1-2-g93a898d-alpha
* LibRangeCheck-2.0 @v4.2.3 (with a couple of local changes)
* LibSharedMedia-3.0 @r113-alpha
Updated for:
- SPELL_POWER_* constants becoming Enum.PowerType.*
- Rank no longer existing in return values for UnitAura, UnitBuff, UnitDebuff, UnitCastingInfo, UnitChannelInfo
- UNIT_POWER event becoming UNIT_POWER_UPDATE
- UnitPopupFrames no longer existing
- Removed events: PLAYER_PET_CHANGED, UNIT_MAXPOWER, PET_BAR_CHANGED, UNIT_DYNAMIC_FLAGS
- Texture return value from UnitAura type changing (name -> id)
- All Warlock specializations using soul shards
- Death Knight rune changes
Haven't tested all classes/specializations yet, so I'm sure I missed some stuff.
Probably need to add support for the new circular cooldown wipe flourish added in the base client.
Saw a problem with cooldown flashes being delayed on DK runes becoming available that probably need to be fixed.
- added new option (enabled by default) to have buffs and debuffs in Info modules sorted by expiration time instead of the order the game returns them in (application time?)