Mercurial > wow > reaction
diff Profile.lua @ 222:d08a74e86c96
un-namespace totem, pet, stance, vehicle exit
author | Flick <flickerstreak@gmail.com> |
---|---|
date | Sun, 21 Nov 2010 14:42:38 -0800 |
parents | bb13624de7e1 |
children | 741c4f9b251e |
line wrap: on
line diff
--- a/Profile.lua Sun Nov 21 12:51:24 2010 -0800 +++ b/Profile.lua Sun Nov 21 14:42:38 2010 -0800 @@ -46,11 +46,11 @@ -- (4) Action 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 name, bar in pairs(db.profile.bars) do + local ac = action.profile.bars and action.profile.bars[name] + if ac then for key, value in pairs(ac) do - c[key] = value + bar[key] = value end end end @@ -60,13 +60,63 @@ -- (5) Bags module uses the bar config directly local bag = db:GetNamespace("Bag",true) or db:RegisterNamespace("Bag") if bag then - for name, bc in pairs(bag.profile.buttons) do - local c = db.profile.bars[name] - c.buttons = bc + for name, bar in pairs(db.profile.bars) do + local bc = bag.profile.buttons and bag.profile.buttons[name] + if bc then + bar.buttons = bc + end end bag:ResetProfile() end + -- (6) Pet module uses the bar config directly + local pet = db:GetNamespace("PetAction",true) or db:RegisterNamespace("PetAction") + if pet then + for name, bar in pairs(db.profile.bars) do + local pc = pet.profile.buttons and pet.profile.buttons[name] + if pc then + bar.buttons = pc + end + end + pet:ResetProfile() + end + + -- (7) Stance module uses the bar config directly + local stance = db:GetNamespace("Stance",true) or db:RegisterNamespace("Stance") + if stance then + for name, bar in pairs(db.profile.bars) do + local sc = stance.profile.buttons and stance.profile.buttons[name] + if sc then + bar.buttons = sc + end + end + stance:ResetProfile() + end + + -- (8) Totem module uses the bar config directly + local totem = db:GetNamespace("Totem",true) or db:RegisterNamespace("Totem") + if totem then + for name, bar in pairs(db.profile.bars) do + local tc = totem.profile.buttons and totem.profile.buttons[name] + if tc then + bar.buttons = tc + end + end + totem:ResetProfile() + end + + -- (9) Vehicle exit button uses the bar config directly + local vehicle = db:GetNamespace("VehicleExit",true) or db:RegisterNamespace("VehicleExit") + if vehicle then + for name, bar in pairs(db.profile.bars) do + local vc = vehicle.profile.buttons and vehicle.profile.buttons[name] + if vc then + bar.buttons = vc + end + end + vehicle:ResetProfile() + end + db.profile.dbversion = 1 end