View Feature Request
Add main menu button to open "Superstar" from the menu line at the top of the screen
Feature #: 671
File: SuperStar - Character Builder
Date: 07/14/15 10:21 AM
By: Baertram
Status: Under Review
Hey Ayantir,

I'm running out of keybindings. And this is why I'd like you to add a button to the main menu bar to open superstar.
You can use the library LibMainMenu-2.0 to add a button, like FCOItemSaver, Votan Settings Menu, Potion Maker and other already use it.

Example:

Somwhere at the start of your addon
Lua Code:
  1. --Create the libMainMenu 2.0 object
  2. local  LMM2 = LibStub("LibMainMenu-2.0")
  3. LMM2:Init()

Somewhere in your addon's setings (if LAM 2.0 is used e.g.) or at a callback function for a chat slash command:
Lua Code:
  1. local descriptor    = "Your addon name"
  2.             local callbackFnc   = function(buttonData)
  3.                 --What should happen if you press the button? Example: Show/Hide SuperStar window
  4.             end
  5.  
  6.             -- Add to main menu
  7.             local categoryLayoutInfo =
  8.             {
  9.                 --Binding must be registered like normal with function ZO_CreateStringId("SI_BINDING_NAME_YOURADDON_MAIN_MENU_BUTTON", "Hide/Show Superstar")
  10.                 binding = "YOURADDON_MAIN_MENU_BUTTON",
  11.                 categoryName = SI_BINDING_NAME_YOURADDON_MAIN_MENU_BUTTON,
  12.                 callback = callbackFnc,
  13.                 visible = function(buttonData)
  14.                     --Assumed that a setting is handling the visibility of the button at the main menu
  15.                     retun settings.showMainMenuButton
  16.                 end,
  17.                 --Specify your used graphics for the button here
  18.                 normal    = "esoui/art/..._up.dds",
  19.                 pressed   = "esoui/art/..._down.dds",
  20.                 highlight = "esoui/art/..._over.dds",
  21.                 disabled  = "esoui/art/..._disabled.dds",
  22.             }
  23.             LMM2:AddMenuItem(descriptor, categoryLayoutInfo)