Fix: Lower OcrCharacterName.merge_thres_y so DanHeng's long name won't mix with others

This commit is contained in:
LmeSzinc 2024-05-13 19:24:17 +08:00
parent ab6aabeefa
commit af603eadf8
2 changed files with 13 additions and 5 deletions

View File

@ -96,6 +96,10 @@ class BattlePassUI(UI):
MAX_LEVEL = 70 MAX_LEVEL = 70
def _battle_pass_wait_rewards_loaded(self, skip_first_screenshot=True): def _battle_pass_wait_rewards_loaded(self, skip_first_screenshot=True):
"""
Returns:
bool: If load success
"""
timeout = Timer(2, count=4).start() timeout = Timer(2, count=4).start()
while 1: while 1:
if skip_first_screenshot: if skip_first_screenshot:
@ -105,12 +109,16 @@ class BattlePassUI(UI):
if timeout.reached(): if timeout.reached():
logger.warning('Wait rewards tab loaded timeout') logger.warning('Wait rewards tab loaded timeout')
break return False
if self.appear(REWARDS_LOADED): if self.appear(REWARDS_LOADED):
logger.info('Rewards tab loaded') logger.info('Rewards tab loaded')
break return True
def _battle_pass_wait_missions_loaded(self, skip_first_screenshot=True): def _battle_pass_wait_missions_loaded(self, skip_first_screenshot=True):
"""
Returns:
bool: If load success
"""
timeout = Timer(2, count=4).start() timeout = Timer(2, count=4).start()
while 1: while 1:
if skip_first_screenshot: if skip_first_screenshot:
@ -120,14 +128,14 @@ class BattlePassUI(UI):
if timeout.reached(): if timeout.reached():
logger.warning('Wait missions tab loaded timeout') logger.warning('Wait missions tab loaded timeout')
break return False
# Has scroll and last mission loaded # Has scroll and last mission loaded
if self.appear(MISSION_PAGE_SCROLL): if self.appear(MISSION_PAGE_SCROLL):
color = get_color(self.device.image, MISSIONS_LOADED.area) color = get_color(self.device.image, MISSIONS_LOADED.area)
if np.mean(color) > 128: if np.mean(color) > 128:
logger.info('Missions tab loaded') logger.info('Missions tab loaded')
break return True
def battle_pass_goto(self, state: KEYWORDS_BATTLE_PASS_TAB): def battle_pass_goto(self, state: KEYWORDS_BATTLE_PASS_TAB):
""" """

View File

@ -16,7 +16,7 @@ from tasks.character.keywords import CharacterList, DICT_SORTED_RANGES, KEYWORDS
class OcrCharacterName(OcrWhiteLetterOnComplexBackground): class OcrCharacterName(OcrWhiteLetterOnComplexBackground):
merge_thres_x = 20 merge_thres_x = 20
merge_thres_y = 20 merge_thres_y = 10
def after_process(self, result): def after_process(self, result):
result = result.replace('', '') result = result.replace('', '')