made requested changes

This commit is contained in:
Dante Ruiz 2016-12-20 18:28:07 +00:00
parent fe4fa351d1
commit bee6e230ae
4 changed files with 13 additions and 16 deletions

View file

@ -91,9 +91,7 @@
// Used to set the state of the bubble HUD button
function writeButtonProperties(parameter) {
var buttonProperties = button.getProperties();
buttonProperties.isActive = parameter;
button.editProperties(buttonProperties);
button.editProperties({isActive: parameter});
}
// The bubble script's update function
@ -168,7 +166,8 @@
// Setup the bubble button and add it to the toolbar
var button = tablet.addButton({
text: "BUBBLE"});
text: "BUBBLE"
});
onBubbleToggled();
button.clicked.connect(Users.toggleIgnoreRadius);

View file

@ -170,7 +170,6 @@ var toolBar = (function () {
var EDIT_SETTING = "io.highfidelity.isEditting"; // for communication with other scripts
var that = {},
toolBar,
systemToolbar,
activeButton,
tablet;
@ -231,11 +230,11 @@ var toolBar = (function () {
}
});
systemToolbar = Toolbars.getToolbar(SYSTEM_TOOLBAR);
tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
activeButton = tablet.addButton({
text: "EDIT"
});
});
activeButton.clicked.connect(function() {
that.toggle();
@ -437,9 +436,7 @@ var toolBar = (function () {
that.toggle = function () {
that.setActive(!isActive);
var buttonProperties = activeButton.getProperties();
buttonProperties.isActive = isActive;
activeButton.editProperties(buttonProperties);
activeButton.editProperties({isActive: isActive});
};
that.setActive = function (active) {

View file

@ -16,20 +16,19 @@
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
var isActive = false
var button = tablet.addButton({
text:"GOTO"})
text:"GOTO"
});
function onAddressBarShown(visible) {
}
function setActive(active) {
isActive = active;
isActive = active;
}
function onClicked(){
setActive(!isActive);
var buttonProperties = button.getProperties();
buttonProperties.isActive = isActive;
button.editProperties(buttonProperties);
button.editProperties({isActive: isActive});
DialogsManager.toggleAddressBar();
}
button.clicked.connect(onClicked);

View file

@ -41,6 +41,7 @@ var button;
// Disable them in hmd.
var desktopOnlyViews = ['Mirror', 'Independent Mode', 'Entity Mode'];
function onHmdChanged(isHmd) {
//TODO change button icon when the hmd changes
desktopOnlyViews.forEach(function (view) {
Menu.setMenuEnabled("View>" + view, !isHmd);
});
@ -52,7 +53,8 @@ function onClicked(){
}
if (headset) {
button = tablet.addButton({
text: "SWITCH"});
text: "SWITCH"
});
onHmdChanged(HMD.active);
button.clicked.connect(onClicked);