From 36cd0bdd58abdef008958c9615e581c42242a2bc Mon Sep 17 00:00:00 2001 From: lonelywolf <13281126@qq.com> Date: Wed, 28 Oct 2026 11:58:03 +0000 Subject: [PATCH] S14V1.71 --- build.ps1 | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/build.ps1 b/build.ps1 index ca2c848..3e6c468 100644 --- a/build.ps1 +++ b/build.ps1 @@ -83,6 +83,10 @@ function Get-ModuleDir { } $good = @($cands | Where-Object { $_.Count -ge 10 } | Sort-Object -Descending Count) + # 兼容「模块与脚本平铺在同一目录」的布局(仓库里可能没有子文件夹) + $flat = @(Get-ChildItem -LiteralPath $Root -Filter '*.txt' -File -ErrorAction SilentlyContinue | + Where-Object { $_.Name -match '^\d{2}-' }).Count + if ($flat -ge 10) { return $Root } if ($good.Count -eq 0) { $tip = '' if ($cands.Count -gt 0) { @@ -152,7 +156,7 @@ function Get-Modules([string]$Dir) { } function Get-Lines([string]$Text) { - $a = $Text -split "`r`n" + $a = $Text -split "\r?\n" if ($a.Count -gt 0 -and $a[-1] -eq '') { if ($a.Count -eq 1) { return @() } return $a[0..($a.Count - 2)] @@ -186,11 +190,15 @@ $PhSet = [System.Collections.Generic.HashSet[string]]::new([System.StringCompare foreach ($x in @($Colors + $Special + $InfoCodes)) { [void]$PhSet.Add($x) } $NumPrefix = @('SK','STAT','CHARSTAT','TABSK','FORMULA') $KwPrefix = @('SK','STAT','CHARSTAT','TABSK','MULTI','CLSK','FORMULA') -$IgnoreUndef = @('SPEARBASE2_3') + $IgnoreUndef = @() $MaxLineLen = 1024 function Test-Placeholder([string]$name) { if ($PhSet.Contains($name)) { return $true } + # 带连字符的显示宏(图标/边框/音效/层级):只认合法形态,写错即报非法占位符 + if ($name -match '^(MAP|DOT|BG|BORDER|PX|PY)-[0-9A-Fa-f]{2}$') { return $true } + if ($name -match '^SOUNDID-\d+$') { return $true } + if ($name -match '^TIER-[1-5]$') { return $true } foreach ($p in $NumPrefix) { if (-not $name.StartsWith($p, [System.StringComparison]::Ordinal)) { continue } $tail = $name.Substring($p.Length) @@ -300,7 +308,7 @@ function Invoke-SelfCheck([string[]]$Lines, $Mods) { $ruleRe = [regex]'^ItemDisplay\[([^\]]*)\]:(.*)$' $aliasRe = [regex]'^Alias\[([^\]]+)\]:(.*)$' $formulaRe = [regex]'^Formula\[([^\]]+)\]:(.*)$' - $phRe = [regex]'%([A-Za-z][A-Za-z0-9_]*)%' + $phRe = [regex]'%([A-Za-z][A-Za-z0-9_\-]*)%' $tokRe = [regex]'(?