Merge pull request #535 from LmeSzinc/dev

Bug fix
This commit is contained in:
LmeSzinc 2024-06-20 03:05:04 +08:00 committed by GitHub
commit ec5f75dbcf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 66 additions and 26 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@ -557,7 +557,7 @@ class KeywordExtract:
self.load_keywords(['模拟宇宙', '拟造花萼(金)', '拟造花萼(赤)', '凝滞虚影', '侵蚀隧洞', '历战余响', self.load_keywords(['模拟宇宙', '拟造花萼(金)', '拟造花萼(赤)', '凝滞虚影', '侵蚀隧洞', '历战余响',
'忘却之庭', '虚构叙事']) '忘却之庭', '虚构叙事'])
self.write_keywords(keyword_class='DungeonNav', output_file='./tasks/dungeon/keywords/nav.py') self.write_keywords(keyword_class='DungeonNav', output_file='./tasks/dungeon/keywords/nav.py')
self.load_keywords(['行动摘要', '生存索引', '每日实训', '逐光捡金', '战术训练']) self.load_keywords(['行动摘要', '生存索引', '每日实训', '模拟宇宙', '逐光捡金', '战术训练'])
self.write_keywords(keyword_class='DungeonTab', output_file='./tasks/dungeon/keywords/tab.py') self.write_keywords(keyword_class='DungeonTab', output_file='./tasks/dungeon/keywords/tab.py')
self.load_keywords(['前往', '领取', '进行中', '已领取', '本日活跃度已满']) self.load_keywords(['前往', '领取', '进行中', '已领取', '本日活跃度已满'])
self.write_keywords(keyword_class='DailyQuestState', output_file='./tasks/daily/keywords/daily_quest_state.py') self.write_keywords(keyword_class='DailyQuestState', output_file='./tasks/daily/keywords/daily_quest_state.py')

View File

@ -1,13 +0,0 @@
from tasks.assignment.assets.assets_assignment_ui import (
ALL_ABOUT_BOOTHILL_CHECK, ALL_ABOUT_BOOTHILL_CLICK,
CHARACTER_MATERIALS_CHECK, CHARACTER_MATERIALS_CLICK,
EXP_MATERIALS_CREDITS_CHECK, EXP_MATERIALS_CREDITS_CLICK, GROUP_SEARCH,
SYNTHESIS_MATERIALS_CHECK, SYNTHESIS_MATERIALS_CLICK)
for group_button_wrapper in (
ALL_ABOUT_BOOTHILL_CHECK, ALL_ABOUT_BOOTHILL_CLICK,
CHARACTER_MATERIALS_CHECK, CHARACTER_MATERIALS_CLICK,
EXP_MATERIALS_CREDITS_CHECK, EXP_MATERIALS_CREDITS_CLICK,
SYNTHESIS_MATERIALS_CHECK, SYNTHESIS_MATERIALS_CLICK,
):
group_button_wrapper.load_search(GROUP_SEARCH.button)

View File

@ -15,7 +15,7 @@ from tasks.assignment.assets.assets_assignment_ui import *
from tasks.assignment.keywords import * from tasks.assignment.keywords import *
from tasks.base.assets.assets_base_page import ASSIGNMENT_CHECK from tasks.base.assets.assets_base_page import ASSIGNMENT_CHECK
from tasks.base.ui import UI from tasks.base.ui import UI
from tasks.dungeon.ui import DungeonTabSwitch as Switch from tasks.dungeon.ui import DungeonTabSwitch
class AssignmentStatus(Enum): class AssignmentStatus(Enum):
@ -102,7 +102,11 @@ class AssignmentOcr(Ocr):
return matched return matched
ASSIGNMENT_GROUP_SWITCH = Switch( class AssignmentGroupSwitch(DungeonTabSwitch):
SEARCH_BUTTON = GROUP_SEARCH
ASSIGNMENT_GROUP_SWITCH = AssignmentGroupSwitch(
'AssignmentGroupSwitch', 'AssignmentGroupSwitch',
is_selector=True is_selector=True
) )

View File

