Display different message if whole image matches pattern

The "pattern is highlighted in red" message does not make sense in this
case as there is no room to display the red border around the match.
This commit is contained in:
WarmUpTill
2023-06-03 13:24:47 +02:00
committed by WarmUpTill
parent 284c8020b2
commit 76c759c8f4
2 changed files with 4 additions and 0 deletions

View File

@@ -232,6 +232,7 @@ AdvSceneSwitcher.condition.video.screenshotFail="Failed to get screenshot of sou
AdvSceneSwitcher.condition.video.screenshotEmpty="Screenshot is empty - Is the source visible?"
AdvSceneSwitcher.condition.video.patternMatchFail="Pattern was not found!"
AdvSceneSwitcher.condition.video.patternMatchSuccess="Pattern is highlighted in red"
AdvSceneSwitcher.condition.video.patternMatchSuccessFullImage="Full image matches the pattern"
AdvSceneSwitcher.condition.video.objectMatchFail="Object was not found!"
AdvSceneSwitcher.condition.video.objectMatchSuccess="Object is highlighted in red"
AdvSceneSwitcher.condition.video.ocrMatchSuccess="Detected text:\n\n%1"

View File

@@ -307,6 +307,9 @@ void PreviewImage::MarkMatch(QImage &screenshot,
if (result.total() == 0 || countNonZero(result) == 0) {
emit StatusUpdate(obs_module_text(
"AdvSceneSwitcher.condition.video.patternMatchFail"));
} else if (result.cols == 1 && result.rows == 1) {
emit StatusUpdate(obs_module_text(
"AdvSceneSwitcher.condition.video.patternMatchSuccessFullImage"));
} else {
emit StatusUpdate(obs_module_text(
"AdvSceneSwitcher.condition.video.patternMatchSuccess"));