From 81a26d5e78560f1539f653d20d96d3d82e9c4392 Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Sat, 6 Jul 2024 01:03:43 +0800 Subject: [PATCH] Pref: Lower screenshot speed during teleportation --- tasks/dungeon/ui.py | 11 ++++++++++- tasks/rogue/route/base.py | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/tasks/dungeon/ui.py b/tasks/dungeon/ui.py index 08b48554c..45e09b102 100644 --- a/tasks/dungeon/ui.py +++ b/tasks/dungeon/ui.py @@ -5,6 +5,7 @@ import numpy as np from module.base.base import ModuleBase from module.base.button import ClickButton +from module.base.decorator import run_once from module.base.timer import Timer from module.base.utils import get_color from module.exception import ScriptError @@ -614,7 +615,12 @@ class DungeonUI(DungeonState): """ logger.hr('Dungeon enter', level=2) DUNGEON_LIST.use_plane = bool(dungeon.is_Calyx_Crimson) - skip_first_load = True + skip_first_load = skip_first_screenshot + + @run_once + def screenshot_interval_set(): + self.device.screenshot_interval_set('combat') + while 1: if skip_first_screenshot: skip_first_screenshot = False @@ -624,11 +630,13 @@ class DungeonUI(DungeonState): # End if self.appear(enter_check_button): logger.info(f'Arrive {enter_check_button.name}') + self.device.screenshot_interval_set() break # Additional # Popup that confirm character switch if self.handle_popup_confirm(): + self.interval_reset(page_guide.check_button) continue # Click teleport @@ -640,6 +648,7 @@ class DungeonUI(DungeonState): entrance = DUNGEON_LIST.keyword2button(dungeon) if entrance is not None: self.device.click(entrance) + screenshot_interval_set() self.interval_reset(page_guide.check_button) continue else: diff --git a/tasks/rogue/route/base.py b/tasks/rogue/route/base.py index 548d1deec..d54aba29a 100644 --- a/tasks/rogue/route/base.py +++ b/tasks/rogue/route/base.py @@ -261,6 +261,7 @@ class RouteBase(RouteBase_, RogueExit, RogueEvent, RogueReward): or page_rogue if rogue cleared """ logger.info('Wait next domain') + self.device.screenshot_interval_set('combat') while 1: if skip_first_screenshot: skip_first_screenshot = False @@ -270,10 +271,12 @@ class RouteBase(RouteBase_, RogueExit, RogueEvent, RogueReward): # End if self.is_in_main(): logger.info('Entered another domain') + self.device.screenshot_interval_set() self.wait_until_minimap_stabled() break if self.is_page_rogue_main(): logger.info('Rogue cleared') + self.device.screenshot_interval_set() break if self.match_template_color(ROGUE_REPORT, interval=2):