WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   oUF (Otravi Unit Frames) (https://www.wowinterface.com/forums/forumdisplay.php?f=87)
-   -   Tag Player Spec -> PLAYER_TALENT_UPDATE (https://www.wowinterface.com/forums/showthread.php?t=58549)

neverg 01-16-21 06:55 AM

Tag Player Spec -> PLAYER_TALENT_UPDATE
 
Hi fellas,

I'm re-writting my whole UI (years of code, fixes, patches left a big mess within my codebase).

So my question is, is there a reason why a oUF tag with the event PLAYER_TALENT_UPDATE doesn't actually trigger when it should?

The tag is pretty simple.

Lua Code:
  1. spec = function(unit)
  2.   return E:GetUnitSpecializationInfo(unit)
  3. end,

I've registered the following events "PLAYER_TALENT_UPDATE PLAYER_ROLES_ASSIGNED".

PLAYER_ROLES_ASSIGNED actually get triggered fine.

I can fix this easily by registering PLAYER_TALENT_UPDATE on the frame, but it would be cleaner if the tag would just update with the registered events.

Is there a reason for this, or something I can do other than the aforementioned solution of registering the event to the frame.

lightspark 01-16-21 08:12 AM

Sup!

PLAYER_TALENT_UPDATE is what we internally call a unitless event, it just fires and has no args. I just checked and we too use it internally, but for some reason it's not in our unitlessEvents table, so I'll PR it ASAP.

But in general, when you're writing your own tags that rely on unitless events that aren't known to oUF, you need to add them manually from inside your layout code like so
Lua Code:
  1. oUF.Tags.SharedEvents["PLAYER_TALENT_UPDATE"] = true

neverg 01-16-21 08:15 AM

Quote:

Originally Posted by lightspark (Post 338288)
Sup!

PLAYER_TALENT_UPDATE is what we internally call a unitless event, it just fires and has no args. I just checked and we too use it internally, but for some reason it's not in our unitlessEvents table, so I'll PR it ASAP.

But in general, when you're writing your own tags that rely on unitless events that aren't known to oUF, you need to add them manually from inside your layout code like so
Lua Code:
  1. oUF.Tags.SharedEvents["PLAYER_TALENT_UPDATE"] = true

Today I learned! Didn't know about the SharedEvents, thanks, ls! :)

EDIT - I didn't know about SharedEvents but should have, it's in the comments of the file and I didn't read it... it's very well explained there, my bad! :P

lightspark 01-16-21 08:18 AM

Quote:

Originally Posted by neverg (Post 338289)
Today I learned! Didn't know about the SharedEvents, thanks, ls! :)



You're welcome :cool:


All times are GMT -6. The time now is 03:31 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI