Opt: Use scrcpy screenshot and maatouch clicks

This commit is contained in:
LmeSzinc 2023-06-16 21:43:11 +08:00
parent cec7d1886c
commit f517481e5b
5 changed files with 14 additions and 8 deletions

View File

@ -3,7 +3,7 @@
"Emulator": { "Emulator": {
"Serial": "auto", "Serial": "auto",
"PackageName": "auto", "PackageName": "auto",
"ScreenshotMethod": "auto", "ScreenshotMethod": "scrcpy",
"ControlMethod": "MaaTouch", "ControlMethod": "MaaTouch",
"ScreenshotDedithering": false, "ScreenshotDedithering": false,
"AdbRestart": false "AdbRestart": false

View File

@ -18,7 +18,7 @@
}, },
"ScreenshotMethod": { "ScreenshotMethod": {
"type": "select", "type": "select",
"value": "auto", "value": "scrcpy",
"option": [ "option": [
"auto", "auto",
"ADB", "ADB",
@ -29,7 +29,8 @@
"DroidCast", "DroidCast",
"DroidCast_raw", "DroidCast_raw",
"scrcpy" "scrcpy"
] ],
"display": "hide"
}, },
"ControlMethod": { "ControlMethod": {
"type": "select", "type": "select",
@ -37,7 +38,8 @@
"option": [ "option": [
"minitouch", "minitouch",
"MaaTouch" "MaaTouch"
] ],
"display": "hide"
}, },
"ScreenshotDedithering": { "ScreenshotDedithering": {
"type": "checkbox", "type": "checkbox",

View File

@ -5,6 +5,10 @@
# ==================== Alas ==================== # ==================== Alas ====================
Alas:
Emulator:
ScreenshotMethod: scrcpy
ControlMethod: MaaTouch
Restart: Restart:
Scheduler: Scheduler:
Enable: Enable:

View File

@ -4,7 +4,7 @@ import module.device.method.scrcpy.const as const
class ScrcpyOptions: class ScrcpyOptions:
frame_rate = 6 frame_rate = 10
@classmethod @classmethod
def codec_options(cls) -> str: def codec_options(cls) -> str:

View File

@ -238,9 +238,9 @@ class Screenshot(Adb, WSA, DroidCast, AScreenCap, Scrcpy):
self._screen_black_checked = False self._screen_black_checked = False
return False return False
else: else:
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.is_mumu_family: if self.is_mumu_family:
if self.config.Emulator_ScreenshotMethod == 'DroidCast': if self.config.Emulator_ScreenshotMethod == 'DroidCast':
self.droidcast_stop() self.droidcast_stop()