mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-12 12:18:35 -05:00
Fix OCR value not being assigned to variables with enabled regex
This commit is contained in:
@@ -315,19 +315,17 @@ bool MacroConditionVideo::CheckOCR()
|
||||
|
||||
auto text = RunOCR(_ocrParameters.GetOCR(), _screenshotData.image,
|
||||
_ocrParameters.color, _ocrParameters.colorThreshold);
|
||||
|
||||
if (_ocrParameters.regex.Enabled()) {
|
||||
auto expr = _ocrParameters.regex.GetRegularExpression(
|
||||
_ocrParameters.text);
|
||||
if (!expr.isValid()) {
|
||||
return false;
|
||||
}
|
||||
auto match = expr.match(QString::fromStdString(text));
|
||||
return match.hasMatch();
|
||||
}
|
||||
|
||||
SetVariableValue(text);
|
||||
return text == std::string(_ocrParameters.text);
|
||||
if (!_ocrParameters.regex.Enabled()) {
|
||||
return text == std::string(_ocrParameters.text);
|
||||
}
|
||||
auto expr =
|
||||
_ocrParameters.regex.GetRegularExpression(_ocrParameters.text);
|
||||
if (!expr.isValid()) {
|
||||
return false;
|
||||
}
|
||||
auto match = expr.match(QString::fromStdString(text));
|
||||
return match.hasMatch();
|
||||
}
|
||||
|
||||
bool MacroConditionVideo::CheckColor()
|
||||
|
||||
Reference in New Issue
Block a user