Change syntax back to normal
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include "EdGraph/EdGraph.h"
|
||||
#include "EdGraph/EdGraphNode.h"
|
||||
#include "EdGraph/EdGraphPin.h"
|
||||
#include "K2Node_EditablePinBase.h"
|
||||
#include "EdGraph/EdGraphSchema.h"
|
||||
#include "Kismet2/BlueprintEditorUtils.h"
|
||||
#include "Kismet2/KismetEditorUtilities.h"
|
||||
@@ -53,14 +54,11 @@ extern int32 TrySavePackageSEH(
|
||||
// ============================================================
|
||||
// Name sanitization
|
||||
//
|
||||
// Our parsers use Unicode geometric shape delimiters that
|
||||
// are unlikely to appear in names: ◂▸ for type brackets, ◆
|
||||
// for map key◆value, ◦ for type◦name in prototypes, │ for
|
||||
// list/path separation. If any of these characters appear
|
||||
// in a name, we replace them with safe ASCII equivalents.
|
||||
// One consequence of name sanitization is that we can't use
|
||||
// Unreal's name-lookup routines — the LLM only sees
|
||||
// sanitized names. So we do our own name lookups.
|
||||
// Our parsers reserve certain punctuation marks for parsing
|
||||
// types, paths, and the like. For example: Array<Int>.
|
||||
// We therefore cannot allow those specific punctuation marks
|
||||
// in names. We replace them with similar-looking unicode
|
||||
// characters.
|
||||
// ============================================================
|
||||
|
||||
void WingUtils::SanitizeNameInPlace(FString &Name)
|
||||
@@ -70,14 +68,13 @@ void WingUtils::SanitizeNameInPlace(FString &Name)
|
||||
{
|
||||
TCHAR c = Name[Src];
|
||||
if (c < 0x20 || c == 0x7F) continue;
|
||||
if (c == L'◂') c='<';
|
||||
if (c == L'▸') c='>';
|
||||
if (c == L'◆') c='*';
|
||||
if (c == L'◦') c='.';
|
||||
if (c == L'│') c = '|';
|
||||
if (c == ' ') c=L'·';
|
||||
if (c == '<') c=L'◁';
|
||||
if (c == '>') c=L'▷';
|
||||
if (c == ',') c=L'·';
|
||||
Name[Dst++] = c;
|
||||
}
|
||||
if (Dst == 0) Name[Dst++] = '_';
|
||||
if (Dst == 0) Name[Dst++] = L'·';
|
||||
Name.LeftInline(Dst);
|
||||
}
|
||||
|
||||
@@ -216,6 +213,11 @@ FString WingUtils::FormatName(const FProperty *Prop)
|
||||
return SanitizeName(Prop->GetName());
|
||||
}
|
||||
|
||||
FString WingUtils::FormatName(const FUserPinInfo &Pin)
|
||||
{
|
||||
return SanitizeName(Pin.PinName);
|
||||
}
|
||||
|
||||
// ============================================================
|
||||
// Formatting other things
|
||||
// ============================================================
|
||||
|
||||
Reference in New Issue
Block a user