mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Update entity list upon entity deletion
This commit is contained in:
parent
e8154b5df1
commit
5de451e8e0
3 changed files with 16 additions and 12 deletions
|
@ -475,18 +475,22 @@ var toolBar = (function () {
|
|||
var DELETE_ENTITY_TIMER_TIMEOUT = 100;
|
||||
|
||||
function checkDeletedEntityAndUpdate(entityID) {
|
||||
// Allow for multiple entity deletes before updating the entities selected.
|
||||
if (selectionManager.selections.indexOf(entityID) !== -1) {
|
||||
// Allow for multiple entity deletes before updating the entities selected.
|
||||
entitiesToDelete.push(entityID);
|
||||
if (deletedEntityTimer !== null) {
|
||||
Script.clearTimeout(deletedEntityTimer);
|
||||
}
|
||||
deletedEntityTimer = Script.setTimeout(function () {
|
||||
selectionManager.removeEntities(entitiesToDelete);
|
||||
entitiesToDelete = [];
|
||||
deletedEntityTimer = null;
|
||||
}, DELETE_ENTITY_TIMER_TIMEOUT);
|
||||
}
|
||||
if (deletedEntityTimer !== null) {
|
||||
Script.clearTimeout(deletedEntityTimer);
|
||||
}
|
||||
deletedEntityTimer = Script.setTimeout(function () {
|
||||
if (entitiesToDelete.length > 0) {
|
||||
selectionManager.removeEntities(entitiesToDelete);
|
||||
}
|
||||
entityListTool.clearEntityList();
|
||||
entityListTool.sendUpdate();
|
||||
entitiesToDelete = [];
|
||||
deletedEntityTimer = null;
|
||||
}, DELETE_ENTITY_TIMER_TIMEOUT);
|
||||
}
|
||||
|
||||
function initialize() {
|
||||
|
|
|
@ -346,7 +346,7 @@ function loaded() {
|
|||
if (notFound) {
|
||||
refreshEntities();
|
||||
}
|
||||
} else if (data.type == "update") {
|
||||
} else if (data.type == "update" && data.selectedIDs !== undefined) {
|
||||
var newEntities = data.entities;
|
||||
if (newEntities && newEntities.length == 0) {
|
||||
elNoEntitiesMessage.style.display = "block";
|
||||
|
|
|
@ -893,9 +893,9 @@ function loaded() {
|
|||
} else {
|
||||
elServerScriptStatus.innerText = "Not running";
|
||||
}
|
||||
} else if (data.type === "update") {
|
||||
} else if (data.type === "update" && data.selections) {
|
||||
|
||||
if (!data.selections || data.selections.length === 0) {
|
||||
if (data.selections.length === 0) {
|
||||
if (lastEntityID !== null) {
|
||||
if (editor !== null) {
|
||||
saveJSONUserData(true);
|
||||
|
|
Loading…
Reference in a new issue