Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 7 files). Show all
Unified · Split
| @@ -145,7 +145,7 @@ void EntityScriptingInterface::attachDefaultEventHandlers(ScriptManager* manager · 144 unmodified lines | |||
| 145 | using SingleEntityHandler = std::function<void(const EntityItemID&)>; | 145 | using SingleEntityHandler = std::function<void(const EntityItemID&)>; |
| 146 | auto makeSingleEntityHandler = [manager](QString eventName) -> SingleEntityHandler { | 146 | auto makeSingleEntityHandler = [manager](QString eventName) -> SingleEntityHandler { |
| 147 | return [manager, eventName](const EntityItemID& entityItemID) { | 147 | return [manager, eventName](const EntityItemID& entityItemID) { |
| 148 | manager->forwardHandlerCall(entityItemID, eventName, { entityItemID.toScriptValue(manager->engine().data()) }); | 148 | manager->forwardHandlerCall(entityItemID, eventName, { EntityItemIDtoScriptValue(manager->engine().data(), entityItemID) }); |
| 149 | }; | 149 | }; |
| 150 | }; | 150 | }; |
| 151 | 151 | ||
| @@ -161,7 +161,7 @@ void EntityScriptingInterface::attachDefaultEventHandlers(ScriptManager* manager · 9 unmodified lines | |||
| 161 | if (!EntityTree::areEntityClicksCaptured()) { | 161 | if (!EntityTree::areEntityClicksCaptured()) { |
| 162 | ScriptEngine* engine = manager->engine().data(); | 162 | ScriptEngine* engine = manager->engine().data(); |
| 163 | manager->forwardHandlerCall(entityItemID, eventName, | 163 | manager->forwardHandlerCall(entityItemID, eventName, |
| 164 | { entityItemID.toScriptValue(engine), event.toScriptValue(engine) }); | 164 | { EntityItemIDtoScriptValue(engine, entityItemID), event.toScriptValue(engine) }); |
| 165 | } | 165 | } |
| 166 | }; | 166 | }; |
| 167 | }; | 167 | }; |
| @@ -178,7 +178,8 @@ void EntityScriptingInterface::attachDefaultEventHandlers(ScriptManager* manager · 10 unmodified lines | |||
| 178 | return [manager, eventName](const EntityItemID& idA, const EntityItemID& idB, const Collision& collision) { | 178 | return [manager, eventName](const EntityItemID& idA, const EntityItemID& idB, const Collision& collision) { |
| 179 | ScriptEngine* engine = manager->engine().data(); | 179 | ScriptEngine* engine = manager->engine().data(); |
| 180 | manager->forwardHandlerCall(idA, eventName, | 180 | manager->forwardHandlerCall(idA, eventName, |
| 181 | { idA.toScriptValue(engine), idB.toScriptValue(engine), | 181 | { EntityItemIDtoScriptValue(engine, idA), |
| 182 | EntityItemIDtoScriptValue(engine, idB), | ||
| 182 | collisionToScriptValue(engine, collision) }); | 183 | collisionToScriptValue(engine, collision) }); |
| 183 | }; | 184 | }; |
| 184 | }; | 185 | }; |