Solver.animation改进
All checks were successful
ci/woodpecker/push/check_format Pipeline was successful

This commit is contained in:
zhbaor 2025-02-15 11:02:55 +08:00
parent aa6f8296dc
commit dd4075b39f
2 changed files with 7 additions and 0 deletions

View file

@ -34,6 +34,7 @@ class Recognizer:
self._hsv = None
self._matcher = None
self.scene = Scene.UNDEFINED
self.animation_stop = False
@property
def img(self):

View file

@ -782,6 +782,9 @@ class BaseSolver:
Returns:
bool: 是否正在播放动画
"""
if config.recog.animation_stop:
return False
interval = timedelta(seconds=interval)
last = None
while config.animation:
@ -800,4 +803,7 @@ class BaseSolver:
if result:
logger.debug("等待动画结束")
config.animation.append((config.recog.gray, config.screenshot_time))
else:
config.recog.animation_stop = True
config.animation = []
return result