annotate ReAction.lua @ 27:f1e838841ce1

Rearranged file tree, removed unused code for 1.x start-point
author Flick <flickerstreak@gmail.com>
date Tue, 11 Mar 2008 21:39:34 +0000
parents bf997ea151ca
children 21bcaf8215ff
rev   line source
flickerstreak@25 1 --[[
flickerstreak@25 2 ReAction Add-On main file.
flickerstreak@25 3 Performs add-on and library initialization and setup.
flickerstreak@25 4 --]]
flickerstreak@25 5
flickerstreak@27 6 ------ LOCALIZATION ----------
flickerstreak@27 7 local L = AceLibrary("AceLocale-2.2"):new("ReAction")
flickerstreak@25 8
flickerstreak@27 9
flickerstreak@27 10 ------ GLOBAL VARIABLES ------
flickerstreak@25 11 -- 'ReAction' is exported as a global.
flickerstreak@25 12 ReAction = AceLibrary("AceAddon-2.0"):new(
flickerstreak@25 13 "AceModuleCore-2.0",
flickerstreak@25 14 "AceEvent-2.0",
flickerstreak@25 15 "AceDB-2.0"
flickerstreak@25 16 )
flickerstreak@25 17 -- global variable strings for integration with WoW keybindings dialog (see bindings.xml)
flickerstreak@25 18 BINDING_HEADER_REACTION = L["ReAction"]
flickerstreak@25 19 BINDING_NAME_REACTION_TOGGLELOCK = L["Toggle ReAction Bar Lock"]
flickerstreak@25 20 BINDING_NAME_REACTION_TOGGLEKEYBIND = L["ReAction Keybinding Mode"]
flickerstreak@25 21
flickerstreak@27 22
flickerstreak@27 23 ------ CORE ------
flickerstreak@27 24 local ReAction = ReAction
flickerstreak@27 25 ReAction.revision = tonumber(("$Revision: 1 $"):match("%d+"))
flickerstreak@27 26 ReAction.L = L
flickerstreak@27 27
flickerstreak@27 28
flickerstreak@27 29
flickerstreak@25 30 -- from AceAddon-2.0
flickerstreak@25 31 function ReAction:OnInitialize()
flickerstreak@25 32 self:RegisterDB("ReActionDB")
flickerstreak@25 33 end
flickerstreak@25 34
flickerstreak@25 35 -- from AceAddon-2.0
flickerstreak@25 36 function ReAction:OnEnable()
flickerstreak@25 37
flickerstreak@25 38 end
flickerstreak@25 39
flickerstreak@25 40 -- from AceAddon-2.0
flickerstreak@25 41 function ReAction:OnDisable()
flickerstreak@25 42
flickerstreak@25 43 end
flickerstreak@25 44
flickerstreak@25 45 -- from AceDB-2.0
flickerstreak@25 46 function ReAction:OnProfileEnable()
flickerstreak@25 47
flickerstreak@25 48 end
flickerstreak@25 49
flickerstreak@25 50 -- from AceDB-2.0
flickerstreak@25 51 function ReAction:OnProfileDisable()
flickerstreak@25 52
flickerstreak@25 53 end
flickerstreak@25 54
flickerstreak@25 55 -- from AceModuleCore-2.0
flickerstreak@25 56 function ReAction:OnModuleEnable(module)
flickerstreak@25 57 -- this handles initialization ordering issues with ReAction_Bar
flickerstreak@25 58 local barMod = self:GetModule("Bar")
flickerstreak@25 59 if barMod and module.ApplyToBar then
flickerstreak@25 60 for _, b in pairs(barMod.bars) do
flickerstreak@25 61 if b then
flickerstreak@25 62 module:ApplyToBar(b)
flickerstreak@25 63 end
flickerstreak@25 64 end
flickerstreak@25 65 end
flickerstreak@25 66 end
flickerstreak@25 67
flickerstreak@25 68 -- from AceModuleCore-2.0
flickerstreak@25 69 function ReAction:OnModuleDisable(module)
flickerstreak@25 70 local barMod = self:GetModule("Bar")
flickerstreak@25 71 if barMod and module.RemoveFromBar then
flickerstreak@25 72 for _, b in pairs(barMod.bars) do
flickerstreak@25 73 if b then
flickerstreak@25 74 module:RemoveFromBar(b)
flickerstreak@25 75 end
flickerstreak@25 76 end
flickerstreak@25 77 end
flickerstreak@25 78 end
flickerstreak@25 79
flickerstreak@25 80 --[[
flickerstreak@25 81 Module API (see bar.lua for usage)
flickerstreak@25 82
flickerstreak@25 83 module:ApplyToBar(bar)
flickerstreak@25 84 module:RemoveFromBar(bar)
flickerstreak@25 85 module:RefreshBar(bar)
flickerstreak@25 86 module:ApplyConfigMode(mode,listOfBars)
flickerstreak@25 87 module:GetBarNameModifier(bar)
flickerstreak@25 88 module:EraseBarConfig(barName)
flickerstreak@25 89 ]]--
flickerstreak@25 90
flickerstreak@25 91
flickerstreak@25 92 -- debugging
flickerstreak@25 93 ReAction.debug = true
flickerstreak@25 94 if ReAction.debug then
flickerstreak@25 95 ReAction.print = function(msg)
flickerstreak@25 96 DEFAULT_CHAT_FRAME:AddMessage(msg)
flickerstreak@25 97 end
flickerstreak@25 98 --seterrorhandler(ReAction.print)
flickerstreak@25 99 else
flickerstreak@25 100 ReAction.print = function() end
flickerstreak@25 101 end
flickerstreak@25 102