I'm currently doing that sticklord is suggesting. Trying to create a seperate spawn function for nameplates.
Currently I get this taint:
Lua Code:
10/2 23:59:09.464 An action was blocked in combat because of taint from oUF - SecureStateDriverManager:SetAttribute()
10/2 23:59:09.464 Interface\FrameXML\SecureStateDriver.lua:42 RegisterUnitWatch()
10/2 23:59:09.464 Interface\AddOns\oUF\ouf.lua:553 SpawnNamePlate()
10/2 23:59:09.464 Interface\AddOns\oUF_Simple\core.lua:592 ?()
10/2 23:59:09.464 Interface\AddOns\oUF_Simple\core.lua:617
Currently trying to get rid of that error.
*edit*
Ok I could just remove the unit watch since we have unit_added and unit_removed for nameples. The error seems to be gone.
Lua Code:
function oUF:SpawnNamePlate(unit, overrideName, nameplate)
argcheck(unit, 2, 'string')
if(not style) then return error("Unable to create frame. No styles have been registered.") end
unit = unit:lower()
local name = overrideName or generateName(unit)
local object = CreateFrame("Button", name, nameplate)
Private.UpdateUnits(object, unit)
walkObject(object, unit)
object:SetAttribute("unit", unit)
return object
end
This is all I have for nameplate_added and nameplate_removed atm. Works fine.
Lua Code:
-----------------------------
-- Unit Frame Mixin
-----------------------------
function UFM:UnitAdded(nameplate,unit)
self:SetAttribute("unit", unit)
self:UpdateAllElements("NAME_PLATE_UNIT_ADDED")
end
function UFM:PlayerTargetChanged(nameplate,unit)
self:UpdateAllElements("PLAYER_TARGET_CHANGED")
end
function UFM:UnitRemoved(nameplate,unit)
self:SetAttribute("unit", nil)
self:UpdateAllElements("NAME_PLATE_UNIT_REMOVED")
end