mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:24:00 +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",
|
||||
sortOrder: 10
|
||||
});
|
||||
tablet.screenChanged.connect(function (type, url) {
|
||||
if (isActive && (type !== "QML" || url !== "Edit.qml")) {
|
||||
that.toggle();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
activeButton.clicked.connect(function() {
|
||||
|
@ -457,7 +462,9 @@ var toolBar = (function () {
|
|||
|
||||
that.toggle = function () {
|
||||
that.setActive(!isActive);
|
||||
// activeButton.editProperties({isActive: isActive});
|
||||
if (Settings.getValue("HUDUIEnabled")) {
|
||||
activeButton.editProperties({isActive: isActive});
|
||||
}
|
||||
};
|
||||
|
||||
that.setActive = function (active) {
|
||||
|
@ -482,8 +489,10 @@ var toolBar = (function () {
|
|||
cameraManager.disable();
|
||||
selectionDisplay.triggerMapping.disable();
|
||||
} else {
|
||||
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||
tablet.loadQMLSource("Edit.qml");
|
||||
if (!Settings.getValue("HUDUIEnabled")) {
|
||||
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||
tablet.loadQMLSource("Edit.qml");
|
||||
}
|
||||
UserActivityLogger.enabledEdit();
|
||||
entityListTool.setVisible(true);
|
||||
gridTool.setVisible(true);
|
||||
|
@ -1438,12 +1447,17 @@ var ServerScriptStatusMonitor = function(entityID, statusCallback) {
|
|||
var PropertiesTool = function (opts) {
|
||||
var that = {};
|
||||
|
||||
var webView = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||
// var webView = new OverlayWebWindow({
|
||||
// title: 'Entity Properties',
|
||||
// source: ENTITY_PROPERTIES_URL,
|
||||
// toolWindow: true
|
||||
// });
|
||||
var webView = null;
|
||||
if (Settings.getValue("HUDUIEnabled")) {
|
||||
webView = new OverlayWebWindow({
|
||||
title: 'Entity Properties',
|
||||
source: ENTITY_PROPERTIES_URL,
|
||||
toolWindow: true
|
||||
});
|
||||
} else {
|
||||
webView = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||
webView.setVisible = function(value) {};
|
||||
}
|
||||
|
||||
var visible = false;
|
||||
|
||||
|
@ -1452,11 +1466,11 @@ var PropertiesTool = function (opts) {
|
|||
var currentSelectedEntityID = null;
|
||||
var statusMonitor = null;
|
||||
|
||||
// webView.setVisible(visible);
|
||||
webView.setVisible(visible);
|
||||
|
||||
that.setVisible = function (newVisible) {
|
||||
visible = newVisible;
|
||||
// webView.setVisible(visible);
|
||||
webView.setVisible(visible);
|
||||
};
|
||||
|
||||
function updateScriptStatus(info) {
|
||||
|
@ -1519,7 +1533,6 @@ var PropertiesTool = function (opts) {
|
|||
webView.webEventReceived.connect(function (data) {
|
||||
try {
|
||||
data = JSON.parse(data);
|
||||
print("--- edit.js PropertiesTool webView.webEventReceived ---");
|
||||
}
|
||||
catch(e) {
|
||||
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) {
|
||||
var that = {};
|
||||
|
||||
var url = ENTITY_LIST_HTML_URL;
|
||||
var webView = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||
// var webView = new OverlayWebWindow({
|
||||
// title: 'Entity List', source: url, toolWindow: true
|
||||
// });
|
||||
|
||||
var webView = null;
|
||||
if (Settings.getValue("HUDUIEnabled")) {
|
||||
var url = ENTITY_LIST_HTML_URL;
|
||||
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 searchRadius = 100;
|
||||
|
||||
var visible = false;
|
||||
|
||||
// webView.setVisible(visible);
|
||||
webView.setVisible(visible);
|
||||
|
||||
that.webView = webView;
|
||||
|
||||
that.setVisible = function(newVisible) {
|
||||
visible = newVisible;
|
||||
// webView.setVisible(visible);
|
||||
webView.setVisible(visible);
|
||||
};
|
||||
|
||||
that.toggleVisible = function() {
|
||||
|
@ -101,7 +105,6 @@ EntityListTool = function(opts) {
|
|||
|
||||
webView.webEventReceived.connect(function(data) {
|
||||
data = JSON.parse(data);
|
||||
print("--- edit.js EntityList webView.webEventReceived ---");
|
||||
if (data.type == "selectionUpdate") {
|
||||
var ids = data.entityIds;
|
||||
var entityIDs = [];
|
||||
|
|
|
@ -228,12 +228,16 @@ GridTool = function(opts) {
|
|||
var verticalGrid = opts.verticalGrid;
|
||||
var listeners = [];
|
||||
|
||||
var webView = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||
// var url = GRID_CONTROLS_HTML_URL;
|
||||
// var webView = new OverlayWebWindow({
|
||||
// title: 'Grid', source: url, toolWindow: true
|
||||
// });
|
||||
|
||||
var webView = null;
|
||||
if (Settings.getValue("HUDUIEnabled")) {
|
||||
var url = GRID_CONTROLS_HTML_URL;
|
||||
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) {
|
||||
webView.emitScriptEvent(JSON.stringify(data));
|
||||
|
@ -242,7 +246,6 @@ GridTool = function(opts) {
|
|||
|
||||
webView.webEventReceived.connect(function(data) {
|
||||
data = JSON.parse(data);
|
||||
print("--- edit.js GridTool webView.webEventReceived ---");
|
||||
if (data.type == "init") {
|
||||
horizontalGrid.emitUpdate();
|
||||
} else if (data.type == "update") {
|
||||
|
@ -271,7 +274,7 @@ GridTool = function(opts) {
|
|||
}
|
||||
|
||||
that.setVisible = function(visible) {
|
||||
// webView.setVisible(visible);
|
||||
webView.setVisible(visible);
|
||||
}
|
||||
|
||||
return that;
|
||||
|
|
Loading…
Reference in a new issue