mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-16 06:25:24 +00:00
Fix: Increase slider threshold to 235
so slider can be clicked on white background
This commit is contained in:
parent
be4c401913
commit
d3481e7c0c
@ -93,6 +93,16 @@ class Slider:
|
||||
logger.warning('Detected slider too short')
|
||||
# self.main.device.image_save()
|
||||
|
||||
def is_slider_arrive(self, detect):
|
||||
"""
|
||||
Args:
|
||||
detect: Area to detect
|
||||
|
||||
Returns:
|
||||
bool: If slider arrive detect area
|
||||
"""
|
||||
return self.main.image_color_count(detect, color=(255, 255, 255), threshold=235, count=50)
|
||||
|
||||
def set(self, value: int, total: int, skip_first_screenshot=True):
|
||||
"""
|
||||
Args:
|
||||
@ -158,7 +168,7 @@ class Slider:
|
||||
if trial > 3:
|
||||
logger.warning('Slider.set failed after 3 trial')
|
||||
return False
|
||||
if self.main.image_color_count(detect, color=(255, 255, 255), threshold=221, count=50):
|
||||
if self.is_slider_arrive(detect):
|
||||
logger.info('Slider set done')
|
||||
return True
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user