mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-25 01:49:41 +00:00
Fix: Check save file before entering ornament
This commit is contained in:
parent
487dbf1408
commit
71e01d9bd8
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
@ -13,6 +13,16 @@ DIVERGENT_UNIVERSE_LOADED = ButtonWrapper(
|
||||
button=(893, 608, 911, 628),
|
||||
),
|
||||
)
|
||||
DIVERGENT_UNIVERSE_SAVE_UNAVAILABLE = ButtonWrapper(
|
||||
name='DIVERGENT_UNIVERSE_SAVE_UNAVAILABLE',
|
||||
share=Button(
|
||||
file='./assets/share/dungeon/ui_rogue/DIVERGENT_UNIVERSE_SAVE_UNAVAILABLE.png',
|
||||
area=(437, 316, 1169, 378),
|
||||
search=(417, 296, 1189, 398),
|
||||
color=(197, 105, 95),
|
||||
button=(437, 316, 1169, 378),
|
||||
),
|
||||
)
|
||||
LAST_TELEPORT = ButtonWrapper(
|
||||
name='LAST_TELEPORT',
|
||||
share=Button(
|
||||
|
@ -23,6 +23,23 @@ class OrnamentCombat(DungeonEvent, Combat, RouteLoader):
|
||||
# Different position to OCR
|
||||
return super().get_double_event_remain_at_combat(button)
|
||||
|
||||
def _dungeon_wait_until_dungeon_list_loaded(self, skip_first_screenshot=True):
|
||||
# Check save file before entering
|
||||
result = super()._dungeon_wait_until_dungeon_list_loaded(skip_first_screenshot)
|
||||
|
||||
if self.image_color_count(
|
||||
DIVERGENT_UNIVERSE_SAVE_UNAVAILABLE,
|
||||
color=(195, 89, 79), threshold=221, count=1000,
|
||||
):
|
||||
logger.error(
|
||||
'Divergent Universe save unavailable, '
|
||||
'please clear Divergent Universe once before running Ornament Extraction'
|
||||
)
|
||||
self.config.task_delay(server_update=True)
|
||||
self.config.task_stop()
|
||||
|
||||
return result
|
||||
|
||||
def oe_leave(self, skip_first_screenshot=True):
|
||||
self.interval_clear([COMBAT_PREPARE, MAP_EXIT])
|
||||
logger.hr('OE leave')
|
||||
|
Loading…
Reference in New Issue
Block a user