mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-22 15:13:45 +08:00
Opt: Limit screenshot and control combinations when using nemu_ipc
This commit is contained in:
@@ -726,6 +726,11 @@ class ConfigUpdater:
|
|||||||
key = key.split(".")
|
key = key.split(".")
|
||||||
key[-1] = key[-1].replace("Value", "Record")
|
key[-1] = key[-1].replace("Value", "Record")
|
||||||
yield ".".join(key), datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
yield ".".join(key), datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
||||||
|
# Oh no, dynamic dropdown update can only be used on pywebio > 1.8.0
|
||||||
|
# elif key == 'Alas.Emulator.ScreenshotMethod' and value == 'nemu_ipc':
|
||||||
|
# yield 'Alas.Emulator.ControlMethod', 'nemu_ipc'
|
||||||
|
# elif key == 'Alas.Emulator.ControlMethod' and value == 'nemu_ipc':
|
||||||
|
# yield 'Alas.Emulator.ScreenshotMethod', 'nemu_ipc'
|
||||||
|
|
||||||
def read_file(self, config_name, is_template=False):
|
def read_file(self, config_name, is_template=False):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ class Device(Screenshot, Control, AppControl):
|
|||||||
_ = self.emulator_instance
|
_ = self.emulator_instance
|
||||||
|
|
||||||
self.screenshot_interval_set()
|
self.screenshot_interval_set()
|
||||||
|
self.method_check()
|
||||||
|
|
||||||
# Auto-select the fastest screenshot method
|
# Auto-select the fastest screenshot method
|
||||||
if not self.config.is_template_config and self.config.Emulator_ScreenshotMethod == 'auto':
|
if not self.config.is_template_config and self.config.Emulator_ScreenshotMethod == 'auto':
|
||||||
@@ -99,7 +100,22 @@ class Device(Screenshot, Control, AppControl):
|
|||||||
bench = Benchmark(config=self.config, device=self)
|
bench = Benchmark(config=self.config, device=self)
|
||||||
method = bench.run_simple_screenshot_benchmark()
|
method = bench.run_simple_screenshot_benchmark()
|
||||||
# Set
|
# Set
|
||||||
self.config.Emulator_ScreenshotMethod = method
|
with self.config.multi_set():
|
||||||
|
self.config.Emulator_ScreenshotMethod = method
|
||||||
|
if method == 'nemu_ipc':
|
||||||
|
self.config.Emulator_ControlMethod = 'nemu_ipc'
|
||||||
|
|
||||||
|
def method_check(self):
|
||||||
|
"""
|
||||||
|
Check combinations of screenshot method and control methods
|
||||||
|
"""
|
||||||
|
# nemu_ipc should be together
|
||||||
|
if self.config.Emulator_ScreenshotMethod == 'nemu_ipc' and self.config.Emulator_ControlMethod != 'nemu_ipc':
|
||||||
|
logger.warning('When using nemu_ipc, both screenshot and control should use nemu_ipc')
|
||||||
|
self.config.Emulator_ControlMethod = 'nemu_ipc'
|
||||||
|
if self.config.Emulator_ScreenshotMethod != 'nemu_ipc' and self.config.Emulator_ControlMethod == 'nemu_ipc':
|
||||||
|
logger.warning('When not using nemu_ipc, both screenshot and control should not use nemu_ipc')
|
||||||
|
self.config.Emulator_ControlMethod = 'minitouch'
|
||||||
|
|
||||||
def handle_night_commission(self, daily_trigger='21:00', threshold=30):
|
def handle_night_commission(self, daily_trigger='21:00', threshold=30):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user