From 3e7bdad500e1e07d83cee397ff0d691ffa2adb8b Mon Sep 17 00:00:00 2001 From: ksuprynowicz Date: Wed, 8 Mar 2023 00:45:14 +0100 Subject: [PATCH] Fixes in Create App --- scripts/system/create/edit.js | 102 ++++++++--------- .../system/create/entityList/entityList.js | 105 +++++++++--------- .../entitySelectionTool.js | 4 +- scripts/system/libraries/gridTool.js | 4 +- 4 files changed, 108 insertions(+), 107 deletions(-) diff --git a/scripts/system/create/edit.js b/scripts/system/create/edit.js index 30e6622c59..cf84444862 100644 --- a/scripts/system/create/edit.js +++ b/scripts/system/create/edit.js @@ -16,8 +16,7 @@ /* global Script, SelectionDisplay, LightOverlayManager, CameraManager, Grid, GridTool, EditTools, EditVoxels, EntityListTool, Vec3, SelectionManager, Overlays, OverlayWebWindow, UserActivityLogger, Settings, Entities, Tablet, Toolbars, Messages, Menu, Camera, - progressDialog, tooltip, MyAvatar, Quat, Controller, Clipboard, HMD, UndoStack, OverlaySystemWindow, - keyUpEventFromUIWindow:true */ + progressDialog, tooltip, MyAvatar, Quat, Controller, Clipboard, HMD, UndoStack, OverlaySystemWindow */ (function() { // BEGIN LOCAL_SCOPE //var CreateApp = function() { // BEGIN LOCAL_SCOPE @@ -132,6 +131,7 @@ shouldUseEditTabletApp: shouldUseEditTabletApp }); gridTool.selectionDisplay = selectionDisplay; + gridTool.createApp = createApp; gridTool.setVisible(false); var editTools = new EditTools({ @@ -149,8 +149,10 @@ var EntityShapeVisualizer = Script.require('./modules/entityShapeVisualizer.js'); var entityShapeVisualizer = new EntityShapeVisualizer(["Zone"], entityShapeVisualizerSessionName); - var entityListTool = new EntityListTool(shouldUseEditTabletApp); + var entityListTool = new EntityListTool(shouldUseEditTabletApp, selectionManager); entityListTool.createApp = createApp; + entityListTool.cameraManager = cameraManager; + entityListTool.selectionDisplay = selectionDisplay; selectionManager.addEventListener(function () { selectionDisplay.updateHandles(); @@ -192,9 +194,9 @@ var SETTING_AUTO_FOCUS_ON_SELECT = "autoFocusOnSelect"; var SETTING_EASE_ON_FOCUS = "cameraEaseOnFocus"; var SETTING_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE = "showLightsAndParticlesInEditMode"; - var SETTING_SHOW_ZONES_IN_EDIT_MODE = "showZonesInEditMode"; - var SETTING_EDITOR_COLUMNS_SETUP = "editorColumnsSetup"; - var SETTING_ENTITY_LIST_DEFAULT_RADIUS = "entityListDefaultRadius"; + createApp.SETTING_SHOW_ZONES_IN_EDIT_MODE = "showZonesInEditMode"; + createApp.SETTING_EDITOR_COLUMNS_SETUP = "editorColumnsSetup"; + createApp.SETTING_ENTITY_LIST_DEFAULT_RADIUS = "entityListDefaultRadius"; var SETTING_EDIT_PREFIX = "Edit/"; @@ -1004,11 +1006,11 @@ }); addButton("importEntitiesButton", function() { - importEntitiesFromFile(); + createApp.importEntitiesFromFile(); }); addButton("importEntitiesFromUrlButton", function() { - importEntitiesFromUrl(); + createApp.importEntitiesFromUrl(); }); addButton("openAssetBrowserButton", function() { @@ -1134,7 +1136,7 @@ print("Setting isActive: " + active); isActive = active; activeButton.editProperties({isActive: isActive}); - undoHistory.setEnabled(isActive); + createApp.undoHistory.setEnabled(isActive); editVoxels.setActive(active); @@ -1722,7 +1724,7 @@ (Math.abs(point.z - center.z) <= (dimensions.z / 2.0)); } - function selectAllEntitiesInCurrentSelectionBox(keepIfTouching) { + createApp.selectAllEntitiesInCurrentSelectionBox = function(keepIfTouching) { if (selectionManager.hasSelection()) { // Get all entities touching the bounding box of the current selection var boundingBoxCorner = Vec3.subtract(selectionManager.worldPosition, @@ -1814,7 +1816,7 @@ } } - function unparentSelectedEntities() { + createApp.unparentSelectedEntities = function() { if (SelectionManager.hasSelection() && SelectionManager.hasUnlockedSelection()) { var selectedEntities = selectionManager.selections; var parentCheck = false; @@ -1855,7 +1857,7 @@ Window.notifyEditError("You have nothing selected or the selection has locked entities."); } } - function parentSelectedEntities() { + createApp.parentSelectedEntities = function() { if (SelectionManager.hasSelection() && SelectionManager.hasUnlockedSelection()) { var selectedEntities = selectionManager.selections; if (selectedEntities.length <= 1) { @@ -1890,7 +1892,7 @@ Window.notifyEditError("You have nothing selected or the selection has locked entities."); } } - function deleteSelectedEntities() { + createApp.deleteSelectedEntities = function() { if (SelectionManager.hasSelection() && SelectionManager.hasUnlockedSelection()) { var deletedIDs = []; @@ -1928,7 +1930,7 @@ } } - function toggleSelectedEntitiesLocked() { + createApp.toggleSelectedEntitiesLocked = function() { if (SelectionManager.hasSelection()) { var locked = !Entities.getEntityProperties(SelectionManager.selections[0], ["locked"]).locked; for (var i = 0; i < selectionManager.selections.length; i++) { @@ -1942,7 +1944,7 @@ } } - function toggleSelectedEntitiesVisible() { + createApp.toggleSelectedEntitiesVisible = function() { if (SelectionManager.hasSelection()) { var visible = !Entities.getEntityProperties(SelectionManager.selections[0], ["visible"]).visible; for (var i = 0; i < selectionManager.selections.length; i++) { @@ -2007,7 +2009,7 @@ if (radius < 0 || isNaN(radius)){ radius = 100; } - Settings.setValue(SETTING_ENTITY_LIST_DEFAULT_RADIUS, radius); + Settings.setValue(createApp.SETTING_ENTITY_LIST_DEFAULT_RADIUS, radius); } } @@ -2019,22 +2021,22 @@ } else if (menuItem === MENU_ALLOW_SELECTION_LIGHTS) { Entities.setLightsArePickable(Menu.isOptionChecked(MENU_ALLOW_SELECTION_LIGHTS)); } else if (menuItem === "Delete") { - deleteSelectedEntities(); + createApp.deleteSelectedEntities(); } else if (menuItem === "Undo") { - undoHistory.undo(); + createApp.undoHistory.undo(); } else if (menuItem === "Redo") { - undoHistory.redo(); + createApp.undoHistory.redo(); } else if (menuItem === MENU_SHOW_ICONS_IN_CREATE_MODE) { entityIconOverlayManager.setVisible(isActive && Menu.isOptionChecked(MENU_SHOW_ICONS_IN_CREATE_MODE)); } else if (menuItem === MENU_CREATE_ENTITIES_GRABBABLE) { Settings.setValue(SETTING_EDIT_PREFIX + menuItem, Menu.isOptionChecked(menuItem)); } else if (menuItem === MENU_ENTITY_LIST_DEFAULT_RADIUS) { Window.promptTextChanged.connect(onPromptTextChangedDefaultRadiusUserPref); - Window.promptAsync("Entity List Default Radius (in meters)", "" + Settings.getValue(SETTING_ENTITY_LIST_DEFAULT_RADIUS, 100)); + Window.promptAsync("Entity List Default Radius (in meters)", "" + Settings.getValue(createApp.SETTING_ENTITY_LIST_DEFAULT_RADIUS, 100)); } else if (menuItem === MENU_IMPORT_FROM_FILE) { - importEntitiesFromFile(); + createApp.importEntitiesFromFile(); } else if (menuItem === MENU_IMPORT_FROM_URL) { - importEntitiesFromUrl(); + createApp.importEntitiesFromUrl(); } tooltip.show(false); } @@ -2177,7 +2179,7 @@ function deleteKey(value) { if (value === 0) { // on release - deleteSelectedEntities(); + createApp.deleteSelectedEntities(); } } function deselectKey(value) { @@ -2192,17 +2194,17 @@ } function focusKey(value) { if (value === 0) { // on release - setCameraFocusToSelection(); + createApp.setCameraFocusToSelection(); } } function gridKey(value) { if (value === 0) { // on release - alignGridToSelection(); + createApp.alignGridToSelection(); } } function viewGridKey(value) { if (value === 0) { // on release - toggleGridVisibility(); + createApp.toggleGridVisibility(); } } function snapKey(value) { @@ -2212,12 +2214,12 @@ } function gridToAvatarKey(value) { if (value === 0) { // on release - alignGridToAvatar(); + createApp.alignGridToAvatar(); } } - function rotateAsNextClickedSurfaceKey(value) { + createApp.rotateAsNextClickedSurfaceKey = function(value) { if (value === 0) { // on release - rotateAsNextClickedSurface(); + createApp.rotateAsNextClickedSurface(); } } function quickRotate90xKey(value) { @@ -2321,10 +2323,10 @@ }; function updateUndoRedoMenuItems() { - Menu.setMenuEnabled("Edit > Undo", undoHistory.canUndo()); - Menu.setMenuEnabled("Edit > Redo", undoHistory.canRedo()); + Menu.setMenuEnabled("Edit > Undo", createApp.undoHistory.canUndo()); + Menu.setMenuEnabled("Edit > Redo", createApp.undoHistory.canRedo()); } - var undoHistory = new UndoHistory(updateUndoRedoMenuItems); + createApp.undoHistory = new UndoHistory(updateUndoRedoMenuItems); updateUndoRedoMenuItems(); // When an entity has been deleted we need a way to "undo" this deletion. Because it's not currently @@ -2421,7 +2423,7 @@ properties: currentProperties }); } - undoHistory.pushCommand(applyEntityProperties, undoData, applyEntityProperties, redoData); + createApp.undoHistory.pushCommand(applyEntityProperties, undoData, applyEntityProperties, redoData); } var ServerScriptStatusMonitor = function(entityID, statusCallback) { @@ -3060,7 +3062,7 @@ mapping.from([Controller.Hardware.Keyboard.G]).to(viewGridKey); mapping.from([Controller.Hardware.Keyboard.H]).to(snapKey); mapping.from([Controller.Hardware.Keyboard.K]).to(gridToAvatarKey); - mapping.from([Controller.Hardware.Keyboard["0"]]).to(rotateAsNextClickedSurfaceKey); + mapping.from([Controller.Hardware.Keyboard["0"]]).to(createApp.rotateAsNextClickedSurfaceKey); mapping.from([Controller.Hardware.Keyboard["7"]]).to(quickRotate90xKey); mapping.from([Controller.Hardware.Keyboard["8"]]).to(quickRotate90yKey); mapping.from([Controller.Hardware.Keyboard["9"]]).to(quickRotate90zKey); @@ -3080,18 +3082,18 @@ // Bind undo to ctrl-shift-z to maintain backwards-compatibility mapping.from([Controller.Hardware.Keyboard.Z]) .when([Controller.Hardware.Keyboard.Control, Controller.Hardware.Keyboard.Shift]) - .to(whenPressed(function() { undoHistory.redo() })); + .to(whenPressed(function() { createApp.undoHistory.redo() })); mapping.from([Controller.Hardware.Keyboard.P]) .when([Controller.Hardware.Keyboard.Control, Controller.Hardware.Keyboard.Shift]) - .to(whenReleased(function() { unparentSelectedEntities(); })); + .to(whenReleased(function() { createApp.unparentSelectedEntities(); })); mapping.from([Controller.Hardware.Keyboard.P]) .when([Controller.Hardware.Keyboard.Control, !Controller.Hardware.Keyboard.Shift]) - .to(whenReleased(function() { parentSelectedEntities(); })); + .to(whenReleased(function() { createApp.parentSelectedEntities(); })); - var keyUpEventFromUIWindow = function(keyUpEvent) { + createApp.keyUpEventFromUIWindow = function(keyUpEvent) { var WANT_DEBUG_MISSING_SHORTCUTS = false; var pressedValue = 0.0; @@ -3113,7 +3115,7 @@ } else if (keyUpEvent.keyCodeString === "K") { gridToAvatarKey(pressedValue); } else if (keyUpEvent.keyCodeString === "0") { - rotateAsNextClickedSurfaceKey(pressedValue); + createApp.rotateAsNextClickedSurfaceKey(pressedValue); } else if (keyUpEvent.keyCodeString === "7") { quickRotate90xKey(pressedValue); } else if (keyUpEvent.keyCodeString === "8") { @@ -3129,15 +3131,15 @@ } else if (keyUpEvent.controlKey && keyUpEvent.keyCodeString === "D") { selectionManager.duplicateSelection(); } else if (!isOnMacPlatform && keyUpEvent.controlKey && !keyUpEvent.shiftKey && keyUpEvent.keyCodeString === "Z") { - undoHistory.undo(); // undo is only handled via handleMenuItem on Mac + createApp.undoHistory.undo(); // undo is only handled via handleMenuItem on Mac } else if (keyUpEvent.controlKey && !keyUpEvent.shiftKey && keyUpEvent.keyCodeString === "P") { - parentSelectedEntities(); + createApp.parentSelectedEntities(); } else if (keyUpEvent.controlKey && keyUpEvent.shiftKey && keyUpEvent.keyCodeString === "P") { - unparentSelectedEntities(); + createApp.unparentSelectedEntities(); } else if (!isOnMacPlatform && ((keyUpEvent.controlKey && keyUpEvent.shiftKey && keyUpEvent.keyCodeString === "Z") || (keyUpEvent.controlKey && keyUpEvent.keyCodeString === "Y"))) { - undoHistory.redo(); // redo is only handled via handleMenuItem on Mac + createApp.undoHistory.redo(); // redo is only handled via handleMenuItem on Mac } else if (WANT_DEBUG_MISSING_SHORTCUTS) { console.warn("unhandled key event: " + JSON.stringify(keyUpEvent)) } @@ -3230,17 +3232,17 @@ return realChildren; } - function importEntitiesFromFile() { + createApp.importEntitiesFromFile = function() { Window.browseChanged.connect(onFileOpenChanged); Window.browseAsync("Select .json to Import", "", "*.json"); } - function importEntitiesFromUrl() { + createApp.importEntitiesFromUrl = function() { Window.promptTextChanged.connect(onPromptTextChanged); Window.promptAsync("URL of a .json to import", ""); } - function setCameraFocusToSelection() { + createApp.setCameraFocusToSelection = function() { cameraManager.enable(); if (selectionManager.hasSelection()) { cameraManager.focus(selectionManager.worldPosition, selectionManager.worldDimensions, @@ -3248,7 +3250,7 @@ } } - function alignGridToSelection() { + createApp.alignGridToSelection = function() { if (selectionManager.hasSelection()) { if (!grid.getVisible()) { grid.setVisible(true, true); @@ -3257,14 +3259,14 @@ } } - function alignGridToAvatar() { + createApp.alignGridToAvatar = function() { if (!grid.getVisible()) { grid.setVisible(true, true); } grid.moveToAvatar(); } - function toggleGridVisibility() { + createApp.toggleGridVisibility = function() { if (!grid.getVisible()) { grid.setVisible(true, true); } else { @@ -3272,7 +3274,7 @@ } } - function rotateAsNextClickedSurface() { + createApp.rotateAsNextClickedSurface = function() { if (!SelectionManager.hasSelection() || !SelectionManager.hasUnlockedSelection()) { audioFeedback.rejection(); Window.notifyEditError("You have nothing selected, or the selection is locked."); diff --git a/scripts/system/create/entityList/entityList.js b/scripts/system/create/entityList/entityList.js index 2f7756df14..6f45340828 100644 --- a/scripts/system/create/entityList/entityList.js +++ b/scripts/system/create/entityList/entityList.js @@ -11,9 +11,9 @@ // SPDX-License-Identifier: Apache-2.0 // -/* global EntityListTool, Tablet, selectionManager, Entities, Camera, MyAvatar, Vec3, Menu, Messages, - cameraManager, MENU_EASE_ON_FOCUS, deleteSelectedEntities, toggleSelectedEntitiesLocked, toggleSelectedEntitiesVisible, - keyUpEventFromUIWindow, Script, SelectionDisplay, SelectionManager, Clipboard */ +/* global EntityListTool, Tablet, Entities, Camera, MyAvatar, Vec3, Menu, Messages, + MENU_EASE_ON_FOCUS, + Script, Clipboard */ var PROFILING_ENABLED = false; var profileIndent = ''; @@ -32,8 +32,9 @@ const PROFILE = !PROFILING_ENABLED ? PROFILE_NOOP : function(name, fn, args) { console.log("PROFILE-Script " + profileIndent + "(" + name + ") End " + delta + "ms"); }; -var EntityListTool = function(shouldUseEditTabletApp) { +var EntityListTool = function(shouldUseEditTabletApp, selectionManager) { var that = {}; + that.selectionManager = selectionManager; var CreateWindow = Script.require('../modules/createWindow.js'); @@ -110,8 +111,8 @@ var EntityListTool = function(shouldUseEditTabletApp) { } var selectedIDs = []; - for (var i = 0; i < selectionManager.selections.length; i++) { - selectedIDs.push(selectionManager.selections[i]); + for (var i = 0; i < that.selectionManager.selections.length; i++) { + selectedIDs.push(that.selectionManager.selections[i]); } emitJSONScriptEvent({ @@ -259,8 +260,8 @@ var EntityListTool = function(shouldUseEditTabletApp) { }); var selectedIDs = []; - for (var j = 0; j < selectionManager.selections.length; j++) { - selectedIDs.push(selectionManager.selections[j]); + for (var j = 0; j < that.selectionManager.selections.length; j++) { + selectedIDs.push(that.selectionManager.selections[j]); } emitJSONScriptEvent({ @@ -291,7 +292,7 @@ var EntityListTool = function(shouldUseEditTabletApp) { function onFileSaveChanged(filename) { Window.saveFileChanged.disconnect(onFileSaveChanged); if (filename !== "") { - var success = Clipboard.exportEntities(filename, selectionManager.selections); + var success = Clipboard.exportEntities(filename, that.selectionManager.selections); if (!success) { Window.notifyEditError("Export failed."); } @@ -313,113 +314,113 @@ var EntityListTool = function(shouldUseEditTabletApp) { for (var i = 0; i < ids.length; i++) { entityIDs.push(ids[i]); } - selectionManager.setSelections(entityIDs, that); + that.selectionManager.setSelections(entityIDs, that); if (data.focus) { - cameraManager.enable(); - cameraManager.focus(selectionManager.worldPosition, - selectionManager.worldDimensions, + that.cameraManager.enable(); + that.cameraManager.focus(that.selectionManager.worldPosition, + that.selectionManager.worldDimensions, Menu.isOptionChecked(MENU_EASE_ON_FOCUS)); } } else if (data.type === "refresh") { that.sendUpdate(); } else if (data.type === "teleport") { - if (selectionManager.hasSelection()) { - MyAvatar.position = selectionManager.worldPosition; + if (that.selectionManager.hasSelection()) { + MyAvatar.position = that.selectionManager.worldPosition; } } else if (data.type === "export") { - if (!selectionManager.hasSelection()) { + if (!that.selectionManager.hasSelection()) { Window.notifyEditError("No entities have been selected."); } else { Window.saveFileChanged.connect(onFileSaveChanged); Window.saveAsync("Select Where to Save", "", "*.json"); } } else if (data.type === "delete") { - deleteSelectedEntities(); + that.createApp.deleteSelectedEntities(); } else if (data.type === "toggleLocked") { - toggleSelectedEntitiesLocked(); + that.createApp.toggleSelectedEntitiesLocked(); } else if (data.type === "toggleVisible") { - toggleSelectedEntitiesVisible(); + that.createApp.toggleSelectedEntitiesVisible(); } else if (data.type === "filterInView") { filterInView = data.filterInView === true; } else if (data.type === "radius") { searchRadius = data.radius; } else if (data.type === "cut") { - SelectionManager.cutSelectedEntities(); + that.selectionManager.cutSelectedEntities(); } else if (data.type === "copy") { - SelectionManager.copySelectedEntities(); + that.selectionManager.copySelectedEntities(); } else if (data.type === "paste") { - SelectionManager.pasteEntities(); + that.selectionManager.pasteEntities(); } else if (data.type === "duplicate") { - SelectionManager.duplicateSelection(); + that.selectionManager.duplicateSelection(); that.sendUpdate(); } else if (data.type === "rename") { Entities.editEntity(data.entityID, {name: data.name}); // make sure that the name also gets updated in the properties window - SelectionManager._update(); + that.selectionManager._update(); } else if (data.type === "toggleSpaceMode") { SelectionDisplay.toggleSpaceMode(); } else if (data.type === 'keyUpEvent') { - keyUpEventFromUIWindow(data.keyUpEvent); + that.createApp.keyUpEventFromUIWindow(data.keyUpEvent); } else if (data.type === 'undo') { - undoHistory.undo(); + that.createApp.undoHistory.undo(); } else if (data.type === 'redo') { - undoHistory.redo(); + that.createApp.undoHistory.redo(); } else if (data.type === 'parent') { - parentSelectedEntities(); + that.createApp.parentSelectedEntities(); } else if (data.type === 'unparent') { - unparentSelectedEntities(); + that.createApp.unparentSelectedEntities(); } else if (data.type === 'hmdMultiSelectMode') { hmdMultiSelectMode = data.value; } else if (data.type === 'selectAllInBox') { - selectAllEntitiesInCurrentSelectionBox(false); + that.createApp.selectAllEntitiesInCurrentSelectionBox(false); } else if (data.type === 'selectAllTouchingBox') { - selectAllEntitiesInCurrentSelectionBox(true); + that.createApp.selectAllEntitiesInCurrentSelectionBox(true); } else if (data.type === 'selectParent') { - SelectionManager.selectParent(); + that.selectionManager.selectParent(); } else if (data.type === 'selectTopParent') { - SelectionManager.selectTopParent(); + that.selectionManager.selectTopParent(); } else if (data.type === 'addChildrenToSelection') { - SelectionManager.addChildrenToSelection(); + that.selectionManager.addChildrenToSelection(); } else if (data.type === 'selectFamily') { - SelectionManager.selectFamily(); + that.selectionManager.selectFamily(); } else if (data.type === 'selectTopFamily') { - SelectionManager.selectTopFamily(); + that.selectionManager.selectTopFamily(); } else if (data.type === 'teleportToEntity') { - SelectionManager.teleportToEntity(); + that.selectionManager.teleportToEntity(); } else if (data.type === 'rotateAsTheNextClickedSurface') { - rotateAsNextClickedSurface(); + that.createApp.rotateAsNextClickedSurface(); } else if (data.type === 'quickRotate90x') { - selectionDisplay.rotate90degreeSelection("X"); + that.selectionDisplay.rotate90degreeSelection("X"); } else if (data.type === 'quickRotate90y') { - selectionDisplay.rotate90degreeSelection("Y"); + that.selectionDisplay.rotate90degreeSelection("Y"); } else if (data.type === 'quickRotate90z') { - selectionDisplay.rotate90degreeSelection("Z"); + that.selectionDisplay.rotate90degreeSelection("Z"); } else if (data.type === 'moveEntitySelectionToAvatar') { - SelectionManager.moveEntitiesSelectionToAvatar(); + that.selectionManager.moveEntitiesSelectionToAvatar(); } else if (data.type === 'loadConfigSetting') { - var columnsData = Settings.getValue(SETTING_EDITOR_COLUMNS_SETUP, "NO_DATA"); - var defaultRadius = Settings.getValue(SETTING_ENTITY_LIST_DEFAULT_RADIUS, 100); + var columnsData = Settings.getValue(that.createApp.SETTING_EDITOR_COLUMNS_SETUP, "NO_DATA"); + var defaultRadius = Settings.getValue(that.createApp.SETTING_ENTITY_LIST_DEFAULT_RADIUS, 100); emitJSONScriptEvent({ "type": "loadedConfigSetting", "columnsData": columnsData, "defaultRadius": defaultRadius }); } else if (data.type === 'saveColumnsConfigSetting') { - Settings.setValue(SETTING_EDITOR_COLUMNS_SETUP, data.columnsData); + Settings.setValue(that.createApp.SETTING_EDITOR_COLUMNS_SETUP, data.columnsData); } else if (data.type === 'importFromFile') { - importEntitiesFromFile(); + that.createApp.importEntitiesFromFile(); } else if (data.type === 'importFromUrl') { - importEntitiesFromUrl(); + that.createApp.importEntitiesFromUrl(); } else if (data.type === 'setCameraFocusToSelection') { - setCameraFocusToSelection(); + that.createApp.setCameraFocusToSelection(); } else if (data.type === 'alignGridToSelection') { - alignGridToSelection(); + that.createApp.alignGridToSelection(); } else if (data.type === 'alignGridToAvatar') { - alignGridToAvatar(); + that.createApp.alignGridToAvatar(); } else if (data.type === 'brokenURLReport') { - brokenURLReport(selectionManager.selections); + brokenURLReport(that.selectionManager.selections); } else if (data.type === 'toggleGridVisibility') { - toggleGridVisibility(); + that.createApp.toggleGridVisibility(); } else if (data.type === 'toggleSnapToGrid') { that.toggleSnapToGrid(); } diff --git a/scripts/system/create/entitySelectionTool/entitySelectionTool.js b/scripts/system/create/entitySelectionTool/entitySelectionTool.js index 9273b97a29..2be752eab0 100644 --- a/scripts/system/create/entitySelectionTool/entitySelectionTool.js +++ b/scripts/system/create/entitySelectionTool/entitySelectionTool.js @@ -495,7 +495,7 @@ SelectionManager = (function() { that.cutSelectedEntities = function() { that.copySelectedEntities(); - deleteSelectedEntities(); + that.createApp.deleteSelectedEntities(); }; that.copySelectedEntities = function() { @@ -624,7 +624,7 @@ SelectionManager = (function() { } redo(copiedProperties); - undoHistory.pushCommand(undo, copiedProperties, redo, copiedProperties); + that.createApp.undoHistory.pushCommand(undo, copiedProperties, redo, copiedProperties); }; that._update = function(selectionUpdated, caller) { diff --git a/scripts/system/libraries/gridTool.js b/scripts/system/libraries/gridTool.js index 79f5398365..fd40a87574 100644 --- a/scripts/system/libraries/gridTool.js +++ b/scripts/system/libraries/gridTool.js @@ -10,8 +10,6 @@ // SPDX-License-Identifier: Apache-2.0 // -/* global keyUpEventFromUIWindow */ - var GRID_CONTROLS_HTML_URL = Script.resolvePath('../html/gridControls.html'); Grid = function() { @@ -321,7 +319,7 @@ GridTool = function(opts) { horizontalGrid.moveToSelection(); } } else if (data.type === 'keyUpEvent') { - keyUpEventFromUIWindow(data.keyUpEvent); + that.createApp.keyUpEventFromUIWindow(data.keyUpEvent); } };