mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-29 18:22:55 +02:00
Clear entity list when you change domains
This commit is contained in:
parent
ba5109c458
commit
52f6fe1d04
3 changed files with 16 additions and 2 deletions
|
@ -245,6 +245,10 @@ var toolBar = (function () {
|
||||||
that.setActive(false);
|
that.setActive(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
that.clearEntityList = function() {
|
||||||
|
entityListTool.clearEntityList();
|
||||||
|
};
|
||||||
|
|
||||||
that.setActive = function(active) {
|
that.setActive = function(active) {
|
||||||
if (active != isActive) {
|
if (active != isActive) {
|
||||||
if (active && !Entities.canAdjustLocks()) {
|
if (active && !Entities.canAdjustLocks()) {
|
||||||
|
@ -510,6 +514,7 @@ var toolBar = (function () {
|
||||||
|
|
||||||
Window.domainChanged.connect(function() {
|
Window.domainChanged.connect(function() {
|
||||||
that.setActive(false);
|
that.setActive(false);
|
||||||
|
that.clearEntityList();
|
||||||
});
|
});
|
||||||
|
|
||||||
Entities.canAdjustLocksChanged.connect(function(canAdjustLocks) {
|
Entities.canAdjustLocksChanged.connect(function(canAdjustLocks) {
|
||||||
|
|
|
@ -201,7 +201,9 @@
|
||||||
EventBridge.scriptEventReceived.connect(function(data) {
|
EventBridge.scriptEventReceived.connect(function(data) {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
|
|
||||||
if (data.type == "selectionUpdate") {
|
if (data.type === "clearEntityList") {
|
||||||
|
clearEntities();
|
||||||
|
} else if (data.type == "selectionUpdate") {
|
||||||
var notFound = updateSelectedEntities(data.selectedIDs);
|
var notFound = updateSelectedEntities(data.selectedIDs);
|
||||||
if (notFound) {
|
if (notFound) {
|
||||||
refreshEntities();
|
refreshEntities();
|
||||||
|
|
|
@ -26,13 +26,20 @@ EntityListTool = function(opts) {
|
||||||
selectedIDs.push(selectionManager.selections[i]);
|
selectedIDs.push(selectionManager.selections[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
data = {
|
var data = {
|
||||||
type: 'selectionUpdate',
|
type: 'selectionUpdate',
|
||||||
selectedIDs: selectedIDs,
|
selectedIDs: selectedIDs,
|
||||||
};
|
};
|
||||||
webView.eventBridge.emitScriptEvent(JSON.stringify(data));
|
webView.eventBridge.emitScriptEvent(JSON.stringify(data));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
that.clearEntityList = function () {
|
||||||
|
var data = {
|
||||||
|
type: 'clearEntityList'
|
||||||
|
}
|
||||||
|
webView.eventBridge.emitScriptEvent(JSON.stringify(data));
|
||||||
|
};
|
||||||
|
|
||||||
that.sendUpdate = function() {
|
that.sendUpdate = function() {
|
||||||
var entities = [];
|
var entities = [];
|
||||||
var ids = Entities.findEntities(MyAvatar.position, searchRadius);
|
var ids = Entities.findEntities(MyAvatar.position, searchRadius);
|
||||||
|
|
Loading…
Reference in a new issue