Fix: Update CONFIRM_ASSIGNMENT and close character list

This commit is contained in:
LmeSzinc 2024-04-02 12:38:35 +08:00
parent 1298605c65
commit 92288deff3
6 changed files with 37 additions and 12 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -128,17 +128,17 @@ CONFIRM_ASSIGNMENT = ButtonWrapper(
name='CONFIRM_ASSIGNMENT', name='CONFIRM_ASSIGNMENT',
cn=Button( cn=Button(
file='./assets/cn/assignment/dispatch/CONFIRM_ASSIGNMENT.png', file='./assets/cn/assignment/dispatch/CONFIRM_ASSIGNMENT.png',
area=(1024, 653, 1104, 672), area=(1007, 660, 1085, 678),
search=(1004, 633, 1124, 692), search=(987, 640, 1105, 698),
color=(154, 154, 153), color=(148, 148, 147),
button=(920, 645, 1208, 682), button=(909, 651, 1184, 686),
), ),
en=Button( en=Button(
file='./assets/en/assignment/dispatch/CONFIRM_ASSIGNMENT.png', file='./assets/en/assignment/dispatch/CONFIRM_ASSIGNMENT.png',
area=(964, 655, 1164, 671), area=(946, 661, 1146, 677),
search=(944, 635, 1184, 691), search=(926, 641, 1166, 697),
color=(161, 160, 160), color=(162, 162, 161),
button=(928, 645, 1201, 681), button=(909, 652, 1182, 687),
), ),
) )
DURATION_12 = ButtonWrapper( DURATION_12 = ButtonWrapper(

View File

@ -77,8 +77,9 @@ class AssignmentDispatch(AssignmentUI):
""" """
Pages: Pages:
in: EMPTY_SLOT in: EMPTY_SLOT
out: CHARACTER_LIST out: EMPTY_SLOT
""" """
logger.info('Select characters')
skip_first_screenshot = True skip_first_screenshot = True
self.interval_clear( self.interval_clear(
(CHARACTER_LIST, CHARACTER_1_SELECTED, CHARACTER_2_SELECTED), interval=2) (CHARACTER_LIST, CHARACTER_1_SELECTED, CHARACTER_2_SELECTED), interval=2)
@ -88,9 +89,13 @@ class AssignmentDispatch(AssignmentUI):
else: else:
self.device.screenshot() self.device.screenshot()
# End # End
if self.match_template_color(CONFIRM_ASSIGNMENT): if self.appear(CONFIRM_ASSIGNMENT):
logger.info('Characters are all selected') if self.image_color_count(CONFIRM_ASSIGNMENT.button, color=(227, 227, 227), count=1000):
break logger.info('Characters are all selected (light button)')
break
if self.image_color_count(CONFIRM_ASSIGNMENT.button, color=(144, 144, 144), count=1000):
logger.info('Characters are all selected (gray button)')
break
# Ensure character list # Ensure character list
# Search EMPTY_SLOT to load offset # Search EMPTY_SLOT to load offset
if not self.appear(CHARACTER_LIST) and self.appear(EMPTY_SLOT): if not self.appear(CHARACTER_LIST) and self.appear(EMPTY_SLOT):
@ -108,6 +113,26 @@ class AssignmentDispatch(AssignmentUI):
self.device.click(CHARACTER_2) self.device.click(CHARACTER_2)
self.interval_reset(CHARACTER_2_SELECTED, interval=2) self.interval_reset(CHARACTER_2_SELECTED, interval=2)
# CHARACTER_LIST -> CONFIRM_ASSIGNMENT
logger.info('Close character list')
self.interval_clear([CHARACTER_LIST, EMPTY_SLOT], interval=2)
skip_first_screenshot = True
while 1:
if skip_first_screenshot:
skip_first_screenshot = False
else:
self.device.screenshot()
# End
if self.appear(CONFIRM_ASSIGNMENT):
if self.image_color_count(CONFIRM_ASSIGNMENT.button, color=(227, 227, 227), count=1000):
logger.info('Characters are all selected (light button)')
break
if self.appear(CHARACTER_LIST, interval=2):
# EMPTY_SLOT appeared above
self.device.click(EMPTY_SLOT)
continue
def _select_support(self): def _select_support(self):
skip_first_screenshot = True skip_first_screenshot = True
self.interval_clear( self.interval_clear(