mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 13:30:33 +02:00
Merge pull request #7785 from imgntn/editicons
Re-add locking/visibility tools to edit.js
This commit is contained in:
commit
b72ac35e8e
4 changed files with 41 additions and 22 deletions
|
@ -336,7 +336,9 @@ var toolBar = (function() {
|
|||
if (active && !Entities.canAdjustLocks()) {
|
||||
Window.alert(INSUFFICIENT_PERMISSIONS_ERROR_MSG);
|
||||
} else {
|
||||
Messages.sendLocalMessage("edit-events", JSON.stringify({enabled: active}));
|
||||
Messages.sendLocalMessage("edit-events", JSON.stringify({
|
||||
enabled: active
|
||||
}));
|
||||
isActive = active;
|
||||
if (!isActive) {
|
||||
entityListTool.setVisible(false);
|
||||
|
@ -549,8 +551,16 @@ var toolBar = (function() {
|
|||
type: "ParticleEffect",
|
||||
isEmitting: true,
|
||||
particleRadius: 0.1,
|
||||
emitAcceleration: {x: 0, y: -1, z: 0},
|
||||
accelerationSpread: {x: 5, y: 0, z: 5},
|
||||
emitAcceleration: {
|
||||
x: 0,
|
||||
y: -1,
|
||||
z: 0
|
||||
},
|
||||
accelerationSpread: {
|
||||
x: 5,
|
||||
y: 0,
|
||||
z: 5
|
||||
},
|
||||
emitSpeed: 1,
|
||||
lifespan: 1,
|
||||
particleRadius: 0.025,
|
||||
|
@ -1207,7 +1217,9 @@ function toggleSelectedEntitiesLocked() {
|
|||
var locked = !Entities.getEntityProperties(SelectionManager.selections[0], ["locked"]).locked;
|
||||
for (var i = 0; i < selectionManager.selections.length; i++) {
|
||||
var entityID = SelectionManager.selections[i];
|
||||
Entities.editEntity(entityID, { locked: locked });
|
||||
Entities.editEntity(entityID, {
|
||||
locked: locked
|
||||
});
|
||||
}
|
||||
entityListTool.sendUpdate();
|
||||
selectionManager._update();
|
||||
|
@ -1219,7 +1231,9 @@ function toggleSelectedEntitiesVisible() {
|
|||
var visible = !Entities.getEntityProperties(SelectionManager.selections[0], ["visible"]).visible;
|
||||
for (var i = 0; i < selectionManager.selections.length; i++) {
|
||||
var entityID = SelectionManager.selections[i];
|
||||
Entities.editEntity(entityID, { visible: visible });
|
||||
Entities.editEntity(entityID, {
|
||||
visible: visible
|
||||
});
|
||||
}
|
||||
entityListTool.sendUpdate();
|
||||
selectionManager._update();
|
||||
|
@ -1554,8 +1568,7 @@ PropertiesTool = function(opts) {
|
|||
data.properties.keyLight.direction.x * DEGREES_TO_RADIANS, data.properties.keyLight.direction.y * DEGREES_TO_RADIANS);
|
||||
}
|
||||
Entities.editEntity(selectionManager.selections[0], data.properties);
|
||||
if (data.properties.name !== undefined || data.properties.modelURL !== undefined
|
||||
|| data.properties.visible !== undefined || data.properties.locked !== undefined) {
|
||||
if (data.properties.name !== undefined || data.properties.modelURL !== undefined || data.properties.visible !== undefined || data.properties.locked !== undefined) {
|
||||
entityListTool.sendUpdate();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ var toolBar = (function() {
|
|||
browseExamplesButton;
|
||||
|
||||
function initialize() {
|
||||
toolBar = new ToolBar(0, 0, ToolBar.HORIXONTAL, "highfidelity.examples.toolbar", function(windowDimensions, toolbar) {
|
||||
toolBar = new ToolBar(0, 0, ToolBar.HORIZONTAL, "highfidelity.examples.toolbar", function(windowDimensions, toolbar) {
|
||||
return {
|
||||
x: windowDimensions.x / 2,
|
||||
y: windowDimensions.y
|
||||
|
|
|
@ -59,6 +59,8 @@ EntityListTool = function(opts) {
|
|||
name: properties.name,
|
||||
type: properties.type,
|
||||
url: properties.type == "Model" ? properties.modelURL : "",
|
||||
locked: properties.locked,
|
||||
visible: properties.visible
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -99,6 +101,10 @@ EntityListTool = function(opts) {
|
|||
}
|
||||
} else if (data.type == "delete") {
|
||||
deleteSelectedEntities();
|
||||
} else if (data.type == "toggleLocked") {
|
||||
toggleSelectedEntitiesLocked();
|
||||
} else if (data.type == "toggleVisible") {
|
||||
toggleSelectedEntitiesVisible();
|
||||
} else if (data.type === "radius") {
|
||||
searchRadius = data.radius;
|
||||
that.sendUpdate();
|
||||
|
|
Loading…
Reference in a new issue