mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-25 10:01:10 +00:00
Fix: Check EVENT_FINISHED
TODO: [EN] Add EVENT_FINISHED
This commit is contained in:
parent
de53612530
commit
c43a0837c4
BIN
assets/cn/assignment/ui/EVENT_FINISHED.png
Normal file
BIN
assets/cn/assignment/ui/EVENT_FINISHED.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.9 KiB |
@ -116,6 +116,17 @@ ENTRY_LOADED = ButtonWrapper(
|
||||
button=(474, 161, 491, 615),
|
||||
),
|
||||
)
|
||||
EVENT_FINISHED = ButtonWrapper(
|
||||
name='EVENT_FINISHED',
|
||||
cn=Button(
|
||||
file='./assets/cn/assignment/ui/EVENT_FINISHED.png',
|
||||
area=(700, 300, 752, 331),
|
||||
search=(680, 280, 772, 351),
|
||||
color=(223, 215, 195),
|
||||
button=(700, 300, 752, 331),
|
||||
),
|
||||
en=None,
|
||||
)
|
||||
EXP_MATERIALS_CREDITS_CHECK = ButtonWrapper(
|
||||
name='EXP_MATERIALS_CREDITS_CHECK',
|
||||
cn=Button(
|
||||
|
@ -4,6 +4,7 @@ from module.config.stored.classes import now
|
||||
from module.logger import logger
|
||||
from module.ocr.ocr import Duration
|
||||
from tasks.assignment.assets.assets_assignment_claim import *
|
||||
from tasks.assignment.assets.assets_assignment_ui import EVENT_FINISHED
|
||||
from tasks.assignment.dispatch import AssignmentDispatch
|
||||
from tasks.assignment.keywords import AssignmentEntry
|
||||
from tasks.base.page import page_assignment
|
||||
@ -79,6 +80,9 @@ class AssignmentClaim(AssignmentDispatch):
|
||||
if self.appear(page_assignment.check_button):
|
||||
logger.info('Assignment report is closed')
|
||||
break
|
||||
if self.appear(EVENT_FINISHED):
|
||||
logger.info('Event finished')
|
||||
return
|
||||
# Close report
|
||||
if self.appear(REPORT, interval=1):
|
||||
self.device.click(click_button)
|
||||
|
@ -217,6 +217,9 @@ class AssignmentUI(UI):
|
||||
if timeout.reached():
|
||||
logger.warning('Wait entry loaded timeout')
|
||||
break
|
||||
if self.appear(EVENT_FINISHED):
|
||||
logger.info('Event finished')
|
||||
break
|
||||
if self.appear(ASSIGNMENT_CHECK) and \
|
||||
self.image_color_count(ENTRY_LOADED, (35, 35, 35), count=800):
|
||||
logger.info('Entry loaded')
|
||||
@ -234,6 +237,9 @@ class AssignmentUI(UI):
|
||||
if timeout.reached():
|
||||
logger.warning('Wait correct entry loaded timeout')
|
||||
break
|
||||
if self.appear(EVENT_FINISHED):
|
||||
logger.info('Event finished')
|
||||
break
|
||||
|
||||
ASSIGNMENT_ENTRY_LIST.load_rows(self)
|
||||
if all(
|
||||
|
Loading…
Reference in New Issue
Block a user