Showing the changes to tutorial/tutorialZone.js (1 of 2 files). Show all
Unified · Split
| @@ -27,10 +27,14 @@ if (!Function.prototype.bind) { · 26 unmodified lines | |||
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | (function() { | 29 | (function() { |
| 30 | var ownershipTokenPath = Script.resolvePath("ownershipToken.js"); | 30 | Script.include("ownershipToken.js"); |
| 31 | var tutorialPath = Script.resolvePath("tutorial.js"); | 31 | Script.include("tutorial.js"); |
| 32 | Script.include(ownershipTokenPath); | 32 | |
| 33 | Script.include(tutorialPath); | 33 | var CHANNEL_AWAY_ENABLE = "Hifi-Away-Enable"; |
| 34 | function setAwayEnabled(value) { | ||
| 35 | var message = value ? 'enable' : 'disable'; | ||
| 36 | Messages.sendLocalMessage(CHANNEL_AWAY_ENABLE, message); | ||
| 37 | } | ||
| 34 | 38 | ||
| 35 | var TutorialZone = function() { | 39 | var TutorialZone = function() { |
| 36 | print("TutorialZone | Creating"); | 40 | print("TutorialZone | Creating"); |
| @@ -65,7 +69,9 @@ if (!Function.prototype.bind) { · 28 unmodified lines | |||
| 65 | if (!this.token) { | 69 | if (!this.token) { |
| 66 | print("TutorialZone | Creating token"); | 70 | print("TutorialZone | Creating token"); |
| 67 | // The start zone has been entered, hide the overlays immediately | 71 | // The start zone has been entered, hide the overlays immediately |
| 72 | setAwayEnabled(false); | ||
| 68 | Menu.setIsOptionChecked("Overlays", false); | 73 | Menu.setIsOptionChecked("Overlays", false); |
| 74 | MyAvatar.shouldRenderLocally = false; | ||
| 69 | this.token = new OwnershipToken(Math.random() * 100000, this.entityID, { | 75 | this.token = new OwnershipToken(Math.random() * 100000, this.entityID, { |
| 70 | onGainedOwnership: function(token) { | 76 | onGainedOwnership: function(token) { |
| 71 | print("TutorialZone | GOT OWNERSHIP"); | 77 | print("TutorialZone | GOT OWNERSHIP"); |
| @@ -100,6 +106,8 @@ if (!Function.prototype.bind) { · 28 unmodified lines | |||
| 100 | // re-enable the HUD/Overlays | 106 | // re-enable the HUD/Overlays |
| 101 | if (!self.tutorialManager) { | 107 | if (!self.tutorialManager) { |
| 102 | Menu.setIsOptionChecked("Overlays", true); | 108 | Menu.setIsOptionChecked("Overlays", true); |
| 109 | MyAvatar.shouldRenderLocally = true; | ||
| 110 | setAwayEnabled(true); | ||
| 103 | } | 111 | } |
| 104 | }, | 112 | }, |
| 105 | 113 | ||