Fix: Handle Herta drop in rogue rewards

This commit is contained in:
LmeSzinc 2023-11-03 13:35:14 +08:00
parent 548d938cf0
commit 9d282b23b7
5 changed files with 37 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@ -13,6 +13,23 @@ BATTLE_PASS_NOTIFICATION = ButtonWrapper(
button=(895, 595, 1180, 630),
),
)
GET_CHARACTER = ButtonWrapper(
name='GET_CHARACTER',
cn=Button(
file='./assets/cn/base/popup/GET_CHARACTER.png',
area=(204, 322, 249, 338),
search=(184, 302, 269, 358),
color=(156, 155, 154),
button=(204, 322, 249, 338),
),
en=Button(
file='./assets/en/base/popup/GET_CHARACTER.png',
area=(205, 321, 242, 339),
search=(185, 301, 262, 359),
color=(126, 127, 127),
button=(205, 321, 242, 339),
),
)
GET_LIGHT_CONE = ButtonWrapper(
name='GET_LIGHT_CONE',
cn=Button(

View File

@ -117,6 +117,23 @@ class PopupHandler(ModuleBase):
return False
def handle_get_character(self, interval=2) -> bool:
"""
Popup when getting a character from rogue rewards.
Args:
interval:
Returns:
If handled.
"""
if self.appear(GET_CHARACTER, interval=interval):
logger.info(f'{GET_CHARACTER} -> {GET_REWARD}')
self.device.click(GET_REWARD)
return True
return False
def handle_ui_close(self, appear_button: ButtonWrapper | Callable, interval=2) -> bool:
"""
Args:

View File

@ -255,6 +255,9 @@ class RouteBase(RouteBase_, RogueExit, RogueEvent, RogueReward):
# First-time cleared reward
if self.handle_reward():
continue
# Get Herta
if self.handle_get_character():
continue
def domain_single_exit(self, *waypoints):
"""