overte/scripts/system/onFirstRun.js
kasenvr 2777854e73
Update scripts/system/onFirstRun.js
Co-authored-by: David Rowe <david@ctrlaltstudio.com>
2020-10-13 15:51:52 -04:00

32 lines
869 B
JavaScript

'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;
}
}
}());