WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   Cycling nameplates (https://www.wowinterface.com/forums/showthread.php?t=53164)

MunkDev 02-29-16 06:41 PM

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" />

Dridzt 03-01-16 07:03 PM

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

MunkDev 03-02-16 08:34 AM

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.

Dridzt 03-02-16 10:16 AM

Quote:

Originally Posted by MunkDev (Post 313363)
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" :p 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


All times are GMT -6. The time now is 05:03 AM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI