mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 17:14:59 +02:00
Update Entities.getServerScriptStatus to return more information
This commit is contained in:
parent
fa28933464
commit
d45f5ade97
1 changed files with 16 additions and 1 deletions
|
@ -680,7 +680,22 @@ bool EntityScriptingInterface::getServerScriptStatus(QUuid entityID, QScriptValu
|
|||
auto client = DependencyManager::get<EntityScriptClient>();
|
||||
auto request = client->createScriptStatusRequest(entityID);
|
||||
connect(request, &GetScriptStatusRequest::finished, callback.engine(), [callback](GetScriptStatusRequest* request) mutable {
|
||||
QScriptValueList args { true };
|
||||
QString statusString;
|
||||
switch (request->status) {
|
||||
case RUNNING:
|
||||
statusString = "running";
|
||||
break;
|
||||
case ERROR_LOADING_SCRIPT:
|
||||
statusString = "error_loading_script";
|
||||
break;
|
||||
case ERROR_RUNNING_SCRIPT:
|
||||
statusString = "error_running_script";
|
||||
break;
|
||||
default:
|
||||
statusString = "";
|
||||
break;
|
||||
}
|
||||
QScriptValueList args { request->responseReceived, request->isRunning, statusString, request->errorInfo };
|
||||
callback.call(QScriptValue(), args);
|
||||
request->deleteLater();
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue