From 6e9661401b010f608607b73a9f1ffe0d2726991d Mon Sep 17 00:00:00 2001 From: Hengyu Date: Thu, 29 Jun 2023 22:28:08 +0800 Subject: [PATCH] Upd: extract dungeon_enter check button as a function parameter --- tasks/dungeon/ui.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tasks/dungeon/ui.py b/tasks/dungeon/ui.py index 5ca163335..e05799734 100644 --- a/tasks/dungeon/ui.py +++ b/tasks/dungeon/ui.py @@ -192,7 +192,7 @@ class DungeonUI(UI): return True - def _dungeon_enter(self, dungeon, skip_first_screenshot=True): + def _dungeon_enter(self, dungeon, enter_check_button=COMBAT_PREPARE, skip_first_screenshot=True): """ Pages: in: page_guide, Survival_Index, nav including dungeon @@ -207,8 +207,8 @@ class DungeonUI(UI): self.device.screenshot() # End - if self.appear(COMBAT_PREPARE) or self.appear(FORGOTTEN_HALL_CHECK): - logger.info('Arrive COMBAT_PREPARE') + if self.appear(enter_check_button): + logger.info(f'Arrive {enter_check_button.name}') break # Additional @@ -279,7 +279,7 @@ class DungeonUI(UI): if dungeon.is_Forgotten_Hall: DUNGEON_NAV_LIST.select_row(KEYWORDS_DUNGEON_NAV.Forgotten_Hall, main=self) self._dungeon_insight(dungeon) - self._dungeon_enter(dungeon) + self._dungeon_enter(dungeon, enter_check_button=FORGOTTEN_HALL_CHECK) return True logger.error(f'Goto dungeon {dungeon} is not supported')