diff --git a/assets/share/dungeon/event/OCR_DOUBLE_EVENT_REMAIN.png b/assets/share/dungeon/event/OCR_DOUBLE_EVENT_REMAIN.png index a67c5e11b..33a1030eb 100644 Binary files a/assets/share/dungeon/event/OCR_DOUBLE_EVENT_REMAIN.png and b/assets/share/dungeon/event/OCR_DOUBLE_EVENT_REMAIN.png differ diff --git a/tasks/dungeon/assets/assets_dungeon_event.py b/tasks/dungeon/assets/assets_dungeon_event.py index f09003247..5f17dc470 100644 --- a/tasks/dungeon/assets/assets_dungeon_event.py +++ b/tasks/dungeon/assets/assets_dungeon_event.py @@ -27,9 +27,9 @@ OCR_DOUBLE_EVENT_REMAIN = ButtonWrapper( name='OCR_DOUBLE_EVENT_REMAIN', share=Button( file='./assets/share/dungeon/event/OCR_DOUBLE_EVENT_REMAIN.png', - area=(434, 141, 1163, 166), - search=(414, 121, 1183, 186), - color=(228, 185, 100), - button=(434, 141, 1163, 166), + area=(437, 177, 1169, 208), + search=(417, 157, 1189, 228), + color=(234, 190, 103), + button=(437, 177, 1169, 208), ), ) diff --git a/tasks/dungeon/event.py b/tasks/dungeon/event.py index 6c9f0c464..b2ac550dd 100644 --- a/tasks/dungeon/event.py +++ b/tasks/dungeon/event.py @@ -1,3 +1,5 @@ +import re + from module.logger import logger from module.ocr.ocr import DigitCounter from tasks.base.ui import UI @@ -8,6 +10,14 @@ from tasks.dungeon.assets.assets_dungeon_event import ( ) +class DoubleEventOcr(DigitCounter): + def after_process(self, result): + result = super().after_process(result) + # 9112 -> 9/12 + result = re.sub(r'112$', '/12', result) + return result + + class DungeonEvent(UI): def has_double_calyx_event(self) -> bool: """ @@ -34,7 +44,7 @@ class DungeonEvent(UI): Pages: in: page_guide, Survival_Index, selected at the nav with double event """ - ocr = DigitCounter(OCR_DOUBLE_EVENT_REMAIN) + ocr = DoubleEventOcr(OCR_DOUBLE_EVENT_REMAIN) remain, _, total = ocr.ocr_single_line(self.device.image) if total not in [3, 12]: logger.warning(f'Invalid double event remain')