Problem of nameplate anchor
zcqiu opened this issue ยท 2 comments
I've written an aura that shows the cooldown of interrupting skills on the nameplate. I set Aura's anchor to nameplate, and create two triggers, one is the casting state of the current target, the other is the player's interrupt skill cooldown. In previous versions, the aura has been working well. But in recent versions, the icon can not be positioned to the nameplate, and it can only be displayed on the relative position of the screen.
I analyzed the code, and in AuraEnvironment.lua
WeakAuras.GetUnitNameplate = function(unit)
if Private.multiUnitUnits.nameplate[unit] then
return LGF.GetUnitNameplate(unit)
end
end
The sentence "if" is false,and cause the problem.
I've tried that aura works only when I add a trigger and the trigger's unit set to nameplate. However, if you do this, it will cause icons to appear on all nameplates, not just the current target.
After I comment the if sentence of the above code, aura can work normally. Otherwise, I can only achieve this function through TSU.
Similar problems appear in the display of an icon above the nameplate of the focus target. I'm pretty sure that aura was easy to implement before. I don't know whether this change is intentional or there is a bug.
We did change that because in the WeakAuras design, the trigger is responsible for updating the state if a aura needs reanchoring.
The two built-in trigger you are using will not respond to any nameplate related events, and thus will not update the state if nameplates are shown/hidden and thus even with removing the if does not make this work.
That is your change only appears to work, but doesn't. This is easy to test for you.
- Hide all nameplates
- Target a mob that is casting.
- Show nameplates
This won't attach the aura to the nameplate, because as far as the triggers are concerned nothing in their state has changed.
We did change that because in the WeakAuras design, the trigger is responsible for updating the state if a aura needs reanchoring.
The two built-in trigger you are using will not respond to any nameplate related events, and thus will not update the state if nameplates are shown/hidden and thus even with removing the if does not make this work.
That is your change only appears to work, but doesn't. This is easy to test for you.
- Hide all nameplates
- Target a mob that is casting.
- Show nameplates
This won't attach the aura to the nameplate, because as far as the triggers are concerned nothing in their state has changed.
I tried, and as you said, because neither trigger is related to nameplate, aura is not updated when nameplate changes.
I understand why it is designed in this way, but I still want to ask how to realize the function of marking the focus target on the nameplate, or displaying an icon on the current target nameplate?
In the current design, triggers need to specify nameplate to anchor aura to nameplate. However, those triggers do not provide unit filtering function, such as judging that nameplate unit is the focus.