Fix: Redundant swipe left after getting reward from daily

This commit is contained in:
LmeSzinc 2023-07-30 17:15:09 +08:00
parent 7ceb9bc4fb
commit 7e778efa17

View File

@ -9,6 +9,7 @@ from tasks.daily.camera import CameraUI
from tasks.daily.keywords import DailyQuest, DailyQuestState, KEYWORDS_DAILY_QUEST, KEYWORDS_DAILY_QUEST_STATE
from tasks.daily.synthesize import SynthesizeConsumablesUI, SynthesizeMaterialUI
from tasks.daily.use_technique import UseTechniqueUI
from tasks.dungeon.assets.assets_dungeon_ui import DAILY_TRAINING_CHECK
from tasks.dungeon.keywords import KEYWORDS_DUNGEON_TAB
from tasks.dungeon.ui import DungeonUI
from tasks.item.consumable_usage import ConsumableUsageUI
@ -52,7 +53,10 @@ class DailyQuestUI(DungeonUI):
if self.appear(template):
logger.info(f"Ensure position: {direction}")
break
if interval.reached():
# Might be a screenshot mixed with daily_training and get_reward
# Swipe at daily training page only
if interval.reached() and self.match_template_color(DAILY_TRAINING_CHECK):
self._daily_quests_swipe(direction)
interval.reset()
continue