Skip to content

Fix/use compatibility functions#143

Open
Bearstonk wants to merge 2 commits intoebonyfaye:masterfrom
Bearstonk:fix/use-compatibility-functions
Open

Fix/use compatibility functions#143
Bearstonk wants to merge 2 commits intoebonyfaye:masterfrom
Bearstonk:fix/use-compatibility-functions

Conversation

@Bearstonk
Copy link
Copy Markdown

@Bearstonk Bearstonk commented Jan 16, 2026

Dependencies: Requires PR #142 (feat: add API compatibility layer for cross-version support)

This PR updates Core.lua to use the compatibility functions introduced in PR #1...

Update Core.lua to use API compatibility functions

Use GetAddOnMetadataCompat for version detection
Use IsAddOnLoadedCompat for addon checks
Export compatibility functions in EMAPrivate.Core so other modules can use them
Depends on PR 142 (API compatibility layer) - #142
Prepares for PR 144 (module fixes)

Tested on TBC Anniversary on 0230 - no regression
✅ PR #143 introduced no regressions
✅ PR #143 fixed the Core.lua issues (version detection works)
⏳ PR #144 will eliminate DisplayTeam (32x) + Quest-Classic (2x) IsAddOnLoaded errors
image


To Verify settings still work:

Type /ema config
Settings window should open
Version should display correctly at the top
Expected result after PR #143:

No new errors introduced
Settings functional
Version displays
Important caveat: PR #143 won't eliminate the DisplayTeam.lua and Quest-Classic.lua errors yet (32x + 2x IsAddOnLoaded errors). Those are fixed by PR #144, which will use the compatibility function exports that PR #2 just created.

PR #143 success = "no regressions + settings work"
PR #144 success = "DisplayTeam & Quest-Classic errors gone"

- Add GetAddOnMetadataCompat wrapper for C_AddOns.GetAddOnMetadata
- Add IsAddOnLoadedCompat wrapper for C_AddOns.IsAddOnLoaded
- Supports TBC Classic, Wrath, Cata, and Retail
- Safely checks if C_AddOns namespace exists before using it
- Use GetAddOnMetadataCompat for version detection
- Use IsAddOnLoadedCompat for addon compatibility checks
- Export compatibility functions in EMAPrivate.Core for use by other modules
- Enables other modules to safely call API functions across WoW versions

This prepares Core.lua to be fully compatible across Classic, TBC, Wrath, Cata, and Retail versions.
Bearstonk added a commit to Bearstonk/ema that referenced this pull request Jan 16, 2026
- DisplayTeam.lua: Replace C_AddOns.IsAddOnLoaded with EMAPrivate.Core.IsAddOnLoaded
  - Line 29: TrufiGCD initialization
  - Lines 3263, 3280: TrufiGCD integration checks

- Quest-Classic.lua: Replace IsAddOnLoaded with EMAPrivate.Core.IsAddOnLoaded
  - Line 1959: ElvUI detection for frame positioning

Enables cross-version compatibility by using the compatibility wrapper functions
exported by Core.lua in PR ebonyfaye#143. Fixes nil value errors in TBC Anniversary.

Depends on: PR ebonyfaye#142, PR ebonyfaye#143
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant