Merge pull request #331 from LmeSzinc/bug_fix

Bug fix
This commit is contained in:
LmeSzinc 2024-02-19 01:11:18 +08:00 committed by GitHub
commit 16636a3cd2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View File

@ -94,8 +94,8 @@ class OcrDungeonList(Ocr):
result = re.sub(r'蛀星的旧.*?历战', '蛀星的旧靥•历战', result) result = re.sub(r'蛀星的旧.*?历战', '蛀星的旧靥•历战', result)
# 9支援仓段 # 9支援仓段
result = result.removeprefix('9') for word in 'Q9α':
result = result.removeprefix('Q') result = result.removeprefix(word)
return result return result
@ -165,6 +165,11 @@ class DraggableDungeonList(DraggableList):
indexes = [self.keyword2index(row.matched_keyword) indexes = [self.keyword2index(row.matched_keyword)
for row in self.cur_buttons] for row in self.cur_buttons]
indexes = [index for index in indexes if index] indexes = [index for index in indexes if index]
if not indexes:
logger.warning(f'No valid rows loaded into {self}')
return
self.cur_min = min(indexes) self.cur_min = min(indexes)
self.cur_max = max(indexes) self.cur_max = max(indexes)
logger.attr(self.name, f'{self.cur_min} - {self.cur_max}') logger.attr(self.name, f'{self.cur_min} - {self.cur_max}')

View File

@ -54,6 +54,7 @@ class WeeklyDungeon(Dungeon):
# Equivalent to self.dungeon_goto(dungeon), but check limit remains # Equivalent to self.dungeon_goto(dungeon), but check limit remains
DUNGEON_LIST.search_button = OCR_DUNGEON_LIST DUNGEON_LIST.search_button = OCR_DUNGEON_LIST
self._dungeon_nav_goto(KEYWORDS_DUNGEON_NAV.Echo_of_War) self._dungeon_nav_goto(KEYWORDS_DUNGEON_NAV.Echo_of_War)
self._dungeon_wait_until_dungeon_list_loaded()
# Check limit # Check limit
remain = self.get_weekly_remain() remain = self.get_weekly_remain()