View Single Post
06-15-16, 12:36 AM   #3
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
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)
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

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

Last edited by zork : 06-15-16 at 07:24 AM.