wired up ui

This commit is contained in:
Roman Trapeznikov 2024-01-25 23:24:37 +03:00
parent e0a44cdc2f
commit dad50e2141
No known key found for this signature in database
GPG Key ID: 7F4F4115DE048582
2 changed files with 9 additions and 2 deletions

View File

@ -20,6 +20,7 @@
languages; I feel it helps keep logic more understandable and should help us
catch problems where a base class changes or removes a method and child
classes forget to adapt to the change.
- Replays now have rewind/fast-forward buttons!! (Thanks Dliwk, vishal332008!)
### 1.7.32 (build 21741, api 8, 2023-12-20)
- Fixed a screen message that no one will ever see (Thanks vishal332008?...)

View File

@ -536,7 +536,7 @@ class MainMenuWindow(bui.Window):
size=(b_size, b_size),
label='',
autoselect=True,
on_activate_call=bui.Call(self._change_replay_speed, -1),
on_activate_call=bui.WeakCall(self._rewind_replay),
)
bui.textwidget(
parent=self._root_widget,
@ -561,7 +561,7 @@ class MainMenuWindow(bui.Window):
size=(b_size, b_size),
label='',
autoselect=True,
on_activate_call=bui.Call(bs.forward_replay),
on_activate_call=bui.WeakCall(self._forward_replay),
)
bui.textwidget(
parent=self._root_widget,
@ -577,6 +577,12 @@ class MainMenuWindow(bui.Window):
scale=2.0 * t_scale,
)
def _rewind_replay(self) -> None:
bs.seek_replay(-2 * pow(2, bs.get_replay_speed_exponent()))
def _forward_replay(self) -> None:
bs.seek_replay(2 * pow(2, bs.get_replay_speed_exponent()))
def _refresh_not_in_game(
self, positions: list[tuple[float, float, float]]
) -> tuple[float, float, float]: