mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-18 15:01:29 +08:00
Opt: Template.match_result returns similarity and Button
- Add Button.move() Button.crop()
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -27,13 +27,11 @@ class CampaignBase(CampaignBase_):
|
||||
"""
|
||||
template = dic_archives_template[name]
|
||||
|
||||
sim, point = template.match_result(self.device.image)
|
||||
sim, button = template.match_result(self.device.image)
|
||||
if sim < 0.85:
|
||||
return None
|
||||
|
||||
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
|
||||
|
||||
def _search_archives_entrance(self, name, skip_first_screenshot=True):
|
||||
|
||||
Reference in New Issue
Block a user