mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-25 10:01:10 +00:00
Fix login task stuck when render error (#503)
* modify similarity limit for login task * Revert modification to similarity and add asset for render error * Apply luma match for `LOGIN_CONFIRM` * cancel color match for login confirm
This commit is contained in:
parent
365b1744e5
commit
1f734b494d
@ -96,7 +96,8 @@ class UI(MainPage):
|
||||
if self.handle_popup_confirm():
|
||||
timeout.reset()
|
||||
continue
|
||||
if self.appear_then_click(LOGIN_CONFIRM, interval=5):
|
||||
if self.is_in_login_confirm(interval=5):
|
||||
self.device.click(LOGIN_CONFIRM)
|
||||
timeout.reset()
|
||||
continue
|
||||
if self.appear(MAP_LOADING, interval=5):
|
||||
@ -169,7 +170,8 @@ class UI(MainPage):
|
||||
continue
|
||||
if self.handle_popup_confirm():
|
||||
continue
|
||||
if self.appear_then_click(LOGIN_CONFIRM, interval=5):
|
||||
if self.is_in_login_confirm(interval=5):
|
||||
self.device.click(LOGIN_CONFIRM)
|
||||
continue
|
||||
|
||||
# Reset connection
|
||||
@ -327,6 +329,20 @@ class UI(MainPage):
|
||||
|
||||
return appear
|
||||
|
||||
def is_in_login_confirm(self, interval=0):
|
||||
self.device.stuck_record_add(LOGIN_CONFIRM)
|
||||
|
||||
if interval and not self.interval_is_reached(LOGIN_CONFIRM, interval=interval):
|
||||
return False
|
||||
|
||||
appear = LOGIN_CONFIRM.match_template_luma(self.device.image)
|
||||
|
||||
if appear and interval:
|
||||
self.interval_reset(LOGIN_CONFIRM, interval=interval)
|
||||
|
||||
return appear
|
||||
|
||||
|
||||
def is_in_map_exit(self, interval=0):
|
||||
self.device.stuck_record_add(MAP_EXIT)
|
||||
|
||||
|
@ -56,7 +56,8 @@ class Login(UI, LoginAndroidCloud):
|
||||
orientation_timer.reset()
|
||||
|
||||
# Login
|
||||
if self.appear_then_click(LOGIN_CONFIRM):
|
||||
if self.is_in_login_confirm(interval=5):
|
||||
self.device.click(LOGIN_CONFIRM)
|
||||
login_success = True
|
||||
continue
|
||||
if self.appear_then_click(USER_AGREEMENT_ACCEPT):
|
||||
|
Loading…
Reference in New Issue
Block a user