History

Update tutorial to disable away.js right away

Ryan Huffman committed 10 years ago

Commit b9bc9bb1 parent 02347472 files · +14 −4Browse files

Showing the changes to tutorial/tutorialZone.js (1 of 2 files). Show all

Unified · Split

tutorial/tutorialZone.js+12−4
@@ -27,10 +27,14 @@ if (!Function.prototype.bind) { · 26 unmodified lines
2727 }
2828
2929 (function() {
30− var ownershipTokenPath = Script.resolvePath("ownershipToken.js");
31− var tutorialPath = Script.resolvePath("tutorial.js");
32− Script.include(ownershipTokenPath);
33− Script.include(tutorialPath);
30+ Script.include("ownershipToken.js");
31+ Script.include("tutorial.js");
32+
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+ }
3438
3539 var TutorialZone = function() {
3640 print("TutorialZone | Creating");
@@ -65,7 +69,9 @@ if (!Function.prototype.bind) { · 28 unmodified lines
6569 if (!this.token) {
6670 print("TutorialZone | Creating token");
6771 // The start zone has been entered, hide the overlays immediately
72+ setAwayEnabled(false);
6873 Menu.setIsOptionChecked("Overlays", false);
74+ MyAvatar.shouldRenderLocally = false;
6975 this.token = new OwnershipToken(Math.random() * 100000, this.entityID, {
7076 onGainedOwnership: function(token) {
7177 print("TutorialZone | GOT OWNERSHIP");
@@ -100,6 +106,8 @@ if (!Function.prototype.bind) { · 28 unmodified lines
100106 // re-enable the HUD/Overlays
101107 if (!self.tutorialManager) {
102108 Menu.setIsOptionChecked("Overlays", true);
109+ MyAvatar.shouldRenderLocally = true;
110+ setAwayEnabled(true);
103111 }
104112 },
105113

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t