Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 9 files). Show all
Unified · Split
| @@ -44,6 +44,7 @@ · 43 unmodified lines | |||
| 44 | #include <PathUtils.h> | 44 | #include <PathUtils.h> |
| 45 | #include <ResourceScriptingInterface.h> | 45 | #include <ResourceScriptingInterface.h> |
| 46 | #include <NodeList.h> | 46 | #include <NodeList.h> |
| 47 | #include <ScriptAvatarData.h> | ||
| 47 | #include <udt/PacketHeaders.h> | 48 | #include <udt/PacketHeaders.h> |
| 48 | #include <UUID.h> | 49 | #include <UUID.h> |
| 49 | #include <ui/Menu.h> | 50 | #include <ui/Menu.h> |
| @@ -535,6 +536,16 @@ static QScriptValue createScriptableResourcePrototype(QScriptEngine* engine) { · 485 unmodified lines | |||
| 535 | return prototype; | 536 | return prototype; |
| 536 | } | 537 | } |
| 537 | 538 | ||
| 539 | QScriptValue avatarDataToScriptValue(QScriptEngine* engine, ScriptAvatarData* const& in) { | ||
| 540 | return engine->newQObject(in, QScriptEngine::ScriptOwnership, DEFAULT_QOBJECT_WRAP_OPTIONS); | ||
| 541 | } | ||
| 542 | |||
| 543 | void avatarDataFromScriptValue(const QScriptValue& object, ScriptAvatarData*& out) { | ||
| 544 | // This is not implemented because there are no slots/properties that take an AvatarSharedPointer from a script | ||
| 545 | assert(false); | ||
| 546 | out = nullptr; | ||
| 547 | } | ||
| 548 | |||
| 538 | void ScriptEngine::resetModuleCache(bool deleteScriptCache) { | 549 | void ScriptEngine::resetModuleCache(bool deleteScriptCache) { |
| 539 | if (QThread::currentThread() != thread()) { | 550 | if (QThread::currentThread() != thread()) { |
| 540 | executeOnScriptThread([=]() { resetModuleCache(deleteScriptCache); }); | 551 | executeOnScriptThread([=]() { resetModuleCache(deleteScriptCache); }); |
| @@ -614,6 +625,7 @@ void ScriptEngine::init() { · 73 unmodified lines | |||
| 614 | 625 | ||
| 615 | qScriptRegisterMetaType(this, injectorToScriptValue, injectorFromScriptValue); | 626 | qScriptRegisterMetaType(this, injectorToScriptValue, injectorFromScriptValue); |
| 616 | qScriptRegisterMetaType(this, inputControllerToScriptValue, inputControllerFromScriptValue); | 627 | qScriptRegisterMetaType(this, inputControllerToScriptValue, inputControllerFromScriptValue); |
| 628 | qScriptRegisterMetaType(this, avatarDataToScriptValue, avatarDataFromScriptValue); | ||
| 617 | qScriptRegisterMetaType(this, animationDetailsToScriptValue, animationDetailsFromScriptValue); | 629 | qScriptRegisterMetaType(this, animationDetailsToScriptValue, animationDetailsFromScriptValue); |
| 618 | qScriptRegisterMetaType(this, webSocketToScriptValue, webSocketFromScriptValue); | 630 | qScriptRegisterMetaType(this, webSocketToScriptValue, webSocketFromScriptValue); |
| 619 | qScriptRegisterMetaType(this, qWSCloseCodeToScriptValue, qWSCloseCodeFromScriptValue); | 631 | qScriptRegisterMetaType(this, qWSCloseCodeToScriptValue, qWSCloseCodeFromScriptValue); |