Fix: limit_entrance has no effect on calyx crimson dungeons

This commit is contained in:
LmeSzinc 2024-02-19 01:43:05 +08:00
parent 87c322a21b
commit ca39c06062

View File

@ -118,6 +118,10 @@ class OcrDungeonListLimitEntrance(OcrDungeonList):
self.button = ClickButton((*self.button.area[:3], self.button.area[3] - 70)) self.button = ClickButton((*self.button.area[:3], self.button.area[3] - 70))
class OcrDungeonListCalyxCrimsonLimitEntrance(OcrDungeonListCalyxCrimson, OcrDungeonListLimitEntrance):
pass
class DraggableDungeonNav(DraggableList): class DraggableDungeonNav(DraggableList):
# 0.5 is the magic number to reach bottom in 1 swipe # 0.5 is the magic number to reach bottom in 1 swipe
# but relax we still have retires when magic doesn't work # 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. # use_plane: True to use map planes to predict dungeons only.
# Can only be True in Calyx Crimson # Can only be True in Calyx Crimson
use_plane = False 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): def load_rows(self, main: ModuleBase, allow_early_access=False):
""" """
@ -141,9 +147,15 @@ class DraggableDungeonList(DraggableList):
relative_area = (0, 0, 1280, 120) relative_area = (0, 0, 1280, 120)
if self.use_plane: if self.use_plane:
self.keyword_class = [MapPlane, DungeonEntrance] self.keyword_class = [MapPlane, DungeonEntrance]
if self.limit_entrance:
self.ocr_class = OcrDungeonListCalyxCrimsonLimitEntrance
else:
self.ocr_class = OcrDungeonListCalyxCrimson self.ocr_class = OcrDungeonListCalyxCrimson
else: else:
self.keyword_class = [DungeonList, DungeonEntrance] self.keyword_class = [DungeonList, DungeonEntrance]
if self.limit_entrance:
self.ocr_class = OcrDungeonListLimitEntrance
else:
self.ocr_class = OcrDungeonList self.ocr_class = OcrDungeonList
super().load_rows(main=main) super().load_rows(main=main)
@ -525,10 +537,10 @@ class DungeonUI(DungeonState):
DUNGEON_LIST.drag_vector = (-0.4, -0.2) # Keyword loaded is reversed DUNGEON_LIST.drag_vector = (-0.4, -0.2) # Keyword loaded is reversed
else: else:
DUNGEON_LIST.drag_vector = (0.2, 0.4) 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.insight_row(dungeon, main=self)
DUNGEON_LIST.drag_vector = DraggableList.drag_vector DUNGEON_LIST.drag_vector = DraggableList.drag_vector
DUNGEON_LIST.ocr_class = OcrDungeonList DUNGEON_LIST.limit_entrance = False
DUNGEON_LIST.load_rows(main=self) DUNGEON_LIST.load_rows(main=self)
# Check if dungeon unlocked # Check if dungeon unlocked
for entrance in DUNGEON_LIST.navigates: for entrance in DUNGEON_LIST.navigates: