From: Vincent Vanwaelscappel Date: Tue, 10 May 2022 14:41:30 +0000 (+0200) Subject: wip #5228 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=2d4fb248814ada9b4eb6c6ce98c0097da47bbe80;p=Animations.git wip #5228 @1 --- diff --git a/PPD/Map2/Map2.zip b/PPD/Map2/Map2.zip index 9343b94..d16bafd 100644 Binary files a/PPD/Map2/Map2.zip and b/PPD/Map2/Map2.zip differ diff --git a/PPD/Map2/map2.js b/PPD/Map2/map2.js index 3582b94..62d406a 100644 --- a/PPD/Map2/map2.js +++ b/PPD/Map2/map2.js @@ -9,6 +9,8 @@ var NB_STEPS = 25; var currentFlashing = 1; var completedSteps = []; var completedPart1 = false; +var lastPassedStep = 0; + var STEPS = { 1: {"layers": [], 'e': 's1'}, @@ -75,7 +77,8 @@ $(function () { try { currentFlashing = parseInt(fluidbook.cache.get('map2_current_flashing', 1).toString()); completedSteps = fluidbook.cache.get('map2_completed_steps', []).sort(); - if (completedSteps.length === NB_STEPS) { + lastPassedStep = fluidbook.cache.get('map2_last_passed_step', 0); + if (lastPassedStep == 26) { _end(); } else if (congratSteps.diff(completedSteps).length === 0) { completedPart1 = true; @@ -127,11 +130,12 @@ function setStep(s) { try { fluidbook.cache.set('map2_completed_steps', completedSteps); + fluidbook.cache.set('map2_last_passed_step', s); } catch (e) { console.log(e); } if (completedSteps.length === NB_STEPS) { - end(s); + } else if (congratSteps.diff(completedSteps).length === 0) { congratulations(s); } @@ -153,18 +157,19 @@ function setStep(s) { } function end(s) { - if (!isPopupStep(s)) { - return _end(); - } else { - pJquery(fluidbook).one('fluidbook.view.close.all', function () { - _end(); - }); - } + } function _end() { setTimeout(function () { - fluidbook.links.triggerLinkById('m2end'); + try { + if (fluidbook.cache.get('map2_end_seen', 0) == 0) { + fluidbook.cache.set('map2_end_seen', 1); + fluidbook.links.triggerLinkById('m2end'); + } + } catch (e) { + + } }, 1000); }