History

disable href and entity script events when in edit mode

SamGondelman committed 7 years ago

Commit f2c248c1 parent 12f5a736 files · +34 −15Browse 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+3−1
@@ -976,7 +976,9 @@ void ScriptEngine::addEventHandler(const EntityItemID& entityID, const QString& · 975 unmodified lines
976976 using PointerHandler = std::function<void(const EntityItemID&, const PointerEvent&)>;
977977 auto makePointerHandler = [this](QString eventName) -> PointerHandler {
978978 return [this, eventName](const EntityItemID& entityItemID, const PointerEvent& event) {
979− forwardHandlerCall(entityItemID, eventName, { entityItemID.toScriptValue(this), event.toScriptValue(this) });
979+ if (!EntityTree::areEntityClicksCaptured()) {
980+ forwardHandlerCall(entityItemID, eventName, { entityItemID.toScriptValue(this), event.toScriptValue(this) });
981+ }
980982 };
981983 };
982984