tukui-org / ElvUI

User Interface replacement AddOn for World of Warcraft.
https://tukui.org
Other
396 stars 136 forks source link

Threat Display on UnitFrame showing wrong information #1187

Closed MojoOli closed 2 months ago

MojoOli commented 3 months ago

Troubleshooting Steps

Whenever you enable "Threat Display Mode" in any UnitFrame except the player one, e.g. the target, the wrong threat information is gathered and displayed.

For example, if I am fighting a mob and have aggro on it, the threat border is not displayed on the target (see attachment one). If I then target myself, the border is shown (attachment 2). This is due to the fact that ElvUI is calling the oUF library without supplying a feedbackUnit, which basically means that the threat situation of the target is determined which has none.

I dug through the code a bit and came to the conclusion that Construct_Threat method in the Threat.lua needs to have a new param feedbackUnit. This way the ThreatIndicator can be supplied with the correct unit. Then, the Target.lua file needs to create the ThreatIndicator the following way:

frame.ThreatIndicator = UF:Construct_Threat(frame, "player")

After that, the threat of the player in relation to the target can be determined. This results in the correct border:

This would need adjusting for all unitframes except player, pet and groups/raids. I also think this affects all versions of ElvUI, so Classic/Wrath/Retail.

Verification Steps

MojoOli commented 2 months ago

Closed by latest dev version.