mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-22 00:35:34 +00:00
Fix: Handle blessing randomized by curio
This commit is contained in:
parent
8da4644e13
commit
6c9678cf87
BIN
assets/share/rogue/ui/BLESSING_LOST.png
Normal file
BIN
assets/share/rogue/ui/BLESSING_LOST.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.6 KiB |
@ -23,6 +23,16 @@ BLESSING_ENHANCED = ButtonWrapper(
|
||||
button=(630, 351, 651, 370),
|
||||
),
|
||||
)
|
||||
BLESSING_LOST = ButtonWrapper(
|
||||
name='BLESSING_LOST',
|
||||
share=Button(
|
||||
file='./assets/share/rogue/ui/BLESSING_LOST.png',
|
||||
area=(51, 530, 81, 552),
|
||||
search=(31, 510, 101, 572),
|
||||
color=(248, 248, 248),
|
||||
button=(51, 530, 81, 552),
|
||||
),
|
||||
)
|
||||
BLESSING_OBTAINED = ButtonWrapper(
|
||||
name='BLESSING_OBTAINED',
|
||||
share=Button(
|
||||
|
@ -8,7 +8,7 @@ from module.base.utils import get_color
|
||||
from module.logger import logger
|
||||
from module.ocr.ocr import Ocr, OcrResultButton
|
||||
from tasks.rogue.assets.assets_rogue_curio import CURIO_ENFORCE, OCR_ROGUE_CURIO
|
||||
from tasks.rogue.assets.assets_rogue_ui import BLESSING_CONFIRM, BLESSING_ENHANCED, BLESSING_OBTAINED
|
||||
from tasks.rogue.assets.assets_rogue_ui import BLESSING_CONFIRM, BLESSING_ENHANCED, BLESSING_LOST, BLESSING_OBTAINED
|
||||
from tasks.rogue.bleesing.preset import CURIO_PRESET_1
|
||||
from tasks.rogue.bleesing.selector import RogueSelector
|
||||
from tasks.rogue.bleesing.utils import get_regex_from_keyword_name, parse_name
|
||||
@ -62,6 +62,7 @@ class RogueCurioSelector(RogueSelector):
|
||||
Case 3: is_page_choose_blessing()
|
||||
Case 4: BLESSING_ENHANCED
|
||||
Case 5: BLESSING_OBTAINED
|
||||
Case 6: BLESSING_LOST
|
||||
"""
|
||||
if self.main.is_in_main():
|
||||
logger.info("Main page checked")
|
||||
@ -78,6 +79,9 @@ class RogueCurioSelector(RogueSelector):
|
||||
if self.main.appear(BLESSING_OBTAINED):
|
||||
logger.info("BLESSING_OBTAINED checked")
|
||||
return True
|
||||
if self.main.appear(BLESSING_LOST):
|
||||
logger.info("BLESSING_LOST checked")
|
||||
return True
|
||||
return False
|
||||
|
||||
enforce = False
|
||||
|
@ -76,4 +76,9 @@ class RogueUI(UI):
|
||||
logger.info(f'{BLESSING_ENHANCED} -> {BLESSING_CONFIRM}')
|
||||
self.device.click(BLESSING_CONFIRM)
|
||||
return True
|
||||
# Lost and re-obtain blessing, randomized by curio
|
||||
if self.appear(BLESSING_LOST, interval=2):
|
||||
logger.info(f'{BLESSING_LOST} -> {BLESSING_CONFIRM}')
|
||||
self.device.click(BLESSING_CONFIRM)
|
||||
return True
|
||||
return False
|
||||
|
Loading…
Reference in New Issue
Block a user