mirror of
https://github.com/mehotkhan/BandersnatchInteractive.git
synced 2025-07-28 01:33:23 +00:00
assets/scripts.js: Tweak precondition debug log
This commit is contained in:
parent
3fbed6886b
commit
4260f0ccf4
1 changed files with 4 additions and 3 deletions
|
@ -43,7 +43,7 @@ function evalPrecondition(precondition, text) {
|
||||||
if (precondition) {
|
if (precondition) {
|
||||||
let cond = preconditionToJS(precondition);
|
let cond = preconditionToJS(precondition);
|
||||||
let match = eval(cond);
|
let match = eval(cond);
|
||||||
console.log(text, ':', cond, '==', match);
|
console.log('precondition', text, ':', cond, '==', match);
|
||||||
return match;
|
return match;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,8 +99,9 @@ function getMoments(segmentId, ms) {
|
||||||
let moments = momentsBySegment[segmentId] || [];
|
let moments = momentsBySegment[segmentId] || [];
|
||||||
for (let i = 0; i < moments.length; i++) {
|
for (let i = 0; i < moments.length; i++) {
|
||||||
let m = moments[i];
|
let m = moments[i];
|
||||||
if (ms >= m.startMs && ms < m.endMs && evalPrecondition(m.precondition)) {
|
let momentId = segmentId + '/' + i;
|
||||||
result[segmentId + '/' + i] = m;
|
if (ms >= m.startMs && ms < m.endMs && evalPrecondition(m.precondition, 'moment ' + momentId)) {
|
||||||
|
result[momentId] = m;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue