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