mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 19:29:47 +02:00
Add Parent-Children Selector group
Add Parent-Children Selector group "Inverse Selection" is now responding to Ctrl-I Code Adjustments
This commit is contained in:
parent
bfc216ab00
commit
a68590e68a
1 changed files with 71 additions and 16 deletions
|
@ -47,6 +47,14 @@ const COLUMNS = {
|
||||||
alwaysShown: true,
|
alwaysShown: true,
|
||||||
defaultSortOrder: ASCENDING_SORT,
|
defaultSortOrder: ASCENDING_SORT,
|
||||||
},
|
},
|
||||||
|
parentState: {
|
||||||
|
columnHeader: "A",
|
||||||
|
vglyph: true,
|
||||||
|
dropdownLabel: "Hierarchy",
|
||||||
|
propertyID: "parentState",
|
||||||
|
initialWidth: 0.08,
|
||||||
|
defaultSortOrder: DESCENDING_SORT,
|
||||||
|
},
|
||||||
name: {
|
name: {
|
||||||
columnHeader: "Name",
|
columnHeader: "Name",
|
||||||
propertyID: "name",
|
propertyID: "name",
|
||||||
|
@ -134,14 +142,6 @@ const COLUMNS = {
|
||||||
initialWidth: 0.06,
|
initialWidth: 0.06,
|
||||||
defaultSortOrder: DESCENDING_SORT,
|
defaultSortOrder: DESCENDING_SORT,
|
||||||
},
|
},
|
||||||
parentState: {
|
|
||||||
columnHeader: "M",
|
|
||||||
vglyph: true,
|
|
||||||
dropdownLabel: "Hierarchy",
|
|
||||||
propertyID: "parentState",
|
|
||||||
initialWidth: 0.04,
|
|
||||||
defaultSortOrder: DESCENDING_SORT,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const FILTER_TYPES = [
|
const FILTER_TYPES = [
|
||||||
|
@ -227,6 +227,11 @@ let elEntityTable,
|
||||||
elSelectNone,
|
elSelectNone,
|
||||||
elSelectAllInBox,
|
elSelectAllInBox,
|
||||||
elSelectAllTouchingBox,
|
elSelectAllTouchingBox,
|
||||||
|
elSelectParent,
|
||||||
|
elSelectTopParent,
|
||||||
|
elAddChildrenToSelection,
|
||||||
|
elSelectFamily,
|
||||||
|
elSelectTopFamily,
|
||||||
elTeleportToEntity,
|
elTeleportToEntity,
|
||||||
elFilterTypeMultiselectBox,
|
elFilterTypeMultiselectBox,
|
||||||
elFilterTypeText,
|
elFilterTypeText,
|
||||||
|
@ -290,6 +295,11 @@ function loaded() {
|
||||||
elSelectNone = document.getElementById("selectnone");
|
elSelectNone = document.getElementById("selectnone");
|
||||||
elSelectAllInBox = document.getElementById("selectallinbox");
|
elSelectAllInBox = document.getElementById("selectallinbox");
|
||||||
elSelectAllTouchingBox = document.getElementById("selectalltouchingbox");
|
elSelectAllTouchingBox = document.getElementById("selectalltouchingbox");
|
||||||
|
elSelectParent = document.getElementById("selectparent");
|
||||||
|
elSelectTopParent = document.getElementById("selecttopparent");
|
||||||
|
elAddChildrenToSelection = document.getElementById("addchildrentoselection");
|
||||||
|
elSelectFamily = document.getElementById("selectfamily");
|
||||||
|
elSelectTopFamily = document.getElementById("selecttopfamily");
|
||||||
elTeleportToEntity = document.getElementById("teleport-to-entity");
|
elTeleportToEntity = document.getElementById("teleport-to-entity");
|
||||||
elFilterTypeMultiselectBox = document.getElementById("filter-type-multiselect-box");
|
elFilterTypeMultiselectBox = document.getElementById("filter-type-multiselect-box");
|
||||||
elFilterTypeText = document.getElementById("filter-type-text");
|
elFilterTypeText = document.getElementById("filter-type-text");
|
||||||
|
@ -329,7 +339,6 @@ function loaded() {
|
||||||
EventBridge.emitWebEvent(JSON.stringify({ type: 'hmdMultiSelectMode', value: hmdMultiSelectMode }));
|
EventBridge.emitWebEvent(JSON.stringify({ type: 'hmdMultiSelectMode', value: hmdMultiSelectMode }));
|
||||||
};
|
};
|
||||||
elActionsMenu.onclick = function() {
|
elActionsMenu.onclick = function() {
|
||||||
|
|
||||||
document.getElementById("menuBackgroundOverlay").style.display = "block";
|
document.getElementById("menuBackgroundOverlay").style.display = "block";
|
||||||
document.getElementById("actions-menu").style.display = "block";
|
document.getElementById("actions-menu").style.display = "block";
|
||||||
};
|
};
|
||||||
|
@ -446,6 +455,26 @@ function loaded() {
|
||||||
EventBridge.emitWebEvent(JSON.stringify({ type: 'selectAllTouchingBox' }));
|
EventBridge.emitWebEvent(JSON.stringify({ type: 'selectAllTouchingBox' }));
|
||||||
closeAllEntityListMenu();
|
closeAllEntityListMenu();
|
||||||
};
|
};
|
||||||
|
elSelectParent.onclick = function() {
|
||||||
|
EventBridge.emitWebEvent(JSON.stringify({ type: 'selectParent' }));
|
||||||
|
closeAllEntityListMenu();
|
||||||
|
};
|
||||||
|
elSelectTopParent.onclick = function() {
|
||||||
|
EventBridge.emitWebEvent(JSON.stringify({ type: 'selectTopParent' }));
|
||||||
|
closeAllEntityListMenu();
|
||||||
|
};
|
||||||
|
elAddChildrenToSelection.onclick = function() {
|
||||||
|
EventBridge.emitWebEvent(JSON.stringify({ type: 'addChildrenToSelection' }));
|
||||||
|
closeAllEntityListMenu();
|
||||||
|
};
|
||||||
|
elSelectFamily.onclick = function() {
|
||||||
|
EventBridge.emitWebEvent(JSON.stringify({ type: 'selectFamily' }));
|
||||||
|
closeAllEntityListMenu();
|
||||||
|
};
|
||||||
|
elSelectTopFamily.onclick = function() {
|
||||||
|
EventBridge.emitWebEvent(JSON.stringify({ type: 'selectTopFamily' }));
|
||||||
|
closeAllEntityListMenu();
|
||||||
|
};
|
||||||
elTeleportToEntity.onclick = function () {
|
elTeleportToEntity.onclick = function () {
|
||||||
EventBridge.emitWebEvent(JSON.stringify({ type: "teleportToEntity" }));
|
EventBridge.emitWebEvent(JSON.stringify({ type: "teleportToEntity" }));
|
||||||
closeAllEntityListMenu();
|
closeAllEntityListMenu();
|
||||||
|
@ -1536,6 +1565,32 @@ function loaded() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (controlKey && keyCodeString === "I") {
|
||||||
|
let visibleEntityIDs = visibleEntities.map(visibleEntity => visibleEntity.id);
|
||||||
|
let selectionIncludesAllVisibleEntityIDs = visibleEntityIDs.every(visibleEntityID => {
|
||||||
|
return selectedEntities.includes(visibleEntityID);
|
||||||
|
});
|
||||||
|
|
||||||
|
let selection = [];
|
||||||
|
|
||||||
|
if (!selectionIncludesAllVisibleEntityIDs) {
|
||||||
|
visibleEntityIDs.forEach(function(id) {
|
||||||
|
if (!selectedEntities.includes(id)) {
|
||||||
|
selection.push(id);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
updateSelectedEntities(selection);
|
||||||
|
|
||||||
|
EventBridge.emitWebEvent(JSON.stringify({
|
||||||
|
"type": "selectionUpdate",
|
||||||
|
"focus": false,
|
||||||
|
"entityIds": selection
|
||||||
|
}));
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
EventBridge.emitWebEvent(JSON.stringify({
|
EventBridge.emitWebEvent(JSON.stringify({
|
||||||
type: 'keyUpEvent',
|
type: 'keyUpEvent',
|
||||||
|
@ -1615,9 +1670,9 @@ function loaded() {
|
||||||
});
|
});
|
||||||
|
|
||||||
function closeAllEntityListMenu() {
|
function closeAllEntityListMenu() {
|
||||||
document.getElementById("menuBackgroundOverlay").style.display = "none";
|
document.getElementById("menuBackgroundOverlay").style.display = "none";
|
||||||
document.getElementById("selection-menu").style.display = "none";
|
document.getElementById("selection-menu").style.display = "none";
|
||||||
document.getElementById("actions-menu").style.display = "none";
|
document.getElementById("actions-menu").style.display = "none";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue