mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-16 06:25:24 +00:00
Fix: acquire_lang_checked() stuck game launch
This commit is contained in:
parent
c7d09043c2
commit
bc5e7f887d
@ -58,17 +58,29 @@ class MainPage(ModuleBase):
|
||||
return server.lang
|
||||
|
||||
def handle_lang_check(self, page: Page):
|
||||
"""
|
||||
Args:
|
||||
page:
|
||||
|
||||
Returns:
|
||||
bool: If checked
|
||||
"""
|
||||
if MainPage._lang_checked:
|
||||
return
|
||||
return False
|
||||
if page != page_main:
|
||||
return
|
||||
return False
|
||||
|
||||
self.check_lang_from_map_plane()
|
||||
MainPage._lang_checked = True
|
||||
return True
|
||||
|
||||
def acquire_lang_checked(self):
|
||||
"""
|
||||
Returns:
|
||||
bool: If checked
|
||||
"""
|
||||
if MainPage._lang_checked:
|
||||
return
|
||||
return False
|
||||
|
||||
logger.info('acquire_lang_checked')
|
||||
try:
|
||||
@ -78,3 +90,4 @@ class MainPage(ModuleBase):
|
||||
raise ScriptError
|
||||
|
||||
self.handle_lang_check(page=page_main)
|
||||
return True
|
||||
|
@ -153,8 +153,10 @@ class UI(PopupHandler, MainPage):
|
||||
bool: If UI switched.
|
||||
"""
|
||||
logger.hr("UI ensure")
|
||||
self.acquire_lang_checked()
|
||||
self.ui_get_current_page(skip_first_screenshot=skip_first_screenshot)
|
||||
if self.acquire_lang_checked():
|
||||
self.ui_get_current_page(skip_first_screenshot=skip_first_screenshot)
|
||||
|
||||
if self.ui_current == destination:
|
||||
logger.info("Already at %s" % destination)
|
||||
return False
|
||||
|
Loading…
Reference in New Issue
Block a user