mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-02-06 23:59:18 +08:00
End Test Text instead of End Game for Stress Tests
This commit is contained in:
parent
7abe73b1dc
commit
7e56e94299
@ -60,7 +60,7 @@ def run_stress_test(playlist_type: str = 'Random',
|
|||||||
from ba._generated.enums import TimeType
|
from ba._generated.enums import TimeType
|
||||||
_ba.screenmessage(
|
_ba.screenmessage(
|
||||||
'Beginning stress test.. use '
|
'Beginning stress test.. use '
|
||||||
"'End Game' to stop testing.",
|
"'End Test' to stop testing.",
|
||||||
color=(1, 1, 0))
|
color=(1, 1, 0))
|
||||||
with _ba.Context('ui'):
|
with _ba.Context('ui'):
|
||||||
start_stress_test({
|
start_stress_test({
|
||||||
@ -138,7 +138,8 @@ def _reset_stress_test(args: dict[str, Any]) -> None:
|
|||||||
|
|
||||||
def run_gpu_benchmark() -> None:
|
def run_gpu_benchmark() -> None:
|
||||||
"""Kick off a benchmark to test gpu speeds."""
|
"""Kick off a benchmark to test gpu speeds."""
|
||||||
_ba.screenmessage('FIXME: Not wired up yet.', color=(1, 0, 0))
|
# FIXME: Not wired up yet.
|
||||||
|
_ba.screenmessage('Not wired up yet.', color=(1, 0, 0))
|
||||||
|
|
||||||
|
|
||||||
def run_media_reload_benchmark() -> None:
|
def run_media_reload_benchmark() -> None:
|
||||||
|
|||||||
@ -552,7 +552,7 @@ class AccountSettingsWindow(ba.Window):
|
|||||||
position=((self._sub_width - button_width) * 0.5, v + 30),
|
position=((self._sub_width - button_width) * 0.5, v + 30),
|
||||||
autoselect=True,
|
autoselect=True,
|
||||||
size=(button_width, 60),
|
size=(button_width, 60),
|
||||||
label=ba.Lstr(resource=self._r + '.manageAccount'),
|
label=ba.Lstr(resource=self._r + '.manageAccountText'),
|
||||||
color=(0.55, 0.5, 0.6),
|
color=(0.55, 0.5, 0.6),
|
||||||
icon=ba.gettexture('settingsIcon'),
|
icon=ba.gettexture('settingsIcon'),
|
||||||
textcolor=(0.75, 0.7, 0.8),
|
textcolor=(0.75, 0.7, 0.8),
|
||||||
|
|||||||
@ -250,8 +250,12 @@ class MainMenuWindow(ba.Window):
|
|||||||
scale=scale,
|
scale=scale,
|
||||||
size=(self._button_width, self._button_height),
|
size=(self._button_width, self._button_height),
|
||||||
autoselect=self._use_autoselect,
|
autoselect=self._use_autoselect,
|
||||||
label=ba.Lstr(resource=self._r + '.endGameText'),
|
label=ba.Lstr(resource=self._r +
|
||||||
on_activate_call=self._confirm_end_game)
|
('.endTestText' if self._is_benchmark()
|
||||||
|
else '.endGameText')),
|
||||||
|
on_activate_call=(self._confirm_end_test
|
||||||
|
if self._is_benchmark()
|
||||||
|
else self._confirm_end_game))
|
||||||
# Assume we're in a client-session.
|
# Assume we're in a client-session.
|
||||||
else:
|
else:
|
||||||
ba.buttonwidget(
|
ba.buttonwidget(
|
||||||
@ -863,6 +867,11 @@ class MainMenuWindow(ba.Window):
|
|||||||
StoreBrowserWindow(
|
StoreBrowserWindow(
|
||||||
origin_widget=self._store_button).get_root_widget())
|
origin_widget=self._store_button).get_root_widget())
|
||||||
|
|
||||||
|
def _is_benchmark(self) -> bool:
|
||||||
|
session = ba.internal.get_foreground_host_session()
|
||||||
|
return (getattr(session, 'benchmark_type', None) == 'cpu'
|
||||||
|
or ba.app.stress_test_reset_timer is not None)
|
||||||
|
|
||||||
def _confirm_end_game(self) -> None:
|
def _confirm_end_game(self) -> None:
|
||||||
# pylint: disable=cyclic-import
|
# pylint: disable=cyclic-import
|
||||||
from bastd.ui.confirm import ConfirmWindow
|
from bastd.ui.confirm import ConfirmWindow
|
||||||
@ -874,6 +883,16 @@ class MainMenuWindow(ba.Window):
|
|||||||
self._end_game,
|
self._end_game,
|
||||||
cancel_is_selected=True)
|
cancel_is_selected=True)
|
||||||
|
|
||||||
|
def _confirm_end_test(self) -> None:
|
||||||
|
# pylint: disable=cyclic-import
|
||||||
|
from bastd.ui.confirm import ConfirmWindow
|
||||||
|
|
||||||
|
# Select cancel by default; this occasionally gets called by accident
|
||||||
|
# in a fit of button mashing and this will help reduce damage.
|
||||||
|
ConfirmWindow(ba.Lstr(resource=self._r + '.exitToMenuText'),
|
||||||
|
self._end_game,
|
||||||
|
cancel_is_selected=True)
|
||||||
|
|
||||||
def _confirm_end_replay(self) -> None:
|
def _confirm_end_replay(self) -> None:
|
||||||
# pylint: disable=cyclic-import
|
# pylint: disable=cyclic-import
|
||||||
from bastd.ui.confirm import ConfirmWindow
|
from bastd.ui.confirm import ConfirmWindow
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user