Update mainmenu.py

This commit is contained in:
Vishal 2023-12-18 14:43:51 +05:30 committed by GitHub
parent d94e88803a
commit e0180666eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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