Quantcast
WoWInterface - View Single Post - Class icons on nameplates
View Single Post
08-21-18, 10:30 AM   #4
Mitur
A Murloc Raider
Join Date: Aug 2008
Posts: 6
Originally Posted by Vrul View Post
I see a few things that I think are wrong but I'm not sure since you reference things not in the posted code. Post ALL of your code.
I only omitted things like table creation (icons table for example), and obvious stuff like event registration etc. Main logic is contained within the code I posted.

Originally Posted by Ammako View Post
You're running :Hide() on the nameplate itself, why?
The nameplate already disappears when unit is removed, that part is redundant, and you're not actually hiding the iconframe. Meaning, once the nameplate gets reassigned to a different unit, it is still anchored to it and will still appear, even if the character is of the wrong class.

[I wrote a thing here that I realized would not work, edited out]

Also, not related to the functionality of your code, but you are creating a new frame every time a nameplate appears. You should only create one per nameplate. Efficiency reasons.
Thanks for explaining the Hide() part, I just don't know how to get the reference to the Frame that I created to hide it properly.
And you're right about the efficiency part for sure.
I should somehow check if the nameplate already contains my Frame. If only I knew how to manage the nameplates properly
  Reply With Quote