mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-16 21:47:09 +02:00
Fix enterEntity event not firing in entithy script after content reload
This commit is contained in:
parent
82a0815964
commit
c6728be4e8
1 changed files with 7 additions and 7 deletions
|
@ -167,6 +167,13 @@ void EntityTreeRenderer::resetEntitiesScriptEngine() {
|
|||
auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>();
|
||||
entityScriptingInterface->setEntitiesScriptEngine(entitiesScriptEngineProvider);
|
||||
|
||||
connect(_entitiesScriptEngine.data(), &ScriptEngine::entityScriptPreloadFinished, [&](const EntityItemID& entityID) {
|
||||
EntityItemPointer entity = getTree()->findEntityByID(entityID);
|
||||
if (entity) {
|
||||
entity->setScriptHasFinishedPreload(true);
|
||||
}
|
||||
});
|
||||
|
||||
// Connect mouse events to entity script callbacks
|
||||
if (!_mouseAndPreloadSignalHandlersConnected) {
|
||||
|
||||
|
@ -205,13 +212,6 @@ void EntityTreeRenderer::resetEntitiesScriptEngine() {
|
|||
_entitiesScriptEngine->callEntityScriptMethod(entityID, "hoverLeaveEntity", event);
|
||||
});
|
||||
|
||||
connect(_entitiesScriptEngine.data(), &ScriptEngine::entityScriptPreloadFinished, [&](const EntityItemID& entityID) {
|
||||
EntityItemPointer entity = getTree()->findEntityByID(entityID);
|
||||
if (entity) {
|
||||
entity->setScriptHasFinishedPreload(true);
|
||||
}
|
||||
});
|
||||
|
||||
_mouseAndPreloadSignalHandlersConnected = true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue