From f34d1fe0817be4052f9c3b74279e0ed585cbcd86 Mon Sep 17 00:00:00 2001 From: WarmUpTill Date: Mon, 6 Feb 2023 19:48:23 +0100 Subject: [PATCH] Enable variable support --- src/macro-external/video/macro-condition-video.cpp | 5 +++++ src/macro-external/video/macro-condition-video.hpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/macro-external/video/macro-condition-video.cpp b/src/macro-external/video/macro-condition-video.cpp index 40d38c15..fa0c923c 100644 --- a/src/macro-external/video/macro-condition-video.cpp +++ b/src/macro-external/video/macro-condition-video.cpp @@ -293,6 +293,7 @@ bool MacroConditionVideo::CheckOCR() return match.hasMatch(); } + SetVariableValue(text); return text == std::string(_ocrParamters.text); } @@ -305,6 +306,10 @@ bool MacroConditionVideo::Compare() _areaParameters.area.height); } + if (_condition != VideoCondition::OCR) { + SetVariableValue(""); + } + switch (_condition) { case VideoCondition::MATCH: return _screenshotData.image == _matchImage; diff --git a/src/macro-external/video/macro-condition-video.hpp b/src/macro-external/video/macro-condition-video.hpp index 7ae76925..738c8b3e 100644 --- a/src/macro-external/video/macro-condition-video.hpp +++ b/src/macro-external/video/macro-condition-video.hpp @@ -22,7 +22,7 @@ class PreviewDialog; class MacroConditionVideo : public MacroCondition { public: - MacroConditionVideo(Macro *m) : MacroCondition(m){}; + MacroConditionVideo(Macro *m) : MacroCondition(m, true){}; bool CheckCondition(); bool Save(obs_data_t *obj) const; bool Load(obs_data_t *obj);