Showing the changes to libraries/script-engine/src/AssetScriptingInterface.cpp (1 of 16 files). Show all
Unified · Split
| @@ -88,6 +88,20 @@ void AssetScriptingInterface::downloadData(QString urlString, QScriptValue callb · 87 unmodified lines | |||
| 88 | assetRequest->start(); | 88 | assetRequest->start(); |
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | void AssetScriptingInterface::setBakingEnabled(QString path, bool enabled, QScriptValue callback) { | ||
| 92 | auto setBakingEnabledRequest = DependencyManager::get<AssetClient>()->createSetBakingEnabledRequest({ path }, enabled); | ||
| 93 | |||
| 94 | QObject::connect(setBakingEnabledRequest, &SetBakingEnabledRequest::finished, this, [this, callback](SetBakingEnabledRequest* request) mutable { | ||
| 95 | if (callback.isFunction()) { | ||
| 96 | QString error = request->getErrorString(); | ||
| 97 | QScriptValueList args{ error }; | ||
| 98 | callback.call(_engine->currentContext()->thisObject(), args); | ||
| 99 | } | ||
| 100 | request->deleteLater(); | ||
| 101 | }); | ||
| 102 | setBakingEnabledRequest->start(); | ||
| 103 | } | ||
| 104 | |||
| 91 | #if (PR_BUILD || DEV_BUILD) | 105 | #if (PR_BUILD || DEV_BUILD) |
| 92 | void AssetScriptingInterface::sendFakedHandshake() { | 106 | void AssetScriptingInterface::sendFakedHandshake() { |
| 93 | auto nodeList = DependencyManager::get<NodeList>(); | 107 | auto nodeList = DependencyManager::get<NodeList>(); |