From ca39c060621294976ed2299b00cb97c7fb19593b Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Mon, 19 Feb 2024 01:43:05 +0800 Subject: [PATCH] Fix: limit_entrance has no effect on calyx crimson dungeons --- tasks/dungeon/ui.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/tasks/dungeon/ui.py b/tasks/dungeon/ui.py index 6d42aeb42..fd0bfd9ee 100644 --- a/tasks/dungeon/ui.py +++ b/tasks/dungeon/ui.py @@ -118,6 +118,10 @@ class OcrDungeonListLimitEntrance(OcrDungeonList): self.button = ClickButton((*self.button.area[:3], self.button.area[3] - 70)) +class OcrDungeonListCalyxCrimsonLimitEntrance(OcrDungeonListCalyxCrimson, OcrDungeonListLimitEntrance): + pass + + class DraggableDungeonNav(DraggableList): # 0.5 is the magic number to reach bottom in 1 swipe # but relax we still have retires when magic doesn't work @@ -131,6 +135,8 @@ class DraggableDungeonList(DraggableList): # use_plane: True to use map planes to predict dungeons only. # Can only be True in Calyx Crimson use_plane = False + # limit_entrance: True to ensure the teleport button is insight + limit_entrance = False def load_rows(self, main: ModuleBase, allow_early_access=False): """ @@ -141,10 +147,16 @@ class DraggableDungeonList(DraggableList): relative_area = (0, 0, 1280, 120) if self.use_plane: self.keyword_class = [MapPlane, DungeonEntrance] - self.ocr_class = OcrDungeonListCalyxCrimson + if self.limit_entrance: + self.ocr_class = OcrDungeonListCalyxCrimsonLimitEntrance + else: + self.ocr_class = OcrDungeonListCalyxCrimson else: self.keyword_class = [DungeonList, DungeonEntrance] - self.ocr_class = OcrDungeonList + if self.limit_entrance: + self.ocr_class = OcrDungeonListLimitEntrance + else: + self.ocr_class = OcrDungeonList super().load_rows(main=main) # Check early access dungeons @@ -525,10 +537,10 @@ class DungeonUI(DungeonState): DUNGEON_LIST.drag_vector = (-0.4, -0.2) # Keyword loaded is reversed else: DUNGEON_LIST.drag_vector = (0.2, 0.4) - DUNGEON_LIST.ocr_class = OcrDungeonListLimitEntrance + DUNGEON_LIST.limit_entrance = True DUNGEON_LIST.insight_row(dungeon, main=self) DUNGEON_LIST.drag_vector = DraggableList.drag_vector - DUNGEON_LIST.ocr_class = OcrDungeonList + DUNGEON_LIST.limit_entrance = False DUNGEON_LIST.load_rows(main=self) # Check if dungeon unlocked for entrance in DUNGEON_LIST.navigates: