zetaPRIME / sb.StardustSuite

Starbound mod suite
MIT License
36 stars 12 forks source link

metagui setVisible does not function on tabs #21

Closed WasabiRaptor closed 2 years ago

WasabiRaptor commented 2 years ago

attempting to use the :setVisible() method on a tab's ID causes a crash from indexing a nil value

WasabiRaptor commented 2 years ago

further attempts it does function if I use :newtab() on a tabfield ID to create the tab, and then use :setVisible() on the tab ID returned by that, however it still does not work if I have a tab with an ID defined in the .ui file, this requisite of the tab having to be created in script isn't mentioned in the documentation and seems like its an oversight

zetaPRIME commented 2 years ago

the tabs need to be referenced through the tabfield object (tabField.tabs.tabID); they're not placed into _ENV like widgets are

WasabiRaptor commented 2 years ago

ah, perhaps that should change the readme to actually mention this, as TabField currently has no description

Perhaps something like

Tab Field

Displays the content of the selected tab, the tabs themselves are inherently a scroll area when they would extend past the space of their layout, methods for individual tabs need either to use the ID returned by tabField:newtab() or from a predefined tab with the path tabField.tabs.tabID