Update tutorial to disable away.js right away

This commit is contained in:
Ryan Huffman 2016-10-17 16:26:20 -07:00
parent 0234747ec3
commit b9bc9bb802
2 changed files with 14 additions and 4 deletions

View file

@ -185,3 +185,5 @@ OwnershipToken.prototype = {
Script.setTimeout(checkOwnershipRequest.bind(this), 2000);
},
};
debug("Returning from ownershipToken");

View file

@ -27,10 +27,14 @@ if (!Function.prototype.bind) {
}
(function() {
var ownershipTokenPath = Script.resolvePath("ownershipToken.js");
var tutorialPath = Script.resolvePath("tutorial.js");
Script.include(ownershipTokenPath);
Script.include(tutorialPath);
Script.include("ownershipToken.js");
Script.include("tutorial.js");
var CHANNEL_AWAY_ENABLE = "Hifi-Away-Enable";
function setAwayEnabled(value) {
var message = value ? 'enable' : 'disable';
Messages.sendLocalMessage(CHANNEL_AWAY_ENABLE, message);
}
var TutorialZone = function() {
print("TutorialZone | Creating");
@ -65,7 +69,9 @@ if (!Function.prototype.bind) {
if (!this.token) {
print("TutorialZone | Creating token");
// The start zone has been entered, hide the overlays immediately
setAwayEnabled(false);
Menu.setIsOptionChecked("Overlays", false);
MyAvatar.shouldRenderLocally = false;
this.token = new OwnershipToken(Math.random() * 100000, this.entityID, {
onGainedOwnership: function(token) {
print("TutorialZone | GOT OWNERSHIP");
@ -100,6 +106,8 @@ if (!Function.prototype.bind) {
// re-enable the HUD/Overlays
if (!self.tutorialManager) {
Menu.setIsOptionChecked("Overlays", true);
MyAvatar.shouldRenderLocally = true;
setAwayEnabled(true);
}
},