Thread Tools Display Modes
12-08-17, 05:23 PM   #1
Sweetsour
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Dec 2014
Posts: 130
Firing events using Ace3 not working?

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:
  1. <Ui xmlns="http://www.blizzard.com/wow/ui/">
  2.     <Script file="Libs\LibStub\LibStub.lua"/>
  3.     <Include file="Libs\CallbackHandler-1.0\CallbackHandler-1.0.xml"/>
  4.     <Include file="Libs\AceAddon-3.0\AceAddon-3.0.xml"/>
  5.     <Include file="Libs\AceEvent-3.0\AceEvent-3.0.xml"/>
  6.     <Include file="Libs\AceDB-3.0\AceDB-3.0.xml"/>
  7.     <Include file="Libs\AceConsole-3.0\AceConsole-3.0.xml"/>
  8.     <Include file="Libs\AceGUI-3.0\AceGUI-3.0.xml"/>
  9.     <Include file="Libs\LibSharedMedia-3.0\lib.xml"/>
  10.     <Include file="Libs\AceGUI-3.0-SharedMediaWidgets\widget.xml"/>
  11.     <Include file="Libs\LibAboutPanel\lib.xml"/>
  12.     <Include file="Libs\AceConfig-3.0\AceConfig-3.0.xml"/>
  13. </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:
  1. local Crits = LibStub('AceAddon-3.0'):NewAddon(FOLDER_NAME, 'AceConsole-3.0','AceEvent-3.0');
  2.  
  3. function Crits:OnInitialize()  
  4.    
  5. end
  6.  
  7. function Crits:OnEnable()
  8.     print(FOLDER_NAME) -- This is printing fine
  9.  
  10.     self:RegisterEvent("PLAYER_REGEN_DISABLED")
  11. end
  12.  
  13. function Crits:PLAYER_REGEN_DISABLED()
  14.     print("Combat Started") -- Not printing
  15.  
  16.     self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
  17.     self:RegisterEvent("PLAYER_REGEN_ENABLED")
  18. end
  19.  
  20. function Crits:PLAYER_REGEN_DISABLED()
  21.     self:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
  22.     self:UnregisterEvent("PLAYER_REGEN_ENABLED")
  23. end
  24.  
  25. function Crits:COMBAT_LOG_EVENT_UNFILTERED(event,...)
  26.     print(event) -- Not printing
  27. end

Last edited by Sweetsour : 12-08-17 at 05:27 PM.
  Reply With Quote
12-08-17, 05:28 PM   #2
Sweetsour
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Dec 2014
Posts: 130
It figures that the moment I post this, I immediately found the issue. I have PLAYER_REGEN_DISABLE() called twice. Changed the second one to PLAYER_REGEN_ENABLED() and everything works fine.

Ugh.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Firing events using Ace3 not working?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off