Solver.animation改进
All checks were successful
ci/woodpecker/push/check_format Pipeline was successful
All checks were successful
ci/woodpecker/push/check_format Pipeline was successful
This commit is contained in:
parent
aa6f8296dc
commit
dd4075b39f
2 changed files with 7 additions and 0 deletions
|
@ -34,6 +34,7 @@ class Recognizer:
|
||||||
self._hsv = None
|
self._hsv = None
|
||||||
self._matcher = None
|
self._matcher = None
|
||||||
self.scene = Scene.UNDEFINED
|
self.scene = Scene.UNDEFINED
|
||||||
|
self.animation_stop = False
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def img(self):
|
def img(self):
|
||||||
|
|
|
@ -782,6 +782,9 @@ class BaseSolver:
|
||||||
Returns:
|
Returns:
|
||||||
bool: 是否正在播放动画
|
bool: 是否正在播放动画
|
||||||
"""
|
"""
|
||||||
|
if config.recog.animation_stop:
|
||||||
|
return False
|
||||||
|
|
||||||
interval = timedelta(seconds=interval)
|
interval = timedelta(seconds=interval)
|
||||||
last = None
|
last = None
|
||||||
while config.animation:
|
while config.animation:
|
||||||
|
@ -800,4 +803,7 @@ class BaseSolver:
|
||||||
if result:
|
if result:
|
||||||
logger.debug("等待动画结束")
|
logger.debug("等待动画结束")
|
||||||
config.animation.append((config.recog.gray, config.screenshot_time))
|
config.animation.append((config.recog.gray, config.screenshot_time))
|
||||||
|
else:
|
||||||
|
config.recog.animation_stop = True
|
||||||
|
config.animation = []
|
||||||
return result
|
return result
|
||||||
|
|
Loading…
Add table
Reference in a new issue