Quantcast Moving ClassNameplate - WoWInterface
 
Thread Tools Display Modes
06-14-16, 06:07 AM   #1
liquidbase
A Black Drake
 
liquidbase's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2010
Posts: 82
Moving ClassNameplate

Hello everyone!

At the moment I try to move the new class nameplate (health, power & ressources) coming with Legion. My problem is that I have not yet found approach, how I can move the whole unit or assign a fixed position.
Don't get me wrong, the new nameplates are perfect. However, players display moves, depending on the camera position in impossible places, which follow the display can be more complex than useful.

If someone had a starting for me, with whom I could start working, I would be pleased to hear about this.

Thanks in advance for alle help

greetz
liquid
 
06-14-16, 10:54 PM   #2
siweia
A Flamescale Wyrmkin
 
siweia's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2011
Posts: 114
NamePlatePlayerResourceFrame:ClearAllPoints();
NamePlatePlayerResourceFrame:SetPoint("CENTER", UIParent, 0, 0)
NamePlatePlayerResourceFrame.SetPoint=function() return end
Something like this?
 
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,739
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) | TDMOG

"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.
 
06-16-16, 11:02 AM   #4
liquidbase
A Black Drake
 
liquidbase's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2010
Posts: 82
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.
 
06-17-16, 05:15 AM   #5
liquidbase
A Black Drake
 
liquidbase's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2010
Posts: 82
Tested the function with some changes and a problem occur. The entire nameplate-script is here (@line 286 & @line 317). Changes I had made are:
  • removed the if-statements
  • removed local for nameplate
Positions are printed as should but the repostioning infight seems like is protected for the class-nameplate.

outfight with target:
Code:
NamePlate1 NamePlate1UnitFrame
CENTER table: 0000018DD96EB610 CENTER 0 0
infight with target:
Code:
NamePlate2 NamePlate2UnitFrame
Interface action failed because of an AddOn
Error message:
Code:
1x [ADDON_ACTION_BLOCKED] AddOn 'DuffedUI' tried to call the protected function 'NamePlate2:ClearAllPoints()'.
!BugGrabber\BugGrabber.lua:573: in function <!BugGrabber\BugGrabber.lua:573>
[C]: in function `ClearAllPoints'
...ceDuffedUI\modules\nameplates\nameplates.lua:291: in function <...ceDuffedUI\modules\nameplates\nameplates.lua:286>
[C]: ?
[C]: ?
[C]: ?
[C]: ?
[C]: ?
[C]: ?
[C]: ?
[C]: ?
[C]: ?
...
[C]: ?
[C]: ?
[C]: ?
[C]: ?
[C]: in function `DefaultCompactNamePlateFrameSetupInternal'
FrameXML\CompactUnitFrame.lua:1748: in function `func'
FrameXML\CompactUnitFrame.lua:201: in function `CompactUnitFrame_SetUpFrame'
...eBlizzard_NamePlates\Blizzard_NamePlates.lua:68: in function `ApplyFrameOptions'
...eBlizzard_NamePlates\Blizzard_NamePlates.lua:57: in function `OnNamePlateAdded'
...eBlizzard_NamePlates\Blizzard_NamePlates.lua:24: in function <...eBlizzard_NamePlates\Blizzard_NamePlates.lua:18>

Locals:

Last edited by liquidbase : 06-17-16 at 05:22 AM.
 
06-19-16, 03:21 PM   #6
lieandswell
A Cyclonian
 
lieandswell's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2007
Posts: 45
Originally Posted by liquidbase View Post
...repostioning infight seems like is protected for the class-nameplate.
Yes, all NamePlate# frames are protected unit frames. I'm pretty sure, however, that the NamePlate#UnitFrame frames aren't protected. They're not clickable and are just there to show information. You should be able to use zork's code on them.
__________________
1/5 15:55:46.001 UNIT_DIED, 0x0000000000000000, nil, 0x80000000, 0xF130001942161FB7, "Gamon", 0xa28
 
06-20-16, 01:02 AM   #7
liquidbase
A Black Drake
 
liquidbase's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2010
Posts: 82
Originally Posted by lieandswell View Post
Yes, all NamePlate# frames are protected unit frames. I'm pretty sure, however, that the NamePlate#UnitFrame frames aren't protected. They're not clickable and are just there to show information. You should be able to use zork's code on them.
That is the problem. I use the code from zork and here I got the posted error.

Code:
if not UnitIsUnit(frame.displayedUnit, "player") then return end
produces on login, reload, combat start or visible / present nameplates a error. Same issue happens if I adjust the code for my nameplate-script. Outside of combat the positioning works very well, but infight ...
That's the reason why I mentioned that repositing is protected infight. Infight the class nameplate moves with the cameraposition and do no stay at my prevered position (bottom, 0, 370).

Last edited by liquidbase : 06-20-16 at 01:08 AM.
 
06-20-16, 07:11 AM   #8
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,739
The code above was a drycode to give you an idea.
If you have troubles applying the setpoint to the nameplate parent try to apply it to the frame instead. It is possible that you may not succeed if all the frames are protected.
__________________
| 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)
 
06-20-16, 10:15 AM   #9
liquidbase
A Black Drake
 
liquidbase's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2010
Posts: 82
I know that it was a dry code with pretty good functionalty. At the moment I work on it, to find a solution.
Problem is here I can only add textures or colors to the frame, but moving cause a taint for health or energy bar (not tried with resources).
 
06-20-16, 11:06 AM   #10
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,059
Wouldn't it be simpler to just create your own frame and inherit the same template?
 
06-20-16, 03:37 PM   #11
liquidbase
A Black Drake
 
liquidbase's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2010
Posts: 82
Originally Posted by semlar View Post
Wouldn't it be simpler to just create your own frame and inherit the same template?
That is the current situation on the live servers, but I want to remove the current resource bars and the use of Blizzard and adjust accordingly to the layout of the interface.
However, if it turns out that you can not edit the Class Name Plates I will probably stay with the current model.
 
 

WoWInterface » Site Forums » Archived Beta Forums » Legion Beta archived threads » Moving ClassNameplate

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off