mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-25 18:05:26 +00:00
b457e49421
in case missed the door
29 lines
824 B
Python
29 lines
824 B
Python
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, MAP_LOADING
|
|
from tasks.map.assets.assets_map_control import A_BUTTON
|
|
|
|
|
|
class CombatInteract(UI):
|
|
def handle_combat_interact(self, interval=2):
|
|
"""
|
|
Returns:
|
|
bool: If clicked.
|
|
"""
|
|
if self.appear_then_click(DUNGEON_COMBAT_INTERACT, interval=interval):
|
|
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
|