comparison ReAction.lua @ 213:8ba8ab8bf6dd

Demodularize LBF
author Flick <flickerstreak@gmail.com>
date Thu, 18 Nov 2010 20:07:48 -0800
parents e275a8663a16
children 9c0691e91488
comparison
equal deleted inserted replaced
212:e275a8663a16 213:8ba8ab8bf6dd
32 32
33 33
34 ------ Handlers ------ 34 ------ Handlers ------
35 function ReAction:OnInitialize() 35 function ReAction:OnInitialize()
36 self.db = LibStub("AceDB-3.0"):New("ReAction_DB", 36 self.db = LibStub("AceDB-3.0"):New("ReAction_DB",
37 { 37 self.defaultProfile,
38 profile = {
39 dbversion = nil,
40 bars = { },
41 options = {
42 hideBlizzardBars = false,
43 hideBlizzardVehicleBar = false,
44 },
45 },
46 global = {
47 skipKeybindWarning = false,
48 }
49 },
50 true -- use global 'Default' (locale-specific) 38 true -- use global 'Default' (locale-specific)
51 ) 39 )
52 40
53 self:UpdateDB() 41 self:UpgradeProfile()
54 42
55 self.bars = { } 43 self.bars = { }
56 self.defaultBarConfig = { } 44 self.defaultBarConfig = { }
45
46 self.LBF = LibStub("LibButtonFacade",true)
47 if self.LBF then
48 self.LBF:RegisterSkinCallback("ReAction", self.OnSkinChanged, self)
49 end
57 50
58 -- It's fairly normal to use the Blizzard vehicle bar, and to have 51 -- It's fairly normal to use the Blizzard vehicle bar, and to have
59 -- your regular buttons in the same location. If you do this, and don't 52 -- your regular buttons in the same location. If you do this, and don't
60 -- bother to hide your buttons, they'll obscure some parts of the vehicle bar. 53 -- bother to hide your buttons, they'll obscure some parts of the vehicle bar.
61 VehicleMenuBar:SetFrameLevel(VehicleMenuBar:GetFrameLevel()+3) 54 VehicleMenuBar:SetFrameLevel(VehicleMenuBar:GetFrameLevel()+3)
89 self:SetKeybindMode(true) 82 self:SetKeybindMode(true)
90 end 83 end
91 84
92 function ReAction:LIBKEYBOUND_DISABLED( evt ) 85 function ReAction:LIBKEYBOUND_DISABLED( evt )
93 return self:SetKeybindMode(false) 86 return self:SetKeybindMode(false)
87 end
88
89 function ReAction:OnSkinChanged( skinID, gloss, backdrop, group, button, colors )
90 if group == nil then
91 -- don't store global
92 else
93 -- 'group' is the bar-name
94 local bar = self:GetBar(group)
95 if bar then
96 local c = bar:GetConfig().ButtonFacade
97 if c then
98 c.skinID = skinID
99 c.gloss = gloss
100 c.backdrop = backdrop
101 c.colors = colors
102 end
103 end
104 end
94 end 105 end
95 106
96 107
97 ------ Methods ------ 108 ------ Methods ------
98 109