mirror of
https://github.com/0O0o0oOoO00/Alas.git
synced 2026-05-23 02:59:28 +08:00
Del: screenshot interval limit
This commit is contained in:
@@ -499,11 +499,11 @@
|
||||
},
|
||||
"ScreenshotInterval": {
|
||||
"name": "放慢截图速度至 X 秒一张",
|
||||
"help": "执行两次截图之间的最小间隔,限制在 0.1 ~ 2.0,根据需要自行调整\n建议调整为较短的间隔,比如0.1s\n我也不知道为什么,但这似乎对于减少Alas的部分报错有一定的帮助 : )"
|
||||
"help": ""
|
||||
},
|
||||
"CombatScreenshotInterval": {
|
||||
"name": "战斗中放慢截图速度至 X 秒一张",
|
||||
"help": "执行两次截图之间的最小间隔,限制在 0.1 ~ 5.0,根据需要自行调整\n建议调整为较短的间隔,比如0.5s\n我也不知道为什么,但这似乎对于减少Alas的部分报错有一定的帮助 : )"
|
||||
"help": ""
|
||||
},
|
||||
"TaskHoardingDuration": {
|
||||
"name": "囤积任务 X 分钟",
|
||||
|
||||
@@ -155,31 +155,12 @@ class Screenshot(Adb, WSA, DroidCast, AScreenCap, Scrcpy, NemuIpc):
|
||||
Minimum interval between 2 screenshots in seconds.
|
||||
Or None for Optimization_ScreenshotInterval, 'combat' for Optimization_CombatScreenshotInterval
|
||||
"""
|
||||
if interval is None:
|
||||
origin = self.config.Optimization_ScreenshotInterval
|
||||
interval = limit_in(origin, 0.1, 2.0)
|
||||
if interval != origin:
|
||||
logger.warning(f'Optimization.ScreenshotInterval {origin} is revised to {interval}')
|
||||
self.config.Optimization_ScreenshotInterval = interval
|
||||
# Allow nemu_ipc to have a lower default
|
||||
if self.config.Emulator_ScreenshotMethod == 'nemu_ipc':
|
||||
interval = limit_in(origin, 0.1, 0.2)
|
||||
elif interval == 'combat':
|
||||
origin = self.config.Optimization_CombatScreenshotInterval
|
||||
interval = limit_in(origin, 0.3, 5.0)
|
||||
if interval != origin:
|
||||
logger.warning(f'Optimization.CombatScreenshotInterval {origin} is revised to {interval}')
|
||||
self.config.Optimization_CombatScreenshotInterval = interval
|
||||
elif isinstance(interval, (int, float)):
|
||||
if isinstance(interval, (int, float)):
|
||||
# No limitation for manual set in code
|
||||
pass
|
||||
else:
|
||||
logger.warning(f'Unknown screenshot interval: {interval}')
|
||||
raise ScriptError(f'Unknown screenshot interval: {interval}')
|
||||
# Screenshot interval in scrcpy is meaningless,
|
||||
# video stream is received continuously no matter you use it or not.
|
||||
if self.config.Emulator_ScreenshotMethod == 'scrcpy':
|
||||
interval = 0.1
|
||||
|
||||
if interval != self._screenshot_interval.limit:
|
||||
logger.info(f'Screenshot interval set to {interval}s')
|
||||
|
||||
Reference in New Issue
Block a user