api util setMainTab ignores command when in layout only mode

This commit is contained in:
garak 2023-02-22 15:51:16 -05:00
parent f485ebdd3e
commit 2d2b7f723b

View file

@ -144,6 +144,9 @@ void ScriptUtility::setMainTab(int index) {
// Can't select Wild Encounters tab if it's disabled // Can't select Wild Encounters tab if it's disabled
if (index == 4 && !userConfig.getEncounterJsonActive()) if (index == 4 && !userConfig.getEncounterJsonActive())
return; return;
// don't change tab when not editing a map
if (!window->editor || !window->editor->map)
return;
window->on_mainTabBar_tabBarClicked(index); window->on_mainTabBar_tabBarClicked(index);
} }