View Single Post
06-16-16, 11:02 AM   #4
liquidbase
A Warpwood Thunder Caller
 
liquidbase's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2010
Posts: 97
Originally Posted by zork View Post
Don't do this. Just look into the Blizzard Interface files and find the function you need to hook.

https://github.com/tomrus88/Blizzard...ard_NamePlates
https://github.com/tomrus88/Blizzard...tUnitFrame.lua

https://github.com/tomrus88/Blizzard...rame.lua#L1752

Lua Code:
  1. --SetupPlayerNamePlate
  2. local function SetupPlayerNamePlate(frame, setupOptions, frameOptions)
  3.   if not UnitIsUnit(frame.displayedUnit, "player") then return end
  4.   local parent = frame:GetParent()
  5.   local nameplate = C_NamePlate.GetNamePlateForUnit("player")
  6.   print(parent:GetName(),frame:Getname(),nameplate:GetName())
  7.   --apply setpoint to parent
  8.   print(parent:GetPoint())
  9.   parent:ClearAllPoints()
  10.   parent:SetPoint("CENTER")
  11. end
  12. hooksecurefunc("DefaultCompactNamePlateFrameSetupInternal", SetupPlayerNamePlate)
Thanks Zork!
That is was I searched for. I think I have it overseen in the Blizzardfiles.