History

Review fixes (non-working)

Trouble with: > Script.getExternalPath(Script.ExternalPaths.Assets, "hi") [UncaughtException evaluate] Error: cannot call getExternalPath(): argument 1 has unknown type `ExternalResource::Bucket' (register the type with qScriptRegisterMetaType()) in about:console:1 [Backtrace] <global>() at about:console:1 TypeError: cannot call getExternalPath(): argument 1 has unknown type `ExternalResource::Bucket' (register the type with qScriptRegisterMetaType())

Dale Glass committed 6 years ago

Commit 89aa89e1 parent 792854c6 files · +52 −28Browse files

Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 6 files). Show all

Unified · Split

libraries/script-engine/src/ScriptEngine.cpp+5−0
@@ -769,6 +769,7 @@ void ScriptEngine::init() { · 768 unmodified lines
769 require.setProperty("resolve", resolve, READONLY_PROP_FLAGS);769 require.setProperty("resolve", resolve, READONLY_PROP_FLAGS);
770 resetModuleCache();770 resetModuleCache();
771 }771 }
772 registerEnum("Script.ExternalPaths", QMetaEnum::fromType<ExternalResource::Bucket>());
772 773
773 registerGlobalObject("Audio", DependencyManager::get<AudioScriptingInterface>().data());774 registerGlobalObject("Audio", DependencyManager::get<AudioScriptingInterface>().data());
774 775
@@ -2869,3 +2870,7 @@ void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QS · 2094 unmodified lines
2869 }2870 }
2870 }2871 }
2871}2872}
2873
2874QString ScriptEngine::getExternalPath(ExternalResource::Bucket bucket, const QString &relative_path) {
2875 return ExternalResource::getInstance()->getUrl(bucket, relative_path);
2876}