Upd: assets and Ocr to fit in English ui

This commit is contained in:
Hengyu 2023-08-20 23:53:25 +08:00
parent 5dfe509f38
commit 9228b200a5
9 changed files with 32 additions and 29 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

View File

@ -57,10 +57,10 @@ OCR_RESET_COUNT = ButtonWrapper(
name='OCR_RESET_COUNT',
share=Button(
file='./assets/share/rogue/blessing/OCR_RESET_COUNT.png',
area=(714, 595, 824, 620),
search=(694, 575, 844, 640),
color=(37, 37, 41),
button=(714, 595, 824, 620),
area=(655, 593, 873, 623),
search=(635, 573, 893, 643),
color=(23, 24, 26),
button=(655, 593, 873, 623),
),
)
OCR_ROGUE_BUFF = ButtonWrapper(

View File

@ -7,10 +7,10 @@ BONUS_BOTTOM_WHITE_BAR = ButtonWrapper(
name='BONUS_BOTTOM_WHITE_BAR',
share=Button(
file='./assets/share/rogue/bonus/BONUS_BOTTOM_WHITE_BAR.png',
area=(182, 568, 1098, 590),
search=(162, 548, 1118, 610),
color=(221, 221, 222),
button=(182, 568, 1098, 590),
area=(731, 568, 774, 590),
search=(711, 548, 794, 610),
color=(250, 250, 250),
button=(731, 568, 774, 590),
),
)
BONUS_CONFIRM = ButtonWrapper(

View File

@ -3,6 +3,16 @@ from module.base.button import Button, ButtonWrapper
# This file was auto-generated, do not modify it manually. To generate:
# ``` python -m dev_tools.button_extract ```
BLESSING_CONFIRM = ButtonWrapper(
name='BLESSING_CONFIRM',
share=Button(
file='./assets/share/rogue/ui/BLESSING_CONFIRM.png',
area=(960, 629, 1233, 677),
search=(940, 609, 1253, 697),
color=(217, 218, 218),
button=(960, 629, 1233, 677),
),
)
CHECK_BLESSING = ButtonWrapper(
name='CHECK_BLESSING',
share=Button(
@ -13,16 +23,6 @@ CHECK_BLESSING = ButtonWrapper(
button=(946, 17, 986, 57),
),
)
CONFIRM = ButtonWrapper(
name='CONFIRM',
share=Button(
file='./assets/share/rogue/ui/CONFIRM.png',
area=(960, 629, 1233, 677),
search=(940, 609, 1253, 697),
color=(217, 218, 218),
button=(960, 629, 1233, 677),
),
)
COSMIC_FRAGMENT = ButtonWrapper(
name='COSMIC_FRAGMENT',
share=Button(
@ -57,10 +57,10 @@ PAGE_CHOOSE_BUFF = ButtonWrapper(
name='PAGE_CHOOSE_BUFF',
share=Button(
file='./assets/share/rogue/ui/PAGE_CHOOSE_BUFF.png',
area=(1105, 95, 1154, 113),
search=(1085, 75, 1174, 133),
color=(81, 82, 83),
button=(1105, 95, 1154, 113),
area=(1016, 94, 1135, 113),
search=(996, 74, 1155, 133),
color=(71, 71, 73),
button=(1016, 94, 1135, 113),
),
)
PAGE_CHOOSE_CURIO = ButtonWrapper(

View File

@ -9,7 +9,7 @@ from module.logger import logger
from module.ocr.ocr import Ocr, OcrResultButton, DigitCounter, Digit
from module.ocr.utils import split_and_pair_buttons
from tasks.rogue.assets.assets_rogue_blessing import *
from tasks.rogue.assets.assets_rogue_ui import CONFIRM
from tasks.rogue.assets.assets_rogue_ui import BLESSING_CONFIRM
from tasks.rogue.keywords import *
from tasks.rogue.preset import *
from tasks.rogue.selector import RogueSelector
@ -56,7 +56,7 @@ RESONANCE_FILTER = MultiLangFilter(FILETER_REGEX, (RESONANCE_ATTR_NAME,), RESONA
class RogueBuffOcr(Ocr):
merge_thres_x = 40
merge_thres_y = 40
def after_process(self, result):
result = super().after_process(result)
@ -147,7 +147,8 @@ class RogueBlessingSelector(RogueSelector):
Case 4: event ui
"""
return (self.main.is_in_main() or self.main.is_page_choose_curio()
or (self.main.is_page_choose_blessing() and not is_card_selected(self.main, target, CONFIRM))
or (self.main.is_page_choose_blessing() and not is_card_selected(self.main, target,
BLESSING_CONFIRM))
or self.main.is_page_event())
interval = Timer(1)
@ -163,7 +164,7 @@ class RogueBlessingSelector(RogueSelector):
else:
self.main.device.screenshot()
if is_card_selected(self.main, target, confirm_button=CONFIRM):
if is_card_selected(self.main, target, confirm_button=BLESSING_CONFIRM):
if enforce:
logger.info("Buff selected (enforce)")
else:
@ -187,7 +188,7 @@ class RogueBlessingSelector(RogueSelector):
if is_select_blessing_complete():
break
if interval.reached():
self.main.device.click(CONFIRM)
self.main.device.click(BLESSING_CONFIRM)
interval.reset()
def _get_reset_count(self):

View File

@ -8,7 +8,7 @@ from module.base.utils import get_color
from module.logger import logger
from module.ocr.ocr import Ocr, OcrResultButton
from tasks.rogue.assets.assets_rogue_curio import *
from tasks.rogue.assets.assets_rogue_ui import CONFIRM
from tasks.rogue.assets.assets_rogue_ui import BLESSING_CONFIRM
from tasks.rogue.keywords import RogueCurio
from tasks.rogue.preset import CURIO_PRESET_1
from tasks.rogue.selector import RogueSelector
@ -24,6 +24,8 @@ CURIO_FILTER = MultiLangFilter(FILTER_REGEX, CURIO_FILTER_ATTR, CURIO_FILTER_PRE
class RogueCurioOcr(Ocr):
merge_thres_y = 40
def after_process(self, result):
result = super().after_process(result)
if self.lang == 'ch':
@ -94,7 +96,7 @@ class RogueCurioSelector(RogueSelector):
if is_select_curio_complete():
break
if interval.reached():
self.main.device.click(CONFIRM)
self.main.device.click(BLESSING_CONFIRM)
interval.reset()
def try_select(self, option: OcrResultButton | str):