mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-05-30 08:53:26 +02:00
toggle menu item
This commit is contained in:
parent
5bed68ac4c
commit
71b6096644
1 changed files with 5 additions and 11 deletions
|
@ -12,23 +12,17 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
(function() { // BEGIN LOCAL_SCOPE
|
(function() { // BEGIN LOCAL_SCOPE
|
||||||
|
var MENU_ITEM = "Users Online";
|
||||||
// create tablet button
|
// create tablet button
|
||||||
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||||
var button = tablet.addButton({
|
var button = tablet.addButton({
|
||||||
icon: "icons/tablet-icons/people-i.svg",
|
icon: "icons/tablet-icons/people-i.svg",
|
||||||
text: "Users"
|
text: "Users",
|
||||||
|
isActive: Menu.isOptionChecked(MENU_ITEM)
|
||||||
});
|
});
|
||||||
var showUsersOverlays = false;
|
|
||||||
function onClicked() {
|
function onClicked() {
|
||||||
print(showUsersOverlays);
|
Menu.setIsOptionChecked(MENU_ITEM, !Menu.isOptionChecked(MENU_ITEM));
|
||||||
// hide/show users overlays
|
button.editProperties({isActive: Menu.isOptionChecked(MENU_ITEM)});
|
||||||
if (showUsersOverlays) {
|
|
||||||
showUsersOverlays = false;
|
|
||||||
} else {
|
|
||||||
showUsersOverlays = true;
|
|
||||||
}
|
|
||||||
button.editProperties({isActive: showUsersOverlays});
|
|
||||||
}
|
}
|
||||||
button.clicked.connect(onClicked);
|
button.clicked.connect(onClicked);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue