annotate 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
rev   line source
flickerstreak@23 1 --[[
flickerstreak@23 2 FuBar plugin module for ReAction
flickerstreak@23 3
flickerstreak@23 4 --]]
flickerstreak@23 5
flickerstreak@23 6 -- local imports
flickerstreak@23 7 local ReAction = ReAction
flickerstreak@23 8 local L = ReAction.L
flickerstreak@23 9 local _G = _G
flickerstreak@23 10 local Tablet = AceLibrary("Tablet-2.0")
flickerstreak@23 11 local Dewdrop = AceLibrary("Dewdrop-2.0")
flickerstreak@23 12
flickerstreak@23 13 -- module declaration
flickerstreak@23 14 local moduleID = "ReActionFu"
flickerstreak@28 15 local rmodule = ReAction:NewModule( moduleID )
flickerstreak@28 16 local module = AceLibrary("AceAddon-2.0"):new("FuBarPlugin-2.0")
flickerstreak@28 17 rmodule.fubar = module
flickerstreak@23 18
flickerstreak@23 19 module.hasIcon = "Interface\\Icons\\INV_Qiraj_JewelEncased"
flickerstreak@23 20 module.hasNoColor = true
flickerstreak@23 21 module.clickableTooltip = false
flickerstreak@23 22 module.cannotDetachTooltip = true
flickerstreak@23 23 module.hideMenuTitle = true
flickerstreak@23 24 module.independentProfile = true
flickerstreak@23 25 module.defaultPosition = "LEFT"
flickerstreak@23 26 module.defaultMinimapPosition = 240 -- degrees
flickerstreak@23 27
flickerstreak@28 28 function rmodule:OnInitialize()
flickerstreak@28 29 self.db = ReAction.db:RegisterNamespace(moduleID,
flickerstreak@23 30 {
flickerstreak@28 31 profile = {
flickerstreak@28 32 requireFuBar = false
flickerstreak@28 33 }
flickerstreak@23 34 }
flickerstreak@23 35 )
flickerstreak@28 36 self.db.RegisterCallback(self,"OnProfileChanged")
flickerstreak@23 37
flickerstreak@23 38 if self.db.profile.requireFuBar == true then
flickerstreak@23 39 self:Hide()
flickerstreak@23 40 end
flickerstreak@23 41
flickerstreak@23 42 end
flickerstreak@23 43
flickerstreak@28 44 function rmodule:OnEnable()
flickerstreak@23 45
flickerstreak@23 46 end
flickerstreak@23 47
flickerstreak@28 48 function rmodule:OnDisable()
flickerstreak@28 49
flickerstreak@28 50 end
flickerstreak@28 51
flickerstreak@28 52 function rmodule:OnProfileChanged()
flickerstreak@23 53 if self.db.profile.requireFuBar == true then
flickerstreak@28 54 module:Hide()
flickerstreak@23 55 else
flickerstreak@23 56 self:Show()
flickerstreak@23 57 end
flickerstreak@23 58 end
flickerstreak@23 59
flickerstreak@23 60 function module:OnTooltipUpdate()
flickerstreak@23 61
flickerstreak@23 62 end
flickerstreak@23 63
flickerstreak@23 64 function module:OnClick(button)
flickerstreak@23 65
flickerstreak@23 66 end
flickerstreak@23 67
flickerstreak@23 68 function module:OnMenuRequest( level, value, inTooltip, valueN_1, valueN_2, valueN_3, valueN_4 )
flickerstreak@23 69 if not self.aceOptionsTable then
flickerstreak@23 70 local opts = {
flickerstreak@23 71 type = "group",
flickerstreak@23 72 handler = ReAction,
flickerstreak@23 73 args = {
flickerstreak@23 74 }
flickerstreak@23 75 }
flickerstreak@23 76 Dewdrop:InjectAceOptionsTable(ReAction,opts)
flickerstreak@23 77 self.aceOptionsTable = opts
flickerstreak@23 78 end
flickerstreak@28 79 for _, m in ReAction:IterateModules() do
flickerstreak@28 80 if m and type(m.GetGlobalOptions) == "function" then
flickerstreak@28 81 for k,v in pairs(m:GetGlobalOptions()) do
flickerstreak@28 82 self.aceOptionsTable.args[k] = v
flickerstreak@28 83 end
flickerstreak@23 84 end
flickerstreak@23 85 end
flickerstreak@23 86 Dewdrop:FeedAceOptionsTable(self.aceOptionsTable)
flickerstreak@23 87 end
flickerstreak@23 88