int3ro / Nameplates_Threat

Colors the nameplate healthbar according to threat.
GNU General Public License v3.0
1 stars 1 forks source link

Does not work correctly with the new Modern client on classic Hardcore\Era realms #39

Closed kissthisthen closed 1 week ago

kissthisthen commented 10 months ago

First off want to say that I love the nameplates, keeping the default look with threat indicators.

They do however not work correctly with the new Modern client on classic Hardcore\Era realms. There are two main bugs:

  1. The color of the health bar does not correctly represent your threat level when in a party.
  2. Health bar colors do not reset if you reset\leash a mob.

I'm happy to provide more detail or screenshots if needed, but the easiest way to see this in action is to simply try it on a classic HC\Era realm, as it is very obvious.

mikfhan commented 10 months ago

Thanks! Always encouraging to hear! Please do bring screenshots - I don't have a subscription and so far the Classic PTR has been offline so unable to do much on this currently I'm afraid. You might be able to reset colors if you enable color gradients, and/or turn the camera around then back on the monster again. Readme has a bit more info on the colors, especially when you enable "Color Nameplates by Role" at the bottom of addon options (they're a bit more confusing than normal traffic light colors).

If someone with scripting savvy and a WoW subscription finds the buggy code lines I shall name them Hero of the Storm!

kissthisthen commented 10 months ago

Hi, sorry for the late reply. Here's an example of the nameplate color not resetting on the Hardcore realm Defias Pillager, using the latest 4.0 version of the addon: https://www.twitch.tv/eldairtv/clip/PoisedHardOkapiSuperVinlin-2crju5rAWYvwLsXh

mikfhan commented 10 months ago

Huh, interesting, something with plates stopping color refresh when they leave range but still in line of sight? What happens if you increase nameplate distance in game/video settings to maximum? Still happen just as often? I may have to listen for some additional events when plate enter/leave range.

kissthisthen commented 10 months ago

I think it happens whenever a mob resets aggro, you can see the bar turn gray the moment the mob resets at 22 seconds in the clip. Nameplate range is 20 in classic so this is max range already.

kissthisthen commented 10 months ago

Here is another example while in a party, on the Hardcore realm Defias Pillager: https://clips.twitch.tv/FurtivePlainSrirachaOptimizePrime-wTPL0FHDMVWWK9k7

There might be something with how the addon determines what role you are, since you can't set that specifically in 5 man parties in Classic, but I was the party leader so it should classify me as a tank according to the readme: "Classic Era has no roles; leader or raid maintank/assist are tank".

kissthisthen commented 10 months ago

Ok, I found the bug causing the nameplates to not update correctly when tanking in a party on Classic Era, it's these lines: https://github.com/int3ro/Nameplates_Threat/blob/b185c940f608ed00a6f4cd3941d2da03359fdc12/NamePlatesThreat.lua#L200-L204

With the new Era client it seems that UnitGroupRolesAssigned("player") will always return a role, so collectedPlayer == "NONE" will never be true and thus the if condition will never activate.

I suggest you update the if condition to: if WOW_PROJECT_ID == WOW_PROJECT_CLASSIC and UnitIsGroupLeader("player") then

kissthisthen commented 10 months ago

The above does however not fix the bug with nameplates threat color not resetting, as seen here: https://clips.twitch.tv/FunHomelySwordPeteZarollTie-wuHfvxVbcnSzOjr1

A full UI reload corrects the problem.

The event PLAYER_REGEN_ENABLED detects when a player exits combat, but the callback function does not seem to reset the nameplates correctly: https://github.com/int3ro/Nameplates_Threat/blob/b185c940f608ed00a6f4cd3941d2da03359fdc12/NamePlatesThreat.lua#L721-L722

mikfhan commented 10 months ago

Nice find! Although on hardcore PTR right now, running around solo I still get the NONE role if I type this in chat: /script print(UnitGroupRolesAssigned("player")) Maybe that only happens if my character does not yet have access to talent points, I'd have to level them up further to verify that, to see if the role default selector from Wrath appears then. So I am tempted to focus on the other issue first as I level up.

Been some busy weeks IRL but looks like classic PTR is up so maybe I can fiddle with the regen callback next couple weeks. Hmm last seems more likely to be an issue with me not keeping proper track of which nameplate belongs to which mob. Last video suddenly shows one of the others in gray instead of purple, even though it's not the one who ran back to spawn. I doubt I will be able to solve this before new year, I should add some debug tracking of mobs/plates somehow.

mikfhan commented 9 months ago

I've tried to simplify the wow classic checks now in mikfhan branch if you or anyone else want to try it out, but I doubt it works yet (just copy/paste the below over your current nameplates.lua file content in notepad): https://raw.githubusercontent.com/int3ro/Nameplates_Threat/mikfhan/NamePlatesThreat.lua

Also it now always does the 0.1 sec wait before callback to recolor nameplates, maybe that helps with some of the gray vs red bars you saw randomly on defias mobs not even in combat (the recent Blizzard "soft" action interact/targeting would otherwise override addon plate color on its own). But I still think that part is a different issue happening.

Some of the code fixes can only be properly tested in a group I think - I have a troll hunter Mikfhan + gnome warlock Sjakal on Classic Era PTR now, usually online 18:00-23:00 CET maybe if you reply your usual times we could link up and try some things.

mikfhan commented 8 months ago

I did not manage in time before 10.2.5 release to reproduce the wrong Classic Era colors on Defias Pillagers etc, nor the wrong coloring of party leader as tank. Possibly due to the latest tweaks I did just above, and I have not heard from others reply to this thread either, so I am tempted to mark this Closed some time after January 16th if I or others still can't reproduce issue when PTR servers are back online (and I can't reproduce bugs that require multiple players in same party either).

mikfhan commented 2 weeks ago

Is this issue still happening in 4.4-release and later? Please reply below or I am tempted to close this old one by 2025 new year.

kissthisthen commented 1 week ago

This seems to be fixed now with the 4.4 release, thanks a lot for your hard work!