Fix a lot of broken menu stuff in MCP

This commit is contained in:
2026-03-20 14:56:40 -04:00
parent acc5bafe34
commit 0ac9a01859
7 changed files with 142 additions and 167 deletions

View File

@@ -87,6 +87,32 @@ FString WingUtils::SanitizeName(FName Name)
return SanitizeName(Name.ToString());
}
FString WingUtils::StandardizeMenuItem(const FString &Item)
{
FString Sanitized = Item;
int32 Dst = 0;
bool Upper = true;
for (int32 Src = 0; Src < Sanitized.Len(); Src++)
{
TCHAR c = Sanitized[Src];
if (FChar::IsAlnum(c))
{
if (Upper) c = FChar::ToUpper(c);
Sanitized[Dst++] = c;
Upper = false;
}
else
{
Upper = true;
if ((c <= 0x20)||(c == 0x7F)) continue;
if (c == ':') c = L'';
Sanitized[Dst++] = c;
}
}
Sanitized.LeftInline(Dst);
return Sanitized;
}
// ============================================================
// Name Lookup
// ============================================================