mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 15:49:24 +02:00
Updated edit.js and selection tool
Last selected entity will now be yellow instead of orange
This commit is contained in:
parent
ff2c344eaa
commit
d96f95a7e9
2 changed files with 14 additions and 16 deletions
|
@ -1115,7 +1115,6 @@ function recursiveDelete(entities, childrenList) {
|
|||
}
|
||||
}
|
||||
function unparentSelectedEntities() {
|
||||
print("unparenting2 Selected Entities");
|
||||
if (SelectionManager.hasSelection()) {
|
||||
var selectedEntities = selectionManager.selections;
|
||||
selectedEntities.forEach(function (id, index) {
|
||||
|
@ -1128,7 +1127,6 @@ function unparentSelectedEntities() {
|
|||
|
||||
}
|
||||
function parentSelectedEntities() {
|
||||
print("parenting selected Entities");
|
||||
if (SelectionManager.hasSelection()) {
|
||||
var selectedEntities = selectionManager.selections;
|
||||
if (selectedEntities.length <= 1) {
|
||||
|
@ -1137,16 +1135,12 @@ function parentSelectedEntities() {
|
|||
}
|
||||
var lastEntityId = selectedEntities[selectedEntities.length-1];
|
||||
|
||||
print("last " + lastEntityId);
|
||||
selectedEntities.forEach(function (id, index) {
|
||||
if (lastEntityId !== id) {
|
||||
print("iterating2 " + id);
|
||||
|
||||
// OK time to check why this breaks!
|
||||
Entities.editEntity(id, {parentID: lastEntityId})
|
||||
}
|
||||
});
|
||||
|
||||
Window.notify("Entities Parented");
|
||||
} else {
|
||||
Window.notifyEditError("You have nothing selected")
|
||||
|
@ -1384,7 +1378,7 @@ Controller.keyReleaseEvent.connect(function (event) {
|
|||
grid.setPosition(newPosition);
|
||||
}
|
||||
} else if (event.text === 'p' && event.isControl ) {
|
||||
if (event.isShifted) {
|
||||
if (event.isAlt) {
|
||||
unparentSelectedEntities();
|
||||
} else {
|
||||
parentSelectedEntities();
|
||||
|
|
|
@ -2189,8 +2189,12 @@ SelectionDisplay = (function() {
|
|||
offset = Vec3.multiplyQbyV(properties.rotation, offset);
|
||||
var boxPosition = Vec3.sum(properties.position, offset);
|
||||
|
||||
var color = {red: 255, green: 153, blue: 0};
|
||||
if (i >= selectionManager.selections.length - 1) color = {red: 255, green: 255, blue: 0};
|
||||
|
||||
Overlays.editOverlay(selectionBoxes[i], {
|
||||
position: boxPosition,
|
||||
color: color,
|
||||
rotation: properties.rotation,
|
||||
dimensions: properties.dimensions,
|
||||
visible: true,
|
||||
|
|
Loading…
Reference in a new issue