fix(task): 修复课程中遇到四/五张手牌时会卡住的问题

This commit is contained in:
XcantloadX 2025-02-28 12:20:23 +08:00
parent f0a3baa5d6
commit ae22253b21
3 changed files with 25 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 893 KiB

View File

@ -0,0 +1 @@
{"definitions":{"439c91c9-9a8d-48ae-a7ba-1ecdae3a40ca":{"name":"InPurodyuusu.BoxLessonCards5_1","displayName":"课程中手牌 1/5","type":"hint-box","annotationId":"439c91c9-9a8d-48ae-a7ba-1ecdae3a40ca","useHintRect":false}},"annotations":[{"id":"439c91c9-9a8d-48ae-a7ba-1ecdae3a40ca","type":"rect","data":{"x1":16,"y1":882,"x2":208,"y2":1136}}]}

View File

@ -199,6 +199,30 @@ def detect_recommended_card(
SKIP_POSITION = (621, 739, 85, 85, 10)
GLOW_EXTENSION = 15
if card_count == 4:
logger.info("4 cards detected. Currently not supported. Use 1st card.")
return CardDetectResult(
type=0,
score=1,
left_score=1,
right_score=1,
top_score=1,
bottom_score=1,
rect=(17, 883, 192, 252)
)
if card_count == 5:
logger.info("5 cards detected. Currently not supported. Use 1st card.")
return CardDetectResult(
type=0,
score=1,
left_score=1,
right_score=1,
top_score=1,
bottom_score=1,
rect=R.InPurodyuusu.BoxLessonCards5_1
)
if card_count == 1:
cards = CARD_POSITIONS_1
elif card_count == 2: