Add tab enums

This commit is contained in:
GriffinR
2024-07-03 13:41:00 -04:00
parent 6b0034e523
commit 0aa7ddf27d
4 changed files with 69 additions and 36 deletions

View File

@@ -154,7 +154,10 @@ int ScriptUtility::getMapViewTab() {
}
void ScriptUtility::setMapViewTab(int index) {
if (this->getMainTab() != 0 || !window->ui->mapViewTab || index < 0 || index >= window->ui->mapViewTab->count())
if (this->getMainTab() != MainTab::Map || !window->ui->mapViewTab || index < 0 || index >= window->ui->mapViewTab->count())
return;
// Can't select tab if it's disabled
if (!window->ui->mapViewTab->isTabEnabled(index))
return;
window->on_mapViewTab_tabBarClicked(index);
}