overte/scripts/system/quickGoto.js
2019-02-06 11:37:52 -08:00

36 lines
1 KiB
JavaScript

"use strict";
//
// quickGoto.js
// scripts/system/
//
// Created by Dante Ruiz
// 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
function addGotoButton(destination) {
tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
button = tablet.addButton({
icon: "icons/tablet-icons/goto-i.svg",
activeIcon: "icons/tablet-icons/goto-a.svg",
text: destination
});
var buttonDestination = destination;
button.clicked.connect(function() {
Window.location = "hifi://" + buttonDestination;
});
Script.scriptEnding.connect(function () {
tablet.removeButton(button);
});
}
addGotoButton("dev-mobile");
addGotoButton("quest-dev");
}()); // END LOCAL_SCOPE