1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-04-01 06:56:20 +08:00

Opt: Template.match_result returns similarity and Button

- Add Button.move() Button.crop()
This commit is contained in:
LmeSzinc
2021-06-30 13:59:24 +08:00
parent 672d459469
commit cf5bfbc9a7
6 changed files with 71 additions and 15 deletions

View File

@@ -20,11 +20,9 @@ class CampaignBase(CampaignBase_):
if '-5' not in name:
return super().campaign_get_entrance(name)
sim, point = TEMPLATE_STAGE_SOS.match_result(self.device.image)
sim, button = TEMPLATE_STAGE_SOS.match_result(self.device.image)
if sim < 0.85:
raise CampaignNameError
button = area_offset(area=(-12, -12, 44, 32), offset=point)
color = get_color(self.device.image, button)
entrance = Button(area=button, color=color, button=button, name=name)
entrance = button.crop((-12, -12, 44, 32), image=self.device.image, name=name)
return entrance