assets/scripts.js: Show choices on game-over screens, too

This commit is contained in:
Vladimir Panteleev 2019-07-28 03:58:26 +00:00
parent ab29b0e5c8
commit 783db22881

View file

@ -187,8 +187,7 @@ function addChoices(r) {
function momentStart(m, seeked) { function momentStart(m, seeked) {
console.log('momentStart', m, seeked); console.log('momentStart', m, seeked);
if (m.type == 'scene:cs_bs') { if (m.choices) {
addZones(currentSegment);
addChoices(m); addChoices(m);
} }
if (!seeked) if (!seeked)
@ -197,7 +196,7 @@ function momentStart(m, seeked) {
function momentUpdate(m, ms) { function momentUpdate(m, ms) {
//console.log('momentUpdate', m); //console.log('momentUpdate', m);
if (m.type == 'scene:cs_bs') { if (m.choices) {
var p = 100 - Math.floor((ms - m.startMs) * 100 / (m.endMs - m.startMs)); var p = 100 - Math.floor((ms - m.startMs) * 100 / (m.endMs - m.startMs));
document.getElementById("progress").style.width = p + '%'; document.getElementById("progress").style.width = p + '%';
} }
@ -205,9 +204,7 @@ function momentUpdate(m, ms) {
function momentEnd(m, seeked) { function momentEnd(m, seeked) {
console.log('momentEnd', m, seeked); console.log('momentEnd', m, seeked);
if (m.type == 'scene:cs_bs') { if (m.choices) {
setNextSegment(null);
addZones(currentSegment);
addChoices(0); addChoices(0);
document.getElementById("progress").style.width = 0; document.getElementById("progress").style.width = 0;
} }