flickerstreak@23: --[[ flickerstreak@23: FuBar plugin module for ReAction flickerstreak@23: flickerstreak@23: --]] flickerstreak@23: flickerstreak@23: -- local imports flickerstreak@23: local ReAction = ReAction flickerstreak@23: local L = ReAction.L flickerstreak@23: local _G = _G flickerstreak@23: local Tablet = AceLibrary("Tablet-2.0") flickerstreak@23: local Dewdrop = AceLibrary("Dewdrop-2.0") flickerstreak@23: flickerstreak@23: -- module declaration flickerstreak@23: local moduleID = "ReActionFu" flickerstreak@28: local rmodule = ReAction:NewModule( moduleID ) flickerstreak@28: local module = AceLibrary("AceAddon-2.0"):new("FuBarPlugin-2.0") flickerstreak@28: rmodule.fubar = module flickerstreak@23: flickerstreak@23: module.hasIcon = "Interface\\Icons\\INV_Qiraj_JewelEncased" flickerstreak@23: module.hasNoColor = true flickerstreak@23: module.clickableTooltip = false flickerstreak@23: module.cannotDetachTooltip = true flickerstreak@23: module.hideMenuTitle = true flickerstreak@23: module.independentProfile = true flickerstreak@23: module.defaultPosition = "LEFT" flickerstreak@23: module.defaultMinimapPosition = 240 -- degrees flickerstreak@23: flickerstreak@28: function rmodule:OnInitialize() flickerstreak@28: self.db = ReAction.db:RegisterNamespace(moduleID, flickerstreak@23: { flickerstreak@28: profile = { flickerstreak@28: requireFuBar = false flickerstreak@28: } flickerstreak@23: } flickerstreak@23: ) flickerstreak@28: self.db.RegisterCallback(self,"OnProfileChanged") flickerstreak@23: flickerstreak@23: if self.db.profile.requireFuBar == true then flickerstreak@23: self:Hide() flickerstreak@23: end flickerstreak@23: flickerstreak@23: end flickerstreak@23: flickerstreak@28: function rmodule:OnEnable() flickerstreak@23: flickerstreak@23: end flickerstreak@23: flickerstreak@28: function rmodule:OnDisable() flickerstreak@28: flickerstreak@28: end flickerstreak@28: flickerstreak@28: function rmodule:OnProfileChanged() flickerstreak@23: if self.db.profile.requireFuBar == true then flickerstreak@28: module:Hide() flickerstreak@23: else flickerstreak@23: self:Show() flickerstreak@23: end flickerstreak@23: end flickerstreak@23: flickerstreak@23: function module:OnTooltipUpdate() flickerstreak@23: flickerstreak@23: end flickerstreak@23: flickerstreak@23: function module:OnClick(button) flickerstreak@23: flickerstreak@23: end flickerstreak@23: flickerstreak@23: function module:OnMenuRequest( level, value, inTooltip, valueN_1, valueN_2, valueN_3, valueN_4 ) flickerstreak@23: if not self.aceOptionsTable then flickerstreak@23: local opts = { flickerstreak@23: type = "group", flickerstreak@23: handler = ReAction, flickerstreak@23: args = { flickerstreak@23: } flickerstreak@23: } flickerstreak@23: Dewdrop:InjectAceOptionsTable(ReAction,opts) flickerstreak@23: self.aceOptionsTable = opts flickerstreak@23: end flickerstreak@28: for _, m in ReAction:IterateModules() do flickerstreak@28: if m and type(m.GetGlobalOptions) == "function" then flickerstreak@28: for k,v in pairs(m:GetGlobalOptions()) do flickerstreak@28: self.aceOptionsTable.args[k] = v flickerstreak@28: end flickerstreak@23: end flickerstreak@23: end flickerstreak@23: Dewdrop:FeedAceOptionsTable(self.aceOptionsTable) flickerstreak@23: end flickerstreak@23: