Not bug, wondering how to do this custom lua mod
cdavidr opened this issue ยท 2 comments
I currently use Plater but wanted to switch to KUI, however I havnt been able to reproduce one of my Plater mods on KUI.
I was looking at this as a reference:
https://github.com/kesava-wow/kuinameplates-customs/blob/master/custom.target-target-glow.lua
I am trying to update nameplate if any nameplate targets me.
On plater I can do it with this:
if UnitIsUnit(unitFrame.targetUnitID, "player") then...
It seems it saves all target units on the unitFrame, so is there a way to get the same thing and what event would update frequently to trigger it?
Let me know if I dont make much sense as I am pretty new to lua coding
The equivalent to that in KNP would be: if UnitIsUnit(frame.unit..'target','player') then ....
However I'm pretty certain the game doesn't fire events for when nameplate units change targets, so you'd need to watch for that manually. See this script - it provides the TargetChanged message, then uses it set an extra text field to the target's name.