Add new button in HMD

Add new button in HMD:
- add undo and redo support
- add HMD detection
This commit is contained in:
Alezia Kurdis 2020-09-26 00:46:32 -04:00 committed by GitHub
parent 08038fb1bc
commit ab45a32fea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,6 +3,7 @@
// entityList.js
//
// Copyright 2014 High Fidelity, Inc.
// Copyright 2020 Vircadia contributors.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
@ -73,7 +74,7 @@ EntityListTool = function(shouldUseEditTabletApp) {
that.setVisible = function(newVisible) {
visible = newVisible;
webView.setVisible(shouldUseEditTabletApp() && visible);
entityListWindow.setVisible(!shouldUseEditTabletApp() && visible);
entityListWindow.setVisible(!shouldUseEditTabletApp() && visible);
};
that.isVisible = function() {
@ -163,6 +164,12 @@ EntityListTool = function(shouldUseEditTabletApp) {
}
that.sendUpdate = function() {
emitJSONScriptEvent({
"type": "confirmHMDstate",
"isHmd": HMD.active
});
PROFILE('Script-sendUpdate', function() {
var entities = [];
@ -302,6 +309,10 @@ EntityListTool = function(shouldUseEditTabletApp) {
SelectionDisplay.toggleSpaceMode();
} else if (data.type === 'keyUpEvent') {
keyUpEventFromUIWindow(data.keyUpEvent);
} else if (data.type === 'undo') {
undoHistory.undo();
} else if (data.type === 'redo') {
undoHistory.redo();
}
};