View Single Post
07/06/20, 04:14 AM   #4
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
Changing the tab buttons is done via applying the "descriptor" (structure containing all relevant data of the tab button) to the ZO_MenuBar tab.
There exists a function which does this and then changes the tab for you, let me search it.

https://github.com/esoui/esoui/blob/...zo_menubar.lua

Get descriptor for a tab button:
ZO_MenuBar_GetSelectedDescriptor(buttonControl)

Set descriptor to change to a tab button:
ZO_MenuBar_SelectDescriptor(self, descriptor, skipAnimation, reselectIfSelected)


Here it is used in the provisioner part:
https://github.com/esoui/esoui/blob/...ioner.lua#L160

So it should be something like this:
Lua Code:
  1. ZO_MenuBar_SelectDescriptor(PROVISIONER.tabs, PROVISIONER.tabs[1].descriptor)
Where tabs[1] will be the first button and tabs[2] the second.
If you know the exact descriptor name you can even use this instead.

They are defined here in the provsioner crafting:
https://github.com/esoui/esoui/blob/...ioner.lua#L123

So it's a filtertype for the buttons.
And these are defined at this line and below:
https://github.com/esoui/esoui/blob/...ioner.lua#L133

So it's one of these:
Code:
PROVISIONER_SPECIAL_INGREDIENT_TYPE_SPICES
PROVISIONER_SPECIAL_INGREDIENT_TYPE_FLAVORING
PROVISIONER_SPECIAL_INGREDIENT_TYPE_FURNISHING
So just use these as the "descriptor" directly e.g.
Lua Code:
  1. ZO_MenuBar_SelectDescriptor(PROVISIONER.tabs, PROVISIONER_SPECIAL_INGREDIENT_TYPE_FURNISHING)

Last edited by Baertram : 07/06/20 at 04:22 AM.
  Reply With Quote