mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-02-08 00:30:22 +08:00
Stopping stress tests from running when you are already in a game
This commit is contained in:
parent
2e3191c76a
commit
fee6e59440
@ -366,10 +366,14 @@ class BenchmarksAndStressTestsWindow(bui.MainWindow):
|
|||||||
bui.app.classic.run_media_reload_benchmark()
|
bui.app.classic.run_media_reload_benchmark()
|
||||||
|
|
||||||
def _stress_test_pressed(self) -> None:
|
def _stress_test_pressed(self) -> None:
|
||||||
|
from bascenev1lib.mainmenu import MainMenuActivity
|
||||||
|
|
||||||
if bui.app.classic is None:
|
if bui.app.classic is None:
|
||||||
logging.warning('stress-test requires classic')
|
logging.warning('stress-test requires classic')
|
||||||
return
|
return
|
||||||
|
|
||||||
|
activity = bs.get_foreground_host_activity()
|
||||||
|
if isinstance(activity, MainMenuActivity):
|
||||||
bui.app.classic.run_stress_test(
|
bui.app.classic.run_stress_test(
|
||||||
playlist_type=self._stress_test_game_type,
|
playlist_type=self._stress_test_game_type,
|
||||||
playlist_name=cast(
|
playlist_name=cast(
|
||||||
@ -379,3 +383,5 @@ class BenchmarksAndStressTestsWindow(bui.MainWindow):
|
|||||||
round_duration=self._stress_test_round_duration,
|
round_duration=self._stress_test_round_duration,
|
||||||
)
|
)
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_right')
|
bui.containerwidget(edit=self._root_widget, transition='out_right')
|
||||||
|
else:
|
||||||
|
bui.screenmessage(bui.Lstr(value='Already present in another activity.'))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user