From e0180666eb56f12b9ba4a65d09107dd3036d4d2d Mon Sep 17 00:00:00 2001 From: Vishal Date: Mon, 18 Dec 2023 14:43:51 +0530 Subject: [PATCH] Update mainmenu.py --- .../ba_data/python/bauiv1lib/mainmenu.py | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/assets/ba_data/python/bauiv1lib/mainmenu.py b/src/assets/ba_data/python/bauiv1lib/mainmenu.py index 16f318ae..978e5046 100644 --- a/src/assets/ba_data/python/bauiv1lib/mainmenu.py +++ b/src/assets/ba_data/python/bauiv1lib/mainmenu.py @@ -511,6 +511,41 @@ class MainMenuWindow(bui.Window): size=(0, 0), scale=3.0 * t_scale, ) + btn = bui.buttonwidget( + parent=self._root_widget, + position=(h + b_buffer + 60, v - b_size - b_buffer + v_offs), + button_type='square', + size=(b_size, b_size), + label='', + autoselect=True, + on_activate_call=bui.Call(self._pause_replay), + ) + bui.textwidget( + parent=self._root_widget, + draw_controller=btn, + text='|', + position=( + (h + b_size * 0.5 + b_buffer) + 54, + v - b_size * 0.5 - b_buffer + 5 * t_scale + v_offs, + ), + h_align='center', + v_align='center', + size=(0, 0), + scale=0.7, + ) + bui.textwidget( + parent=self._root_widget, + draw_controller=btn, + text='>', + position=( + (h + b_size * 0.5 + b_buffer) + 62, + v - b_size * 0.5 - b_buffer + 5 * t_scale + v_offs, + ), + h_align='center', + v_align='center', + size=(0, 0), + scale=3.0 * t_scale, + ) def _refresh_not_in_game( self, positions: list[tuple[float, float, float]] @@ -1034,6 +1069,9 @@ class MainMenuWindow(bui.Window): ), ) + def _pause_replay(self) -> None: + bs.pause_replay() + def _quit(self) -> None: # pylint: disable=cyclic-import from bauiv1lib.confirm import QuitWindow