1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-16 18:37:23 +08:00

Refactor: Standardize the use of match_template_color()

This commit is contained in:
LmeSzinc
2024-12-09 16:09:34 +08:00
parent 164db6f4da
commit ba5b853cb9
22 changed files with 79 additions and 66 deletions

View File

@@ -231,12 +231,10 @@ class OpsiAshBeacon(Meta):
else:
self.device.screenshot()
if self.appear(META_INNER_PAGE_DAMAGE, offset=(20, 20)) \
and META_INNER_PAGE_DAMAGE.match_appear_on(self.device.image):
if self.match_template_color(META_INNER_PAGE_DAMAGE, offset=(20, 20)):
logger.info('Already in meta damage page')
break
if self.appear(META_INNER_PAGE_NOT_DAMAGE, offset=(20, 20)) \
and META_INNER_PAGE_NOT_DAMAGE.match_appear_on(self.device.image):
if self.match_template_color(META_INNER_PAGE_NOT_DAMAGE, offset=(20, 20)):
logger.info('In meta details page, should switch to damage page')
self.appear_then_click(META_INNER_PAGE_NOT_DAMAGE, offset=(20, 20), interval=2)
continue