From 679f7ede152019aec2802e96a2bf98edebe8f841 Mon Sep 17 00:00:00 2001 From: EsreverWoW <49285632+EsreverWoW@users.noreply.github.com> Date: Thu, 1 Sep 2022 22:06:53 -0500 Subject: [PATCH] When logging into Wrath Classic for the first time, do a purge to clear out old settings from earlier versions of the game --- PallyPower.lua | 19 +++++++++++++------ PallyPowerValues.lua | 6 ++++-- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/PallyPower.lua b/PallyPower.lua index b924194..4aed5d8 100644 --- a/PallyPower.lua +++ b/PallyPower.lua @@ -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) @@ -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() diff --git a/PallyPowerValues.lua b/PallyPowerValues.lua index 28c2865..1ae4123 100644 --- a/PallyPowerValues.lua +++ b/PallyPowerValues.lua @@ -65,7 +65,8 @@ PALLYPOWER_DEFAULT_VALUES = { ShowTooltips = true, ShowWhenSolo = true, skin = "Smooth", - SmartBuffs = true + SmartBuffs = true, + WrathTransition = false, } } @@ -123,7 +124,8 @@ PALLYPOWER_OTHER_VALUES = { ShowTooltips = true, ShowWhenSolo = true, skin = "Smooth", - SmartBuffs = false + SmartBuffs = false, + WrathTransition = false, } }