mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 00:28:20 +08:00
Fix: Handle SOS chapters not fully unlocked
This commit is contained in:
@@ -66,6 +66,8 @@ class CampaignSos(CampaignRun, CampaignBase):
|
||||
chapter_buttons = [button.crop(self._sos_chapter_crop) for button in all_buttons]
|
||||
ocr_chapters = Digit(chapter_buttons, letter=[132, 230, 115], threshold=136, name='OCR_SOS_CHAPTER')
|
||||
chapter_list = ocr_chapters.ocr(self.device.image)
|
||||
if not isinstance(chapter_list, list):
|
||||
chapter_list = [chapter_list]
|
||||
if chapter in chapter_list:
|
||||
logger.info('Target SOS chapter found')
|
||||
return all_buttons[chapter_list.index(chapter)]
|
||||
@@ -137,7 +139,10 @@ class CampaignSos(CampaignRun, CampaignBase):
|
||||
positions = [0.0, 0.5, 1.0]
|
||||
|
||||
for scroll_position in positions:
|
||||
self._sos_scroll.set(scroll_position, main=self)
|
||||
if self._sos_scroll.appear(main=self):
|
||||
self._sos_scroll.set(scroll_position, main=self)
|
||||
else:
|
||||
logger.info('SOS signal scroll not appear, skip setting scroll position')
|
||||
target_button = self._find_target_chapter(chapter)
|
||||
if target_button is not None:
|
||||
self._sos_signal_confirm(entrance=target_button)
|
||||
|
||||
Reference in New Issue
Block a user