Unschedule any remaining scheduled items when a button is pressed

This means that less confusion will reign if a button is pressed
at the wrong time, and catch-up needs to happen. Randomly switching
out lyrics/images for things scheduled from the previous tranche
just leads to chaos.
This commit is contained in:
2025-08-23 22:29:59 +01:00
parent 5a25e325f3
commit 02db65fcc8

7
gig.py
View File

@@ -70,6 +70,8 @@ class EventRunner:
elif marker != 'select':
return False
self._selected = selected
else:
self.stop(full=False)
now = time.time()
if not self._currentitem.activate(marker, now):
return False
@@ -82,8 +84,11 @@ class EventRunner:
self._next_button_is_prestart = self._currentitem.is_button_prestart(self._next_button)
return True
def stop(self):
def stop(self, full=True):
print("Unscheduling events")
pyglet.clock.unschedule(self.update)
if not full:
return
self._playing = None
self._selected = None
for event in self._active: