Quantcast
Tag Player Spec -> PLAYER_TALENT_UPDATE - WoWInterface
 
Thread Tools Display Modes
01-16-21, 06:55 AM   #1
neverg
A Frostmaul Preserver
 
neverg's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2007
Posts: 268
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.
__________________
My oUF Layout: oUF Lumen
  Reply With Quote
01-16-21, 08:12 AM   #2
lightspark
A Rage Talon Dragon Guard
 
lightspark's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2012
Posts: 330
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
__________________
  Reply With Quote
01-16-21, 08:15 AM   #3
neverg
A Frostmaul Preserver
 
neverg's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2007
Posts: 268
Originally Posted by lightspark View Post
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
__________________
My oUF Layout: oUF Lumen

Last edited by neverg : 01-16-21 at 08:46 AM.
  Reply With Quote
01-16-21, 08:18 AM   #4
lightspark
A Rage Talon Dragon Guard
 
lightspark's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2012
Posts: 330
Originally Posted by neverg View Post
Today I learned! Didn't know about the SharedEvents, thanks, ls!


You're welcome
__________________
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Tag Player Spec -> PLAYER_TALENT_UPDATE

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off