Compare commits
2 Commits
fd15f9eb8f
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| bbb8a32270 | |||
| 1e9108bee5 |
Binary file not shown.
@@ -74,13 +74,29 @@ def _parse_choices(comment_text: str) -> dict[str, str] | None:
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
choices: dict[str, str] = {}
|
choices: dict[str, str] = {}
|
||||||
for line in comment_text.splitlines():
|
token_re = re.compile(r"(\d+)\s*=\s*")
|
||||||
m = re.match(r"^\s*(\d+)\s*=\s*(.+?)\s*$", line)
|
|
||||||
if not m:
|
|
||||||
continue
|
|
||||||
choices[m.group(1)] = m.group(2)
|
|
||||||
|
|
||||||
return choices or None
|
for line in comment_text.splitlines():
|
||||||
|
s = line.lstrip()
|
||||||
|
matches = list(token_re.finditer(s))
|
||||||
|
if not matches:
|
||||||
|
continue
|
||||||
|
if len(matches) == 1 and matches[0].start() != 0:
|
||||||
|
# Avoid false positives such as "... (0=无限制)" inside a sentence.
|
||||||
|
continue
|
||||||
|
|
||||||
|
for i, m in enumerate(matches):
|
||||||
|
key = m.group(1)
|
||||||
|
start = m.end()
|
||||||
|
end = matches[i + 1].start() if i + 1 < len(matches) else len(s)
|
||||||
|
label = s[start:end].strip().strip(",;|/、").strip()
|
||||||
|
if not label:
|
||||||
|
continue
|
||||||
|
choices[key] = label
|
||||||
|
|
||||||
|
# Single "0=Disabled" style hints are common in server.ini, but they are not real enums.
|
||||||
|
# Only treat it as an enum when there are at least 2 options.
|
||||||
|
return choices if len(choices) >= 2 else None
|
||||||
|
|
||||||
|
|
||||||
def parse_server_ini(filepath: str) -> ParsedConfig:
|
def parse_server_ini(filepath: str) -> ParsedConfig:
|
||||||
@@ -284,4 +300,3 @@ def parse_sandboxvars_lua(filepath: str, translations_json: str | None = None) -
|
|||||||
fixed_settings.append(s)
|
fixed_settings.append(s)
|
||||||
|
|
||||||
return ParsedConfig(source="lua", filepath=str(path), lines=lines, settings=fixed_settings)
|
return ParsedConfig(source="lua", filepath=str(path), lines=lines, settings=fixed_settings)
|
||||||
|
|
||||||
|
|||||||
@@ -116,6 +116,24 @@
|
|||||||
border-color: rgba(15, 23, 42, 0.14) !important;
|
border-color: rgba(15, 23, 42, 0.14) !important;
|
||||||
z-index: 2000 !important;
|
z-index: 2000 !important;
|
||||||
}
|
}
|
||||||
|
.ts-dropdown .ts-dropdown-content { padding: 6px; }
|
||||||
|
.ts-dropdown [data-selectable].option {
|
||||||
|
border-radius: 10px;
|
||||||
|
margin: 2px 0;
|
||||||
|
padding: 8px 10px;
|
||||||
|
transition: background-color .12s ease, transform .12s ease, box-shadow .12s ease;
|
||||||
|
}
|
||||||
|
.ts-dropdown [data-selectable].option:hover {
|
||||||
|
background: rgba(79, 70, 229, 0.08) !important;
|
||||||
|
transform: translateX(2px);
|
||||||
|
}
|
||||||
|
.ts-dropdown .option.active,
|
||||||
|
.ts-dropdown .option.active.create {
|
||||||
|
background: rgba(79, 70, 229, 0.12) !important;
|
||||||
|
color: rgba(15, 23, 42, 0.96) !important;
|
||||||
|
box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.16);
|
||||||
|
}
|
||||||
|
.ts-dropdown .option.active:hover { background: rgba(79, 70, 229, 0.14) !important; }
|
||||||
|
|
||||||
.btn-detail {
|
.btn-detail {
|
||||||
border-color: rgba(79, 70, 229, 0.30) !important;
|
border-color: rgba(79, 70, 229, 0.30) !important;
|
||||||
|
|||||||
Reference in New Issue
Block a user