diff --git a/assets/share/assignment/ui/OCR_ASSIGNMENT_LIMIT.png b/assets/share/assignment/ui/OCR_ASSIGNMENT_LIMIT.png index 30022b8bf..12d28fac5 100644 Binary files a/assets/share/assignment/ui/OCR_ASSIGNMENT_LIMIT.png and b/assets/share/assignment/ui/OCR_ASSIGNMENT_LIMIT.png differ diff --git a/tasks/assignment/assets/assets_assignment_ui.py b/tasks/assignment/assets/assets_assignment_ui.py index 319fecce4..83352665a 100644 --- a/tasks/assignment/assets/assets_assignment_ui.py +++ b/tasks/assignment/assets/assets_assignment_ui.py @@ -47,10 +47,10 @@ OCR_ASSIGNMENT_LIMIT = ButtonWrapper( name='OCR_ASSIGNMENT_LIMIT', share=Button( file='./assets/share/assignment/ui/OCR_ASSIGNMENT_LIMIT.png', - area=(1095, 82, 1180, 125), - search=(1075, 62, 1200, 145), - color=(41, 44, 50), - button=(1095, 82, 1180, 125), + area=(1095, 95, 1180, 119), + search=(1075, 75, 1200, 139), + color=(51, 54, 60), + button=(1095, 95, 1180, 119), ), ) OCR_ASSIGNMENT_LIST = ButtonWrapper( diff --git a/tasks/base/ui.py b/tasks/base/ui.py index 80bf47fe5..21abe365f 100644 --- a/tasks/base/ui.py +++ b/tasks/base/ui.py @@ -13,6 +13,7 @@ from tasks.combat.assets.assets_combat_prepare import COMBAT_PREPARE class UI(PopupHandler): ui_current: Page + ui_main_confirm_timer = Timer(0.2, count=0) def ui_page_appear(self, page): """ @@ -112,6 +113,8 @@ class UI(PopupHandler): # Destination page if self.ui_page_appear(destination): logger.info(f'Page arrive: {destination}') + if self.ui_page_confirm(destination): + logger.info(f'Page arrive confirm {destination}') break # Other pages @@ -121,6 +124,8 @@ class UI(PopupHandler): continue if self.appear(page.check_button, interval=5): logger.info(f'Page switch: {page} -> {page.parent}') + if self.ui_page_confirm(page): + logger.info(f'Page arrive confirm {page}') button = page.links[page.parent] self.device.click(button) self.ui_button_interval_reset(button) @@ -287,6 +292,45 @@ class UI(PopupHandler): return False + def _ui_button_confirm( + self, + button, + confirm=Timer(0.1, count=0), + timeout=Timer(2, count=6), + skip_first_screenshot=True + ): + confirm.reset() + timeout.reset() + while 1: + if skip_first_screenshot: + skip_first_screenshot = False + else: + self.device.screenshot() + + if timeout.reached(): + logger.warning(f'_ui_button_confirm({button}) timeout') + break + + if self.appear(button): + if confirm.reached(): + break + else: + confirm.reset() + + def ui_page_confirm(self, page): + """ + Args: + page (Page): + + Returns: + bool: If handled + """ + if page == page_main: + self._ui_button_confirm(page.check_button) + return True + + return False + def ui_button_interval_reset(self, button): """ Reset interval of some button to avoid mistaken clicks diff --git a/tasks/daily/daily_quest.py b/tasks/daily/daily_quest.py index f50947ee5..c5f6d0a20 100644 --- a/tasks/daily/daily_quest.py +++ b/tasks/daily/daily_quest.py @@ -31,6 +31,7 @@ class DailyQuestOcr(Ocr): if self.lang == 'ch': result = result.replace("J", "」") result = result.replace(";", "」") + result = result.replace("了", "」") result = result.replace("宇审", "宇宙") # 进行中」hbadarin if "进行中" in result: