Quantcast
WoWInterface - View Single Post - oUF for nameplate creation?
View Single Post
10-02-16, 04:03 PM   #5
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,739
I'm currently doing that sticklord is suggesting. Trying to create a seperate spawn function for nameplates.

Currently I get this taint:
Lua Code:
  1. 10/2 23:59:09.464  An action was blocked in combat because of taint from oUF - SecureStateDriverManager:SetAttribute()
  2. 10/2 23:59:09.464      Interface\FrameXML\SecureStateDriver.lua:42 RegisterUnitWatch()
  3. 10/2 23:59:09.464      Interface\AddOns\oUF\ouf.lua:553 SpawnNamePlate()
  4. 10/2 23:59:09.464      Interface\AddOns\oUF_Simple\core.lua:592 ?()
  5. 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:
  1. function oUF:SpawnNamePlate(unit, overrideName, nameplate)
  2.   argcheck(unit, 2, 'string')
  3.   if(not style) then return error("Unable to create frame. No styles have been registered.") end
  4.   unit = unit:lower()
  5.   local name = overrideName or generateName(unit)
  6.   local object = CreateFrame("Button", name, nameplate)
  7.   Private.UpdateUnits(object, unit)
  8.   walkObject(object, unit)
  9.   object:SetAttribute("unit", unit)
  10.   return object
  11. end

This is all I have for nameplate_added and nameplate_removed atm. Works fine.

Lua Code:
  1. -----------------------------
  2. -- Unit Frame Mixin
  3. -----------------------------
  4.  
  5. function UFM:UnitAdded(nameplate,unit)
  6.   self:SetAttribute("unit", unit)
  7.   self:UpdateAllElements("NAME_PLATE_UNIT_ADDED")
  8. end
  9.  
  10. function UFM:PlayerTargetChanged(nameplate,unit)
  11.   self:UpdateAllElements("PLAYER_TARGET_CHANGED")
  12. end
  13.  
  14. function UFM:UnitRemoved(nameplate,unit)
  15.   self:SetAttribute("unit", nil)
  16.   self:UpdateAllElements("NAME_PLATE_UNIT_REMOVED")
  17. end
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW) | TDMOG

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)

Last edited by zork : 10-02-16 at 04:14 PM.
  Reply With Quote