mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 07:57:30 +02:00
fix bugs in unloading scripts when changing domains
This commit is contained in:
parent
e9207ab74d
commit
93755e6506
2 changed files with 6 additions and 13 deletions
|
@ -127,9 +127,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
var globalMouseClick = function(event) {
|
var globalMouseClick = function(event) {
|
||||||
print("globalMouseClick");
|
|
||||||
var clickedOverlay = Overlays.getOverlayAtPoint({x: event.x, y: event.y});
|
var clickedOverlay = Overlays.getOverlayAtPoint({x: event.x, y: event.y});
|
||||||
|
|
||||||
if (clickedOverlay == externalThis.standUpButton) {
|
if (clickedOverlay == externalThis.standUpButton) {
|
||||||
seat.model = null;
|
seat.model = null;
|
||||||
externalThis.standUp();
|
externalThis.standUp();
|
||||||
|
@ -166,6 +164,7 @@
|
||||||
} catch (e){}
|
} catch (e){}
|
||||||
Script.update.connect(standingUpAnimation);
|
Script.update.connect(standingUpAnimation);
|
||||||
Overlays.editOverlay(this.standUpButton, { visible: false });
|
Overlays.editOverlay(this.standUpButton, { visible: false });
|
||||||
|
Controller.mousePressEvent.disconnect(globalMouseClick);
|
||||||
}
|
}
|
||||||
|
|
||||||
function SeatIndicator(modelProperties, seatIndex) {
|
function SeatIndicator(modelProperties, seatIndex) {
|
||||||
|
@ -226,20 +225,11 @@
|
||||||
print("Was seated: " + sitting);
|
print("Was seated: " + sitting);
|
||||||
storeStartPoseAndTransition();
|
storeStartPoseAndTransition();
|
||||||
updateJoints(1.0);
|
updateJoints(1.0);
|
||||||
Overlays.editOverlay(this.standUpButton, { visible: true });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
frame++;
|
frame++;
|
||||||
}
|
}
|
||||||
|
|
||||||
var locationChanged = false;
|
|
||||||
if (location.hostname != oldHost || !location.isConnected) {
|
|
||||||
this.removeIndicators();
|
|
||||||
oldHost = location.hostname;
|
|
||||||
locationChanged = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
var oldHost = location.hostname;
|
|
||||||
|
|
||||||
this.addIndicators = function() {
|
this.addIndicators = function() {
|
||||||
if (!this.indicatorsAdded) {
|
if (!this.indicatorsAdded) {
|
||||||
|
@ -351,12 +341,13 @@
|
||||||
|
|
||||||
this.unload = function(entityID) {
|
this.unload = function(entityID) {
|
||||||
this.cleanup();
|
this.cleanup();
|
||||||
|
Script.update.disconnect(update);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.preload = function(entityID) {
|
this.preload = function(entityID) {
|
||||||
this.updateProperties(entityID); // All callbacks start by updating the properties
|
this.updateProperties(entityID); // All callbacks start by updating the properties
|
||||||
this.createStandupButton();
|
this.createStandupButton();
|
||||||
Script.update.connect(update); // do we want to do this??? how expensive will this be?
|
Script.update.connect(update);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -64,6 +64,9 @@ EntityTreeRenderer::~EntityTreeRenderer() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntityTreeRenderer::clear() {
|
void EntityTreeRenderer::clear() {
|
||||||
|
foreach (const EntityItemID& entityID, _entityScripts.keys()) {
|
||||||
|
checkAndCallUnload(entityID);
|
||||||
|
}
|
||||||
OctreeRenderer::clear();
|
OctreeRenderer::clear();
|
||||||
_entityScripts.clear();
|
_entityScripts.clear();
|
||||||
}
|
}
|
||||||
|
@ -858,7 +861,6 @@ void EntityTreeRenderer::mouseMoveEvent(QMouseEvent* event, unsigned int deviceI
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntityTreeRenderer::deletingEntity(const EntityItemID& entityID) {
|
void EntityTreeRenderer::deletingEntity(const EntityItemID& entityID) {
|
||||||
|
|
||||||
checkAndCallUnload(entityID);
|
checkAndCallUnload(entityID);
|
||||||
_entityScripts.remove(entityID);
|
_entityScripts.remove(entityID);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue