flickerstreak@25: --[[ flickerstreak@25: ReAction Add-On main file. flickerstreak@25: Performs add-on and library initialization and setup. flickerstreak@25: --]] flickerstreak@25: flickerstreak@27: ------ LOCALIZATION ---------- flickerstreak@27: local L = AceLibrary("AceLocale-2.2"):new("ReAction") flickerstreak@25: flickerstreak@27: flickerstreak@27: ------ GLOBAL VARIABLES ------ flickerstreak@25: -- 'ReAction' is exported as a global. flickerstreak@25: ReAction = AceLibrary("AceAddon-2.0"):new( flickerstreak@25: "AceModuleCore-2.0", flickerstreak@25: "AceEvent-2.0", flickerstreak@25: "AceDB-2.0" flickerstreak@25: ) flickerstreak@25: -- global variable strings for integration with WoW keybindings dialog (see bindings.xml) flickerstreak@25: BINDING_HEADER_REACTION = L["ReAction"] flickerstreak@25: BINDING_NAME_REACTION_TOGGLELOCK = L["Toggle ReAction Bar Lock"] flickerstreak@25: BINDING_NAME_REACTION_TOGGLEKEYBIND = L["ReAction Keybinding Mode"] flickerstreak@25: flickerstreak@27: flickerstreak@27: ------ CORE ------ flickerstreak@27: local ReAction = ReAction flickerstreak@27: ReAction.revision = tonumber(("$Revision: 1 $"):match("%d+")) flickerstreak@27: ReAction.L = L flickerstreak@27: flickerstreak@27: flickerstreak@27: flickerstreak@25: -- from AceAddon-2.0 flickerstreak@25: function ReAction:OnInitialize() flickerstreak@25: self:RegisterDB("ReActionDB") flickerstreak@25: end flickerstreak@25: flickerstreak@25: -- from AceAddon-2.0 flickerstreak@25: function ReAction:OnEnable() flickerstreak@25: flickerstreak@25: end flickerstreak@25: flickerstreak@25: -- from AceAddon-2.0 flickerstreak@25: function ReAction:OnDisable() flickerstreak@25: flickerstreak@25: end flickerstreak@25: flickerstreak@25: -- from AceDB-2.0 flickerstreak@25: function ReAction:OnProfileEnable() flickerstreak@25: flickerstreak@25: end flickerstreak@25: flickerstreak@25: -- from AceDB-2.0 flickerstreak@25: function ReAction:OnProfileDisable() flickerstreak@25: flickerstreak@25: end flickerstreak@25: flickerstreak@25: -- from AceModuleCore-2.0 flickerstreak@25: function ReAction:OnModuleEnable(module) flickerstreak@25: -- this handles initialization ordering issues with ReAction_Bar flickerstreak@25: local barMod = self:GetModule("Bar") flickerstreak@25: if barMod and module.ApplyToBar then flickerstreak@25: for _, b in pairs(barMod.bars) do flickerstreak@25: if b then flickerstreak@25: module:ApplyToBar(b) flickerstreak@25: end flickerstreak@25: end flickerstreak@25: end flickerstreak@25: end flickerstreak@25: flickerstreak@25: -- from AceModuleCore-2.0 flickerstreak@25: function ReAction:OnModuleDisable(module) flickerstreak@25: local barMod = self:GetModule("Bar") flickerstreak@25: if barMod and module.RemoveFromBar then flickerstreak@25: for _, b in pairs(barMod.bars) do flickerstreak@25: if b then flickerstreak@25: module:RemoveFromBar(b) flickerstreak@25: end flickerstreak@25: end flickerstreak@25: end flickerstreak@25: end flickerstreak@25: flickerstreak@25: --[[ flickerstreak@25: Module API (see bar.lua for usage) flickerstreak@25: flickerstreak@25: module:ApplyToBar(bar) flickerstreak@25: module:RemoveFromBar(bar) flickerstreak@25: module:RefreshBar(bar) flickerstreak@25: module:ApplyConfigMode(mode,listOfBars) flickerstreak@25: module:GetBarNameModifier(bar) flickerstreak@25: module:EraseBarConfig(barName) flickerstreak@25: ]]-- flickerstreak@25: flickerstreak@25: flickerstreak@25: -- debugging flickerstreak@25: ReAction.debug = true flickerstreak@25: if ReAction.debug then flickerstreak@25: ReAction.print = function(msg) flickerstreak@25: DEFAULT_CHAT_FRAME:AddMessage(msg) flickerstreak@25: end flickerstreak@25: --seterrorhandler(ReAction.print) flickerstreak@25: else flickerstreak@25: ReAction.print = function() end flickerstreak@25: end flickerstreak@25: