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

Merge remote-tracking branch 'upstream/master'

This commit is contained in:
SevCrane
2024-06-07 18:00:59 +08:00
50 changed files with 253 additions and 119 deletions

View File

@@ -115,7 +115,7 @@ class CampaignOcr(ModuleBase):
@cached_property
def _stage_image(self):
return crop(self.device.image, self._stage_detect_area)
return crop(self.device.image, self._stage_detect_area, copy=False)
@cached_property
def _stage_image_gray(self):
@@ -270,6 +270,8 @@ class CampaignOcr(ModuleBase):
del_cached_property(self, '_stage_image')
del_cached_property(self, '_stage_image_gray')
buttons = self.campaign_extract_name_image(image)
del_cached_property(self, '_stage_image')
del_cached_property(self, '_stage_image_gray')
if len(buttons) == 0:
logger.info('No stage found.')
raise CampaignNameError

View File

@@ -297,7 +297,7 @@ class GemsFarming(CampaignRun, Dock, EquipmentChange):
scanner.set_limitation(fleet=0)
candidates = [ship for ship in scanner.scan(self.device.image, output=False)
if template.match(self.image_crop(ship.button), similarity=SIM_VALUE)]
if template.match(self.image_crop(ship.button, copy=False), similarity=SIM_VALUE)]
if candidates:
return candidates
@@ -306,7 +306,7 @@ class GemsFarming(CampaignRun, Dock, EquipmentChange):
self.dock_sort_method_dsc_set(False)
candidates = [ship for ship in scanner.scan(self.device.image)
if template.match(self.image_crop(ship.button), similarity=SIM_VALUE)]
if template.match(self.image_crop(ship.button, copy=False), similarity=SIM_VALUE)]
return candidates
@@ -366,7 +366,7 @@ class GemsFarming(CampaignRun, Dock, EquipmentChange):
candidates = []
for item in template:
candidates = [ship for ship in scanner.scan(self.device.image, output=False)
if item.match(self.image_crop(ship.button), similarity=SIM_VALUE)]
if item.match(self.image_crop(ship.button, copy=False), similarity=SIM_VALUE)]
if candidates:
break
return candidates