annotate modules/FuBar_ReActionFu/FuBar_ReActionFu.lua @ 30:0d95ce7a9ec2

- added Ace3 externs - converted ReAction_ConfigUI to use blizzard interface addons panel via AceConfigDialog-3.0 - partially converted FuBar module to LibRock, deprecated it (going to remove it entirely later) - cleaned up a couple other tidbits
author Flick <flickerstreak@gmail.com>
date Wed, 02 Apr 2008 23:31:13 +0000
parents 21bcaf8215ff
children
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
flickerstreak@23 9 -- module declaration
flickerstreak@23 10 local moduleID = "ReActionFu"
flickerstreak@30 11 local module = ReAction:NewModule( moduleID,
flickerstreak@30 12 "FuBarPlugin-3.0"
flickerstreak@30 13 )
flickerstreak@23 14
flickerstreak@30 15 local fubarOptions = {
flickerstreak@30 16 iconPath = "Interface\\Icons\\INV_Qiraj_JewelEncased",
flickerstreak@30 17 hasNoColor = true,
flickerstreak@30 18 tooltipType = "Tablet-2.0",
flickerstreak@30 19 configType = "Dewdrop-2.0",
flickerstreak@30 20 hasNoText = true,
flickerstreak@30 21 defaultPosition = "LEFT",
flickerstreak@30 22 defaultMinimapPosition = 240, -- degrees
flickerstreak@30 23 clickableTooltip = false,
flickerstreak@30 24 independentProfile = true
flickerstreak@30 25 cannotDetachTooltip = true
flickerstreak@30 26 hideMenuTitle = true
flickerstreak@30 27 }
flickerstreak@23 28
flickerstreak@30 29 function module:OnInitialize()
flickerstreak@28 30 self.db = ReAction.db:RegisterNamespace(moduleID,
flickerstreak@23 31 {
flickerstreak@28 32 profile = {
flickerstreak@28 33 requireFuBar = false
flickerstreak@28 34 }
flickerstreak@23 35 }
flickerstreak@23 36 )
flickerstreak@28 37 self.db.RegisterCallback(self,"OnProfileChanged")
flickerstreak@23 38
flickerstreak@23 39 if self.db.profile.requireFuBar == true then
flickerstreak@23 40 self:Hide()
flickerstreak@23 41 end
flickerstreak@23 42
flickerstreak@30 43 self.OnMenuRequest = {
flickerstreak@30 44 type = "group",
flickerstreak@30 45 handler = ReAction,
flickerstreak@30 46 args = {
flickerstreak@30 47 -- include profile management by default
flickerstreak@30 48 profile = LibStub("AceDBOptions-3.0"):GetOptionsTable(ReAction.db)
flickerstreak@30 49 }
flickerstreak@30 50 }
flickerstreak@30 51
flickerstreak@30 52 -- insert each module's registered global opts into the table top level
flickerstreak@30 53 local opts = self.OnMenuRequest
flickerstreak@30 54 for m, tbl in pairs(ReAction:GetOptions("global")) do
flickerstreak@30 55 if tbl.args then
flickerstreak@30 56 for k, v in pairs(tbl.args) do
flickerstreak@30 57 opts.args[k] = v
flickerstreak@30 58 end
flickerstreak@30 59 end
flickerstreak@30 60 end
flickerstreak@30 61
flickerstreak@30 62 -- listen for new module adds
flickerstreak@30 63 ReAction.RegisterCallback(self, "OnOptionsRegistered")
flickerstreak@30 64
flickerstreak@30 65 -- configure FuBarPlugin
flickerstreak@30 66 for k, v in pairs(fubarOptions) do
flickerstreak@30 67 self:SetFuBarOption(k,v)
flickerstreak@30 68 end
flickerstreak@23 69 end
flickerstreak@23 70
flickerstreak@30 71 function module:OnProfileChanged()
flickerstreak@23 72 if self.db.profile.requireFuBar == true then
flickerstreak@28 73 module:Hide()
flickerstreak@23 74 else
flickerstreak@23 75 self:Show()
flickerstreak@23 76 end
flickerstreak@23 77 end
flickerstreak@23 78
flickerstreak@30 79 function module:OnOptionsRegistered( evtName, context, module, opts )
flickerstreak@30 80 if context == "global" then
flickerstreak@30 81 if opts.args then
flickerstreak@30 82 for k, v in pairs(tbl.args) do
flickerstreak@30 83 opts.args[k] = v
flickerstreak@28 84 end
flickerstreak@23 85 end
flickerstreak@23 86 end
flickerstreak@23 87 end
flickerstreak@23 88
flickerstreak@30 89 function module:OnFuBarClick(button)
flickerstreak@30 90 -- TODO:
flickerstreak@30 91 -- alt, shift, ctrl clicks
flickerstreak@30 92 end
flickerstreak@30 93
flickerstreak@30 94 function module:OnUpdateFuBarTooltip()
flickerstreak@30 95 -- TODO:
flickerstreak@30 96 -- display status of config mode, keybind mode, etc
flickerstreak@30 97 end
flickerstreak@30 98