I've been using Ace3 for a while and have a pretty solid understanding of how it and its mixins work. However, I'm trying to setup a new addon and I can't seem to get the event firings to work.
File Structure
Code:
[root_folder][Libs][AceAddon-3.0]
[AceConfig-3.0]
[AceConsole-3.0]
[AceDB-3.0]
[AceEvent-3.0]
[AceGUI-3.0]
[CallbackHandler-1.0]
[LibStub]
Ace3.lua
Ace3.toc
core.lua
AddonName.toc
embeds.xml
embeds.xml
xml Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/">
<Script file="Libs\LibStub\LibStub.lua"/>
<Include file="Libs\CallbackHandler-1.0\CallbackHandler-1.0.xml"/>
<Include file="Libs\AceAddon-3.0\AceAddon-3.0.xml"/>
<Include file="Libs\AceEvent-3.0\AceEvent-3.0.xml"/>
<Include file="Libs\AceDB-3.0\AceDB-3.0.xml"/>
<Include file="Libs\AceConsole-3.0\AceConsole-3.0.xml"/>
<Include file="Libs\AceGUI-3.0\AceGUI-3.0.xml"/>
<Include file="Libs\LibSharedMedia-3.0\lib.xml"/>
<Include file="Libs\AceGUI-3.0-SharedMediaWidgets\widget.xml"/>
<Include file="Libs\LibAboutPanel\lib.xml"/>
<Include file="Libs\AceConfig-3.0\AceConfig-3.0.xml"/>
</Ui>
TOC File
Code:
## Interface: 70300
## Title: <Addon Name>
## Notes: <Addon Description>
## Author: Sweetsour
## Version: r01-beta
## SavedVariables: CCS_db_private
## SavedVariablesPerCharacter: CCS_db
## OptionalDeps: Ace3
## X-Embeds: Ace3
embeds.xml
core.lua
core.lua
Lua Code:
local Crits = LibStub('AceAddon-3.0'):NewAddon(FOLDER_NAME, 'AceConsole-3.0','AceEvent-3.0');
function Crits:OnInitialize()
end
function Crits:OnEnable()
print(FOLDER_NAME) -- This is printing fine
self:RegisterEvent("PLAYER_REGEN_DISABLED")
end
function Crits:PLAYER_REGEN_DISABLED()
print("Combat Started") -- Not printing
self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
self:RegisterEvent("PLAYER_REGEN_ENABLED")
end
function Crits:PLAYER_REGEN_DISABLED()
self:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
self:UnregisterEvent("PLAYER_REGEN_ENABLED")
end
function Crits:COMBAT_LOG_EVENT_UNFILTERED(event,...)
print(event) -- Not printing
end