Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions autowsgr/ui/map/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ class MapIdentity:
(9, 3): '南入海口海域',
(9, 4): '河口外海',
(9, 5): '南大洋群岛',
# 第十章:极地海峡
(10, 1): '极地海峡',
}
"""已知地图 (章节, 关卡号) → 名称。"""

Expand All @@ -109,7 +111,7 @@ class MapIdentity:
CHAPTER_MAP_COUNTS[_ch] = max(CHAPTER_MAP_COUNTS.get(_ch, 0), _mn)


TOTAL_CHAPTERS: int = 9
TOTAL_CHAPTERS: int = 10
"""总章节数。"""


Expand Down Expand Up @@ -226,8 +228,8 @@ def parse_map_title(text: str) -> MapIdentity | None:
MapIdentity | None
解析成功返回地图信息,失败返回 ``None``。
"""
# ── 第 1 步: 严格单位数匹配 ──
m = re.search(r'(\d)\s*[--—]\s*(\d)\s*[/]?\s*(.*)', text)
# ── 第 1 步: 单位数/双位数匹配 ──
m = re.search(r'(\d{1,2})\s*[--—]\s*(\d)\s*[/]?\s*(.*)', text)
if m:
chapter = int(m.group(1))
map_num = int(m.group(2))
Expand Down
Loading