mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-09 18:39:04 +08:00
Fix: ensure management page when quitting product page
This commit is contained in:
parent
fe9e76736b
commit
eb41ec572f
@ -454,7 +454,7 @@ class IslandProjectRun(IslandUI):
|
|||||||
self.device.screenshot()
|
self.device.screenshot()
|
||||||
|
|
||||||
if timeout.reached():
|
if timeout.reached():
|
||||||
self.island_product_quit()
|
self.ui_ensure_management_page()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
image = self.image_crop((0, 0, 910, 1280), copy=False)
|
image = self.image_crop((0, 0, 910, 1280), copy=False)
|
||||||
@ -524,7 +524,7 @@ class IslandProjectRun(IslandUI):
|
|||||||
trial -= 1
|
trial -= 1
|
||||||
continue
|
continue
|
||||||
if trial <= 0:
|
if trial <= 0:
|
||||||
self.island_product_quit()
|
self.ui_ensure_management_page()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if option == current.name:
|
if option == current.name:
|
||||||
@ -542,7 +542,7 @@ class IslandProjectRun(IslandUI):
|
|||||||
|
|
||||||
if last == current.items[-1]:
|
if last == current.items[-1]:
|
||||||
logger.info(f'Reach the bottom of items, dit not match item {option}')
|
logger.info(f'Reach the bottom of items, dit not match item {option}')
|
||||||
self.island_product_quit()
|
self.ui_ensure_management_page()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if drag:
|
if drag:
|
||||||
@ -574,11 +574,11 @@ class IslandProjectRun(IslandUI):
|
|||||||
break
|
break
|
||||||
if self.image_color_count(PROJECT_START, color=(151, 155, 155), threshold=221, count=200):
|
if self.image_color_count(PROJECT_START, color=(151, 155, 155), threshold=221, count=200):
|
||||||
if self.appear(PRODUCT_MANJUU_CHECK, offset=(20, 20)):
|
if self.appear(PRODUCT_MANJUU_CHECK, offset=(20, 20)):
|
||||||
self.island_product_quit()
|
self.ui_ensure_management_page()
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
logger.warning('Product requirement is not satisfied, quitting and retrying')
|
logger.warning('Product requirement is not satisfied, quitting and retrying')
|
||||||
self.island_product_quit()
|
self.ui_ensure_management_page()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if not success:
|
if not success:
|
||||||
@ -603,7 +603,7 @@ class IslandProjectRun(IslandUI):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
if self.info_bar_count():
|
if self.info_bar_count():
|
||||||
self.island_product_quit()
|
self.ui_ensure_management_page()
|
||||||
return True
|
return True
|
||||||
if self.island_in_management():
|
if self.island_in_management():
|
||||||
return True
|
return True
|
||||||
|
|||||||
@ -88,20 +88,6 @@ class IslandUI(UI):
|
|||||||
skip_first_screenshot=True
|
skip_first_screenshot=True
|
||||||
)
|
)
|
||||||
|
|
||||||
def island_product_quit(self):
|
|
||||||
"""
|
|
||||||
Execute quit product page
|
|
||||||
"""
|
|
||||||
logger.info('Island product quit')
|
|
||||||
self.interval_clear(ISLAND_MANAGEMENT_CHECK)
|
|
||||||
self.ui_click(
|
|
||||||
click_button=SHOP_BACK_ARROW,
|
|
||||||
check_button=self.island_in_management,
|
|
||||||
offset=(20, 20),
|
|
||||||
retry_wait=2,
|
|
||||||
skip_first_screenshot=True
|
|
||||||
)
|
|
||||||
|
|
||||||
def ui_ensure_management_page(self, skip_first_screenshot=True):
|
def ui_ensure_management_page(self, skip_first_screenshot=True):
|
||||||
"""
|
"""
|
||||||
Pages:
|
Pages:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user