Add items to menubar and handling selection
Bit weird of a topic cause i didn't know how to word it in short.
Anyways. The following problem. We all know the menubars ingame. For example the one above the screen with skills, character, mail, and so forth. But also the one to the right when you open your map, where you can select quests, zones, icons, and so on. I added a menubar button item to the right pane when you are in map mode. The button itself works correctly. Meaning it highlight when selected and unhighlights when another button in the menubar is selected. What i expected when adding the button is that when you select quests, you get also the quest overview. When you select zones, you get the zone overview. When you select my button, you get nothing (cause i did not define anything). However it stays on the last selection. The button when defined has a callbackhandler, but that only fires when selected. The buttons should behave in a way similar to a radiogroup control. What i couldn't find and looking for is : How does the right pane handle the button state changes, so that it results in new information below the menubar ? Or how in general is button state changes handled from a menubar perspective ? |
Ok, a small snippet on how the button is created and added to the right pane. Now, can anyone tell me how do i hide/show data based on enabled/disabled state of that button ? It's driving me nuts ....
Code:
local buttonData = |
It's possible the mechanism is similar to the one for showing/hiding buttons on the keybind strip. See: http://wiki.esoui.com/How_to_add_but...able.2FDisable
ETA: You'd have to find the WorldMapInfoMenuBar equivalent to KEYBIND_STRIP:UpdateKeybindButtonGroup(myButtonGroup) though. |
ZO_WorldMapInfoMenuBar is not just menu bar, but scene fragment bar (menu bar with added functionality).
To add button you need to use function: Lua Code:
So, if I update your code: Lua Code:
|
When i call ZO_WorldMapInfoMenuBar:Add(name, fragmentGroup, buttonData, keybindButton) then i get an error "function expected instead of nil.
So apparantly the ZO_WorldMapInfoMenuBar:Add is either not public or using the wrong control object to add. The MenuBarTemplate which ZO_WorldMapInfoMenuBar derives from doesn't define an :Add, so I asumming the wrong object to add. In more detail what i can find ZO_WorldMapInfoMenuBar is a virtual control that derives from ZO_MenuBarTemplate, which does not define :Add ZO_WorldMapInfo defines a control ZO_WorldMapInfoMenuBar that derives from the virtual ZO_WorldMapInfoMenuBar , which does define the :Add I am assuming the double naming is messing the stuff up, and allways returns the virtual control object |
if that is the case this should do the job of retreiving the right contol:
Lua Code:
|
Quote:
|
Quote:
Code that I have tested, so it works: Lua Code:
|
Lua Code:
ZO_CreateStringId( name, string ), which is inserted into the global namespace. And from what i saw the callback is only needed if you want to do things other than showing your fragment, the 4 other buttons don't have a callback in their buttonData. |
All times are GMT -6. The time now is 03:17 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI