Quantcast WoWInterface - View Single Post - Highlight Targeted unit
View Single Post
10-28-18, 12:13 PM   #15
Gilsuk
A Murloc Raider
Join Date: Sep 2018
Posts: 4
Lua Code:
  1. local GetNamePlateForUnit = C_NamePlate.GetNamePlateForUnit
  2. local previousTarget
  3.  
  4. local function OnTargetChanged()
  5.     local parent = GetNamePlateForUnit('target')
  6.     local currentTarget = parent and parent.unitFrame
  7.  
  8.     if currentTarget == previousTarget then return end
  9.  
  10.     if previousTarget then
  11.         previousTarget:SetBackdropBorderColor(0, 0, 0)
  12.         previousTarget = nil
  13.     end
  14.  
  15.     if currentTarget then
  16.         currentTarget:SetBackdropBorderColor(1, 1, 1)
  17.         previousTarget = currentTarget
  18.     end
  19. end
  20.  
  21. oUF:SpawnNamePlates('MyStyle', OnTargetChanged)
I use this code above and don't have any issues
  Reply With Quote