Skip to content

Fix/update module api calls#144

Open
Bearstonk wants to merge 3 commits intoebonyfaye:masterfrom
Bearstonk:fix/update-module-api-calls
Open

Fix/update module api calls#144
Bearstonk wants to merge 3 commits intoebonyfaye:masterfrom
Bearstonk:fix/update-module-api-calls

Conversation

@Bearstonk
Copy link
Copy Markdown

Update modules to use API compatibility functions

  • 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. Fixes 34 nil value errors in TBC Anniversary (DisplayTeam:29 x32, Quest-Classic:1954 x2).

Depends on: PR #142, PR #143

- 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.
- 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
@Bearstonk
Copy link
Copy Markdown
Author

TESTED & WORKING ON LIVE TBC ANNIVERSARY 2.5.4

Successfully tested on TBC Anniversary with EMA v4.3 (0229) deployed version.

Test Results:

  • All 34 IsAddOnLoaded nil errors eliminated
    • DisplayTeam.lua:29 (32x errors) → 0
    • Quest-Classic.lua:1954 (2x errors) → 0
  • Team display now fully functional and visible
  • Settings window opens correctly
  • No new errors introduced

Implementation Note:
The deployed v4.3 code (which this fix targets) differs from the master branch PR code:

Location Deployed v4.3 PR #144 (Master)
DisplayTeam.lua:29 IsAddOnLoaded() C_AddOns.IsAddOnLoaded()
DisplayTeam.lua:3263 IsAddOnLoaded() C_AddOns.IsAddOnLoaded()
DisplayTeam.lua:3280 IsAddOnLoaded() C_AddOns.IsAddOnLoaded()
Quest-Classic.lua:1959 IsAddOnLoaded() IsAddOnLoaded()

Both variations now use EMAPrivate.Core.IsAddOnLoaded() compatibility wrapper, which safely calls either API depending on WoW version. The deployed version had older global function calls that needed fixing as well.

Depends on: PR #142, PR #143

image

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