mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-31 20:09:11 +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 {
|
} else {
|
||||||
// look for event if none is loaded
|
// look for event if none is loaded
|
||||||
if (this.current <= 0 || this.secondaryTimer <= 0) this.rollLoad();
|
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() {
|
rollLoad() {
|
||||||
const now = this._getCurrentTime();
|
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 foundNow = null;
|
||||||
let nextIndex = null;
|
let nextIndex = null;
|
||||||
@@ -990,6 +990,7 @@ export class EventTimer extends Timer {
|
|||||||
// nothing to play next, unload
|
// nothing to play next, unload
|
||||||
if (foundNow == null && nextIndex == null) {
|
if (foundNow == null && nextIndex == null) {
|
||||||
this.unload();
|
this.unload();
|
||||||
|
console.log('Roll: no events found');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -998,6 +999,8 @@ export class EventTimer extends Timer {
|
|||||||
this._loadThisTitles(nextIndex, 'next');
|
this._loadThisTitles(nextIndex, 'next');
|
||||||
|
|
||||||
if (foundNow == null) {
|
if (foundNow == null) {
|
||||||
|
if (this.secondaryTimer == null)
|
||||||
|
console.log('Roll: waiting for event start');
|
||||||
// timer counts to nextStart
|
// timer counts to nextStart
|
||||||
this.secondaryTimer = nextStart;
|
this.secondaryTimer = nextStart;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user