comparison 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
comparison
equal deleted inserted replaced
221:bb13624de7e1 222:d08a74e86c96
44 end 44 end
45 45
46 -- (4) Action module uses the bar config directly 46 -- (4) Action module uses the bar config directly
47 local action = db:GetNamespace("Action",true) or db:RegisterNamespace("Action") 47 local action = db:GetNamespace("Action",true) or db:RegisterNamespace("Action")
48 if action then 48 if action then
49 for name, ac in pairs(action.profile.bars) do 49 for name, bar in pairs(db.profile.bars) do
50 local c = db.profile.bars[name] 50 local ac = action.profile.bars and action.profile.bars[name]
51 if c then 51 if ac then
52 for key, value in pairs(ac) do 52 for key, value in pairs(ac) do
53 c[key] = value 53 bar[key] = value
54 end 54 end
55 end 55 end
56 end 56 end
57 action:ResetProfile() 57 action:ResetProfile()
58 end 58 end
59 59
60 -- (5) Bags module uses the bar config directly 60 -- (5) Bags module uses the bar config directly
61 local bag = db:GetNamespace("Bag",true) or db:RegisterNamespace("Bag") 61 local bag = db:GetNamespace("Bag",true) or db:RegisterNamespace("Bag")
62 if bag then 62 if bag then
63 for name, bc in pairs(bag.profile.buttons) do 63 for name, bar in pairs(db.profile.bars) do
64 local c = db.profile.bars[name] 64 local bc = bag.profile.buttons and bag.profile.buttons[name]
65 c.buttons = bc 65 if bc then
66 bar.buttons = bc
67 end
66 end 68 end
67 bag:ResetProfile() 69 bag:ResetProfile()
70 end
71
72 -- (6) Pet module uses the bar config directly
73 local pet = db:GetNamespace("PetAction",true) or db:RegisterNamespace("PetAction")
74 if pet then
75 for name, bar in pairs(db.profile.bars) do
76 local pc = pet.profile.buttons and pet.profile.buttons[name]
77 if pc then
78 bar.buttons = pc
79 end
80 end
81 pet:ResetProfile()
82 end
83
84 -- (7) Stance module uses the bar config directly
85 local stance = db:GetNamespace("Stance",true) or db:RegisterNamespace("Stance")
86 if stance then
87 for name, bar in pairs(db.profile.bars) do
88 local sc = stance.profile.buttons and stance.profile.buttons[name]
89 if sc then
90 bar.buttons = sc
91 end
92 end
93 stance:ResetProfile()
94 end
95
96 -- (8) Totem module uses the bar config directly
97 local totem = db:GetNamespace("Totem",true) or db:RegisterNamespace("Totem")
98 if totem then
99 for name, bar in pairs(db.profile.bars) do
100 local tc = totem.profile.buttons and totem.profile.buttons[name]
101 if tc then
102 bar.buttons = tc
103 end
104 end
105 totem:ResetProfile()
106 end
107
108 -- (9) Vehicle exit button uses the bar config directly
109 local vehicle = db:GetNamespace("VehicleExit",true) or db:RegisterNamespace("VehicleExit")
110 if vehicle then
111 for name, bar in pairs(db.profile.bars) do
112 local vc = vehicle.profile.buttons and vehicle.profile.buttons[name]
113 if vc then
114 bar.buttons = vc
115 end
116 end
117 vehicle:ResetProfile()
68 end 118 end
69 119
70 db.profile.dbversion = 1 120 db.profile.dbversion = 1
71 end 121 end
72 122