mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 08:21:24 +02:00
added button to menu
This commit is contained in:
parent
c0e82d3e05
commit
fc4b4f85f4
4 changed files with 16 additions and 30 deletions
|
@ -91,9 +91,9 @@
|
||||||
|
|
||||||
// Used to set the state of the bubble HUD button
|
// Used to set the state of the bubble HUD button
|
||||||
function writeButtonProperties(parameter) {
|
function writeButtonProperties(parameter) {
|
||||||
//button.writeProperty('buttonState', parameter ? 0 : 1);
|
var buttonProperties = button.getProperties();
|
||||||
//button.writeProperty('defaultState', parameter ? 0 : 1);
|
buttonProperties.isActive = parameter;
|
||||||
//button.writeProperty('hoverState', parameter ? 2 : 3);
|
button.editProperties(buttonProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
// The bubble script's update function
|
// The bubble script's update function
|
||||||
|
@ -168,14 +168,7 @@
|
||||||
|
|
||||||
// Setup the bubble button and add it to the toolbar
|
// Setup the bubble button and add it to the toolbar
|
||||||
var button = tablet.addButton({
|
var button = tablet.addButton({
|
||||||
color: "#63b0ff",
|
|
||||||
text: "BUBBLE"});
|
text: "BUBBLE"});
|
||||||
/*var button = toolbar.addButton({
|
|
||||||
objectName: 'bubble',
|
|
||||||
imageURL: buttonImageURL(),
|
|
||||||
visible: true,
|
|
||||||
alpha: 0.9
|
|
||||||
});*/
|
|
||||||
onBubbleToggled();
|
onBubbleToggled();
|
||||||
|
|
||||||
button.clicked.connect(Users.toggleIgnoreRadius);
|
button.clicked.connect(Users.toggleIgnoreRadius);
|
||||||
|
|
|
@ -165,7 +165,6 @@ function toggleMarketplace() {
|
||||||
}
|
}
|
||||||
|
|
||||||
var TOOLS_PATH = Script.resolvePath("assets/images/tools/");
|
var TOOLS_PATH = Script.resolvePath("assets/images/tools/");
|
||||||
|
|
||||||
var toolBar = (function () {
|
var toolBar = (function () {
|
||||||
var EDIT_SETTING = "io.highfidelity.isEditting"; // for communication with other scripts
|
var EDIT_SETTING = "io.highfidelity.isEditting"; // for communication with other scripts
|
||||||
var that = {},
|
var that = {},
|
||||||
|
@ -234,7 +233,6 @@ var toolBar = (function () {
|
||||||
systemToolbar = Toolbars.getToolbar(SYSTEM_TOOLBAR);
|
systemToolbar = Toolbars.getToolbar(SYSTEM_TOOLBAR);
|
||||||
tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||||
activeButton = tablet.addButton({
|
activeButton = tablet.addButton({
|
||||||
color: "#63d0ff",
|
|
||||||
text: "EDIT"
|
text: "EDIT"
|
||||||
});
|
});
|
||||||
/*activeButton = systemToolbar.addButton({
|
/*activeButton = systemToolbar.addButton({
|
||||||
|
@ -446,9 +444,9 @@ var toolBar = (function () {
|
||||||
|
|
||||||
that.toggle = function () {
|
that.toggle = function () {
|
||||||
that.setActive(!isActive);
|
that.setActive(!isActive);
|
||||||
activeButton.writeProperty("buttonState", isActive ? 0 : 1);
|
var buttonProperties = activeButton.getProperties();
|
||||||
activeButton.writeProperty("defaultState", isActive ? 0 : 1);
|
buttonProperties.isActive = isActive;
|
||||||
activeButton.writeProperty("hoverState", isActive ? 2 : 3);
|
activeButton.editProperties(buttonProperties);
|
||||||
};
|
};
|
||||||
|
|
||||||
that.setActive = function (active) {
|
that.setActive = function (active) {
|
||||||
|
|
|
@ -14,26 +14,22 @@
|
||||||
(function() { // BEGIN LOCAL_SCOPE
|
(function() { // BEGIN LOCAL_SCOPE
|
||||||
|
|
||||||
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||||
|
var isActive = false
|
||||||
var button = tablet.addButton({
|
var button = tablet.addButton({
|
||||||
color: "63d0ff",
|
|
||||||
text:"GOTO"})
|
text:"GOTO"})
|
||||||
/*var button = toolBar.addButton({
|
|
||||||
objectName: "goto",
|
|
||||||
imageURL: Script.resolvePath("assets/images/tools/directory.svg"),
|
|
||||||
visible: true,
|
|
||||||
buttonState: 1,
|
|
||||||
defaultState: 1,
|
|
||||||
hoverState: 3,
|
|
||||||
alpha: 0.9,
|
|
||||||
});*/
|
|
||||||
|
|
||||||
function onAddressBarShown(visible) {
|
function onAddressBarShown(visible) {
|
||||||
//button.writeProperty('buttonState', visible ? 0 : 1);
|
}
|
||||||
//button.writeProperty('defaultState', visible ? 0 : 1);
|
|
||||||
//button.writeProperty('hoverState', visible ? 2 : 3);
|
function setActive(active) {
|
||||||
|
isActive = active;
|
||||||
}
|
}
|
||||||
function onClicked(){
|
function onClicked(){
|
||||||
|
setActive(!isActive);
|
||||||
|
var buttonProperties = button.getProperties();
|
||||||
|
buttonProperties.isActive = isActive;
|
||||||
|
button.editProperties(buttonProperties);
|
||||||
DialogsManager.toggleAddressBar();
|
DialogsManager.toggleAddressBar();
|
||||||
}
|
}
|
||||||
button.clicked.connect(onClicked);
|
button.clicked.connect(onClicked);
|
||||||
|
|
|
@ -63,7 +63,6 @@ if (headset) {
|
||||||
alpha: 0.9
|
alpha: 0.9
|
||||||
});*/
|
});*/
|
||||||
button = tablet.addButton({
|
button = tablet.addButton({
|
||||||
color: "#63d0ff",
|
|
||||||
text: "SWITCH"});
|
text: "SWITCH"});
|
||||||
onHmdChanged(HMD.active);
|
onHmdChanged(HMD.active);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue