Merge pull request #529 from LmeSzinc/dev

Bug fix
This commit is contained in:
LmeSzinc 2024-06-19 12:50:00 +08:00 committed by GitHub
commit f29b54385e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 25 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -153,6 +153,16 @@ SURVIVAL_INDEX_LOADED = ButtonWrapper(
button=(451, 286, 476, 302), 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( TREASURES_LIGHTWARD_CHECK = ButtonWrapper(
name='TREASURES_LIGHTWARD_CHECK', name='TREASURES_LIGHTWARD_CHECK',
share=Button( share=Button(

View File

@ -33,6 +33,14 @@ from tasks.map.keywords import KEYWORDS_MAP_WORLD, MapPlane
class DungeonTabSwitch(Switch): 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): def click(self, state, main):
""" """
Args: Args:

View File

@ -9,6 +9,7 @@ from module.exception import ScriptError
from module.logger import logger from module.logger import logger
from module.ocr.ocr import Digit, Ocr from module.ocr.ocr import Digit, Ocr
from tasks.base.page import page_menu, page_synthesize 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.combat.obtain import CombatObtain
from tasks.item.assets.assets_item_synthesize import * from tasks.item.assets.assets_item_synthesize import *
from tasks.item.inventory import InventoryManager from tasks.item.inventory import InventoryManager
@ -178,6 +179,10 @@ class Synthesize(CombatObtain, ItemUI):
self.device.click(SWITCH_RARITY) self.device.click(SWITCH_RARITY)
switched = True switched = True
continue continue
if self.appear_then_click(ITEM_CLOSE, interval=2):
continue
if self.handle_reward():
continue
return switched return switched
@ -305,6 +310,7 @@ class Synthesize(CombatObtain, ItemUI):
inv.select(first) inv.select(first)
logger.hr('Synthesize select view', level=2) logger.hr('Synthesize select view', level=2)
self.device.click_record_clear()
switch_row = True switch_row = True
while 1: while 1:
# End # End
@ -324,6 +330,7 @@ class Synthesize(CombatObtain, ItemUI):
logger.info('Reached inventory view end, reset view') logger.info('Reached inventory view end, reset view')
self.synthesize_rarity_reset(inv=inv) self.synthesize_rarity_reset(inv=inv)
logger.hr('Synthesize select view', level=2) logger.hr('Synthesize select view', level=2)
self.device.click_record_clear()
continue continue
else: else:
logger.info('Reached inventory list end, no more rows') logger.info('Reached inventory list end, no more rows')