@ -123,6 +123,26 @@ OPERATION_BRIEFING_CLICK = ButtonWrapper(
button=(149, 92, 193, 136), button=(149, 92, 193, 136),
), ),
) )
SIMULATED_UNIVERSE_CHECK = ButtonWrapper(
name='SIMULATED_UNIVERSE_CHECK',
share=Button(
file='./assets/share/dungeon/ui/SIMULATED_UNIVERSE_CHECK.png',
area=(352, 99, 386, 133),
search=(332, 79, 406, 153),
color=(96, 96, 96),
button=(352, 99, 386, 133),
),
)
SIMULATED_UNIVERSE_CLICK = ButtonWrapper(
name='SIMULATED_UNIVERSE_CLICK',
share=Button(
file='./assets/share/dungeon/ui/SIMULATED_UNIVERSE_CLICK.png',
area=(352, 99, 386, 133),
search=(332, 79, 406, 153),
color=(122, 120, 120),
button=(352, 99, 386, 133),
),
)
SURVIVAL_INDEX_CHECK = ButtonWrapper( SURVIVAL_INDEX_CHECK = ButtonWrapper(
name='SURVIVAL_INDEX_CHECK', name='SURVIVAL_INDEX_CHECK',
share=Button( share=Button(
@ -143,10 +163,20 @@ SURVIVAL_INDEX_CLICK = ButtonWrapper(
button=(332, 94, 370, 133), button=(332, 94, 370, 133),
), ),
) )
SURVIVAL_INDEX_LOADED = ButtonWrapper( SURVIVAL_INDEX_OE_LOADED = ButtonWrapper(
name='SURVIVAL_INDEX_LOADED', name='SURVIVAL_INDEX_OE_LOADED',
share=Button( share=Button(
file='./assets/share/dungeon/ui/SURVIVAL_INDEX_LOADED.png', file='./assets/share/dungeon/ui/SURVIVAL_INDEX_OE_LOADED.png',
area=(473, 207, 498, 232),
search=(453, 187, 518, 252),
color=(185, 135, 74),
button=(473, 207, 498, 232),
),
)
SURVIVAL_INDEX_SU_LOADED = ButtonWrapper(
name='SURVIVAL_INDEX_SU_LOADED',
share=Button(
file='./assets/share/dungeon/ui/SURVIVAL_INDEX_SU_LOADED.png',
area=(451, 286, 476, 302), area=(451, 286, 476, 302),
search=(449, 263, 489, 356), search=(449, 263, 489, 356),
color=(142, 150, 197), color=(142, 150, 197),

View File

@ -30,8 +30,17 @@ Daily_Training = DungeonTab(
jp='デイリー訓練', jp='デイリー訓練',
es='Entrenamiento diario', es='Entrenamiento diario',
) )
Treasures_Lightward = DungeonTab( Simulated_Universe = DungeonTab(
id=4, id=4,
name='Simulated_Universe',
cn='模拟宇宙',
cht='模擬宇宙',
en='Simulated Universe',
jp='模擬宇宙',
es='Universo Simulado',
)
Treasures_Lightward = DungeonTab(
id=5,
name='Treasures_Lightward', name='Treasures_Lightward',
cn='逐光捡金', cn='逐光捡金',
cht='逐光撿金', cht='逐光撿金',
@ -40,7 +49,7 @@ Treasures_Lightward = DungeonTab(
es='En busca de fortuna', es='En busca de fortuna',
) )
Strategic_Training = DungeonTab( Strategic_Training = DungeonTab(
id=5, id=6,
name='Strategic_Training', name='Strategic_Training',
cn='战术训练', cn='战术训练',
cht='戰術訓練', cht='戰術訓練',

View File

@ -33,12 +33,14 @@ from tasks.map.keywords import KEYWORDS_MAP_WORLD, MapPlane
class DungeonTabSwitch(Switch): class DungeonTabSwitch(Switch):
SEARCH_BUTTON = TAB_SEARCH
def add_state(self, state, check_button, click_button=None): def add_state(self, state, check_button, click_button=None):
# Load search # Load search
if check_button is not None: if check_button is not None:
check_button.load_search(TAB_SEARCH.area) check_button.load_search(self.__class__.SEARCH_BUTTON.area)
if click_button is not None: if click_button is not None:
click_button.load_search(TAB_SEARCH.area) click_button.load_search(self.__class__.SEARCH_BUTTON.area)
return super().add_state(state, check_button, click_button) return super().add_state(state, check_button, click_button)
def click(self, state, main): def click(self, state, main):
@ -68,6 +70,11 @@ SWITCH_DUNGEON_TAB.add_state(
check_button=SURVIVAL_INDEX_CHECK, check_button=SURVIVAL_INDEX_CHECK,
click_button=SURVIVAL_INDEX_CLICK click_button=SURVIVAL_INDEX_CLICK
) )
SWITCH_DUNGEON_TAB.add_state(
KEYWORDS_DUNGEON_TAB.Simulated_Universe,
check_button=SIMULATED_UNIVERSE_CHECK,
click_button=SIMULATED_UNIVERSE_CLICK
)
SWITCH_DUNGEON_TAB.add_state( SWITCH_DUNGEON_TAB.add_state(
KEYWORDS_DUNGEON_TAB.Treasures_Lightward, KEYWORDS_DUNGEON_TAB.Treasures_Lightward,
check_button=TREASURES_LIGHTWARD_CHECK, check_button=TREASURES_LIGHTWARD_CHECK,
@ -296,8 +303,11 @@ class DungeonUI(DungeonState):
if timeout.reached(): if timeout.reached():
logger.warning('Wait survival index loaded timeout') logger.warning('Wait survival index loaded timeout')
return False return False
if self.appear(SURVIVAL_INDEX_LOADED): if self.appear(SURVIVAL_INDEX_SU_LOADED):
logger.info('Survival index loaded') logger.info('Survival index loaded, SURVIVAL_INDEX_SU_LOADED')
return True
if self.appear(SURVIVAL_INDEX_OE_LOADED):
logger.info('Survival index loaded, SURVIVAL_INDEX_OE_LOADED')
return True return True
def _dungeon_wait_treasures_lightward_loaded(self, skip_first_screenshot=True): def _dungeon_wait_treasures_lightward_loaded(self, skip_first_screenshot=True):
@ -703,7 +713,7 @@ class DungeonUI(DungeonState):
self._rogue_teleport() self._rogue_teleport()
""" """
self.dungeon_tab_goto(KEYWORDS_DUNGEON_TAB.Survival_Index) self.dungeon_tab_goto(KEYWORDS_DUNGEON_TAB.Survival_Index)
if self.appear(SURVIVAL_INDEX_LOADED): if self.appear(SURVIVAL_INDEX_SU_LOADED):
logger.info('Already at nav Simulated_Universe') logger.info('Already at nav Simulated_Universe')
else: else:
self._dungeon_nav_goto(KEYWORDS_DUNGEON_NAV.Simulated_Universe) self._dungeon_nav_goto(KEYWORDS_DUNGEON_NAV.Simulated_Universe)