Merge pull request #390 from LmeSzinc/bug_fix

Bug fix
This commit is contained in:
LmeSzinc 2024-03-28 22:30:15 +08:00 committed by GitHub
commit e9c265432b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 14 additions and 9 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

View File

@ -7,17 +7,17 @@ ASSIGNMENT_START = ButtonWrapper(
name='ASSIGNMENT_START', name='ASSIGNMENT_START',
cn=Button( cn=Button(
file='./assets/cn/assignment/dispatch/ASSIGNMENT_START.png', file='./assets/cn/assignment/dispatch/ASSIGNMENT_START.png',
area=(581, 321, 699, 349), area=(563, 341, 716, 376),
search=(573, 299, 707, 412), search=(552, 299, 725, 412),
color=(93, 84, 66), color=(103, 92, 72),
button=(581, 321, 699, 349), button=(563, 341, 716, 376),
), ),
en=Button( en=Button(
file='./assets/en/assignment/dispatch/ASSIGNMENT_START.png', file='./assets/en/assignment/dispatch/ASSIGNMENT_START.png',
area=(679, 323, 784, 347), area=(693, 343, 831, 374),
search=(669, 297, 794, 416), search=(669, 297, 831, 416),
color=(93, 83, 65), color=(95, 86, 67),
button=(679, 323, 784, 347), button=(693, 343, 831, 374),
), ),
) )
ASSIGNMENT_STARTED_CHECK = ButtonWrapper( ASSIGNMENT_STARTED_CHECK = ButtonWrapper(

View File

@ -67,7 +67,12 @@ class AssignmentOcr(Ocr):
def after_process(self, result: str): def after_process(self, result: str):
result = super().after_process(result) result = super().after_process(result)
# Born to ObeyCurrently Owned:7781 -> Born to Obey
for splitter in ['Currently', 'currently', '当前持有']:
try:
result = result.split(splitter)[0]
except IndexError:
pass
if self.ocr_regex is None: if self.ocr_regex is None:
return result return result
matched = self.ocr_regex.fullmatch(result) matched = self.ocr_regex.fullmatch(result)