mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-15 16:57:20 +08:00
Opt: Change Mumu X screenshot tips to scrcpy
This commit is contained in:
@@ -112,6 +112,10 @@ class ConnectionAttr:
|
|||||||
def is_wsa(self):
|
def is_wsa(self):
|
||||||
return bool(re.match(r'^wsa', self.serial))
|
return bool(re.match(r'^wsa', self.serial))
|
||||||
|
|
||||||
|
@cached_property
|
||||||
|
def is_mumu_family(self):
|
||||||
|
return self.serial == '127.0.0.1:7555'
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def is_emulator(self):
|
def is_emulator(self):
|
||||||
return self.serial.startswith('emulator-') or self.serial.startswith('127.0.0.1:')
|
return self.serial.startswith('emulator-') or self.serial.startswith('127.0.0.1:')
|
||||||
|
|||||||
@@ -89,8 +89,11 @@ class AScreenCap(Connection):
|
|||||||
filepath = os.path.join(self.config.ASCREENCAP_FILEPATH_LOCAL, ver, arc, 'ascreencap')
|
filepath = os.path.join(self.config.ASCREENCAP_FILEPATH_LOCAL, ver, arc, 'ascreencap')
|
||||||
if not os.path.exists(filepath):
|
if not os.path.exists(filepath):
|
||||||
logger.critical('No suitable version of aScreenCap lib available for this device')
|
logger.critical('No suitable version of aScreenCap lib available for this device')
|
||||||
logger.critical('Please use ADB or uiautomator2 for screenshots instead')
|
if self.is_mumu_family:
|
||||||
raise RequestHumanTakeover
|
logger.critical('If you are using MuMu X, please set screenshot method to scrcpy')
|
||||||
|
else:
|
||||||
|
logger.critical('Please use ADB or uiautomator2 for screenshots instead')
|
||||||
|
raise RequestHumanTakeover
|
||||||
|
|
||||||
logger.info(f'pushing {filepath}')
|
logger.info(f'pushing {filepath}')
|
||||||
self.adb_push(filepath, self.config.ASCREENCAP_FILEPATH_REMOTE)
|
self.adb_push(filepath, self.config.ASCREENCAP_FILEPATH_REMOTE)
|
||||||
|
|||||||
@@ -236,11 +236,11 @@ class Screenshot(Adb, WSA, DroidCast, AScreenCap, Scrcpy):
|
|||||||
logger.warning(f'Received pure black screenshots from emulator, color: {color}')
|
logger.warning(f'Received pure black screenshots from emulator, color: {color}')
|
||||||
logger.warning(f'Screenshot method `{self.config.Emulator_ScreenshotMethod}` '
|
logger.warning(f'Screenshot method `{self.config.Emulator_ScreenshotMethod}` '
|
||||||
f'may not work on emulator `{self.serial}`, or the emulator is not fully started')
|
f'may not work on emulator `{self.serial}`, or the emulator is not fully started')
|
||||||
if self.serial == '127.0.0.1:7555':
|
if self.is_mumu_family:
|
||||||
if self.config.Emulator_ScreenshotMethod == 'DroidCast':
|
if self.config.Emulator_ScreenshotMethod == 'DroidCast':
|
||||||
self.droidcast_stop()
|
self.droidcast_stop()
|
||||||
else:
|
else:
|
||||||
logger.warning('If you are using MuMu X, please set screenshot method to DroidCast')
|
logger.warning('If you are using MuMu X, please set screenshot method to scrcpy')
|
||||||
self._screen_black_checked = False
|
self._screen_black_checked = False
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user