Add: is_map_loading()

This commit is contained in:
LmeSzinc 2023-10-03 02:25:22 +08:00
parent 1556b1363f
commit 25e7b1876c
4 changed files with 25 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

@ -13,3 +13,13 @@ DUNGEON_COMBAT_INTERACT = ButtonWrapper(
button=(750, 411, 997, 448),
),
)
MAP_LOADING = ButtonWrapper(
name='MAP_LOADING',
share=Button(
file='./assets/share/combat/interact/MAP_LOADING.png',
area=(644, 367, 662, 389),
search=(639, 347, 667, 394),
color=(159, 141, 149),
button=(644, 367, 662, 389),
),
)

View File

@ -1,5 +1,7 @@
from module.base.utils import color_similar, get_color
from tasks.base.ui import UI
from tasks.combat.assets.assets_combat_interact import DUNGEON_COMBAT_INTERACT
from tasks.combat.assets.assets_combat_interact import DUNGEON_COMBAT_INTERACT, MAP_LOADING
from tasks.map.assets.assets_map_control import A_BUTTON
class CombatInteract(UI):
@ -12,3 +14,15 @@ class CombatInteract(UI):
return True
return False
def is_map_loading(self):
if self.appear(MAP_LOADING, similarity=0.75):
return True
return False
def is_map_loading_black(self):
color = get_color(self.device.image, A_BUTTON.area)
if color_similar(color, (0, 0, 0)):
return True
return False