mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-10 18:03:47 +00:00
refract: secondary timer
small fixes on how the timer is calculated
This commit is contained in:
@@ -242,10 +242,6 @@ export class EventTimer extends Timer {
|
||||
} else {
|
||||
// look for event if none is loaded
|
||||
if (this.current <= 0 || this.secondaryTimer <= 0) this.rollLoad();
|
||||
|
||||
// count to next event
|
||||
// TODO: replace with proper counter
|
||||
if (this.secondaryTimer != null) this.secondaryTimer -= 1000;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -946,8 +942,12 @@ export class EventTimer extends Timer {
|
||||
|
||||
rollLoad() {
|
||||
const now = this._getCurrentTime();
|
||||
this._resetTimers(true);
|
||||
this._resetSelection();
|
||||
|
||||
// maybe roll has already been loaded
|
||||
if (this.secondaryTimer == null) {
|
||||
this._resetTimers(true);
|
||||
this._resetSelection();
|
||||
}
|
||||
|
||||
let foundNow = null;
|
||||
let nextIndex = null;
|
||||
@@ -990,6 +990,7 @@ export class EventTimer extends Timer {
|
||||
// nothing to play next, unload
|
||||
if (foundNow == null && nextIndex == null) {
|
||||
this.unload();
|
||||
console.log('Roll: no events found');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -998,6 +999,8 @@ export class EventTimer extends Timer {
|
||||
this._loadThisTitles(nextIndex, 'next');
|
||||
|
||||
if (foundNow == null) {
|
||||
if (this.secondaryTimer == null)
|
||||
console.log('Roll: waiting for event start');
|
||||
// timer counts to nextStart
|
||||
this.secondaryTimer = nextStart;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user