mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-04-10 06:14:12 +08:00
Fix: MapDetectionError raised in submarine move (#937)
This commit is contained in:
@@ -118,6 +118,13 @@ class StrategyHandler(InfoHandler):
|
|||||||
logger.attr('Map_buff', buff)
|
logger.attr('Map_buff', buff)
|
||||||
return buff
|
return buff
|
||||||
|
|
||||||
|
def is_in_strategy_submarine_move(self):
|
||||||
|
"""
|
||||||
|
Returns:
|
||||||
|
bool:
|
||||||
|
"""
|
||||||
|
return self.appear(SUBMARINE_MOVE_CONFIRM, offset=(20, 20))
|
||||||
|
|
||||||
def strategy_submarine_move_enter(self):
|
def strategy_submarine_move_enter(self):
|
||||||
"""
|
"""
|
||||||
Pages:
|
Pages:
|
||||||
|
|||||||
@@ -110,7 +110,8 @@ class Camera(MapOperation):
|
|||||||
|
|
||||||
self._view_init()
|
self._view_init()
|
||||||
try:
|
try:
|
||||||
if not self.is_in_map():
|
if not self.is_in_map() \
|
||||||
|
and not self.is_in_strategy_submarine_move():
|
||||||
raise MapDetectionError('Image to detect is not in_map')
|
raise MapDetectionError('Image to detect is not in_map')
|
||||||
self.view.load(self.device.image)
|
self.view.load(self.device.image)
|
||||||
except MapDetectionError as e:
|
except MapDetectionError as e:
|
||||||
@@ -133,7 +134,8 @@ class Camera(MapOperation):
|
|||||||
logger.warning('Image is in auto search menu')
|
logger.warning('Image is in auto search menu')
|
||||||
self.ensure_auto_search_exit()
|
self.ensure_auto_search_exit()
|
||||||
raise CampaignEnd('Image is in auto search menu')
|
raise CampaignEnd('Image is in auto search menu')
|
||||||
elif not self.is_in_map():
|
elif not self.is_in_map() \
|
||||||
|
and not self.is_in_strategy_submarine_move():
|
||||||
logger.warning('Image to detect is not in_map')
|
logger.warning('Image to detect is not in_map')
|
||||||
if self.appear_then_click(GAME_TIPS, offset=(20, 20)):
|
if self.appear_then_click(GAME_TIPS, offset=(20, 20)):
|
||||||
logger.warning('Game tips found, retrying')
|
logger.warning('Game tips found, retrying')
|
||||||
|
|||||||
Reference in New Issue
Block a user