Skip to content

Commit

Permalink
Fix Blizzard Loadouts (the yellow ones)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lardeck committed Nov 25, 2023
1 parent cac8f4e commit 150d16c
Showing 1 changed file with 28 additions and 11 deletions.
39 changes: 28 additions & 11 deletions ImprovedTalentLoadouts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -586,21 +586,26 @@ function TalentLoadouts:LoadAsBlizzardLoadout(newConfigInfo)
end
end

local function LoadBlizzardLoadout(configID, currentSpecID, configInfo, categoryInfo)
C_ClassTalents.LoadConfig(configID, true)
C_ClassTalents.UpdateLastSelectedSavedConfigID(currentSpecID, nil)
TalentLoadouts.pendingLoadout = configInfo
TalentLoadouts.pendingCategory = categoryInfo
TalentLoadouts.lastUpdated = nil
TalentLoadouts.lastUpdatedCategory = nil
TalentLoadouts:UpdateDropdownText()
TalentLoadouts:UpdateDataObj(configInfo)
TalentLoadouts:LoadGearAndLayout(configInfo)
end

local function LoadLoadout(self, configInfo, categoryInfo, forceBlizzardDisable)
if not configInfo then return end

local currentSpecID = TalentLoadouts.specID
local configID = configInfo.ID

if ImprovedTalentLoadoutsDB.options.loadBlizzard and C_Traits.GetConfigInfo(configID) then
C_ClassTalents.LoadConfig(configID, true)
C_ClassTalents.UpdateLastSelectedSavedConfigID(currentSpecID, configID)
TalentLoadouts.charDB.lastLoadout = configInfo.ID
TalentLoadouts.charDB[currentSpecID] = configInfo.ID
TalentLoadouts.charDB.lastCategory = categoryInfo
TalentLoadouts:UpdateDropdownText()
TalentLoadouts:UpdateDataObj(configInfo)
TalentLoadouts:LoadGearAndLayout(configInfo)
LoadBlizzardLoadout(configID, currentSpecID, configInfo, categoryInfo)
return
end

Expand Down Expand Up @@ -632,7 +637,7 @@ local function LoadLoadout(self, configInfo, categoryInfo, forceBlizzardDisable)
LoadLoadout(self, configInfo, categoryInfo, true)
end
end
else
elseif configInfo.entryInfo then
TalentLoadouts.pendingLoadout = configInfo
TalentLoadouts.pendingCategory = categoryInfo
TalentLoadouts.lastUpdated = nil
Expand All @@ -643,6 +648,8 @@ local function LoadLoadout(self, configInfo, categoryInfo, forceBlizzardDisable)

TalentLoadouts:UpdateDropdownText()
TalentLoadouts:UpdateDataObj()
elseif C_Traits.GetConfigInfo(configID) then
LoadBlizzardLoadout(configID, currentSpecID, configInfo, categoryInfo)
end

configInfo.error = nil
Expand Down Expand Up @@ -675,9 +682,12 @@ function TalentLoadouts:OnLoadoutSuccess()
if ImprovedTalentLoadoutsDB.options.loadActionbars and configInfo.actionBars then
C_Timer.After(0.25, function()
TalentLoadouts:LoadActionBar(configInfo.actionBars, configInfo.name)
TalentLoadouts:UpdateCurrentExportString()
end)
end

C_Timer.After(0.25, function()
TalentLoadouts:UpdateCurrentExportString()
end)
end

function TalentLoadouts:OnUnknownLoadoutSuccess()
Expand Down Expand Up @@ -727,8 +737,15 @@ function TalentLoadouts:UpdateCurrentExportString()
local configID = TalentLoadouts.charDB[self.specID]
local configInfo = configID and self.globalDB.configIDs[self.specID][configID]
if configInfo then
local exportString = CreateExportString(nil, C_ClassTalents.GetActiveConfigID(), self.specID, true)
local exportString, entryInfo
if not configInfo.entryInfo then
exportString, entryInfo = CreateExportString(nil, C_ClassTalents.GetActiveConfigID(), self.specID)
else
exportString = CreateExportString(nil, C_ClassTalents.GetActiveConfigID(), self.specID, true)
end

configInfo.exportString = exportString
configInfo.entryInfo = configInfo.entryInfo or entryInfo
end
end

Expand Down

0 comments on commit 150d16c

Please sign in to comment.