diff --git a/assets/en/base/popup/QUIT.BUTTON.png b/assets/en/base/popup/QUIT.BUTTON.png new file mode 100644 index 0000000..c1d211f Binary files /dev/null and b/assets/en/base/popup/QUIT.BUTTON.png differ diff --git a/assets/en/base/popup/QUIT.png b/assets/en/base/popup/QUIT.png new file mode 100644 index 0000000..effffef Binary files /dev/null and b/assets/en/base/popup/QUIT.png differ diff --git a/tasks/base/assets/assets_base_popup.py b/tasks/base/assets/assets_base_popup.py index 60c1c15..afaf311 100644 --- a/tasks/base/assets/assets_base_popup.py +++ b/tasks/base/assets/assets_base_popup.py @@ -261,3 +261,15 @@ NETWORK_RECONNECT_OK = ButtonWrapper( button=(540, 471, 744, 530), ), ) +QUIT = ButtonWrapper( + name='QUIT', + jp=None, + en=Button( + file='./assets/en/base/popup/QUIT.png', + area=(587, 309, 688, 357), + search=(567, 289, 708, 377), + color=(225, 225, 225), + button=(410, 473, 623, 532), + ), + zht=None, +) diff --git a/tasks/base/popup.py b/tasks/base/popup.py index 129a60f..cd89495 100644 --- a/tasks/base/popup.py +++ b/tasks/base/popup.py @@ -116,4 +116,11 @@ class PopupHandler(ModuleBase): if self.appear_then_click(LEVEL_UP, interval=interval): return True - return False \ No newline at end of file + return False + + def handle_quit(self, interval=5) -> bool: + if self.appear_then_click(QUIT, interval=interval): + return True + + return False + \ No newline at end of file diff --git a/tasks/base/ui.py b/tasks/base/ui.py index c2fa296..f70fcdc 100644 --- a/tasks/base/ui.py +++ b/tasks/base/ui.py @@ -130,7 +130,7 @@ class UI(MainPage): self.interval_clear(list(Page.iter_check_buttons())) # loading_timer = Timer(0.5) - back_timer = Timer(10, 10) + #back_timer = Timer(10, 10) logger.hr(f"UI goto {destination}") while 1: if skip_first_screenshot: @@ -177,14 +177,14 @@ class UI(MainPage): if self.ui_additional(): continue - back_timer.start() - if back_timer.reached_and_reset(): - if self.match_color(LOGIN_LOADING, interval=5, threshold=80) or self.appear_trademark_year(): - from tasks.login.login import Login - Login(self.config, self.device).handle_app_login() - continue - self.device.back() - logger.info("Unknown page, try to back") + #back_timer.start() + #if back_timer.reached_and_reset(): + # if self.match_color(LOGIN_LOADING, interval=5, threshold=80) or self.appear_trademark_year(): + # from tasks.login.login import Login + # Login(self.config, self.device).handle_app_login() + # continue + # self.device.back() + # logger.info("Unknown page, try to back") # Reset connection Page.clear_connection() @@ -372,6 +372,8 @@ class UI(MainPage): return True if self.handle_daily_news(): return True + if self.handle_quit(): + return True if self.handle_network_reconnect(): return True if self.handle_affection_level_up():