Mercurial > wow > reaction
view Profile.lua @ 220:a4e7475633b3
un-namespace action button config
author | Flick <flickerstreak@gmail.com> |
---|---|
date | Sun, 21 Nov 2010 10:40:54 -0800 |
parents | 258ca67bde4a |
children | bb13624de7e1 |
line wrap: on
line source
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:GetNamespace("HideBlizzard",true) or 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:GetNamespace("ButtonFacade",true) or 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 -- (4) Action is no longer a module, uses the bar config directly local action = db:GetNamespace("Action",true) or db:RegisterNamespace("Action") if action then for name, ac in pairs(action.profile.bars) do local c = db.profile.bars[name] if c then for key, value in pairs(ac) do c[key] = value end end end action:ResetProfile() end db.profile.dbversion = 1 end db.profile.dbversion = self.PROFILEVERSION_LATEST end