From f563b8ca2ec479cc335b485aafa3e4a7d686c0a4 Mon Sep 17 00:00:00 2001 From: Liv Erickson Date: Fri, 5 Jan 2018 17:49:43 -0800 Subject: [PATCH 1/3] Make zones and lights not default grabbable --- scripts/system/edit.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/system/edit.js b/scripts/system/edit.js index e28f877d85..4ffccb3383 100644 --- a/scripts/system/edit.js +++ b/scripts/system/edit.js @@ -239,6 +239,7 @@ var toolBar = (function () { var dimensions = properties.dimensions ? properties.dimensions : DEFAULT_DIMENSIONS; var position = getPositionToCreateEntity(); var entityID = null; + if (position !== null && position !== undefined) { var direction; if (Camera.mode === "entity" || Camera.mode === "independent") { @@ -281,6 +282,12 @@ var toolBar = (function () { if (Menu.isOptionChecked(GRABBABLE_ENTITIES_MENU_ITEM)) { properties.userData = JSON.stringify({ grabbableKey: { grabbable: true } }); } + + if (properties.type === "Zone" || properties.type === "Light") { + properties.userData = JSON.stringify({ grabbableKey: { grabbable: false } }); + properties.dynamic = false; + } + entityID = Entities.addEntity(properties); if (properties.type === "ParticleEffect") { From 4e582975b651ed7ca90f41cc279d2b7a5cb2f7fe Mon Sep 17 00:00:00 2001 From: Liv Erickson Date: Fri, 5 Jan 2018 18:03:20 -0800 Subject: [PATCH 2/3] cleanup --- scripts/system/edit.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/system/edit.js b/scripts/system/edit.js index 4ffccb3383..813dc4ae5b 100644 --- a/scripts/system/edit.js +++ b/scripts/system/edit.js @@ -279,13 +279,11 @@ var toolBar = (function () { position = grid.snapToSurface(grid.snapToGrid(position, false, dimensions), dimensions); properties.position = position; - if (Menu.isOptionChecked(GRABBABLE_ENTITIES_MENU_ITEM)) { + if (Menu.isOptionChecked(GRABBABLE_ENTITIES_MENU_ITEM) && + !(properties.type === "Zone" || properties.type === "Light")) { properties.userData = JSON.stringify({ grabbableKey: { grabbable: true } }); - } - - if (properties.type === "Zone" || properties.type === "Light") { + } else { properties.userData = JSON.stringify({ grabbableKey: { grabbable: false } }); - properties.dynamic = false; } entityID = Entities.addEntity(properties); From d1e176ee9d236350a13288505f009572601f9508 Mon Sep 17 00:00:00 2001 From: Liv Erickson Date: Mon, 8 Jan 2018 11:31:09 -0800 Subject: [PATCH 3/3] Update menu to reflect non-grabbable entity types, include particles --- scripts/system/edit.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/system/edit.js b/scripts/system/edit.js index 813dc4ae5b..5fb75748d5 100644 --- a/scripts/system/edit.js +++ b/scripts/system/edit.js @@ -225,7 +225,7 @@ function adjustPositionPerBoundingBox(position, direction, registration, dimensi var TOOLS_PATH = Script.resolvePath("assets/images/tools/"); var GRABBABLE_ENTITIES_MENU_CATEGORY = "Edit"; -var GRABBABLE_ENTITIES_MENU_ITEM = "Create Entities As Grabbable"; +var GRABBABLE_ENTITIES_MENU_ITEM = "Create Entities As Grabbable (except Zones, Particles, and Lights)"; var toolBar = (function () { var EDIT_SETTING = "io.highfidelity.isEditing"; // for communication with other scripts @@ -280,7 +280,7 @@ var toolBar = (function () { position = grid.snapToSurface(grid.snapToGrid(position, false, dimensions), dimensions); properties.position = position; if (Menu.isOptionChecked(GRABBABLE_ENTITIES_MENU_ITEM) && - !(properties.type === "Zone" || properties.type === "Light")) { + !(properties.type === "Zone" || properties.type === "Light" || properties.type === "ParticleEffect")) { properties.userData = JSON.stringify({ grabbableKey: { grabbable: true } }); } else { properties.userData = JSON.stringify({ grabbableKey: { grabbable: false } });