Upd: [EN] EVENT_COMPLETED

This commit is contained in:
Zebartin 2024-05-21 19:02:45 +08:00
parent d34120358a
commit 8b00515fb8
5 changed files with 17 additions and 11 deletions

View File

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

View File

@ -116,16 +116,22 @@ ENTRY_LOADED = ButtonWrapper(
button=(474, 161, 491, 615), button=(474, 161, 491, 615),
), ),
) )
EVENT_FINISHED = ButtonWrapper( EVENT_COMPLETED = ButtonWrapper(
name='EVENT_FINISHED', name='EVENT_COMPLETED',
cn=Button( cn=Button(
file='./assets/cn/assignment/ui/EVENT_FINISHED.png', file='./assets/cn/assignment/ui/EVENT_COMPLETED.png',
area=(700, 300, 752, 331), area=(700, 300, 752, 331),
search=(680, 280, 772, 351), search=(680, 280, 772, 351),
color=(223, 215, 195), color=(223, 215, 195),
button=(700, 300, 752, 331), button=(700, 300, 752, 331),
), ),
en=None, en=Button(
file='./assets/en/assignment/ui/EVENT_COMPLETED.png',
area=(721, 302, 851, 331),
search=(701, 282, 871, 351),
color=(229, 220, 200),
button=(721, 302, 851, 331),
),
) )
EXP_MATERIALS_CREDITS_CHECK = ButtonWrapper( EXP_MATERIALS_CREDITS_CHECK = ButtonWrapper(
name='EXP_MATERIALS_CREDITS_CHECK', name='EXP_MATERIALS_CREDITS_CHECK',

View File

@ -4,7 +4,7 @@ from module.config.stored.classes import now
from module.logger import logger from module.logger import logger
from module.ocr.ocr import Duration from module.ocr.ocr import Duration
from tasks.assignment.assets.assets_assignment_claim import * from tasks.assignment.assets.assets_assignment_claim import *
from tasks.assignment.assets.assets_assignment_ui import EVENT_FINISHED from tasks.assignment.assets.assets_assignment_ui import EVENT_COMPLETED
from tasks.assignment.dispatch import AssignmentDispatch from tasks.assignment.dispatch import AssignmentDispatch
from tasks.assignment.keywords import AssignmentEntry from tasks.assignment.keywords import AssignmentEntry
from tasks.base.page import page_assignment from tasks.base.page import page_assignment
@ -80,8 +80,8 @@ class AssignmentClaim(AssignmentDispatch):
if self.appear(page_assignment.check_button): if self.appear(page_assignment.check_button):
logger.info('Assignment report is closed') logger.info('Assignment report is closed')
break break
if self.appear(EVENT_FINISHED): if self.appear(EVENT_COMPLETED):
logger.info('Event finished') logger.info('Event completed')
return return
# Close report # Close report
if self.appear(REPORT, interval=1): if self.appear(REPORT, interval=1):

View File

@ -224,8 +224,8 @@ class AssignmentUI(UI):
if timeout.reached(): if timeout.reached():
logger.warning('Wait entry loaded timeout') logger.warning('Wait entry loaded timeout')
break break
if self.appear(EVENT_FINISHED): if self.appear(EVENT_COMPLETED):
logger.info('Event finished') logger.info('Event completed')
break break
if self.appear(ASSIGNMENT_CHECK) and \ if self.appear(ASSIGNMENT_CHECK) and \
self.image_color_count(ENTRY_LOADED, (35, 35, 35), count=800): self.image_color_count(ENTRY_LOADED, (35, 35, 35), count=800):
@ -244,13 +244,13 @@ class AssignmentUI(UI):
if timeout.reached(): if timeout.reached():
logger.warning('Wait correct entry loaded timeout') logger.warning('Wait correct entry loaded timeout')
break break
if isinstance(group, AssignmentEventGroup) and self.appear(EVENT_FINISHED): if isinstance(group, AssignmentEventGroup) and self.appear(EVENT_COMPLETED):
logger.info('Correct entry loaded') logger.info('Correct entry loaded')
ASSIGNMENT_ENTRY_LIST.cur_buttons = [] ASSIGNMENT_ENTRY_LIST.cur_buttons = []
break break
ASSIGNMENT_ENTRY_LIST.load_rows(self) ASSIGNMENT_ENTRY_LIST.load_rows(self)
if all( if ASSIGNMENT_ENTRY_LIST.cur_buttons and all(
x.matched_keyword.group == group x.matched_keyword.group == group
for x in ASSIGNMENT_ENTRY_LIST.cur_buttons for x in ASSIGNMENT_ENTRY_LIST.cur_buttons
): ):