From e875981a6a25c84c7b8b9eb1f98402fdfa8b787b Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Wed, 21 Sep 2016 08:51:05 -0700 Subject: [PATCH] Add tracking of tutorialComplete to tutorial --- tutorial/firePit/flicker.js | 3 ++- tutorial/tutorial.js | 25 ++++++++++++++++++++++--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/tutorial/firePit/flicker.js b/tutorial/firePit/flicker.js index 43148dabba..f4406286c4 100644 --- a/tutorial/firePit/flicker.js +++ b/tutorial/firePit/flicker.js @@ -1,3 +1,4 @@ +// Originally written for the Home content set. Pulled into the tutorial by Ryan Huffman (function() { var MINIMUM_LIGHT_INTENSITY = 50.0; @@ -48,4 +49,4 @@ return new FlickeringFlame -}); \ No newline at end of file +}); diff --git a/tutorial/tutorial.js b/tutorial/tutorial.js index 4e95bf856a..59bc88363a 100644 --- a/tutorial/tutorial.js +++ b/tutorial/tutorial.js @@ -226,6 +226,10 @@ stepDisableControllers.prototype = { })); setControllerPartLayer('touchpad', 'blank'); setControllerPartLayer('tips', 'blank'); + + hideEntitiesWithTag('finish'); + onFinish(); + onFinish(); }, cleanup: function() { @@ -929,11 +933,25 @@ stepFinish.prototype = { start: function(onFinish) { editEntitiesWithTag('door', { visible: false }); showEntitiesWithTag(this.tag); + Settings.setValue("tutorialComplete", true); + onFinish(); }, cleanup: function() { //Menu.setIsOptionChecked("Overlays", true); - hideEntitiesWithTag(this.tag); - deleteEntitiesWithTag(this.tempTag); + //hideEntitiesWithTag(this.tag); + //deleteEntitiesWithTag(this.tempTag); + } +}; + +var stepCleanupFinish = function() { + this.shouldLog = false; +} +stepCleanupFinish.prototype = { + start: function(onFinish) { + hideEntitiesWithTag('finish'); + onFinish(); + }, + cleanup: function() { } }; @@ -996,6 +1014,7 @@ TutorialManager = function() { currentStep = null; startedTutorialAt = Date.now(); STEPS = [ + //new stepCleanupFinish("finish"); new stepDisableControllers("step0"), new stepOrient("orient"), //new stepWelcome("welcome"), @@ -1011,7 +1030,7 @@ TutorialManager = function() { for (var i = 0; i < STEPS.length; ++i) { STEPS[i].cleanup(); } - location = "/tutorial_begin"; + //location = "/tutorial_begin"; //location = "/tutorial"; MyAvatar.shouldRenderLocally = false; this.startNextStep();