1
0
mirror of https://github.com/TheFunny/ArisuAutoSweeper synced 2025-12-16 22:05:12 +00:00

fix(cafe): synchronize Cafe No.2 for global server

This commit is contained in:
YoursFunny 2025-05-13 21:52:07 +08:00
parent cae02d62ec
commit e41b8bf54a
Signed by: YoursFunny
GPG Key ID: 207EDC3CD5B40F9C

View File

@ -8,10 +8,6 @@ from tasks.cafe.assets.assets_cafe import *
from tasks.cafe.invitation import handle_invitation from tasks.cafe.invitation import handle_invitation
from tasks.cafe.ui import CafeUI 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 = Switch('Cafe_switch_select')
SWITCH_CAFE_SELECT.add_state('1', CAFE_FIRST) SWITCH_CAFE_SELECT.add_state('1', CAFE_FIRST)
SWITCH_CAFE_SELECT.add_state('2', CAFE_SECOND) SWITCH_CAFE_SELECT.add_state('2', CAFE_SECOND)
@ -141,41 +137,19 @@ class Cafe(CafeUI):
continue continue
if self.is_second_cafe_on and not is_second and status == CafeStatus.FINISHED: if self.is_second_cafe_on and not is_second and status == CafeStatus.FINISHED:
# handle new jp ui if not SWITCH_CAFE_SELECT.appear(main=self):
if self.config.Emulator_GameLanguage == 'jp': logger.info('Cafe switch not found')
if not SWITCH_CAFE_SELECT.appear(main=self): continue
logger.info('Cafe switch not found') match SWITCH_CAFE_SELECT.get(main=self):
continue case '1':
match SWITCH_CAFE_SELECT.get(main=self): if self.click_with_interval(CAFE_FIRST):
case '1': continue
if self.click_with_interval(CAFE_FIRST): case '2':
continue logger.info('Cafe second arrived')
case '2': status = CafeStatus.STUDENT_LIST
logger.info('Cafe second arrived') is_second = True
status = CafeStatus.STUDENT_LIST self.check = 0
is_second = True loading_timer.reset().start()
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 action_timer.reached_and_reset(): if action_timer.reached_and_reset():
logger.attr('Status', status) logger.attr('Status', status)