diff --git a/assets/src/ba_data/python/ba/_app.py b/assets/src/ba_data/python/ba/_app.py index 9232a9ee..abe571f2 100644 --- a/assets/src/ba_data/python/ba/_app.py +++ b/assets/src/ba_data/python/ba/_app.py @@ -661,13 +661,16 @@ class App: # FIXME: This should not be an actor attr. activity.paused_text = None - def return_to_main_menu_session_gracefully(self) -> None: + def return_to_main_menu_session_gracefully(self, + reset_ui: bool = True) -> None: """Attempt to cleanly get back to the main menu.""" # pylint: disable=cyclic-import from ba import _benchmark from ba._general import Call from bastd.mainmenu import MainMenuSession - _ba.app.main_window = None + if reset_ui: + _ba.app.main_window = None + if isinstance(_ba.get_foreground_host_session(), MainMenuSession): # It may be possible we're on the main menu but the screen is faded # so fade back in. diff --git a/assets/src/ba_data/python/bastd/ui/mainmenu.py b/assets/src/ba_data/python/bastd/ui/mainmenu.py index 113f86b7..95a3135c 100644 --- a/assets/src/ba_data/python/bastd/ui/mainmenu.py +++ b/assets/src/ba_data/python/bastd/ui/mainmenu.py @@ -874,7 +874,7 @@ class MainMenuWindow(ba.Window): if not self._root_widget: return ba.containerwidget(edit=self._root_widget, transition='out_left') - ba.app.return_to_main_menu_session_gracefully() + ba.app.return_to_main_menu_session_gracefully(reset_ui=False) def _leave(self) -> None: if self._input_player: diff --git a/docs/ba_module.md b/docs/ba_module.md index ea3a1495..0f85eb2b 100644 --- a/docs/ba_module.md +++ b/docs/ba_module.md @@ -1,5 +1,5 @@ -
This page documents the Python classes and functions in the 'ba' module, which are the ones most relevant to modding in Ballistica. If you come across something you feel should be included here or could be better explained, please let me know. Happy modding!
return_to_main_menu_session_gracefully(self) -> None
+return_to_main_menu_session_gracefully(self, reset_ui: bool = True) -> None
Attempt to cleanly get back to the main menu.