View Single Post
01-30-23, 08:33 PM   #3
Shateiel
A Defias Bandit
Join Date: Jan 2023
Posts: 2
Thanks for insightful and kind reply which helps me to understand the coding more.

Originally Posted by SDPhantom View Post

PS: EventRegistry can be a little confusing as its a shared system that can handle both internal callbacks and frame events. That being said, frame events require the event to be registered through EventRegistry:RegisterFrameEvent() in order for your callback registered with EventRegistry:RegisterCallback() to run. You can do both in a single call with EventRegistry:RegisterFrameEventAndCallback().

My guess is since this wasn't an issue for you, some other code (possibly not yours) is already using those events and had registered them properly. You shouldn't rely on this as it might not always be the case and EventRegistry runs a counter on how many functions are linked to any specific frame event. If those counters get out of sync by incomplete registrations, you may find yourself randomly no longer getting event triggers.
I tried without any addons but it didn't work without any neither. I just can't make PLAYER_TARGET_CHANGED event to work for playerframe.

Also, at first; copy-pasted all of the codes you provided, it does nothing. Should I add something ? this "local" code is whole new thing for me, sorry if the question is a stupid one.
  Reply With Quote