• 0

    posted a message on IsEventRegistered(event)
    Of course the IsEventRegistered() is not their to prevent double Registering. The blizzard API does not give errors when double registering events either. I do not see the point of this argument.

    A simple practical example (event tester)
    RegisterAllEvents()
    UnRegister(events) --> events that are already known
    
    if IsEventRegistered(event) then --> list of events
     Text:SetColor(green)
    else
     Text:SetColor(red)
    end


    Probably not the best example ... since you can set text color when setting the events, but it gives clean code wich is in some cases preferable. Just for fun: Can you find another practical example where you use RegisterAllEvents??

    Where else could it be more useful? When a module is written for an addon where you can not control setting events and you want an easy way to test if the addon uses the event.

    AddOn written by GrayHoof
    function Addon:HasCustomAction()
     .... huge function ...
    end 
    
    if Addon:HasCustomAction() then
     Button:RegisterEvent(event1)
     Button:RegisterEvent(event2)
    else
     Button:RegisterEvent(event3)
     Button:RegisterEvent(event4)
    end


    Module for GrayHoofs Addon written by another Author
    if Button:IsEventRegistered(event1)
     Button:ExpandButton()
    end

    Posted in: Ace3
  • 0

    posted a message on IsEventRegistered(event)
    Its not possible to use blizzard IsEventRegistered() in an Ace3 Addon because it tests against frame object. The AceEvent object can use one event for multiple objects (addon objects are not frames).

    Conserning usability I believe that IsEventRegistered() would be more used than that an addon builder would ever use RegisterAllEvents(). Still RegisterAllEvents is supported by Ace3.

    Why is RegisterAllEvents() supported and not IsEventRegistered()? Verry Simpel CallBackHandler does support RegisterAll but is does not support IsRegistered functions.

    I am convinced that IsEventRegistered() and IsMessageRegistered() could be easily supported by Ace3 and that these functions will be usefull for addon authors.

    Its been pointed out that I could use some sort of alternative ... ofc I can... but does this make Ace better?? or worse??
    Posted in: Ace3
  • 0

    posted a message on IsEventRegistered(event)
    it is not a question if i cant keep track of it ... in my own addon ye np
    in writing an extension for another addon i can imagine scenarios where i want
    certain actions if an event is registered or not

    the default blizzard api allows this kind of functionality
    ace2 offered this functionality also
    why does ace3 not offer this?
    Posted in: Ace3
  • 0

    posted a message on IsEventRegistered(event)
    Why does Ace3 not support object:IsEventRegistered(event)?
    Posted in: Ace3
  • To post a comment, please or register a new account.