Mercurial > wow > reaction
diff Profile.lua @ 213:8ba8ab8bf6dd
Demodularize LBF
author | Flick <flickerstreak@gmail.com> |
---|---|
date | Thu, 18 Nov 2010 20:07:48 -0800 |
parents | UpdateDB.lua@97949dbe987f |
children | 258ca67bde4a |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Profile.lua Thu Nov 18 20:07:48 2010 -0800 @@ -0,0 +1,50 @@ +local _, addonTable = ... +local ReAction = addonTable.ReAction + +ReAction.PROFILEVERSION_LATEST = 1 + +ReAction.defaultProfile = { + profile = { + dbversion = nil, + bars = { }, + options = { + hideBlizzardBars = false, + hideBlizzardVehicleBar = false, + }, + }, + global = { + skipKeybindWarning = false, + } +} + +function ReAction:UpgradeProfile() + local db = self.db + + if not db.profile.dbversion then + -- upgrade from legacy db to v1 + + -- (1) remove unused defaultBars table (cleanup) + db.profile.defaultBars = nil + + -- (2) HideBlizzard is no longer a module + local hb = db:RegisterNamespace("HideBlizzard") + if hb then + db.profile.options.hideBlizzardBars = hb.profile.hide + db.profile.options.hideBlizzardVehicleBar = hb.profile.hideVehicle + hb:ResetProfile() + end + + -- (3) LBF is no longer a module + local bf = db:RegisterNamespace("ButtonFacade") + if bf then + for name, bar in pairs(db.profile.bars) do + bar.ButtonFacade = bf.profile[name] or bar.ButtonFacade + end + bf:ResetProfile() + end + + db.profile.dbversion = 1 + end + + db.profile.dbversion = self.PROFILEVERSION_LATEST +end