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:
7
gig.py
7
gig.py
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user