mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-07 18:02:31 +02:00
help script
This commit is contained in:
parent
10309cc699
commit
8eb6699420
3 changed files with 153 additions and 1 deletions
|
@ -32,7 +32,8 @@ var DEFAULT_SCRIPTS = [
|
|||
"system/controllers/toggleAdvancedMovementForHandControllers.js",
|
||||
"system/dialTone.js",
|
||||
"system/firstPersonHMD.js",
|
||||
"system/snapshot.js"
|
||||
"system/snapshot.js",
|
||||
"system/help.js"
|
||||
];
|
||||
|
||||
// add a menu item for debugging
|
||||
|
|
110
scripts/system/assets/images/tools/help.svg
Normal file
110
scripts/system/assets/images/tools/help.svg
Normal file
|
@ -0,0 +1,110 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 50 200.1" style="enable-background:new 0 0 50 200.1;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#414042;}
|
||||
.st1{fill:#FFFFFF;}
|
||||
.st2{fill:#1E1E1E;}
|
||||
.st3{fill:#333333;}
|
||||
</style>
|
||||
<g id="Layer_2">
|
||||
<g>
|
||||
<g>
|
||||
<path class="st0" d="M50.1,146.1c0,2.2-1.8,4-4,4h-42c-2.2,0-4-1.8-4-4v-42c0-2.2,1.8-4,4-4h42c2.2,0,4,1.8,4,4V146.1z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<path class="st0" d="M50,196.1c0,2.2-1.8,4-4,4H4c-2.2,0-4-1.8-4-4v-42c0-2.2,1.8-4,4-4h42c2.2,0,4,1.8,4,4V196.1z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<path class="st1" d="M50,46c0,2.2-1.8,4-4,4H4c-2.2,0-4-1.8-4-4V4c0-2.2,1.8-4,4-4h42c2.2,0,4,1.8,4,4V46z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st2" d="M50,96.1c0,2.2-1.8,4-4,4H4c-2.2,0-4-1.8-4-4v-42c0-2.2,1.8-4,4-4h42c2.2,0,4,1.8,4,4V96.1z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g id="Layer_3">
|
||||
</g>
|
||||
<g>
|
||||
<path class="st1" d="M20.1,86v6.4h-1.2v-2.7H16v2.7h-1.2V86H16v2.6h2.9V86H20.1z"/>
|
||||
<path class="st1" d="M26.1,91.3v1.1h-4.4V86H26v1.1h-3.1v1.5h2.7v1h-2.7v1.7H26.1z"/>
|
||||
<path class="st1" d="M27.3,92.4V86h1.2v5.3h3.3v1.1H27.3z"/>
|
||||
<path class="st1" d="M32.8,92.4V86h2.7c0.3,0,0.6,0.1,0.8,0.2s0.5,0.3,0.6,0.5c0.2,0.2,0.3,0.4,0.4,0.7c0.1,0.3,0.2,0.5,0.2,0.8
|
||||
c0,0.3,0,0.5-0.1,0.8c-0.1,0.3-0.2,0.5-0.4,0.7c-0.2,0.2-0.4,0.4-0.6,0.5c-0.2,0.1-0.5,0.2-0.8,0.2h-1.5v2.1H32.8z M34.1,89.2h1.4
|
||||
c0.2,0,0.4-0.1,0.6-0.3c0.2-0.2,0.2-0.4,0.2-0.8c0-0.2,0-0.3-0.1-0.4c0-0.1-0.1-0.2-0.2-0.3c-0.1-0.1-0.2-0.2-0.3-0.2
|
||||
c-0.1,0-0.2-0.1-0.3-0.1h-1.4V89.2z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st1" d="M35.1,60.2c0.2,0,0.4,0.1,0.4,0.3v18.5c0,0.2-0.2,0.3-0.4,0.3H16.6c-0.2,0-0.3-0.2-0.3-0.3V60.5
|
||||
c0-0.2,0.2-0.3,0.3-0.3H35.1 M35.1,58.5H16.6c-1.1,0-2.1,0.9-2.1,2v18.5c0,1.1,0.9,2.1,2.1,2.1h18.5c1.1,0,2.1-0.9,2.1-2.1V60.5
|
||||
C37.2,59.3,36.2,58.5,35.1,58.5L35.1,58.5z"/>
|
||||
<g>
|
||||
<path class="st1" d="M21.6,64c2-0.6,2.9-0.8,4.8-0.8c2.8,0,4.1,0.9,4.1,3.5v0.4c0,1.7-0.6,2.4-1.7,2.8c-0.9,0.3-1.6,0.5-2.6,0.8
|
||||
v1.8h-2l-0.3-3.1c1.2-0.4,2.2-0.7,3-1c0.8-0.3,1.1-0.7,1.1-1.3v-0.4c0-1.3-0.4-1.6-1.8-1.6c-1,0-1.6,0.1-2.4,0.4l-0.2,1.2h-2V64z
|
||||
M23.8,75.3c0-0.9,0.4-1.3,1.4-1.3c1,0,1.4,0.4,1.4,1.3c0,0.9-0.5,1.3-1.4,1.3C24.2,76.6,23.8,76.2,23.8,75.3z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st3" d="M20.1,36.3v6.4h-1.2V40H16v2.7h-1.2v-6.4H16v2.6h2.9v-2.6H20.1z"/>
|
||||
<path class="st3" d="M26.1,41.6v1.1h-4.4v-6.4H26v1.1h-3.1v1.5h2.7v1h-2.7v1.7H26.1z"/>
|
||||
<path class="st3" d="M27.3,42.7v-6.4h1.2v5.3h3.3v1.1H27.3z"/>
|
||||
<path class="st3" d="M32.8,42.7v-6.4h2.7c0.3,0,0.6,0.1,0.8,0.2s0.5,0.3,0.6,0.5c0.2,0.2,0.3,0.4,0.4,0.7c0.1,0.3,0.2,0.5,0.2,0.8
|
||||
c0,0.3,0,0.5-0.1,0.8c-0.1,0.3-0.2,0.5-0.4,0.7c-0.2,0.2-0.4,0.4-0.6,0.5c-0.2,0.1-0.5,0.2-0.8,0.2h-1.5v2.1H32.8z M34.1,39.5h1.4
|
||||
c0.2,0,0.4-0.1,0.6-0.3c0.2-0.2,0.2-0.4,0.2-0.8c0-0.2,0-0.3-0.1-0.4c0-0.1-0.1-0.2-0.2-0.3c-0.1-0.1-0.2-0.2-0.3-0.2
|
||||
c-0.1,0-0.2-0.1-0.3-0.1h-1.4V39.5z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st3" d="M35.1,10.5c0.2,0,0.4,0.1,0.4,0.3v18.5c0,0.2-0.2,0.3-0.4,0.3H16.6c-0.2,0-0.3-0.2-0.3-0.3V10.7
|
||||
c0-0.2,0.2-0.3,0.3-0.3H35.1 M35.1,8.7H16.6c-1.1,0-2.1,0.9-2.1,2v18.5c0,1.1,0.9,2.1,2.1,2.1h18.5c1.1,0,2.1-0.9,2.1-2.1V10.7
|
||||
C37.2,9.6,36.2,8.7,35.1,8.7L35.1,8.7z"/>
|
||||
<g>
|
||||
<path class="st3" d="M21.6,14.3c2-0.6,2.9-0.8,4.8-0.8c2.8,0,4.1,0.9,4.1,3.5v0.4c0,1.7-0.6,2.4-1.7,2.8c-0.9,0.3-1.6,0.5-2.6,0.8
|
||||
v1.8h-2l-0.3-3.1c1.2-0.4,2.2-0.7,3-1c0.8-0.3,1.1-0.7,1.1-1.3v-0.4c0-1.3-0.4-1.6-1.8-1.6c-1,0-1.6,0.1-2.4,0.4l-0.2,1.2h-2V14.3
|
||||
z M23.8,25.6c0-0.9,0.4-1.3,1.4-1.3c1,0,1.4,0.4,1.4,1.3c0,0.9-0.5,1.3-1.4,1.3C24.2,26.9,23.8,26.5,23.8,25.6z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st1" d="M20.1,136v6.4h-1.2v-2.7H16v2.7h-1.2V136H16v2.6h2.9V136H20.1z"/>
|
||||
<path class="st1" d="M26.1,141.3v1.1h-4.4V136H26v1.1h-3.1v1.5h2.7v1h-2.7v1.7H26.1z"/>
|
||||
<path class="st1" d="M27.3,142.4V136h1.2v5.3h3.3v1.1H27.3z"/>
|
||||
<path class="st1" d="M32.8,142.4V136h2.7c0.3,0,0.6,0.1,0.8,0.2s0.5,0.3,0.6,0.5c0.2,0.2,0.3,0.4,0.4,0.7c0.1,0.3,0.2,0.5,0.2,0.8
|
||||
c0,0.3,0,0.5-0.1,0.8c-0.1,0.3-0.2,0.5-0.4,0.7c-0.2,0.2-0.4,0.4-0.6,0.5c-0.2,0.1-0.5,0.2-0.8,0.2h-1.5v2.1H32.8z M34.1,139.2h1.4
|
||||
c0.2,0,0.4-0.1,0.6-0.3c0.2-0.2,0.2-0.4,0.2-0.8c0-0.2,0-0.3-0.1-0.4c0-0.1-0.1-0.2-0.2-0.3c-0.1-0.1-0.2-0.2-0.3-0.2
|
||||
c-0.1,0-0.2-0.1-0.3-0.1h-1.4V139.2z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st1" d="M36.4,108.9c0.2,0,0.4,0.1,0.4,0.3v21c0,0.2-0.2,0.4-0.4,0.4h-21c-0.2,0-0.4-0.2-0.4-0.4v-21
|
||||
c0-0.2,0.2-0.3,0.4-0.3H36.4 M36.4,106.9h-21c-1.3,0-2.3,1-2.3,2.3v21c0,1.3,1.1,2.3,2.3,2.3h21c1.3,0,2.4-1.1,2.4-2.3v-21
|
||||
C38.8,107.9,37.7,106.9,36.4,106.9L36.4,106.9z"/>
|
||||
<g>
|
||||
<path class="st1" d="M21,113.2c2.3-0.7,3.3-0.9,5.5-0.9c3.2,0,4.6,1.1,4.6,4v0.5c0,2-0.7,2.8-2,3.2c-1,0.4-1.9,0.6-2.9,0.9v2H24
|
||||
l-0.3-3.5c1.4-0.4,2.5-0.8,3.4-1.1c1-0.4,1.3-0.8,1.3-1.5v-0.5c0-1.5-0.4-1.8-2.1-1.8c-1.1,0-1.9,0.1-2.7,0.5l-0.2,1.4H21V113.2z
|
||||
M23.5,126.1c0-1,0.5-1.5,1.6-1.5c1.1,0,1.6,0.5,1.6,1.5c0,1-0.6,1.5-1.6,1.5C24,127.6,23.5,127.1,23.5,126.1z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st1" d="M20.1,186.1v6.4h-1.2v-2.7H16v2.7h-1.2v-6.4H16v2.6h2.9v-2.6H20.1z"/>
|
||||
<path class="st1" d="M26.1,191.4v1.1h-4.4v-6.4H26v1.1h-3.1v1.5h2.7v1h-2.7v1.7H26.1z"/>
|
||||
<path class="st1" d="M27.3,192.5v-6.4h1.2v5.3h3.3v1.1H27.3z"/>
|
||||
<path class="st1" d="M32.8,192.5v-6.4h2.7c0.3,0,0.6,0.1,0.8,0.2s0.5,0.3,0.6,0.5c0.2,0.2,0.3,0.4,0.4,0.7c0.1,0.3,0.2,0.5,0.2,0.8
|
||||
c0,0.3,0,0.5-0.1,0.8c-0.1,0.3-0.2,0.5-0.4,0.7c-0.2,0.2-0.4,0.4-0.6,0.5c-0.2,0.1-0.5,0.2-0.8,0.2h-1.5v2.1H32.8z M34.1,189.2h1.4
|
||||
c0.2,0,0.4-0.1,0.6-0.3c0.2-0.2,0.2-0.4,0.2-0.8c0-0.2,0-0.3-0.1-0.4c0-0.1-0.1-0.2-0.2-0.3c-0.1-0.1-0.2-0.2-0.3-0.2
|
||||
c-0.1,0-0.2-0.1-0.3-0.1h-1.4V189.2z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st1" d="M35.1,160.3c0.2,0,0.4,0.1,0.4,0.3V179c0,0.2-0.2,0.3-0.4,0.3H16.6c-0.2,0-0.3-0.2-0.3-0.3v-18.5
|
||||
c0-0.2,0.2-0.3,0.3-0.3H35.1 M35.1,158.5H16.6c-1.1,0-2.1,0.9-2.1,2V179c0,1.1,0.9,2.1,2.1,2.1h18.5c1.1,0,2.1-0.9,2.1-2.1v-18.5
|
||||
C37.2,159.4,36.2,158.5,35.1,158.5L35.1,158.5z"/>
|
||||
<g>
|
||||
<path class="st1" d="M21.6,164.1c2-0.6,2.9-0.8,4.8-0.8c2.8,0,4.1,0.9,4.1,3.5v0.4c0,1.7-0.6,2.4-1.7,2.8
|
||||
c-0.9,0.3-1.6,0.5-2.6,0.8v1.8h-2l-0.3-3.1c1.2-0.4,2.2-0.7,3-1c0.8-0.3,1.1-0.7,1.1-1.3v-0.4c0-1.3-0.4-1.6-1.8-1.6
|
||||
c-1,0-1.6,0.1-2.4,0.4l-0.2,1.2h-2V164.1z M23.8,175.3c0-0.9,0.4-1.3,1.4-1.3c1,0,1.4,0.4,1.4,1.3c0,0.9-0.5,1.3-1.4,1.3
|
||||
C24.2,176.7,23.8,176.2,23.8,175.3z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 6.3 KiB |
41
scripts/system/help.js
Normal file
41
scripts/system/help.js
Normal file
|
@ -0,0 +1,41 @@
|
|||
"use strict";
|
||||
|
||||
//
|
||||
// help.js
|
||||
// scripts/system/
|
||||
//
|
||||
// Created by Howard Stearns on 2 Nov 2016
|
||||
// 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
|
||||
//
|
||||
|
||||
(function() { // BEGIN LOCAL_SCOPE
|
||||
|
||||
var toolBar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system");
|
||||
var buttonName = "help"; // matching location reserved in Desktop.qml
|
||||
var button = toolBar.addButton({
|
||||
objectName: buttonName,
|
||||
imageURL: Script.resolvePath("assets/images/tools/help.svg"),
|
||||
visible: true,
|
||||
hoverState: 2,
|
||||
defaultState: 1,
|
||||
buttonState: 1,
|
||||
alpha: 0.9
|
||||
});
|
||||
|
||||
// TODO: make button state reflect whether the window is opened or closed (independently from us).
|
||||
|
||||
function onClicked(){
|
||||
Menu.triggerOption('Help...')
|
||||
}
|
||||
|
||||
button.clicked.connect(onClicked);
|
||||
|
||||
Script.scriptEnding.connect(function () {
|
||||
toolBar.removeButton(buttonName);
|
||||
button.clicked.disconnect(onClicked);
|
||||
});
|
||||
|
||||
}()); // END LOCAL_SCOPE
|
Loading…
Reference in a new issue