Three fixes addressing the reported 'auras silently vanish on next save'
bug, plus collateral robustness in the same code path:
1. WeakAuras.lua PLAYER_LOGIN handler (~L1297-1308): the downgrade branch
fired StaticPopup_Show('WEAKAURAS_CONFIRM_REPAIR', ...) synchronously
inside the event handler. On the CoA reworked StaticPopup system this
fires too early and silently fails to show the dialog, which means
neither OnAccept nor OnCancel ever runs, so Private.Login() is never
called. With no displays loaded, the next PLAYER_LOGOUT serializes an
empty table over WeakAurasSaved and the user loses all their auras.
Wrap the call in C_Timer.After(0, ...) so it fires after the event
frame stack has unwound and the popup system is ready.
This is the most likely root cause of the user report 'my auras don't
save anymore' that surfaced on the PTR last week.
2. WeakAuras.lua WEAKAURAS_CONFIRM_REPAIR popup (~L2263-2277): OnShow and
OnCancel both unconditionally dereferenced self.data.reason. If the
popup is ever fired with nil or malformed data this throws and blocks
Private.Login() from running via the OnCancel fallback. Guard with a
nil check and default reason to 'unknown' (treated as the automatic /
downgrade path, which is the safe default that still invokes Login).
3. Types.lua WeakAuras.class_types (~L1187): only populated from
CLASS_SORT_ORDER, which on CoA contains only the 11 vanilla classes.
The 21 custom CoA classes were silently missing from every class
filter dropdown in the options UI. Add a fallback loop over
LOCALIZED_CLASS_NAMES_MALE for anything CLASS_SORT_ORDER didn't
already register, mirroring the pattern the spec builder uses at
~L3829.
Same CoA client issue as coa-details: GetAllSpecs(class) returns items
that GetSpecInfo rejects with 'Expected string' at arg #2. Wrap the
addSpec(class, GetSpecInfo(class, spec)) call in pcall so bad iterations
skip silently rather than spamming Error.txt.
Removed a small number of localizations that can be extracted via GetFactionInfoByID(id).
There are more that could be cleaned up using regex, but that might make things look a bit odd, for now, I’m happy with this.
This approach is preferable to remove unnecessary variables saved.
GetFactionInfoByID(id) now provides localized faction names directly from the client, making external localization or libraries like LibBabble-Faction unnecessary.
This is the first implementation that i ever saw to fully eliminate LibBabble-Faction dependency, simplifying the codebase by a ton.
It seems that Creature Type and Familys are saved also inside that function, making this function really powerful, im going to take a look at that too for sure.
Race Localisation we also take already out of this function.
Discovered and integrated the previously undocumented GetFactionInfoByID API call, allowing removal of a workaround table that was no longer needed. Also verified faction localizations across common client faction.dbc files and cleaned up Cataclysm factions that were incorrectly included in the 3.3.5a version of the LibBabble library.
- Closes#37
Due to an error in the implementation of Class & Spec in Load Conditions and Triggers (Unit Characteristics, Power, Health, Class/Spec, BT2 actualSpec), the system now also applies Retail logic.
As a result of this issue, all data has been erased and must be reselected.
- **WeakAuras.SpecForUnit(unit)** = Returns: `classFileName..spec`, `Dominant Tree`, `spent1`, `spent2`, `spent3`
- **WeakAuras.GetUnitRole(unit)** = Returns one of: `"melee"`, `"caster"`, `"healer"`, `"tank"`
- **WeakAuras.SpecRolePositionForUnit(unit)** = Returns: `Dominant Tree`, `spent1`, `spent2`, `spent3`
- **WeakAuras.CheckTalentForUnit(unit, talentId)** = Returns: `"Points spent"` in talent or `nil`
- **WeakAuras.CheckGlyphForUnit(unit, glyphId)** = Returns: `true` if the player has the glyph associated with `spellID` or `spellName`, we can only see the glyphs of players running `LibGroupTalents-1.0`
Arguments might still shut be shared from the original call for custom auras.
More functions need to be added to prototypes.
Documentation is needed soon.