WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   5.1 - The nameplates of mobs tagged to others are now purple. Any way to change it? (https://www.wowinterface.com/forums/showthread.php?t=45337)

fostic_popcorn 12-01-12 01:46 PM

5.1 - The nameplates of mobs tagged to others are now purple. Any way to change it?
 
For reference, I use caelnameplates, but this happens on default name plates as well. To test it yourself you can go to any major city's target dummies, if it isn't right after a server restart you should see their HP bars as this light purple that means they have been tagged to someone else.

Theoretically, I like the idea of this. What I can't stand is the color choice. Light purple? I would much prefer to change it to a light gray.

I tried going into cael's LUA to see if I could affect it there. However, nothing seems to be able to touch the color.

Any help at all would be tremendously appreciated as I have no clue what to do.

Vlad 12-03-12 07:54 AM

I feel your pain, at the moment tagged mobs appear basically like Warlocks, annoying. :P

Haleth 12-03-12 01:09 PM

Well, it's a little annoying. caelNamePlates uses an OnShow script (like most other nameplate addons, I imagine) then checks the colour of the healthbar and replaces it with an appropriate new colour. This worked because colours were only set each time the name plate was shown.

Now, though, the colour can update as soon as a mob is tagged. Since we don't have access to the name plate API, and I *think* there is no event for mobs being tagged -around- you, the only alternative might be to constantly run an OnUpdate script which isn't ideal (name plate addons already use an OnUpdate script to scan for plates in the first place).

Phanx 12-03-12 03:35 PM

The nameplate health bar is just a statusbar like any other; just hook its SetStatusBarColor method, or the SetVertexColor method on its texture.

Vlad 12-03-12 07:59 PM

Hmm, I hooked the SetStatusBarColor but the C-code doesn't seem to fire in a way that the hook also fires, meaning the color remains purple. :(

Damn..

Magicalhats27 12-03-12 08:26 PM

Quote:

Originally Posted by Vlad (Post 270145)
Hmm, I hooked the SetStatusBarColor but the C-code doesn't seem to fire in a way that the hook also fires, meaning the color remains purple. :(

Damn..

Feel your pain, every addon I try still show the purple name plates. I did have some success with X-perl unit frames though. But I hate that addon and rather not be bothered using it.

fostic_popcorn 12-03-12 11:03 PM

For the record I tried a new nameplate addon this week and to my enormous surprise the addon bNameplates appears to color the target dummies gray (after a small 'refresh' - they sometimes appear purple at first but when you move the plates off your camera and back on they will be gray).

I haven't dug into the code yet to figure out how it does it but if someone else wants to beat me to it by all means :)

Phanx 12-03-12 11:49 PM

Quote:

Originally Posted by Vlad (Post 270145)
Hmm, I hooked the SetStatusBarColor but the C-code doesn't seem to fire in a way that the hook also fires, meaning the color remains purple. :(

Try hooking it this way:

Code:

hooksecurefunc(healthBar:GetStatusBarTexture(), "SetVertexColor", function(texture, r, g, b, a)
    print("statusbar texture vertex color changed to", r, g, b, a)
end)

I'm pretty sure healthBar:SetStatusBarColor() is really just a wrapper for healthBar:GetStatusBarTexture():SetVertexColor() in which case it would make sense for the internal API to just call that directly.

Vlad 12-04-12 06:42 AM

Thanks for the suggestions, Phanx. But I tried to see if this hook fired properly, it didn't fire at all.

zork 12-04-12 08:44 AM

Well you can do this:
  1. create a new statusbar on the nameplate object
  2. set the statusbartexture of the old statusbar to "" to keep it for value reference but have it invisible
  3. OnShow check the nameplate name color (if it is gray you have a tagged mob)
  4. if you find a tagged mob instead of using GetStatusBarColor of the old healthbar you apply the name color to your new healthbar

That's basically what I do in rDiabloPlates2 to fix the healthbar alpha bug. I have not yet implemented the tagging color change and I'm still unsure. If I turn around the camera 360° the nameplates return to default color (neutral for training dummies).

devilArt 12-05-12 01:53 PM

It's really annoying
hope you guys can make a small simple addon to change it back

ape47 12-05-12 02:58 PM

Any suggestion for detecting nameplates after mind control?

semlar 12-05-12 09:59 PM

I uploaded a small patch for this called Nameplate Tap Fix.

The purple color is set C side repeatedly onupdate and causes no trackable event as far as I can tell, so I just replace it onupdate. This is not extraordinarily efficient but it's not likely going to have any impact on your game.

edit: I should revise that, it could have an impact on your game if you had a lot of nameplates on your screen, but so would any nameplate addon.

I think it could at least be reduced down to only checking enemy plates but I'm not sure what the best way to detect that is.


All times are GMT -6. The time now is 06:26 AM.

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