History

EntityScriptServer tracks server scripts

Atlante45 committed 9 years ago

Commit 20b7bb01 parent 97e9bff6 files · +19 −4Browse files

Showing the changes to assignment-client/src/scripts/EntityScriptServer.cpp (1 of 6 files). Show all

Unified · Split

assignment-client/src/scripts/EntityScriptServer.cpp+3−3
@@ -97,7 +97,7 @@ void EntityScriptServer::run() { · 96 unmodified lines
97 auto tree = _entityViewer.getTree().get();97 auto tree = _entityViewer.getTree().get();
98 connect(tree, &EntityTree::deletingEntity, this, &EntityScriptServer::deletingEntity, Qt::QueuedConnection);98 connect(tree, &EntityTree::deletingEntity, this, &EntityScriptServer::deletingEntity, Qt::QueuedConnection);
99 connect(tree, &EntityTree::addingEntity, this, &EntityScriptServer::addingEntity, Qt::QueuedConnection);99 connect(tree, &EntityTree::addingEntity, this, &EntityScriptServer::addingEntity, Qt::QueuedConnection);
100 connect(tree, &EntityTree::entityScriptChanging, this, &EntityScriptServer::entityScriptChanging, Qt::QueuedConnection);100 connect(tree, &EntityTree::entityServerScriptChanging, this, &EntityScriptServer::entityServerScriptChanging, Qt::QueuedConnection);
101}101}
102 102
103void EntityScriptServer::nodeActivated(SharedNodePointer activatedNode) {103void EntityScriptServer::nodeActivated(SharedNodePointer activatedNode) {
@@ -220,7 +220,7 @@ void EntityScriptServer::deletingEntity(const EntityItemID& entityID) { · 116 unmodified lines
220 }220 }
221}221}
222 222
223void EntityScriptServer::entityScriptChanging(const EntityItemID& entityID, const bool reload) {223void EntityScriptServer::entityServerScriptChanging(const EntityItemID& entityID, const bool reload) {
224 if (_entityViewer.getTree() && !_shuttingDown) {224 if (_entityViewer.getTree() && !_shuttingDown) {
225 _entitiesScriptEngine->unloadEntityScript(entityID);225 _entitiesScriptEngine->unloadEntityScript(entityID);
226 checkAndCallPreload(entityID, reload);226 checkAndCallPreload(entityID, reload);
@@ -231,7 +231,7 @@ void EntityScriptServer::checkAndCallPreload(const EntityItemID& entityID, const · 4 unmodified lines
231 if (_entityViewer.getTree() && !_shuttingDown) {231 if (_entityViewer.getTree() && !_shuttingDown) {
232 EntityItemPointer entity = _entityViewer.getTree()->findEntityByEntityItemID(entityID);232 EntityItemPointer entity = _entityViewer.getTree()->findEntityByEntityItemID(entityID);
233 if (entity && entity->shouldPreloadScript() && _entitiesScriptEngine) {233 if (entity && entity->shouldPreloadScript() && _entitiesScriptEngine) {
234 QString scriptUrl = entity->getScript();234 QString scriptUrl = entity->getServerScripts();
235 scriptUrl = ResourceManager::normalizeURL(scriptUrl);235 scriptUrl = ResourceManager::normalizeURL(scriptUrl);
236 ScriptEngine::loadEntityScript(_entitiesScriptEngine, entityID, scriptUrl, reload);236 ScriptEngine::loadEntityScript(_entitiesScriptEngine, entityID, scriptUrl, reload);
237 entity->scriptHasPreloaded();237 entity->scriptHasPreloaded();