mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-09-28 06:45:03 +00:00
Add: is_map_loading()
This commit is contained in:
parent
1556b1363f
commit
25e7b1876c
BIN
assets/share/combat/interact/MAP_LOADING.SEARCH.png
Normal file
BIN
assets/share/combat/interact/MAP_LOADING.SEARCH.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.3 KiB |
BIN
assets/share/combat/interact/MAP_LOADING.png
Normal file
BIN
assets/share/combat/interact/MAP_LOADING.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.5 KiB |
@ -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),
|
||||
),
|
||||
)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user