diff --git a/arknights_mower/resources/index_infrastructure_dark.png b/arknights_mower/resources/index_infrastructure_dark.png new file mode 100644 index 000000000..c396f8cde Binary files /dev/null and b/arknights_mower/resources/index_infrastructure_dark.png differ diff --git a/arknights_mower/solvers/base_construct.py b/arknights_mower/solvers/base_construct.py index fbf27cda0..2a3b2e151 100644 --- a/arknights_mower/solvers/base_construct.py +++ b/arknights_mower/solvers/base_construct.py @@ -53,7 +53,7 @@ def run(self, arrange: dict[str, tp.BasePlan] = None, clue_collect: bool = False def transition(self) -> None: if self.scene() == Scene.INDEX: - self.tap_element('index_infrastructure') + self.tap_themed_element('index_infrastructure') elif self.scene() == Scene.INFRA_MAIN: return self.infra_main() elif self.scene() == Scene.INFRA_TODOLIST: diff --git a/arknights_mower/solvers/base_schedule.py b/arknights_mower/solvers/base_schedule.py index f06bc7443..99373d26d 100644 --- a/arknights_mower/solvers/base_schedule.py +++ b/arknights_mower/solvers/base_schedule.py @@ -127,7 +127,7 @@ def run(self) -> None: def transition(self) -> None: self.recog.update() if self.get_infra_scene() == Scene.INDEX: - self.tap_element('index_infrastructure') + self.tap_themed_element('index_infrastructure') elif self.get_infra_scene() == Scene.INFRA_MAIN: return self.infra_main() elif self.get_infra_scene() == Scene.INFRA_TODOLIST: diff --git a/arknights_mower/utils/solver.py b/arknights_mower/utils/solver.py index 931eac591..45d26fa0d 100644 --- a/arknights_mower/utils/solver.py +++ b/arknights_mower/utils/solver.py @@ -122,6 +122,19 @@ def tap_element(self, element_name: str, x_rate: float = 0.5, y_rate: float = 0. self.tap(element, x_rate, y_rate, interval, rebuild) return True + + def tap_themed_element(self, name): + themes = ["dark", "sami"] + themed_names = [name] + ["_".join([name, t]) for t in themes] + for i in themed_names: + try: + if self.tap_element(i): + return True + except: + continue + return False + + def swipe(self, start: tp.Coordinate, movement: tp.Coordinate, duration: int = 100, interval: float = 1, rebuild: bool = True) -> None: """ swipe """ @@ -267,7 +280,7 @@ def get_navigation(self): def back_to_infrastructure(self): self.back_to_index() - self.tap_element('index_infrastructure') + self.tap_themed_element('index_infrastructure') def back_to_index(self): """