]> _ Git - Animations.git/commitdiff
wip #5228 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 10 May 2022 14:41:30 +0000 (16:41 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 10 May 2022 14:41:30 +0000 (16:41 +0200)
PPD/Map2/Map2.zip
PPD/Map2/map2.js

index 9343b948093ffc1472dd6d9655636aa38cd43429..d16bafd8955af5e43ddc6e977724473b70413bb4 100644 (file)
Binary files a/PPD/Map2/Map2.zip and b/PPD/Map2/Map2.zip differ
index 3582b9468acf274ae63fbc48955a9ae90b1eaebe..62d406a2e25d96be581b7329fb80a9b2933b8721 100644 (file)
@@ -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);
 }