mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-05-08 02:58:19 +02:00
Merge pull request #9835 from druiz17/toolbar-window-dont-close
Close toolbar windows when reloading scripts
This commit is contained in:
commit
cef4c988c4
9 changed files with 28 additions and 1284 deletions
|
@ -72,6 +72,9 @@ tablet.screenChanged.connect(onScreenChanged);
|
||||||
AudioDevice.muteToggled.connect(onMuteToggled);
|
AudioDevice.muteToggled.connect(onMuteToggled);
|
||||||
|
|
||||||
Script.scriptEnding.connect(function () {
|
Script.scriptEnding.connect(function () {
|
||||||
|
if (onAudioScreen) {
|
||||||
|
tablet.gotoHomeScreen();
|
||||||
|
}
|
||||||
button.clicked.disconnect(onClicked);
|
button.clicked.disconnect(onClicked);
|
||||||
tablet.screenChanged.disconnect(onScreenChanged);
|
tablet.screenChanged.disconnect(onScreenChanged);
|
||||||
AudioDevice.muteToggled.disconnect(onMuteToggled);
|
AudioDevice.muteToggled.disconnect(onMuteToggled);
|
||||||
|
|
|
@ -18,13 +18,14 @@ var button;
|
||||||
var buttonName = "GOTO";
|
var buttonName = "GOTO";
|
||||||
var toolBar = null;
|
var toolBar = null;
|
||||||
var tablet = null;
|
var tablet = null;
|
||||||
|
var onGotoScreen = false;
|
||||||
function onAddressBarShown(visible) {
|
function onAddressBarShown(visible) {
|
||||||
button.editProperties({isActive: visible});
|
button.editProperties({isActive: visible});
|
||||||
}
|
}
|
||||||
|
|
||||||
function onClicked(){
|
function onClicked(){
|
||||||
DialogsManager.toggleAddressBar();
|
DialogsManager.toggleAddressBar();
|
||||||
|
onGotoScreen = !onGotoScreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Settings.getValue("HUDUIEnabled")) {
|
if (Settings.getValue("HUDUIEnabled")) {
|
||||||
|
@ -49,6 +50,9 @@ button.clicked.connect(onClicked);
|
||||||
DialogsManager.addressBarShown.connect(onAddressBarShown);
|
DialogsManager.addressBarShown.connect(onAddressBarShown);
|
||||||
|
|
||||||
Script.scriptEnding.connect(function () {
|
Script.scriptEnding.connect(function () {
|
||||||
|
if (onGotoScreen) {
|
||||||
|
DialogsManager.toggleAddressBar();
|
||||||
|
}
|
||||||
button.clicked.disconnect(onClicked);
|
button.clicked.disconnect(onClicked);
|
||||||
if (tablet) {
|
if (tablet) {
|
||||||
tablet.removeButton(button);
|
tablet.removeButton(button);
|
||||||
|
|
|
@ -48,6 +48,9 @@
|
||||||
}, POLL_RATE);
|
}, POLL_RATE);
|
||||||
|
|
||||||
Script.scriptEnding.connect(function () {
|
Script.scriptEnding.connect(function () {
|
||||||
|
if (enabled) {
|
||||||
|
Menu.closeInfoView('InfoView_html/help.html');
|
||||||
|
}
|
||||||
button.clicked.disconnect(onClicked);
|
button.clicked.disconnect(onClicked);
|
||||||
Script.clearInterval(interval);
|
Script.clearInterval(interval);
|
||||||
if (tablet) {
|
if (tablet) {
|
||||||
|
|
|
@ -121,6 +121,7 @@ function onClick() {
|
||||||
if (onMarketplaceScreen) {
|
if (onMarketplaceScreen) {
|
||||||
// for toolbar-mode: go back to home screen, this will close the window.
|
// for toolbar-mode: go back to home screen, this will close the window.
|
||||||
tablet.gotoHomeScreen();
|
tablet.gotoHomeScreen();
|
||||||
|
onMarketplaceScreen = false;
|
||||||
} else {
|
} else {
|
||||||
var entity = HMD.tabletID;
|
var entity = HMD.tabletID;
|
||||||
Entities.editEntity(entity, {textures: JSON.stringify({"tex.close": HOME_BUTTON_TEXTURE})});
|
Entities.editEntity(entity, {textures: JSON.stringify({"tex.close": HOME_BUTTON_TEXTURE})});
|
||||||
|
@ -140,6 +141,9 @@ tablet.screenChanged.connect(onScreenChanged);
|
||||||
Entities.canWriteAssetsChanged.connect(onCanWriteAssetsChanged);
|
Entities.canWriteAssetsChanged.connect(onCanWriteAssetsChanged);
|
||||||
|
|
||||||
Script.scriptEnding.connect(function () {
|
Script.scriptEnding.connect(function () {
|
||||||
|
if (onMarketplaceScreen) {
|
||||||
|
tablet.gotoHomeScreen();
|
||||||
|
}
|
||||||
tablet.removeButton(marketplaceButton);
|
tablet.removeButton(marketplaceButton);
|
||||||
tablet.screenChanged.disconnect(onScreenChanged);
|
tablet.screenChanged.disconnect(onScreenChanged);
|
||||||
Entities.canWriteAssetsChanged.disconnect(onCanWriteAssetsChanged);
|
Entities.canWriteAssetsChanged.disconnect(onCanWriteAssetsChanged);
|
||||||
|
|
|
@ -48,6 +48,9 @@ var HOME_BUTTON_TEXTURE = "http://hifi-content.s3.amazonaws.com/alan/dev/tablet-
|
||||||
tablet.screenChanged.connect(onScreenChanged);
|
tablet.screenChanged.connect(onScreenChanged);
|
||||||
|
|
||||||
Script.scriptEnding.connect(function () {
|
Script.scriptEnding.connect(function () {
|
||||||
|
if (onMenuScreen) {
|
||||||
|
tablet.gotoHomeScreen();
|
||||||
|
}
|
||||||
button.clicked.disconnect(onClicked);
|
button.clicked.disconnect(onClicked);
|
||||||
tablet.removeButton(button);
|
tablet.removeButton(button);
|
||||||
tablet.screenChanged.disconnect(onScreenChanged);
|
tablet.screenChanged.disconnect(onScreenChanged);
|
||||||
|
|
|
@ -696,6 +696,9 @@ function clearLocalQMLDataAndClosePAL() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function shutdown() {
|
function shutdown() {
|
||||||
|
if (onPalScreen) {
|
||||||
|
tablet.gotoHomeScreen();
|
||||||
|
}
|
||||||
button.clicked.disconnect(onTabletButtonClicked);
|
button.clicked.disconnect(onTabletButtonClicked);
|
||||||
tablet.removeButton(button);
|
tablet.removeButton(button);
|
||||||
tablet.screenChanged.disconnect(onTabletScreenChanged);
|
tablet.screenChanged.disconnect(onTabletScreenChanged);
|
||||||
|
|
|
@ -211,8 +211,10 @@ Window.snapshotShared.connect(snapshotShared);
|
||||||
Window.processingGif.connect(processingGif);
|
Window.processingGif.connect(processingGif);
|
||||||
|
|
||||||
Script.scriptEnding.connect(function () {
|
Script.scriptEnding.connect(function () {
|
||||||
button.clicked.disconnect(onClicked);
|
if (buttonConnected) {
|
||||||
buttonConnected = false;
|
button.clicked.disconnect(onClicked);
|
||||||
|
buttonConnected = false;
|
||||||
|
}
|
||||||
if (tablet) {
|
if (tablet) {
|
||||||
tablet.removeButton(button);
|
tablet.removeButton(button);
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,6 +115,9 @@
|
||||||
tablet.screenChanged.connect(onScreenChanged);
|
tablet.screenChanged.connect(onScreenChanged);
|
||||||
|
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
|
if (onUsersScreen) {
|
||||||
|
tablet.gotoHomeScreen();
|
||||||
|
}
|
||||||
button.clicked.disconnect(onClicked);
|
button.clicked.disconnect(onClicked);
|
||||||
tablet.removeButton(button);
|
tablet.removeButton(button);
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue