Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 3 files). Show all
Unified · Split
| @@ -156,6 +156,14 @@ void ScriptEngine::setAvatarData(AvatarData* avatarData, const QString& objectNa · 155 unmodified lines | ||
| 156 | 156 | registerGlobalObject(objectName, _avatarData); |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | +void ScriptEngine::setAvatarHashMap(AvatarHashMap* avatarHashMap, const QString& objectName) { | |
| 160 | + // remove the old Avatar property, if it exists | |
| 161 | + _engine.globalObject().setProperty(objectName, QScriptValue()); | |
| 162 | + | |
| 163 | + // give the script engine the new avatar hash map | |
| 164 | + registerGlobalObject(objectName, avatarHashMap); | |
| 165 | +} | |
| 166 | + | |
| 159 | 167 | bool ScriptEngine::setScriptContents(const QString& scriptContents, const QString& fileNameString) { |
| 160 | 168 | if (_isRunning) { |
| 161 | 169 | return false; |