mirror of
https://github.com/overte-org/overte.git
synced 2025-08-13 06:18:39 +02:00
Whoops! Missed an if()
This commit is contained in:
parent
39ae28bfcf
commit
1bebe8aede
1 changed files with 18 additions and 16 deletions
|
@ -173,23 +173,25 @@
|
|||
var buttonName = "SPECTATOR";
|
||||
var showSpectatorInDesktop = true;
|
||||
function addOrRemoveButton(isShuttingDown, isHMDMode) {
|
||||
if (tablet) {
|
||||
if (!button) {
|
||||
if ((isHMDMode || showSpectatorInDesktop) && !isShuttingDown) {
|
||||
button = tablet.addButton({
|
||||
text: buttonName
|
||||
});
|
||||
button.clicked.connect(onTabletButtonClicked);
|
||||
}
|
||||
} else if (button) {
|
||||
if ((!showSpectatorInDesktop || isShuttingDown)) {
|
||||
button.clicked.disconnect(onTabletButtonClicked);
|
||||
tablet.removeButton(button);
|
||||
button = false;
|
||||
}
|
||||
} else {
|
||||
print("ERROR adding/removing Spectator button!");
|
||||
if (!tablet) {
|
||||
print("Warning in addOrRemoveButton(): 'tablet' undefined!");
|
||||
return;
|
||||
}
|
||||
if (!button) {
|
||||
if ((isHMDMode || showSpectatorInDesktop) && !isShuttingDown) {
|
||||
button = tablet.addButton({
|
||||
text: buttonName
|
||||
});
|
||||
button.clicked.connect(onTabletButtonClicked);
|
||||
}
|
||||
} else if (button) {
|
||||
if ((!showSpectatorInDesktop || isShuttingDown)) {
|
||||
button.clicked.disconnect(onTabletButtonClicked);
|
||||
tablet.removeButton(button);
|
||||
button = false;
|
||||
}
|
||||
} else {
|
||||
print("ERROR adding/removing Spectator button!");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue