From a0d2ac5df9d82cee496ff02b070ebc6f5f64769d Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak <dos@dosowisko.net> Date: Sun, 10 Sep 2023 18:06:02 +0200 Subject: [PATCH] Bring back exit to main view --- song.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/song.py b/song.py index 7c1186b..6d039a3 100644 --- a/song.py +++ b/song.py @@ -222,6 +222,11 @@ class SongView(BaseView): media.think(delta_ms) + if self.input.buttons.os.middle.pressed and not self.vm.is_active(self.app): + self.vm.push(self) + self.vm.pop(ViewTransitionSwipeRight(), depth=2) + return + if not self.vm.is_active(self): return @@ -264,11 +269,6 @@ class SongView(BaseView): if self.input.buttons.app.right.pressed: self.debug = not self.debug - - #if self.input.buttons.os.middle.pressed: - # self.vm.push(self) - # self.vm.pop(ViewTransitionSwipeRight(), depth=2) - # return self.good = max(0, self.good - delta_ms / self.data.period) self.bad = max(0, self.bad - delta_ms / 500) @@ -343,9 +343,8 @@ class SongView(BaseView): def on_enter(self, vm: Optional[ViewManager]) -> None: super().on_enter(vm) self.first_think = True - #if self.vm.direction == ViewTransitionDirection.FORWARD: # self-pushed - # print("SELF_PUSHED") - # return + if self.vm.direction == ViewTransitionDirection.FORWARD: # self-pushed + return if self.app: media.load(self.app.path + '/sounds/start.mp3') self.app.blm.volume = 10000 -- GitLab