Thread Tools Display Modes
02-29-16, 06:41 PM   #1
MunkDev
A Scalebane Royal Guard
 
MunkDev's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 431
Cycling nameplates

This is something really simple that I think should be part of the base UI, but instead, we have 3 bindings pertaining to nameplates that I think could be turned into one. Or at least be added as an extra binding. Just thought I'd share it in case anyone wanted to turn it into an addon or include it in their UI compilations or w/e.

This works in combat unlike the /run macros that are passed around as an answer to this fairly common question.

Lua Code:
  1. local PlateCycle = CreateFrame("Button", "NameplateCycle", nil, "SecureActionButtonTemplate, SecureHandlerBaseTemplate")
  2.  
  3. PlateCycle:SetAttribute("type", "macro")
  4.  
  5. PlateCycle:Execute([[
  6.     Scripts = newtable()
  7.  
  8.     Scripts[1] = "/click InterfaceOptionsNamesPanelUnitNameplatesEnemies"
  9.     Scripts[2] = "/click InterfaceOptionsNamesPanelUnitNameplatesFriends"
  10. ]])
  11.  
  12. PlateCycle:WrapScript(PlateCycle, "PreClick", [[
  13.     Index = Index == 1 and 2 or 1
  14.     self:SetAttribute("macrotext", Scripts[Index])
  15. ]])

Lua Code:
  1. /click NameplateCycle

Code:
<Binding name="CLICK NameplateCycle:LeftButton" category="Your addon" />
__________________

Last edited by MunkDev : 02-29-16 at 07:02 PM.
  Reply With Quote
03-01-16, 07:03 PM   #2
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,359
The implementation (and the need for such a one) might be new, but that's actually one of the oldest ideas/addons for WoW since Classic era.

http://www.wowinterface.com/download...NameCycle.html
  Reply With Quote
03-02-16, 08:34 AM   #3
MunkDev
A Scalebane Royal Guard
 
MunkDev's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 431
That addon seems to cycle name visibility, as in the text above players' heads. Not nameplates.
Nameplates are the "clickable" health bars. They can't be messed with in combat from insecure code.
__________________

Last edited by MunkDev : 03-02-16 at 08:36 AM.
  Reply With Quote
03-02-16, 10:16 AM   #4
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,359
Originally Posted by MunkDev View Post
That addon seems to cycle name visibility, as in the text above players' heads. Not nameplates.
Nameplates are the "clickable" health bars. They can't be messed with in combat from insecure code.
You are correct, I have my addons mixed up, however protected nameplates are a relatively "recent" change (3.x something?)

There were several addons that did auto-combat show/hide nameplates (the actual nameplates not the names) and cycle but my memory failed me as to the names.
ShowNameplates() ShowFriendNameplates() and their Hide* counterparts from end of vanilla to some time in WotLK were part of the API and unprotected)
Then they were moved to CVars and eventually protected *.

*Useless history
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Cycling nameplates

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