mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-16 06:25:24 +00:00
Fix: Handle BLESSING_ENHANCED and BLESSING_OBTAINED popups
This commit is contained in:
parent
b2b540698f
commit
357c3096c1
BIN
assets/share/rogue/ui/BLESSING_ENHANCED.png
Normal file
BIN
assets/share/rogue/ui/BLESSING_ENHANCED.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.1 KiB |
BIN
assets/share/rogue/ui/BLESSING_OBTAINED.SEARCH.png
Normal file
BIN
assets/share/rogue/ui/BLESSING_OBTAINED.SEARCH.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.9 KiB |
BIN
assets/share/rogue/ui/BLESSING_OBTAINED.png
Normal file
BIN
assets/share/rogue/ui/BLESSING_OBTAINED.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.6 KiB |
@ -13,6 +13,26 @@ BLESSING_CONFIRM = ButtonWrapper(
|
||||
button=(960, 629, 1233, 677),
|
||||
),
|
||||
)
|
||||
BLESSING_ENHANCED = ButtonWrapper(
|
||||
name='BLESSING_ENHANCED',
|
||||
share=Button(
|
||||
file='./assets/share/rogue/ui/BLESSING_ENHANCED.png',
|
||||
area=(630, 351, 651, 370),
|
||||
search=(610, 331, 671, 390),
|
||||
color=(124, 125, 128),
|
||||
button=(630, 351, 651, 370),
|
||||
),
|
||||
)
|
||||
BLESSING_OBTAINED = ButtonWrapper(
|
||||
name='BLESSING_OBTAINED',
|
||||
share=Button(
|
||||
file='./assets/share/rogue/ui/BLESSING_OBTAINED.png',
|
||||
area=(733, 561, 765, 583),
|
||||
search=(710, 551, 777, 593),
|
||||
color=(248, 248, 248),
|
||||
button=(733, 561, 765, 583),
|
||||
),
|
||||
)
|
||||
CHECK_BLESSING = ButtonWrapper(
|
||||
name='CHECK_BLESSING',
|
||||
share=Button(
|
||||
|
@ -1,6 +1,7 @@
|
||||
import re
|
||||
|
||||
from module.base.utils import area_offset
|
||||
from module.logger import logger
|
||||
from module.ocr.ocr import Digit, Ocr, OcrResultButton
|
||||
from tasks.base.ui import UI
|
||||
from tasks.rogue.assets.assets_rogue_ui import *
|
||||
@ -56,3 +57,16 @@ class RogueUI(UI):
|
||||
"""
|
||||
FLAG_UNRECORD.matched_button.search = area_offset(relative_area, target.area[:2])
|
||||
return self.appear(FLAG_UNRECORD)
|
||||
|
||||
def handle_blessing_popup(self):
|
||||
# Obtained a free blessing from curio
|
||||
if self.appear(BLESSING_OBTAINED, interval=2):
|
||||
logger.info(f'{BLESSING_OBTAINED} -> {BLESSING_CONFIRM}')
|
||||
self.device.click(BLESSING_CONFIRM)
|
||||
return True
|
||||
# Enhanced a blessing from occurrence
|
||||
if self.appear(BLESSING_ENHANCED, interval=2):
|
||||
logger.info(f'{BLESSING_ENHANCED} -> {BLESSING_CONFIRM}')
|
||||
self.device.click(BLESSING_CONFIRM)
|
||||
return True
|
||||
return False
|
||||
|
@ -50,6 +50,8 @@ class RouteBase(RouteBase_, RogueExit, RogueEvent):
|
||||
selector = RogueBonusSelector(self)
|
||||
selector.recognize_and_select()
|
||||
return True
|
||||
if self.handle_blessing_popup():
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user