1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-04-26 23:36:30 +08:00

Merge pull request #360 from noname94/patch1

Fix: fleet_switch_click() may fail when SWITCH_OVER not appeared
This commit is contained in:
LmeSzinc
2021-02-21 15:12:43 +08:00
committed by GitHub

View File

@@ -24,9 +24,7 @@ class MapOperation(MysteryHandler, FleetPreparation, Retirement, FastForwardHand
Switch fleet.
"""
logger.info('Switch over')
if not self.appear(SWITCH_OVER):
logger.warning('No buttons detected.')
return False
self.wait_until_appear(SWITCH_OVER, skip_first_screenshot=True)
FLEET_NUM.load_color(self.device.image)
FLEET_NUM._match_init = True
@@ -37,7 +35,6 @@ class MapOperation(MysteryHandler, FleetPreparation, Retirement, FastForwardHand
if not FLEET_NUM.match(self.device.image, offset=(0, 0), threshold=0.9):
break
logger.warning('Fleet switch failed. Retrying.')
return True
def enter_map(self, button, mode='normal'):
"""Enter a campaign.