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