From 6e789412afa5494522dbc0fea10f86ea9888615b Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Sun, 1 Oct 2023 19:17:43 +0800 Subject: [PATCH] Fix: Strict is_in_main() with color check --- tasks/base/ui.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tasks/base/ui.py b/tasks/base/ui.py index 80a04489b..3c971747f 100644 --- a/tasks/base/ui.py +++ b/tasks/base/ui.py @@ -276,7 +276,13 @@ class UI( MainPage): continue def is_in_main(self): - return self.appear(page_main.check_button) or self.appear(MAP_EXIT) + if self.appear(page_main.check_button): + if self.image_color_count(page_main.check_button, color=(235, 235, 235), threshold=221, count=400): + return True + if self.appear(MAP_EXIT): + if self.image_color_count(MAP_EXIT, color=(235, 235, 235), threshold=221, count=50): + return True + return False def ui_goto_main(self): return self.ui_ensure(destination=page_main)