Compare commits
3 Commits
cae02d62ec
...
49c0894227
| Author | SHA1 | Date | |
|---|---|---|---|
| 49c0894227 | |||
| 1497a0a825 | |||
| e41b8bf54a |
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 7.6 KiB |
@ -34,10 +34,10 @@ CAFE_FIRST = ButtonWrapper(
|
||||
),
|
||||
en=Button(
|
||||
file='./assets/en/cafe/CAFE_FIRST.png',
|
||||
area=(100, 156, 148, 175),
|
||||
search=(80, 136, 168, 195),
|
||||
color=(107, 123, 144),
|
||||
button=(100, 156, 148, 175),
|
||||
area=(205, 96, 215, 107),
|
||||
search=(185, 76, 235, 127),
|
||||
color=(176, 184, 194),
|
||||
button=(205, 96, 215, 107),
|
||||
),
|
||||
)
|
||||
CAFE_INVITE = ButtonWrapper(
|
||||
@ -51,10 +51,10 @@ CAFE_INVITE = ButtonWrapper(
|
||||
),
|
||||
en=Button(
|
||||
file='./assets/en/cafe/CAFE_INVITE.png',
|
||||
area=(816, 635, 845, 655),
|
||||
search=(796, 615, 865, 675),
|
||||
color=(173, 182, 192),
|
||||
button=(816, 635, 845, 655),
|
||||
area=(870, 637, 903, 663),
|
||||
search=(850, 617, 923, 683),
|
||||
color=(253, 217, 235),
|
||||
button=(870, 637, 903, 663),
|
||||
),
|
||||
)
|
||||
CAFE_INVITED = ButtonWrapper(
|
||||
@ -68,10 +68,10 @@ CAFE_INVITED = ButtonWrapper(
|
||||
),
|
||||
en=Button(
|
||||
file='./assets/en/cafe/CAFE_INVITED.png',
|
||||
area=(815, 633, 847, 657),
|
||||
search=(795, 613, 867, 677),
|
||||
color=(144, 144, 146),
|
||||
button=(815, 633, 847, 657),
|
||||
area=(870, 637, 903, 663),
|
||||
search=(850, 617, 923, 683),
|
||||
color=(111, 109, 109),
|
||||
button=(870, 637, 903, 663),
|
||||
),
|
||||
)
|
||||
CAFE_SECOND = ButtonWrapper(
|
||||
@ -85,44 +85,10 @@ CAFE_SECOND = ButtonWrapper(
|
||||
),
|
||||
en=Button(
|
||||
file='./assets/en/cafe/CAFE_SECOND.png',
|
||||
area=(242, 157, 291, 174),
|
||||
search=(222, 137, 311, 194),
|
||||
color=(119, 134, 153),
|
||||
button=(242, 157, 291, 174),
|
||||
),
|
||||
)
|
||||
CHANGE_CAFE_NOT_SELECTED = ButtonWrapper(
|
||||
name='CHANGE_CAFE_NOT_SELECTED',
|
||||
jp=Button(
|
||||
file='./assets/jp/cafe/CHANGE_CAFE_NOT_SELECTED.png',
|
||||
area=(84, 89, 178, 109),
|
||||
search=(64, 69, 198, 129),
|
||||
color=(185, 193, 203),
|
||||
button=(84, 89, 178, 109),
|
||||
),
|
||||
en=Button(
|
||||
file='./assets/en/cafe/CHANGE_CAFE_NOT_SELECTED.png',
|
||||
area=(99, 93, 197, 110),
|
||||
search=(79, 73, 217, 130),
|
||||
color=(179, 187, 196),
|
||||
button=(99, 93, 197, 110),
|
||||
),
|
||||
)
|
||||
CHANGE_CAFE_SELECTED = ButtonWrapper(
|
||||
name='CHANGE_CAFE_SELECTED',
|
||||
jp=Button(
|
||||
file='./assets/jp/cafe/CHANGE_CAFE_SELECTED.png',
|
||||
area=(40, 87, 191, 112),
|
||||
search=(20, 67, 211, 132),
|
||||
color=(82, 105, 130),
|
||||
button=(40, 87, 191, 112),
|
||||
),
|
||||
en=Button(
|
||||
file='./assets/en/cafe/CHANGE_CAFE_SELECTED.png',
|
||||
area=(57, 92, 199, 112),
|
||||
search=(37, 72, 219, 132),
|
||||
color=(92, 115, 140),
|
||||
button=(57, 92, 199, 112),
|
||||
area=(207, 96, 214, 107),
|
||||
search=(187, 76, 234, 127),
|
||||
color=(174, 182, 192),
|
||||
button=(207, 96, 214, 107),
|
||||
),
|
||||
)
|
||||
CHECK_MOMOTALK = ButtonWrapper(
|
||||
@ -153,10 +119,10 @@ CHECK_REWARD = ButtonWrapper(
|
||||
),
|
||||
en=Button(
|
||||
file='./assets/en/cafe/CHECK_REWARD.png',
|
||||
area=(1090, 613, 1229, 644),
|
||||
search=(1070, 593, 1249, 664),
|
||||
color=(64, 88, 115),
|
||||
button=(1086, 611, 1229, 685),
|
||||
area=(1116, 636, 1218, 654),
|
||||
search=(1096, 616, 1238, 674),
|
||||
color=(77, 100, 125),
|
||||
button=(1113, 625, 1239, 692),
|
||||
),
|
||||
)
|
||||
CLICKABLE_TEMPLATE = ButtonWrapper(
|
||||
@ -384,10 +350,10 @@ OCR_CAFE = ButtonWrapper(
|
||||
),
|
||||
en=Button(
|
||||
file='./assets/en/cafe/OCR_CAFE.png',
|
||||
area=(1105, 639, 1195, 674),
|
||||
search=(1085, 619, 1215, 694),
|
||||
color=(84, 104, 127),
|
||||
button=(1105, 639, 1195, 674),
|
||||
area=(1127, 657, 1219, 682),
|
||||
search=(1107, 637, 1239, 702),
|
||||
color=(93, 112, 134),
|
||||
button=(1127, 657, 1219, 682),
|
||||
),
|
||||
)
|
||||
OCR_NAME = ButtonWrapper(
|
||||
|
||||
@ -8,10 +8,6 @@ from tasks.cafe.assets.assets_cafe import *
|
||||
from tasks.cafe.invitation import handle_invitation
|
||||
from tasks.cafe.ui import CafeUI
|
||||
|
||||
SWITCH_CAFE = Switch('Cafe_switch')
|
||||
SWITCH_CAFE.add_state('off', CHANGE_CAFE_NOT_SELECTED)
|
||||
SWITCH_CAFE.add_state('on', CHANGE_CAFE_SELECTED)
|
||||
|
||||
SWITCH_CAFE_SELECT = Switch('Cafe_switch_select')
|
||||
SWITCH_CAFE_SELECT.add_state('1', CAFE_FIRST)
|
||||
SWITCH_CAFE_SELECT.add_state('2', CAFE_SECOND)
|
||||
@ -141,41 +137,19 @@ class Cafe(CafeUI):
|
||||
continue
|
||||
|
||||
if self.is_second_cafe_on and not is_second and status == CafeStatus.FINISHED:
|
||||
# handle new jp ui
|
||||
if self.config.Emulator_GameLanguage == 'jp':
|
||||
if not SWITCH_CAFE_SELECT.appear(main=self):
|
||||
logger.info('Cafe switch not found')
|
||||
continue
|
||||
match SWITCH_CAFE_SELECT.get(main=self):
|
||||
case '1':
|
||||
if self.click_with_interval(CAFE_FIRST):
|
||||
continue
|
||||
case '2':
|
||||
logger.info('Cafe second arrived')
|
||||
status = CafeStatus.STUDENT_LIST
|
||||
is_second = True
|
||||
self.check = 0
|
||||
loading_timer.reset().start()
|
||||
else:
|
||||
if not SWITCH_CAFE.appear(main=self):
|
||||
logger.warning('Cafe switch not found')
|
||||
continue
|
||||
if SWITCH_CAFE.get(main=self) == 'off':
|
||||
SWITCH_CAFE.set('on', main=self)
|
||||
logger.info('Switching to second cafe')
|
||||
if not SWITCH_CAFE_SELECT.appear(main=self):
|
||||
logger.info('Cafe switch select not found')
|
||||
continue
|
||||
match SWITCH_CAFE_SELECT.get(main=self):
|
||||
case '1':
|
||||
if self.click_with_interval(CAFE_SECOND):
|
||||
continue
|
||||
case '2':
|
||||
logger.info('Cafe second arrived')
|
||||
SWITCH_CAFE.set('off', main=self)
|
||||
status = CafeStatus.STUDENT_LIST
|
||||
is_second = True
|
||||
self.check = 0
|
||||
if not SWITCH_CAFE_SELECT.appear(main=self):
|
||||
logger.info('Cafe switch not found')
|
||||
continue
|
||||
match SWITCH_CAFE_SELECT.get(main=self):
|
||||
case '1':
|
||||
if self.click_with_interval(CAFE_FIRST):
|
||||
continue
|
||||
case '2':
|
||||
logger.info('Cafe second arrived')
|
||||
status = CafeStatus.STUDENT_LIST
|
||||
is_second = True
|
||||
self.check = 0
|
||||
loading_timer.reset().start()
|
||||
|
||||
if action_timer.reached_and_reset():
|
||||
logger.attr('Status', status)
|
||||
|
||||