mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-15 22:19:18 +00:00
Fix: Handle light cone drop from Echo of War (#171)
This commit is contained in:
parent
1e4db4eef0
commit
881389efce
BIN
assets/cn/base/popup/GET_LIGHT_CONE.png
Normal file
BIN
assets/cn/base/popup/GET_LIGHT_CONE.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.9 KiB |
BIN
assets/en/base/popup/GET_LIGHT_CONE.png
Normal file
BIN
assets/en/base/popup/GET_LIGHT_CONE.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.8 KiB |
@ -13,6 +13,23 @@ BATTLE_PASS_NOTIFICATION = ButtonWrapper(
|
||||
button=(895, 595, 1180, 630),
|
||||
),
|
||||
)
|
||||
GET_LIGHT_CONE = ButtonWrapper(
|
||||
name='GET_LIGHT_CONE',
|
||||
cn=Button(
|
||||
file='./assets/cn/base/popup/GET_LIGHT_CONE.png',
|
||||
area=(205, 321, 242, 339),
|
||||
search=(185, 301, 262, 359),
|
||||
color=(130, 130, 131),
|
||||
button=(205, 321, 242, 339),
|
||||
),
|
||||
en=Button(
|
||||
file='./assets/en/base/popup/GET_LIGHT_CONE.png',
|
||||
area=(260, 322, 306, 338),
|
||||
search=(240, 302, 326, 358),
|
||||
color=(147, 147, 148),
|
||||
button=(260, 322, 306, 338),
|
||||
),
|
||||
)
|
||||
GET_REWARD = ButtonWrapper(
|
||||
name='GET_REWARD',
|
||||
share=Button(
|
||||
|
@ -96,3 +96,20 @@ class PopupHandler(ModuleBase):
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def handle_get_light_cone(self, interval=2) -> bool:
|
||||
"""
|
||||
Popup when getting a light cone from Echo of War.
|
||||
|
||||
Args:
|
||||
interval:
|
||||
|
||||
Returns:
|
||||
If handled.
|
||||
"""
|
||||
if self.appear(GET_LIGHT_CONE, interval=interval):
|
||||
logger.info(f'{GET_LIGHT_CONE} -> {GET_REWARD}')
|
||||
self.device.click(GET_REWARD)
|
||||
return True
|
||||
|
||||
return False
|
||||
|
@ -321,6 +321,8 @@ class UI(MainPage):
|
||||
return True
|
||||
if self.handle_monthly_card_reward():
|
||||
return True
|
||||
if self.handle_get_light_cone():
|
||||
return True
|
||||
if self.appear(COMBAT_PREPARE, interval=5):
|
||||
logger.info(f'UI additional: {COMBAT_PREPARE} -> {CLOSE}')
|
||||
self.device.click(CLOSE)
|
||||
|
@ -306,6 +306,8 @@ class Combat(CombatInteract, CombatPrepare, CombatState, CombatTeam, CombatSuppo
|
||||
logger.info(f'{COMBAT_AGAIN} -> {COMBAT_EXIT}')
|
||||
self.device.click(COMBAT_EXIT)
|
||||
continue
|
||||
if self.handle_get_light_cone():
|
||||
continue
|
||||
|
||||
def is_trailblaze_power_exhausted(self) -> bool:
|
||||
flag = self.config.stored.TrailblazePower.value < self.combat_wave_cost
|
||||
|
Loading…
Reference in New Issue
Block a user