Merge pull request #4481 from LmeSzinc/dev

Bug fix
This commit is contained in:
LmeSzinc 2025-01-02 01:08:49 +08:00 committed by GitHub
commit 3733cc516b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 9 deletions

View File

@ -139,13 +139,13 @@ class CampaignUI(MapOperation, CampaignEvent, CampaignOcr):
chapter: 'part1', 'part2', 'sp', 'ex'
"""
if chapter in ['part1', 'a', 'c', 't']:
MODE_SWITCH_20241219.set('part1', main=self)
ASIDE_SWITCH_20241219.set('part1', main=self)
elif chapter in ['part2', 'b', 'd']:
MODE_SWITCH_20241219.set('part2', main=self)
ASIDE_SWITCH_20241219.set('part2', main=self)
elif chapter in ['sp', 'ex_sp']:
MODE_SWITCH_20241219.set('sp', main=self)
ASIDE_SWITCH_20241219.set('sp', main=self)
elif chapter in ['ex', 'ex_ex']:
MODE_SWITCH_20241219.set('sp', main=self)
ASIDE_SWITCH_20241219.set('ex', main=self)
else:
logger.warning(f'Unknown campaign aside: {chapter}')

View File

@ -109,16 +109,16 @@ class EventStory(CampaignUI, Combat, LoginHandler):
Returns:
str: 'finish', 'story', 'unknown'
"""
if self.match_template_color(STORY_FINISHED, offset=(20, 20), interval=3):
if self.match_template_color(STORY_FINISHED, offset=(20, 20)):
return 'finish'
if self.appear_then_click(STORY_FIRST, offset=(20, 20), interval=3):
if self.appear_then_click(STORY_FIRST, offset=(20, 20)):
return 'story'
if self.match_template_color(STORY_LAST, offset=(20, 20), interval=3):
if self.match_template_color(STORY_LAST, offset=(20, 20)):
return 'story'
if self.appear_then_click(STORY_MIDDLE, offset=(20, 200), interval=3):
if self.appear_then_click(STORY_MIDDLE, offset=(20, 200)):
return 'story'
if self.appear_then_click(BATTLE_MIDDLE, offset=(20, 200), interval=3):
if self.appear_then_click(BATTLE_MIDDLE, offset=(20, 200)):
return 'story'
return 'unknown'