Blozzom said:
I'm not trying to pick a fight or stroke my e-peen, just trying to understand your reasoning better (from a programmers pov). :wink:
In order to answer your question, I have to describe WoW's general event handling abit.
Events in general are recieved by frames. Yes, you're reading correct: UI Frames.. stupid, 'eh? That basically means, that nearly every addon has a - visible or hidden - frame which consists of several On-function (OnLoad, OnMouseClick, OnEscPressed, OnVomit.. OnNameIt).
One of those On-functions is the OnEvent function which passes every registered event to the addon's event handler. What do I mean with 'registered event'? Every single change in the environment is being flooded with defined event to the UI and its addons (buffs, dmg, chat actions, target changes, aura changes, everything). The auther can define which events he wants to recieve and which not. He registers those events on which then his OnEvent function is triggered.
Example: Assuming the author wants to recieve an event every time a change occurs in the player's bags (loot recieved, equipment changed, pot swallowed etc), he registers the respective event and than can act accordingly (for example recount the free bagslots).
Ok. Let's go into details:
Events then can be computed in 2 different ways: At the end the event handler is a single function with decides what to do after a certain event occured. Lazy addon authors have a big function with a huge if-elseif-elseif-elseif.....end construct to catch all the possible events. The second option is to use some fake-OOP approach and simulate a case-contruct which basically leads to parallelizing events into dedicated functions.
That's the way most people do the job and it makes sense as it's seperated, more logical, easier to debug and extend. But that leads to the fact that you have to work with global states (global in your addon environment) as you normally don't only work with one event and they most likely depend on each other.
Example: SheepWatch checks for the "user successfully casted a spell"-event, sets a specific state and then waits for the "mob gets debuffed"-event before it actually displays a progress bar.
And that's basically the reason why your addon suggestion is a bit problematic. This addon disables specific events for an addon. The addon generally runs but doesn't get dedicated events anymore. What happens now if the addon relys on events to be fired because several states have been met? During that time the addon as it still runs and computes other events and data and ofc changes its status. That may lead to an undefined status which can cause alot of trouble.
The addon I suggested uses the opposite approach: It hooks (and then disables) all events to be sent to addons (but a few necessary ones like CHAT events) and therefore kinda puts them into a kind of hibernation mode during the zoning. The actual state when zoning started remains the same as - like mentioned above - the addon execution itself relys on events.
EDIT: Typos :cry: