mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-26 04:45:03 +08:00
Fix: _dorm_receive handle stacked popups, may occur if ui_ensure did not handle
This commit is contained in:
@@ -100,20 +100,20 @@ class RewardDorm(UI):
|
|||||||
self.device.minitouch_send()
|
self.device.minitouch_send()
|
||||||
|
|
||||||
# Collect
|
# Collect
|
||||||
for n in range(3):
|
_dorm_receive_attempt = 0
|
||||||
|
while 1:
|
||||||
self.device.screenshot()
|
self.device.screenshot()
|
||||||
# Close trophies info
|
|
||||||
if self.appear(DORM_TROPHY_CONFIRM, offset=(30, 30)):
|
|
||||||
self.ui_click(DORM_TROPHY_CONFIRM, check_button=DORM_CHECK, skip_first_screenshot=True)
|
|
||||||
self.device.screenshot()
|
|
||||||
# Close DORM_INFO. Usually, it was handled in ui_ensure(), but sometimes not.
|
|
||||||
if self.appear(DORM_INFO, offset=(30, 30)):
|
|
||||||
self.ui_click(DORM_INFO, check_button=DORM_CHECK, skip_first_screenshot=True)
|
|
||||||
self.device.screenshot()
|
|
||||||
|
|
||||||
if self._dorm_receive_click():
|
# Handle all popups
|
||||||
self.ensure_no_info_bar()
|
if self.ui_additional():
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
# End
|
||||||
|
# - If max _dorm_receive_attempt (3+) reached
|
||||||
|
# - If _dorm_receive_click returns 0 (no coins/loves clicked)
|
||||||
|
if _dorm_receive_attempt < 3 and self._dorm_receive_click():
|
||||||
|
self.ensure_no_info_bar()
|
||||||
|
_dorm_receive_attempt += 1
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user