Skip to content

Commit

Permalink
WoW 11 addon api changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ynazar1 committed Aug 12, 2024
1 parent 7a4f4a8 commit a0e05f2
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1014,8 +1014,8 @@ importOptions.args.GatherMateData = {
name = "GatherMate2Data", -- addon name to import from, don't localize
handler = ImportHelper,
disabled = function()
local name, title, notes, loadable, reason, security, newVersion = GetAddOnInfo("GatherMate2_Data")
local enabled = GetAddOnEnableState(UnitName("player"), "GatherMate2T_Data") > 0
local name, title, notes, loadable, reason, security, newVersion = C_AddOns.GetAddOnInfo("GatherMate2_Data")
local enabled = C_AddOns.GetAddOnEnableState("GatherMate2T_Data", UnitName("player")) > 0
-- disable if the addon is not enabled, or
-- disable if there is a reason why it can't be loaded ("MISSING" or "DISABLED")
return not enabled or (reason ~= nil and reason ~= "" and reason ~= "DEMAND_LOADED")
Expand Down Expand Up @@ -1087,7 +1087,7 @@ importOptions.args.GatherMateData = {
desc = L["Load GatherMate2Data and import the data to your database."],
type = "execute",
func = function()
local loaded, reason = LoadAddOn("GatherMate2_Data")
local loaded, reason = C_AddOns.LoadAddOn("GatherMate2_Data")
local GatherMateData = LibStub("AceAddon-3.0"):GetAddon("GatherMate2_Data")
if loaded and GatherMateData.generatedVersion then
local dataVersion = tonumber(GatherMateData.generatedVersion:match("%d+"))
Expand Down Expand Up @@ -1183,7 +1183,11 @@ function Config:OnInitialize()
acd:AddToBlizOptions("GM2T/FAQ", "FAQ", "GatherMate 2 Treasures")

local function openOptions()
InterfaceOptionsFrame_OpenToCategory("GatherMate 2 Treasures")
if Settings and Settings.OpenToCategory then
Settings.OpenToCategory("GatherMate 2 Treasures")
else
InterfaceOptionsFrame_OpenToCategory("GatherMate 2 Treasures")
end
end

SLASH_GatherMate2Treasures1 = "/gathermatets"
Expand Down Expand Up @@ -1233,7 +1237,7 @@ end

function Config:CheckAutoImport()
for k,v in pairs(db.importers) do
local verline = GetAddOnMetadata(k, "X-Generated-Version")
local verline = C_AddOns.GetAddOnMetadata(k, "X-Generated-Version")
if verline and v["autoImport"] then
local dataVersion = tonumber(verline:match("%d+"))
if dataVersion and dataVersion > v["lastImport"] then
Expand Down

0 comments on commit a0e05f2

Please sign in to comment.