Yet more tweaking of Format error Message

This commit is contained in:
2024-11-19 22:24:22 -05:00
parent 622a912474
commit c1f2d74351
3 changed files with 9 additions and 8 deletions

View File

@@ -104,8 +104,8 @@ void UK2Node_FormatError::CreateCorrectPins()
}
if (FindPin(FormatPinName, EGPD_Input) == nullptr) {
UEdGraphPin *P = CreatePin(EGPD_Input, UEdGraphSchema_K2::PC_Text, FormatPinName);
P->DefaultTextValue = LOCTEXT("FormatErrorMessage_DefaultMessage", "Error Message");
UEdGraphPin *P = CreatePin(EGPD_Input, UEdGraphSchema_K2::PC_String, FormatPinName);
P->DefaultValue = TEXT("Error Message");
}
if (FindPin(VerbosityPinName, EGPD_Input) == nullptr) {
@@ -252,7 +252,7 @@ void UK2Node_FormatError::PinDefaultValueChanged(UEdGraphPin* Pin)
if(IsFormatPin(Pin))
{
PinNames.Empty();
FText::GetFormatPatternParameters(Pin->DefaultTextValue, PinNames);
FText::GetFormatPatternParameters(FText::FromString(Pin->DefaultValue), PinNames);
CreateCorrectPins();
GetGraph()->NotifyNodeChanged(this);
}
@@ -608,11 +608,12 @@ FText UK2Node_FormatError::GetMenuCategory() const
return FEditorCategoryUtils::GetCommonCategory(FCommonEditorCategory::Text);
}
void UlxFormatErrorLibrary::FormatErrorInternal(UObject *Context, ElxLogVerbosity Verbosity, ElxDisplayDuration DisplayDuration, FText InPattern, TArray<FFormatArgumentData> InArgs)
void UlxFormatErrorLibrary::FormatErrorInternal(UObject *Context, ElxLogVerbosity Verbosity, ElxDisplayDuration DisplayDuration, const FString &InPattern, TArray<FFormatArgumentData> InArgs)
{
// Generate the formatted string.
//
FText Message = FTextFormatter::Format(MoveTemp(InPattern), MoveTemp(InArgs), false, false);
FText InPatternText(FText::FromString(InPattern));
FText Message = FTextFormatter::Format(MoveTemp(InPatternText), MoveTemp(InArgs), false, false);
FString MessageString = Message.ToString();
// Convert the DisplayDuration enum into a number of seconds.

View File

@@ -134,7 +134,7 @@ class UlxFormatErrorLibrary : public UBlueprintFunctionLibrary
public:
UFUNCTION(BlueprintCallable, meta=(WorldContext = "Context", BlueprintInternalUseOnly = "true"))
static void FormatErrorInternal(UObject *Context, ElxLogVerbosity Verbosity, ElxDisplayDuration DisplayDuration, FText InPattern, TArray<FFormatArgumentData> InArgs);
static void FormatErrorInternal(UObject *Context, ElxLogVerbosity Verbosity, ElxDisplayDuration DisplayDuration, const FString &InPattern, TArray<FFormatArgumentData> InArgs);
};