comparison modules/FuBar_ReActionFu/FuBar_ReActionFu.lua @ 28:21bcaf8215ff

- converted to Ace3 - rearranged file layout - configGUI menus not working right now
author Flick <flickerstreak@gmail.com>
date Mon, 17 Mar 2008 18:24:53 +0000
parents dba04d85c799
children 0d95ce7a9ec2
comparison
equal deleted inserted replaced
27:f1e838841ce1 28:21bcaf8215ff
10 local Tablet = AceLibrary("Tablet-2.0") 10 local Tablet = AceLibrary("Tablet-2.0")
11 local Dewdrop = AceLibrary("Dewdrop-2.0") 11 local Dewdrop = AceLibrary("Dewdrop-2.0")
12 12
13 -- module declaration 13 -- module declaration
14 local moduleID = "ReActionFu" 14 local moduleID = "ReActionFu"
15 local module = ReAction:NewModule( moduleID, 15 local rmodule = ReAction:NewModule( moduleID )
16 "FuBarPlugin-2.0" 16 local module = AceLibrary("AceAddon-2.0"):new("FuBarPlugin-2.0")
17 ) 17 rmodule.fubar = module
18 18
19 module.hasIcon = "Interface\\Icons\\INV_Qiraj_JewelEncased" 19 module.hasIcon = "Interface\\Icons\\INV_Qiraj_JewelEncased"
20 module.hasNoColor = true 20 module.hasNoColor = true
21 module.clickableTooltip = false 21 module.clickableTooltip = false
22 module.cannotDetachTooltip = true 22 module.cannotDetachTooltip = true
23 module.hideMenuTitle = true 23 module.hideMenuTitle = true
24 module.independentProfile = true 24 module.independentProfile = true
25 module.defaultPosition = "LEFT" 25 module.defaultPosition = "LEFT"
26 module.defaultMinimapPosition = 240 -- degrees 26 module.defaultMinimapPosition = 240 -- degrees
27 27
28 function module:OnInitialize() 28 function rmodule:OnInitialize()
29 self.db = ReAction:AcquireDBNamespace(moduleID) 29 self.db = ReAction.db:RegisterNamespace(moduleID,
30 ReAction:RegisterDefaults(moduleID,"profile",
31 { 30 {
32 requireFuBar = false 31 profile = {
32 requireFuBar = false
33 }
33 } 34 }
34 ) 35 )
36 self.db.RegisterCallback(self,"OnProfileChanged")
35 37
36 if self.db.profile.requireFuBar == true then 38 if self.db.profile.requireFuBar == true then
37 self:Hide() 39 self:Hide()
38 end 40 end
39 end
40
41 function module:OnEnable()
42 41
43 end 42 end
44 43
45 function module:OnDisable() 44 function rmodule:OnEnable()
46 45
47 end 46 end
48 47
49 function module:OnProfileEnable() 48 function rmodule:OnDisable()
49
50 end
51
52 function rmodule:OnProfileChanged()
50 if self.db.profile.requireFuBar == true then 53 if self.db.profile.requireFuBar == true then
51 self:Hide() 54 module:Hide()
52 else 55 else
53 self:Show() 56 self:Show()
54 end 57 end
55 end
56
57 function module:OnProfileDisable()
58
59 end 58 end
60 59
61 function module:OnTooltipUpdate() 60 function module:OnTooltipUpdate()
62 61
63 end 62 end
75 } 74 }
76 } 75 }
77 Dewdrop:InjectAceOptionsTable(ReAction,opts) 76 Dewdrop:InjectAceOptionsTable(ReAction,opts)
78 self.aceOptionsTable = opts 77 self.aceOptionsTable = opts
79 end 78 end
80 for _, m in ReAction:IterateModulesWithMethod("GetGlobalOptions") do 79 for _, m in ReAction:IterateModules() do
81 for k,v in pairs(m:GetGlobalOptions()) do 80 if m and type(m.GetGlobalOptions) == "function" then
82 self.aceOptionsTable.args[k] = v 81 for k,v in pairs(m:GetGlobalOptions()) do
82 self.aceOptionsTable.args[k] = v
83 end
83 end 84 end
84 end 85 end
85 Dewdrop:FeedAceOptionsTable(self.aceOptionsTable) 86 Dewdrop:FeedAceOptionsTable(self.aceOptionsTable)
86 end 87 end
87 88