mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-16 06:25:24 +00:00
Fix: Skip non-draggable event options
This commit is contained in:
parent
afa771e1b4
commit
e6b0f8a92a
@ -110,6 +110,20 @@ class Scroll:
|
|||||||
"""
|
"""
|
||||||
return np.mean(self.match_color(main)) > 0.1
|
return np.mean(self.match_color(main)) > 0.1
|
||||||
|
|
||||||
|
def is_draggable(self, main):
|
||||||
|
"""
|
||||||
|
If scroll `length` is just a little smaller than `total`,
|
||||||
|
game client may not respond to such a short swipe.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
main (ModuleBase):
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
bool:
|
||||||
|
"""
|
||||||
|
_ = self.cal_position(main)
|
||||||
|
return self.length / self.total < 0.95
|
||||||
|
|
||||||
def at_top(self, main):
|
def at_top(self, main):
|
||||||
return self.cal_position(main) < self.edge_threshold
|
return self.cal_position(main) < self.edge_threshold
|
||||||
|
|
||||||
|
@ -288,7 +288,7 @@ class RogueEvent(RogueUI):
|
|||||||
self._event_option_match()
|
self._event_option_match()
|
||||||
self._event_option_ocr(len(self.options))
|
self._event_option_ocr(len(self.options))
|
||||||
# Check next page if there is scroll
|
# Check next page if there is scroll
|
||||||
if SCROLL_OPTION.appear(main=self):
|
if SCROLL_OPTION.appear(main=self) and SCROLL_OPTION.is_draggable(main=self):
|
||||||
if SCROLL_OPTION.set_bottom(main=self):
|
if SCROLL_OPTION.set_bottom(main=self):
|
||||||
expected = self._event_option_match(is_bottom_page=True)
|
expected = self._event_option_match(is_bottom_page=True)
|
||||||
self._event_option_ocr(expected)
|
self._event_option_ocr(expected)
|
||||||
|
Loading…
Reference in New Issue
Block a user