re add locking/visibility tools to edit.js

This commit is contained in:
James B. Pollack 2016-04-28 13:29:54 -07:00
parent b95c81d0ba
commit 795d866da9
3 changed files with 17 additions and 15 deletions

View file

@ -50,10 +50,9 @@ selectionManager.addEventListener(function() {
lightOverlayManager.updatePositions(); lightOverlayManager.updatePositions();
}); });
var toolIconUrl = Script.resolvePath("assets/images/tools/"); var toolIconUrl = HIFI_PUBLIC_BUCKET + "images/tools/";
var toolHeight = 50; var toolHeight = 50;
var toolWidth = 50; var toolWidth = 50;
var TOOLBAR_MARGIN_Y = 25;
var DEGREES_TO_RADIANS = Math.PI / 180.0; var DEGREES_TO_RADIANS = Math.PI / 180.0;
var RADIANS_TO_DEGREES = 180.0 / Math.PI; var RADIANS_TO_DEGREES = 180.0 / Math.PI;
@ -106,7 +105,7 @@ IMPORTING_SVO_OVERLAY_HEIGHT = 30;
IMPORTING_SVO_OVERLAY_MARGIN = 5; IMPORTING_SVO_OVERLAY_MARGIN = 5;
IMPORTING_SVO_OVERLAY_LEFT_MARGIN = 34; IMPORTING_SVO_OVERLAY_LEFT_MARGIN = 34;
var importingSVOImageOverlay = Overlays.addOverlay("image", { var importingSVOImageOverlay = Overlays.addOverlay("image", {
imageURL: Script.resolvePath("assets") + "/images/hourglass.svg", imageURL: HIFI_PUBLIC_BUCKET + "images/hourglass.svg",
width: 20, width: 20,
height: 20, height: 20,
alpha: 1.0, alpha: 1.0,
@ -180,14 +179,11 @@ var toolBar = (function() {
newParticleButton newParticleButton
function initialize() { function initialize() {
toolBar = new ToolBar(0, 0, ToolBar.HORIZONTAL, "highfidelity.edit.toolbar", function(windowDimensions, toolbar) { toolBar = new ToolBar(0, 0, ToolBar.VERTICAL, "highfidelity.edit.toolbar", function(windowDimensions, toolbar) {
return { return {
x: windowDimensions.x / 2, x: windowDimensions.x - 8 - toolbar.width,
y: windowDimensions.y y: (windowDimensions.y - toolbar.height) / 2
}; };
}, {
x: toolWidth,
y: -TOOLBAR_MARGIN_Y - toolHeight
}); });
activeButton = toolBar.addTool({ activeButton = toolBar.addTool({
@ -205,7 +201,7 @@ var toolBar = (function() {
}, true, false); }, true, false);
newModelButton = toolBar.addTool({ newModelButton = toolBar.addTool({
imageURL:toolIconUrl + "model-01.svg", imageURL: toolIconUrl + "model-01.svg",
subImage: { subImage: {
x: 0, x: 0,
y: Tool.IMAGE_WIDTH, y: Tool.IMAGE_WIDTH,
@ -220,7 +216,7 @@ var toolBar = (function() {
}); });
newCubeButton = toolBar.addTool({ newCubeButton = toolBar.addTool({
imageURL:toolIconUrl + "cube-01.svg", imageURL: toolIconUrl + "cube-01.svg",
subImage: { subImage: {
x: 0, x: 0,
y: Tool.IMAGE_WIDTH, y: Tool.IMAGE_WIDTH,

View file

@ -59,6 +59,8 @@ EntityListTool = function(opts) {
name: properties.name, name: properties.name,
type: properties.type, type: properties.type,
url: properties.type == "Model" ? properties.modelURL : "", url: properties.type == "Model" ? properties.modelURL : "",
locked: properties.locked,
visible: properties.visible
}); });
} }
@ -99,6 +101,10 @@ EntityListTool = function(opts) {
} }
} else if (data.type == "delete") { } else if (data.type == "delete") {
deleteSelectedEntities(); deleteSelectedEntities();
} else if (data.type == "toggleLocked") {
toggleSelectedEntitiesLocked();
} else if (data.type == "toggleVisible") {
toggleSelectedEntitiesVisible();
} else if (data.type === "radius") { } else if (data.type === "radius") {
searchRadius = data.radius; searchRadius = data.radius;
that.sendUpdate(); that.sendUpdate();