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

fix(cafe): update latest Cafe No.2 switch for jp

This commit is contained in:
YoursFunny 2025-01-20 23:17:39 +08:00
parent e7ecf0e94f
commit 51c7a5fed2
Signed by: YoursFunny
GPG Key ID: 207EDC3CD5B40F9C
2 changed files with 38 additions and 22 deletions

View File

@ -147,6 +147,22 @@ 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_list = False
is_second = True
self.check = 0
else:
if not SWITCH_CAFE.appear(main=self):
logger.warning('Cafe switch not found')
continue
@ -156,7 +172,7 @@ class Cafe(CafeUI):
if not SWITCH_CAFE_SELECT.appear(main=self):
logger.info('Cafe switch select not found')
continue
match (SWITCH_CAFE_SELECT.get(main=self)):
match SWITCH_CAFE_SELECT.get(main=self):
case '1':
if self.click_with_interval(CAFE_SECOND):
continue

View File

@ -6,7 +6,7 @@ import numpy as np
from module.base.base import ModuleBase
from module.base.timer import Timer
from module.base.utils import area_size, area_offset
from module.base.utils import area_offset, area_size
from module.config.utils import get_server_next_update
from module.logger import logger
from module.ocr.ocr import Ocr
@ -223,7 +223,7 @@ def handle_invitation_status(status: InvitationStatus, main: ModuleBase) -> Invi
if not invitation.is_invitation:
logger.info('Invitation waiting until next refresh')
return InvitationStatus.FINISHED
if main.appear(CAFE_INVITED):
if main.match_color(CAFE_INVITED):
logger.info('Invitation in cooldown')
return InvitationStatus.FINISHED
if invitation.choice != 'list_top' and invitation.target_name is None: