mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 12:33:27 +02:00
partial getMapping PR integration
This commit is contained in:
parent
a863aec4a0
commit
0930cc4f0e
2 changed files with 17 additions and 3 deletions
|
@ -27,8 +27,7 @@
|
|||
#include <shared/QtHelpers.h>
|
||||
#include "Gzip.h"
|
||||
#include "ScriptEngine.h"
|
||||
|
||||
//using Promise = MiniPromise::Promise;
|
||||
#include "ScriptEngineLogging.h"
|
||||
|
||||
AssetScriptingInterface::AssetScriptingInterface(QObject* parent) : BaseAssetScriptingInterface(parent) {
|
||||
if (auto engine = qobject_cast<QScriptEngine*>(parent)) {
|
||||
|
@ -88,7 +87,7 @@ void AssetScriptingInterface::downloadData(QString urlString, QScriptValue callb
|
|||
|
||||
if (!urlString.startsWith(ATP_SCHEME)) {
|
||||
// ... for now at least log a message so user can check logs
|
||||
qDebug() << "AssetScriptingInterface::downloadData ERROR: url does not start with " << ATP_SCHEME;
|
||||
qCDebug(scriptengine) << "AssetScriptingInterface::downloadData url must be of form atp:<hash-value>";
|
||||
return;
|
||||
}
|
||||
QString hash = AssetUtils::extractAssetHash(urlString);
|
||||
|
|
|
@ -79,6 +79,21 @@ public:
|
|||
* @param {string} error
|
||||
*/
|
||||
Q_INVOKABLE void setMapping(QString path, QString hash, QScriptValue callback);
|
||||
|
||||
/**jsdoc
|
||||
* Look up a path to hash mapping within the connected domain's asset server
|
||||
* @function Assets.getMapping
|
||||
* @static
|
||||
* @param path {string}
|
||||
* @param callback {Assets~getMappingCallback}
|
||||
*/
|
||||
|
||||
/**jsdoc
|
||||
* Called when getMapping is complete.
|
||||
* @callback Assets~getMappingCallback
|
||||
* @param error {string} error description if the path could not be resolved; otherwise a null value.
|
||||
* @param assetID {string} hash value if found, else an empty string
|
||||
*/
|
||||
Q_INVOKABLE void getMapping(QString path, QScriptValue callback);
|
||||
|
||||
Q_INVOKABLE void setBakingEnabled(QString path, bool enabled, QScriptValue callback);
|
||||
|
|
Loading…
Reference in a new issue