feat(task): 支持跳过培育结束的演出
This commit is contained in:
parent
9e764c7227
commit
cc73188637
Binary file not shown.
After Width: | Height: | Size: 771 KiB |
|
@ -0,0 +1 @@
|
|||
{"definitions":{"e5e84f9e-28da-4cf4-bcba-c9145fe39b07":{"name":"Produce.ButtonSkipLive","displayName":"培育结束跳过演出按钮","type":"template","annotationId":"e5e84f9e-28da-4cf4-bcba-c9145fe39b07","useHintRect":false}},"annotations":[{"id":"e5e84f9e-28da-4cf4-bcba-c9145fe39b07","type":"rect","data":{"x1":1179,"y1":56,"x2":1221,"y2":106}}]}
|
Binary file not shown.
After Width: | Height: | Size: 339 KiB |
|
@ -0,0 +1 @@
|
|||
{"definitions":{"b6b94f21-ef4b-4425-9c7e-ca2b574b0add":{"name":"Produce.TextSkipLiveDialogTitle","displayName":"跳过演出确认对话框标题","type":"template","annotationId":"b6b94f21-ef4b-4425-9c7e-ca2b574b0add","useHintRect":false},"fad5eec2-5fd5-412f-9abb-987a3087dc54":{"name":"Common.IconButtonCheck","displayName":"按钮✓图标","type":"template","annotationId":"fad5eec2-5fd5-412f-9abb-987a3087dc54","useHintRect":false,"description":"通常会显示在对话框按钮上"},"bc7155ac-18c9-4335-9ec2-c8762d37a057":{"name":"Common.IconButtonCross","displayName":"按钮×图标","type":"template","annotationId":"bc7155ac-18c9-4335-9ec2-c8762d37a057","useHintRect":false,"description":"通常会显示在对话框按钮上"}},"annotations":[{"id":"b6b94f21-ef4b-4425-9c7e-ca2b574b0add","type":"rect","data":{"x1":336,"y1":358,"x2":572,"y2":399}},{"id":"fad5eec2-5fd5-412f-9abb-987a3087dc54","type":"rect","data":{"x1":666,"y1":576,"x2":721,"y2":624}},{"id":"bc7155ac-18c9-4335-9ec2-c8762d37a057","type":"rect","data":{"x1":390,"y1":577,"x2":434,"y2":624}}]}
|
|
@ -67,7 +67,8 @@ class Device:
|
|||
"""上次 image 对象或 ocr 对象的寻找结果"""
|
||||
self.orientation: Literal['portrait', 'landscape'] = 'portrait'
|
||||
"""
|
||||
设备当前方向。默认为竖屏。
|
||||
设备当前方向。默认为竖屏。注意此属性并非用于检测设备方向。
|
||||
如果需要检测设备方向,请使用 `self.detect_orientation()` 方法。
|
||||
|
||||
横屏时为 'landscape',竖屏时为 'portrait'。
|
||||
"""
|
||||
|
|
|
@ -13,12 +13,13 @@ from .. import R
|
|||
from . import loading
|
||||
from .scenes import at_home
|
||||
from ..util.trace import trace
|
||||
from ..game_ui import WhiteFilter
|
||||
from .commu import handle_unread_commu
|
||||
from ..common import ProduceAction, RecommendCardDetectionMode, conf
|
||||
from kotonebot.errors import UnrecoverableError
|
||||
from kotonebot.backend.context.context import use_screenshot
|
||||
from .common import until_acquisition_clear, acquisitions, commut_event
|
||||
from kotonebot.util import AdaptiveWait, Countdown, crop, cropped
|
||||
from kotonebot.util import AdaptiveWait, Countdown, Interval, crop, cropped
|
||||
from kotonebot.backend.dispatch import DispatcherContext, SimpleDispatcher
|
||||
from kotonebot import ocr, device, contains, image, regex, action, sleep, color, Rect, wait
|
||||
from .non_lesson_actions import (
|
||||
|
@ -677,6 +678,7 @@ def exam(type: Literal['mid', 'final']):
|
|||
while ocr.wait_for(contains("メモリー"), timeout=7):
|
||||
device.click_center()
|
||||
|
||||
# TODO: 将这个函数改为手动截图模式
|
||||
@action('考试结束流程')
|
||||
def produce_end():
|
||||
"""执行考试结束流程"""
|
||||
|
@ -690,12 +692,22 @@ def produce_end():
|
|||
# 等待选择封面画面 [screenshots/produce_end/select_cover.jpg]
|
||||
# 次へ
|
||||
logger.info("Waiting for select cover screen...")
|
||||
aw = AdaptiveWait(timeout=60 * 5, max_interval=20)
|
||||
it = Interval()
|
||||
while not image.find(R.InPurodyuusu.ButtonNextNoIcon):
|
||||
# device.screenshot()
|
||||
# 未读交流
|
||||
if handle_unread_commu():
|
||||
logger.info("Skipping unread commu")
|
||||
continue
|
||||
aw()
|
||||
# 跳过演出
|
||||
# [kotonebot-resource\sprites\jp\produce\screenshot_produce_end.png]
|
||||
elif image.find(R.Produce.ButtonSkipLive, preprocessors=[WhiteFilter()]):
|
||||
logger.info("Skipping live.")
|
||||
device.click()
|
||||
# [kotonebot-resource\sprites\jp\produce\screenshot_produce_end_skip.png]
|
||||
elif image.find(R.Produce.TextSkipLiveDialogTitle):
|
||||
logger.info("Confirming skip live.")
|
||||
device.click(image.expect_wait(R.Common.IconButtonCheck))
|
||||
it.wait()
|
||||
device.click(0, 0)
|
||||
# 选择封面
|
||||
logger.info("Use default cover.")
|
||||
|
|
Loading…
Reference in New Issue