1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-12 00:28:20 +08:00

Fix:StopIteration detection of get_main_activity_name is added

Fix:Display detection of wsa-0 has been improved
This commit is contained in:
SarContDeli
2022-03-17 19:45:33 +08:00
parent 357b5cb1c9
commit 86bacf6243
2 changed files with 12 additions and 12 deletions

View File

@@ -197,17 +197,15 @@ class Screenshot(Adb, WSA, Uiautomator2, AScreenCap):
# May get a pure black screenshot on some emulators.
color = get_color(self.image, area=(0, 0, 1280, 720))
if sum(color) < 1:
if self.config.Emulator_Serial == 'wsa-0' and self.get_display_id() != 0:
if self.config.Emulator_Serial == 'wsa-0':
for _ in range(2):
display = self.get_display_id()
if display == 0:
return True
logger.info(f'Game running on display {self.get_display_id()}')
logger.info(f'Game running on display {display}')
logger.warning('Game not running on display 0, will be restarted')
self.app_stop_uiautomator2(self.config.Emulator_PackageName)
return False
elif self.config.Emulator_Serial == 'wsa-0':
return True
elif self.config.Emulator_ScreenshotMethod == 'uiautomator2':
logger.warning(f'Received pure black screenshots from emulator, color: {color}')
logger.warning('Uninstall minicap and retry')