Fix: Handle monthly card popups

This commit is contained in:
LmeSzinc 2023-05-21 09:38:41 +08:00
parent 1e47a1f621
commit 2fbb3c6d0d
7 changed files with 41 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

View File

@ -23,3 +23,23 @@ GET_REWARD = ButtonWrapper(
button=(741, 495, 1071, 644),
),
)
MONTHLY_CARD_GET_ITEM = ButtonWrapper(
name='MONTHLY_CARD_GET_ITEM',
share=Button(
file='./assets/share/base/popup/MONTHLY_CARD_GET_ITEM.png',
area=(612, 328, 652, 368),
search=(592, 308, 672, 388),
color=(209, 187, 179),
button=(741, 495, 1071, 644),
),
)
MONTHLY_CARD_REWARD = ButtonWrapper(
name='MONTHLY_CARD_REWARD',
share=Button(
file='./assets/share/base/popup/MONTHLY_CARD_REWARD.png',
area=(696, 407, 736, 447),
search=(676, 387, 756, 467),
color=(137, 107, 91),
button=(741, 495, 1071, 644),
),
)

View File

@ -30,3 +30,20 @@ class PopupHandler(ModuleBase):
return True
return False
def handle_monthly_card_reward(self, interval=5) -> bool:
"""
Popup at 04:00 server time if you have purchased the monthly card.
Args:
interval:
Returns:
If handled.
"""
if self.appear_then_click(MONTHLY_CARD_REWARD, interval=interval):
return True
if self.appear_then_click(MONTHLY_CARD_GET_ITEM, interval=interval):
return True
return False

View File

@ -164,6 +164,10 @@ class UI(PopupHandler):
return True
if self.handle_battle_pass_notification():
return True
if self.handle_monthly_card_reward():
return True
return False
def ui_button_interval_reset(self, button):
"""