mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 17:54:20 +02:00
Merge pull request #805 from kasenvr/feature/onboarding-experience
First run script.
This commit is contained in:
commit
a934082bfc
2 changed files with 34 additions and 1 deletions
|
@ -35,7 +35,8 @@ var DEFAULT_SCRIPTS_COMBINED = [
|
|||
"system/audioMuteOverlay.js",
|
||||
"system/inspect.js",
|
||||
"system/keyboardShortcuts/keyboardShortcuts.js",
|
||||
"system/checkForUpdates.js"
|
||||
"system/checkForUpdates.js",
|
||||
"system/onFirstRun.js"
|
||||
];
|
||||
var DEFAULT_SCRIPTS_SEPARATE = [
|
||||
"system/controllers/controllerScripts.js",
|
||||
|
|
32
scripts/system/onFirstRun.js
Normal file
32
scripts/system/onFirstRun.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
'use strict';
|
||||
|
||||
//
|
||||
// onFirstRun.js
|
||||
//
|
||||
// Created by Kalila L. on Oct 5 2020.
|
||||
// Copyright 2020 Vircadia contributors.
|
||||
//
|
||||
// This script triggers on first run to perform bootstrapping actions.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
(function() { // BEGIN LOCAL_SCOPE
|
||||
var SETTING_TO_CHECK = 'firstRun';
|
||||
var DEFAULT_DISPLAY_NAME = '';
|
||||
|
||||
if (!Settings.getValue(SETTING_TO_CHECK, false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (MyAvatar.displayName === '') {
|
||||
var selectedDisplayName = Window.prompt('Enter a display name.', MyAvatar.displayName);
|
||||
|
||||
if (selectedDisplayName === '') {
|
||||
MyAvatar.displayName = DEFAULT_DISPLAY_NAME;
|
||||
} else {
|
||||
MyAvatar.displayName = selectedDisplayName;
|
||||
}
|
||||
}
|
||||
}());
|
Loading…
Reference in a new issue