diff --git a/assets/share/dungeon/ui/TAB_SEARCH.png b/assets/share/dungeon/ui/TAB_SEARCH.png new file mode 100644 index 000000000..ad4e7bbd2 Binary files /dev/null and b/assets/share/dungeon/ui/TAB_SEARCH.png differ diff --git a/tasks/dungeon/assets/assets_dungeon_ui.py b/tasks/dungeon/assets/assets_dungeon_ui.py index d70a8e5b3..77c5fe3e6 100644 --- a/tasks/dungeon/assets/assets_dungeon_ui.py +++ b/tasks/dungeon/assets/assets_dungeon_ui.py @@ -153,6 +153,16 @@ SURVIVAL_INDEX_LOADED = ButtonWrapper( button=(451, 286, 476, 302), ), ) +TAB_SEARCH = ButtonWrapper( + name='TAB_SEARCH', + share=Button( + file='./assets/share/dungeon/ui/TAB_SEARCH.png', + area=(139, 84, 599, 144), + search=(119, 64, 619, 164), + color=(92, 87, 83), + button=(139, 84, 599, 144), + ), +) TREASURES_LIGHTWARD_CHECK = ButtonWrapper( name='TREASURES_LIGHTWARD_CHECK', share=Button( diff --git a/tasks/dungeon/ui.py b/tasks/dungeon/ui.py index 4ab40761e..571771f00 100644 --- a/tasks/dungeon/ui.py +++ b/tasks/dungeon/ui.py @@ -33,6 +33,14 @@ from tasks.map.keywords import KEYWORDS_MAP_WORLD, MapPlane class DungeonTabSwitch(Switch): + def add_state(self, state, check_button, click_button=None): + # Load search + if check_button is not None: + check_button.load_search(TAB_SEARCH.area) + if click_button is not None: + click_button.load_search(TAB_SEARCH.area) + return super().add_state(state, check_button, click_button) + def click(self, state, main): """ Args: diff --git a/tasks/item/synthesize.py b/tasks/item/synthesize.py index c6963713f..78f9c7822 100644 --- a/tasks/item/synthesize.py +++ b/tasks/item/synthesize.py @@ -9,6 +9,7 @@ from module.exception import ScriptError from module.logger import logger from module.ocr.ocr import Digit, Ocr from tasks.base.page import page_menu, page_synthesize +from tasks.combat.assets.assets_combat_obtain import ITEM_CLOSE from tasks.combat.obtain import CombatObtain from tasks.item.assets.assets_item_synthesize import * from tasks.item.inventory import InventoryManager @@ -178,6 +179,10 @@ class Synthesize(CombatObtain, ItemUI): self.device.click(SWITCH_RARITY) switched = True continue + if self.appear_then_click(ITEM_CLOSE, interval=2): + continue + if self.handle_reward(): + continue return switched @@ -305,6 +310,7 @@ class Synthesize(CombatObtain, ItemUI): inv.select(first) logger.hr('Synthesize select view', level=2) + self.device.click_record_clear() switch_row = True while 1: # End @@ -324,6 +330,7 @@ class Synthesize(CombatObtain, ItemUI): logger.info('Reached inventory view end, reset view') self.synthesize_rarity_reset(inv=inv) logger.hr('Synthesize select view', level=2) + self.device.click_record_clear() continue else: logger.info('Reached inventory list end, no more rows')