Fix: Clear click record after list dragging

This commit is contained in:
LmeSzinc 2024-08-10 22:49:36 +08:00
parent 2657be9878
commit 2de76057cd
2 changed files with 6 additions and 0 deletions

View File

@ -203,6 +203,7 @@ class CombatSupport(UI):
scroll.set_bottom(main=self) scroll.set_bottom(main=self)
scroll.drag_threshold = backup scroll.drag_threshold = backup
scroll.set_top(main=self) scroll.set_top(main=self)
self.device.click_record_clear()
logger.info("Searching support") logger.info("Searching support")
skip_first_screenshot = True skip_first_screenshot = True
@ -216,9 +217,11 @@ class CombatSupport(UI):
if character: if character:
logger.info("Support found") logger.info("Support found")
if self._select_support(character): if self._select_support(character):
self.device.click_record_clear()
return True return True
else: else:
logger.warning("Support not selected") logger.warning("Support not selected")
self.device.click_record_clear()
return False return False
if not scroll.at_bottom(main=self): if not scroll.at_bottom(main=self):
@ -226,6 +229,7 @@ class CombatSupport(UI):
continue continue
else: else:
logger.info("Support not found") logger.info("Support not found")
self.device.click_record_clear()
return False return False
def _select_support(self, character: SupportCharacter): def _select_support(self, character: SupportCharacter):

View File

@ -578,6 +578,7 @@ class DungeonUI(DungeonState):
DUNGEON_LIST.use_plane = bool(dungeon.is_Calyx_Crimson) DUNGEON_LIST.use_plane = bool(dungeon.is_Calyx_Crimson)
# Insight dungeon # Insight dungeon
DUNGEON_LIST.insight_row(dungeon, main=self) DUNGEON_LIST.insight_row(dungeon, main=self)
self.device.click_record_clear()
# Check if dungeon unlocked # Check if dungeon unlocked
for entrance in DUNGEON_LIST.navigates: for entrance in DUNGEON_LIST.navigates:
entrance: OcrResultButton = entrance entrance: OcrResultButton = entrance
@ -596,6 +597,7 @@ class DungeonUI(DungeonState):
DUNGEON_LIST.drag_vector = (0.2, 0.4) DUNGEON_LIST.drag_vector = (0.2, 0.4)
DUNGEON_LIST.limit_entrance = True DUNGEON_LIST.limit_entrance = True
DUNGEON_LIST.insight_row(dungeon, main=self) DUNGEON_LIST.insight_row(dungeon, main=self)
self.device.click_record_clear()
DUNGEON_LIST.drag_vector = DraggableList.drag_vector DUNGEON_LIST.drag_vector = DraggableList.drag_vector
DUNGEON_LIST.limit_entrance = False DUNGEON_LIST.limit_entrance = False
DUNGEON_LIST.load_rows(main=self) DUNGEON_LIST.load_rows(main=self)