mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 03:58:22 +08:00
Chore: [ALAS] Abstract has_cached_image
This commit is contained in:
@@ -340,7 +340,7 @@ class CampaignRun(CampaignEvent):
|
||||
# UI ensure
|
||||
self.device.stuck_record_clear()
|
||||
self.device.click_record_clear()
|
||||
if not hasattr(self.device, 'image') or self.device.image is None:
|
||||
if not self.device.has_cached_image:
|
||||
self.device.screenshot()
|
||||
self.campaign.device.image = self.device.image
|
||||
if self.campaign.is_in_map():
|
||||
|
||||
@@ -72,6 +72,10 @@ class Screenshot(Adb, WSA, DroidCast, AScreenCap, Scrcpy, NemuIpc):
|
||||
|
||||
return self.image
|
||||
|
||||
@property
|
||||
def has_cached_image(self):
|
||||
return hasattr(self, 'image') and self.image is not None
|
||||
|
||||
def _handle_orientated_image(self, image):
|
||||
"""
|
||||
Args:
|
||||
|
||||
@@ -146,7 +146,7 @@ class UI(InfoHandler):
|
||||
while 1:
|
||||
if skip_first_screenshot:
|
||||
skip_first_screenshot = False
|
||||
if not hasattr(self.device, "image") or self.device.image is None:
|
||||
if not self.device.has_cached_image:
|
||||
self.device.screenshot()
|
||||
else:
|
||||
self.device.screenshot()
|
||||
|
||||
Reference in New Issue
Block a user