mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 03:58:22 +08:00
Opt: Cache ButtonGrid.buttons and add move() crop()
This commit is contained in:
@@ -41,7 +41,7 @@ class GuildBase(UI):
|
||||
current = 0
|
||||
total = 0
|
||||
|
||||
for idx, button in enumerate(GUILD_SIDEBAR.buttons()):
|
||||
for idx, button in enumerate(GUILD_SIDEBAR.buttons):
|
||||
image = np.array(self.image_area(button))
|
||||
if np.sum(image[:, :, 0] > 235) > 100:
|
||||
current = idx + 1
|
||||
|
||||
@@ -424,7 +424,7 @@ class GuildLogistics(GuildBase):
|
||||
# Loop EXCHANGE_GRIDS to detect for red text in bottom right area
|
||||
# indicating player lacks inventory for that item
|
||||
in_red_list = []
|
||||
for button in EXCHANGE_GRIDS.buttons():
|
||||
for button in EXCHANGE_GRIDS.buttons:
|
||||
area = area_offset((35, 64, 83, 83), button.area[0:2])
|
||||
if self.image_color_count(area, color=(255, 93, 90), threshold=221, count=20):
|
||||
in_red_list.append(True)
|
||||
|
||||
@@ -226,7 +226,7 @@ class GuildOperations(GuildBase):
|
||||
text = []
|
||||
index = 0
|
||||
button = None
|
||||
for switch in switch_grid.buttons():
|
||||
for switch in switch_grid.buttons:
|
||||
if self.image_color_count(switch, color=color_inactive, threshold=235, count=30):
|
||||
index += 1
|
||||
text.append(f'| {index} |')
|
||||
|
||||
Reference in New Issue
Block a user