mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-04 07:10:24 +02:00
saving work
This commit is contained in:
parent
4393bc3c2e
commit
61912b6ff0
1 changed files with 57 additions and 0 deletions
57
scripts/system/generalSettings.js
Normal file
57
scripts/system/generalSettings.js
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
//
|
||||||
|
// generalSettings.js
|
||||||
|
// scripts/system/
|
||||||
|
//
|
||||||
|
// Created by Dante Ruiz on 9 Feb 2017
|
||||||
|
// Copyright 2016 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
/* globals Tablet, Toolbars, Script, HMD, DialogsManager */
|
||||||
|
|
||||||
|
(function() { // BEGIN LOCAL_SCOPE
|
||||||
|
|
||||||
|
var button;
|
||||||
|
var buttonName = "Settings";
|
||||||
|
var toolBar = null;
|
||||||
|
var tablet = null;
|
||||||
|
var settings = "../../windows/TabletScrollingWindow.qml"
|
||||||
|
function onClicked(){
|
||||||
|
if (tablet) {
|
||||||
|
tablet.loadQMLSource(settings);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Settings.getValue("HUDUIEnabled")) {
|
||||||
|
toolBar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system");
|
||||||
|
button = toolBar.addButton({
|
||||||
|
objectName: buttonName,
|
||||||
|
imageURL: Script.resolvePath("assets/images/tools/directory.svg"),
|
||||||
|
visible: true,
|
||||||
|
alpha: 0.9
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||||
|
button = tablet.addButton({
|
||||||
|
icon: "icons/tablet-icons/goto-i.svg",
|
||||||
|
text: buttonName,
|
||||||
|
sortOrder: 8
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
button.clicked.connect(onClicked);
|
||||||
|
|
||||||
|
Script.scriptEnding.connect(function () {
|
||||||
|
button.clicked.disconnect(onClicked);
|
||||||
|
if (tablet) {
|
||||||
|
tablet.removeButton(button);
|
||||||
|
}
|
||||||
|
if (toolBar) {
|
||||||
|
toolBar.removeButton(buttonName);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}()); // END LOCAL_SCOPE
|
Loading…
Reference in a new issue