mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-04-15 04:23:08 +08:00
Fix: Handle forced map event on the top of action point popup
This commit is contained in:
@@ -154,11 +154,16 @@ class ActionPointHandler(UI, MapEventHandler):
|
|||||||
else:
|
else:
|
||||||
self.device.screenshot()
|
self.device.screenshot()
|
||||||
|
|
||||||
|
# End
|
||||||
if self.is_current_ap_visible():
|
if self.is_current_ap_visible():
|
||||||
break
|
break
|
||||||
if timeout.reached():
|
if timeout.reached():
|
||||||
logger.warning('Get action points timeout, wait is_current_ap_visible timeout')
|
logger.warning('Get action points timeout, wait is_current_ap_visible timeout')
|
||||||
break
|
break
|
||||||
|
# Forced map event on the top of action point popup
|
||||||
|
if self.handle_map_event():
|
||||||
|
timeout.reset()
|
||||||
|
continue
|
||||||
|
|
||||||
skip_first_screenshot = True
|
skip_first_screenshot = True
|
||||||
timeout = Timer(1, count=2).start()
|
timeout = Timer(1, count=2).start()
|
||||||
@@ -171,6 +176,10 @@ class ActionPointHandler(UI, MapEventHandler):
|
|||||||
if timeout.reached():
|
if timeout.reached():
|
||||||
logger.warning('Get action points timeout')
|
logger.warning('Get action points timeout')
|
||||||
break
|
break
|
||||||
|
# Forced map event on the top of action point popup
|
||||||
|
if self.handle_map_event():
|
||||||
|
timeout.reset()
|
||||||
|
continue
|
||||||
|
|
||||||
self.action_point_update()
|
self.action_point_update()
|
||||||
|
|
||||||
@@ -331,7 +340,21 @@ class ActionPointHandler(UI, MapEventHandler):
|
|||||||
in: ACTION_POINT_USE
|
in: ACTION_POINT_USE
|
||||||
out: page_os
|
out: page_os
|
||||||
"""
|
"""
|
||||||
self.ui_click(ACTION_POINT_CANCEL, check_button=OS_CHECK, skip_first_screenshot=skip_first_screenshot)
|
while 1:
|
||||||
|
if skip_first_screenshot:
|
||||||
|
skip_first_screenshot = False
|
||||||
|
else:
|
||||||
|
self.device.screenshot()
|
||||||
|
|
||||||
|
# End
|
||||||
|
if self.appear(OS_CHECK, offset=(20, 20)):
|
||||||
|
break
|
||||||
|
# Click
|
||||||
|
if self.appear_then_click(ACTION_POINT_CANCEL, offset=(20, 20), interval=3):
|
||||||
|
continue
|
||||||
|
# Forced map event on the top of action point popup
|
||||||
|
if self.handle_map_event():
|
||||||
|
continue
|
||||||
|
|
||||||
def handle_action_point(self, zone, pinned, cost=None, keep_current_ap=True, check_rest_ap=False):
|
def handle_action_point(self, zone, pinned, cost=None, keep_current_ap=True, check_rest_ap=False):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user