Fix: [EN] POPUP assets now in 1280x720

- Add assets check to button_extract
This commit is contained in:
LmeSzinc 2020-06-12 00:02:54 +08:00
parent 49ae4c6361
commit c37fda242c
4 changed files with 11 additions and 2 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -43,6 +43,8 @@ class ImageExtractor:
@staticmethod
def extract(file):
image = Image.open(file).convert('RGB')
if image.size != (1280, 720):
logger.warning(f'Incorrect asset {image.size} {file}')
bbox = image.getbbox()
mean = get_color(image=image, area=bbox)
mean = tuple(np.rint(mean).astype(int))
@ -87,6 +89,13 @@ class TemplateExtractor(ImageExtractor):
# self.module = module
# self.file = file
# self.config = config
@staticmethod
def extract(file):
image = Image.open(file).convert('RGB')
bbox = image.getbbox()
mean = get_color(image=image, area=bbox)
mean = tuple(np.rint(mean).astype(int))
return bbox, mean
@property
def expression(self):

View File

@ -37,8 +37,8 @@ MAP_STAR_2 = Button(area={'cn': (532, 377, 540, 384), 'en': (518, 382, 526, 389)
MAP_STAR_3 = Button(area={'cn': (818, 377, 827, 384), 'en': (804, 382, 812, 389)}, color={'cn': (251, 233, 143), 'en': (252, 234, 144)}, button={'cn': (818, 377, 827, 384), 'en': (804, 382, 812, 389)}, file={'cn': './assets/cn/handler/MAP_STAR_3.png', 'en': './assets/en/handler/MAP_STAR_3.png'})
MAP_WALK_OUT_OF_STEP = Button(area={'cn': (654, 312, 704, 335), 'en': (654, 312, 704, 335)}, color={'cn': (109, 113, 120), 'en': (112, 113, 120)}, button={'cn': (654, 312, 704, 335), 'en': (654, 312, 704, 335)}, file={'cn': './assets/cn/handler/MAP_WALK_OUT_OF_STEP.png', 'en': './assets/en/handler/MAP_WALK_OUT_OF_STEP.png'})
MYSTERY_ITEM = Button(area={'cn': (589, 294, 691, 427), 'en': (589, 294, 691, 427)}, color={'cn': (144, 127, 83), 'en': (144, 127, 83)}, button={'cn': (589, 294, 691, 427), 'en': (589, 294, 691, 427)}, file={'cn': './assets/cn/handler/MYSTERY_ITEM.png', 'en': './assets/en/handler/MYSTERY_ITEM.png'})
POPUP_CANCEL = Button(area={'cn': (404, 493, 576, 550), 'en': (403, 481, 577, 541)}, color={'cn': (166, 169, 172), 'en': (170, 172, 174)}, button={'cn': (404, 493, 576, 550), 'en': (403, 481, 577, 541)}, file={'cn': './assets/cn/handler/POPUP_CANCEL.png', 'en': './assets/en/handler/POPUP_CANCEL.png'})
POPUP_CONFIRM = Button(area={'cn': (704, 493, 876, 550), 'en': (703, 481, 877, 541)}, color={'cn': (94, 144, 204), 'en': (107, 152, 207)}, button={'cn': (704, 493, 876, 550), 'en': (703, 481, 877, 541)}, file={'cn': './assets/cn/handler/POPUP_CONFIRM.png', 'en': './assets/en/handler/POPUP_CONFIRM.png'})
POPUP_CANCEL = Button(area={'cn': (404, 493, 576, 550), 'en': (404, 483, 576, 539)}, color={'cn': (166, 169, 172), 'en': (170, 171, 172)}, button={'cn': (404, 493, 576, 550), 'en': (404, 483, 576, 539)}, file={'cn': './assets/cn/handler/POPUP_CANCEL.png', 'en': './assets/en/handler/POPUP_CANCEL.png'})
POPUP_CONFIRM = Button(area={'cn': (704, 493, 876, 550), 'en': (704, 483, 876, 539)}, color={'cn': (94, 144, 204), 'en': (103, 150, 207)}, button={'cn': (704, 493, 876, 550), 'en': (704, 483, 876, 539)}, file={'cn': './assets/cn/handler/POPUP_CONFIRM.png', 'en': './assets/en/handler/POPUP_CONFIRM.png'})
STORY_CHOOSE = Button(area={'cn': (902, 344, 959, 357), 'en': (902, 344, 959, 357)}, color={'cn': (98, 122, 156), 'en': (98, 122, 156)}, button={'cn': (902, 344, 959, 357), 'en': (902, 344, 959, 357)}, file={'cn': './assets/cn/handler/STORY_CHOOSE.png', 'en': './assets/en/handler/STORY_CHOOSE.png'})
STORY_CHOOSE_2 = Button(area={'cn': (903, 388, 959, 399), 'en': (903, 388, 959, 399)}, color={'cn': (98, 121, 156), 'en': (98, 121, 156)}, button={'cn': (903, 388, 959, 399), 'en': (903, 388, 959, 399)}, file={'cn': './assets/cn/handler/STORY_CHOOSE_2.png', 'en': './assets/en/handler/STORY_CHOOSE_2.png'})
STORY_LETTERS_ONLY = Button(area={'cn': (1159, 26, 1264, 52), 'en': (1159, 26, 1264, 52)}, color={'cn': (123, 128, 141), 'en': (123, 128, 141)}, button={'cn': (1159, 26, 1264, 52), 'en': (1159, 26, 1264, 52)}, file={'cn': './assets/cn/handler/STORY_LETTERS_ONLY.png', 'en': './assets/en/handler/STORY_LETTERS_ONLY.png'})