View Single Post
04-14-21, 03:31 PM   #17
LudiusMaximus
A Rage Talon Dragon Guard
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 320
Originally Posted by myrroddin View Post
If that is what you see for unknown events, then AceEvent is registering by table, a table that has a list of events assigned to the frame. It is the second method I suggested, not the first.
That's what I supposed, too. But the implementation of AceEvent-3.0.lua is really beyond me...
I cannot spot any point where it would seem to maintain such a table of registered events.

What really puzzles me is why there is the unregister error when I call RegisterEvent() with callback:
Lua Code:
  1. local myAddon = LibStub("AceAddon-3.0"):NewAddon(..., "AceEvent-3.0")
  2. pcall(function() myAddon:RegisterEvent("NONSENSE_EVENT", function() end) end)
  3. myAddon:UnregisterAllEvents()
  4. -- Error: Attempt to unregister unknown event "NONSENSE_EVENT"

But no error message when I do it without callback:
Lua Code:
  1. local myAddon = LibStub("AceAddon-3.0"):NewAddon(..., "AceEvent-3.0")
  2. pcall(function() myAddon:RegisterEvent("NONSENSE_EVENT") end)
  3. myAddon:UnregisterAllEvents()
  4. -- No error.

Thanks! Your help is really appreciated.


Originally Posted by myrroddin View Post
Please provide a working example.
An example is just that a user mistypes an event they want to register. The GUI looks like this:
__________________
~ Be the change you want to see in the world... of warcraft interface! ~
  Reply With Quote