mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 08:56:25 +02:00
honor HUDUIEnabled setting
This commit is contained in:
parent
e12c77e576
commit
24fc9bbe67
3 changed files with 48 additions and 29 deletions
|
@ -256,6 +256,11 @@ var toolBar = (function () {
|
||||||
text: "EDIT",
|
text: "EDIT",
|
||||||
sortOrder: 10
|
sortOrder: 10
|
||||||
});
|
});
|
||||||
|
tablet.screenChanged.connect(function (type, url) {
|
||||||
|
if (isActive && (type !== "QML" || url !== "Edit.qml")) {
|
||||||
|
that.toggle();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
activeButton.clicked.connect(function() {
|
activeButton.clicked.connect(function() {
|
||||||
|
@ -457,7 +462,9 @@ var toolBar = (function () {
|
||||||
|
|
||||||
that.toggle = function () {
|
that.toggle = function () {
|
||||||
that.setActive(!isActive);
|
that.setActive(!isActive);
|
||||||
// activeButton.editProperties({isActive: isActive});
|
if (Settings.getValue("HUDUIEnabled")) {
|
||||||
|
activeButton.editProperties({isActive: isActive});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
that.setActive = function (active) {
|
that.setActive = function (active) {
|
||||||
|
@ -482,8 +489,10 @@ var toolBar = (function () {
|
||||||
cameraManager.disable();
|
cameraManager.disable();
|
||||||
selectionDisplay.triggerMapping.disable();
|
selectionDisplay.triggerMapping.disable();
|
||||||
} else {
|
} else {
|
||||||
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
if (!Settings.getValue("HUDUIEnabled")) {
|
||||||
tablet.loadQMLSource("Edit.qml");
|
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||||
|
tablet.loadQMLSource("Edit.qml");
|
||||||
|
}
|
||||||
UserActivityLogger.enabledEdit();
|
UserActivityLogger.enabledEdit();
|
||||||
entityListTool.setVisible(true);
|
entityListTool.setVisible(true);
|
||||||
gridTool.setVisible(true);
|
gridTool.setVisible(true);
|
||||||
|
@ -1438,12 +1447,17 @@ var ServerScriptStatusMonitor = function(entityID, statusCallback) {
|
||||||
var PropertiesTool = function (opts) {
|
var PropertiesTool = function (opts) {
|
||||||
var that = {};
|
var that = {};
|
||||||
|
|
||||||
var webView = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
var webView = null;
|
||||||
// var webView = new OverlayWebWindow({
|
if (Settings.getValue("HUDUIEnabled")) {
|
||||||
// title: 'Entity Properties',
|
webView = new OverlayWebWindow({
|
||||||
// source: ENTITY_PROPERTIES_URL,
|
title: 'Entity Properties',
|
||||||
// toolWindow: true
|
source: ENTITY_PROPERTIES_URL,
|
||||||
// });
|
toolWindow: true
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
webView = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||||
|
webView.setVisible = function(value) {};
|
||||||
|
}
|
||||||
|
|
||||||
var visible = false;
|
var visible = false;
|
||||||
|
|
||||||
|
@ -1452,11 +1466,11 @@ var PropertiesTool = function (opts) {
|
||||||
var currentSelectedEntityID = null;
|
var currentSelectedEntityID = null;
|
||||||
var statusMonitor = null;
|
var statusMonitor = null;
|
||||||
|
|
||||||
// webView.setVisible(visible);
|
webView.setVisible(visible);
|
||||||
|
|
||||||
that.setVisible = function (newVisible) {
|
that.setVisible = function (newVisible) {
|
||||||
visible = newVisible;
|
visible = newVisible;
|
||||||
// webView.setVisible(visible);
|
webView.setVisible(visible);
|
||||||
};
|
};
|
||||||
|
|
||||||
function updateScriptStatus(info) {
|
function updateScriptStatus(info) {
|
||||||
|
@ -1519,7 +1533,6 @@ var PropertiesTool = function (opts) {
|
||||||
webView.webEventReceived.connect(function (data) {
|
webView.webEventReceived.connect(function (data) {
|
||||||
try {
|
try {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
print("--- edit.js PropertiesTool webView.webEventReceived ---");
|
|
||||||
}
|
}
|
||||||
catch(e) {
|
catch(e) {
|
||||||
print('Edit.js received web event that was not valid json.')
|
print('Edit.js received web event that was not valid json.')
|
||||||
|
|
|
@ -3,25 +3,29 @@ var ENTITY_LIST_HTML_URL = Script.resolvePath('../html/entityList.html');
|
||||||
EntityListTool = function(opts) {
|
EntityListTool = function(opts) {
|
||||||
var that = {};
|
var that = {};
|
||||||
|
|
||||||
var url = ENTITY_LIST_HTML_URL;
|
var webView = null;
|
||||||
var webView = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
if (Settings.getValue("HUDUIEnabled")) {
|
||||||
// var webView = new OverlayWebWindow({
|
var url = ENTITY_LIST_HTML_URL;
|
||||||
// title: 'Entity List', source: url, toolWindow: true
|
webView = new OverlayWebWindow({
|
||||||
// });
|
title: 'Entity List', source: url, toolWindow: true
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
webView = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||||
|
webView.setVisible = function(value) {};
|
||||||
|
}
|
||||||
|
|
||||||
var filterInView = false;
|
var filterInView = false;
|
||||||
var searchRadius = 100;
|
var searchRadius = 100;
|
||||||
|
|
||||||
var visible = false;
|
var visible = false;
|
||||||
|
|
||||||
// webView.setVisible(visible);
|
webView.setVisible(visible);
|
||||||
|
|
||||||
that.webView = webView;
|
that.webView = webView;
|
||||||
|
|
||||||
that.setVisible = function(newVisible) {
|
that.setVisible = function(newVisible) {
|
||||||
visible = newVisible;
|
visible = newVisible;
|
||||||
// webView.setVisible(visible);
|
webView.setVisible(visible);
|
||||||
};
|
};
|
||||||
|
|
||||||
that.toggleVisible = function() {
|
that.toggleVisible = function() {
|
||||||
|
@ -101,7 +105,6 @@ EntityListTool = function(opts) {
|
||||||
|
|
||||||
webView.webEventReceived.connect(function(data) {
|
webView.webEventReceived.connect(function(data) {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
print("--- edit.js EntityList webView.webEventReceived ---");
|
|
||||||
if (data.type == "selectionUpdate") {
|
if (data.type == "selectionUpdate") {
|
||||||
var ids = data.entityIds;
|
var ids = data.entityIds;
|
||||||
var entityIDs = [];
|
var entityIDs = [];
|
||||||
|
|
|
@ -228,12 +228,16 @@ GridTool = function(opts) {
|
||||||
var verticalGrid = opts.verticalGrid;
|
var verticalGrid = opts.verticalGrid;
|
||||||
var listeners = [];
|
var listeners = [];
|
||||||
|
|
||||||
var webView = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
var webView = null;
|
||||||
// var url = GRID_CONTROLS_HTML_URL;
|
if (Settings.getValue("HUDUIEnabled")) {
|
||||||
// var webView = new OverlayWebWindow({
|
var url = GRID_CONTROLS_HTML_URL;
|
||||||
// title: 'Grid', source: url, toolWindow: true
|
webView = new OverlayWebWindow({
|
||||||
// });
|
title: 'Grid', source: url, toolWindow: true
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
webView = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||||
|
webView.setVisible = function(value) {};
|
||||||
|
}
|
||||||
|
|
||||||
horizontalGrid.addListener(function(data) {
|
horizontalGrid.addListener(function(data) {
|
||||||
webView.emitScriptEvent(JSON.stringify(data));
|
webView.emitScriptEvent(JSON.stringify(data));
|
||||||
|
@ -242,7 +246,6 @@ GridTool = function(opts) {
|
||||||
|
|
||||||
webView.webEventReceived.connect(function(data) {
|
webView.webEventReceived.connect(function(data) {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
print("--- edit.js GridTool webView.webEventReceived ---");
|
|
||||||
if (data.type == "init") {
|
if (data.type == "init") {
|
||||||
horizontalGrid.emitUpdate();
|
horizontalGrid.emitUpdate();
|
||||||
} else if (data.type == "update") {
|
} else if (data.type == "update") {
|
||||||
|
@ -271,7 +274,7 @@ GridTool = function(opts) {
|
||||||
}
|
}
|
||||||
|
|
||||||
that.setVisible = function(visible) {
|
that.setVisible = function(visible) {
|
||||||
// webView.setVisible(visible);
|
webView.setVisible(visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
return that;
|
return that;
|
||||||
|
|
Loading…
Reference in a new issue