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

Fix: Share screenshot_method_override across tasks

This commit is contained in:
LmeSzinc
2024-09-11 19:02:03 +08:00
parent 9350273533
commit 3d262a5703

View File

@@ -44,6 +44,10 @@ class Screenshot(Adb, WSA, DroidCast, AScreenCap, Scrcpy, NemuIpc, LDOpenGL):
'ldopengl': self.screenshot_ldopengl,
}
@cached_property
def screenshot_method_override(self) -> str:
return ''
def screenshot(self):
"""
Returns:
@@ -53,10 +57,11 @@ class Screenshot(Adb, WSA, DroidCast, AScreenCap, Scrcpy, NemuIpc, LDOpenGL):
self._screenshot_interval.reset()
for _ in range(2):
method = self.screenshot_methods.get(
self.config.Emulator_ScreenshotMethod,
self.screenshot_adb
)
if self.screenshot_method_override:
method = self.screenshot_method_override
else:
method = self.config.Emulator_ScreenshotMethod
method = self.screenshot_methods.get(method, self.screenshot_adb)
self.image = method()
if self.config.Emulator_ScreenshotDedithering: