From ab45a32feaea289eb59a7a5150ddb2a7e08159f9 Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Sat, 26 Sep 2020 00:46:32 -0400 Subject: [PATCH] Add new button in HMD Add new button in HMD: - add undo and redo support - add HMD detection --- scripts/system/create/entityList/entityList.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/system/create/entityList/entityList.js b/scripts/system/create/entityList/entityList.js index b68dcf80ba..644e68bec8 100644 --- a/scripts/system/create/entityList/entityList.js +++ b/scripts/system/create/entityList/entityList.js @@ -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(); } };