Skip to content

Commit

Permalink
When logging into Wrath Classic for the first time, do a purge to cle…
Browse files Browse the repository at this point in the history
…ar out old settings from earlier versions of the game
  • Loading branch information
EsreverWoW committed Sep 2, 2022
1 parent a3b05b7 commit 679f7ed
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
19 changes: 13 additions & 6 deletions PallyPower.lua
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,6 @@ function PallyPower:OnInitialize()
self.db.RegisterCallback(self, "OnProfileCopied", "OnProfileChanged")
self.db.RegisterCallback(self, "OnProfileReset", "OnProfileChanged")

if not PallyPower_SavedPresets or PallyPower_SavedPresets == nil then
PallyPower_SavedPresets = {}
PallyPower_SavedPresets["PallyPower_Assignments"] = {[0] = {}}
PallyPower_SavedPresets["PallyPower_NormalAssignments"] = {[0] = {}}
end

self.opt = self.db.profile
self.options.args.profiles = LibStub("AceDBOptions-3.0"):GetOptionsTable(self.db)

Expand Down Expand Up @@ -175,6 +169,19 @@ function PallyPower:OnInitialize()
if self.isVanilla then
LCD:Register("PallyPower")
end

-- the transition from TBC Classic to Wrath Classic has caused some errors for players with SavedVariables values intended for the 2.5.4 clients and earlier
if self.isWrath and not self.opt.WrathTransition then
PallyPower:Purge()

self.opt.WrathTransition = true
end

if not PallyPower_SavedPresets or PallyPower_SavedPresets == nil then
PallyPower_SavedPresets = {}
PallyPower_SavedPresets["PallyPower_Assignments"] = {[0] = {}}
PallyPower_SavedPresets["PallyPower_NormalAssignments"] = {[0] = {}}
end
end

function PallyPower:OnEnable()
Expand Down
6 changes: 4 additions & 2 deletions PallyPowerValues.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ PALLYPOWER_DEFAULT_VALUES = {
ShowTooltips = true,
ShowWhenSolo = true,
skin = "Smooth",
SmartBuffs = true
SmartBuffs = true,
WrathTransition = false,
}
}

Expand Down Expand Up @@ -123,7 +124,8 @@ PALLYPOWER_OTHER_VALUES = {
ShowTooltips = true,
ShowWhenSolo = true,
skin = "Smooth",
SmartBuffs = false
SmartBuffs = false,
WrathTransition = false,
}
}

Expand Down

0 comments on commit 679f7ed

Please sign in to comment.