From a18d8e1f0bd3ee0f42b029effc1c2f26d55bff15 Mon Sep 17 00:00:00 2001 From: jyelon Date: Tue, 8 Apr 2025 16:44:46 -0400 Subject: [PATCH] Remove Display Duration from Format Log Message --- Content/Tangibles/TAN_Character.uasset | 4 +- Source/Integration/BlueprintErrors.cpp | 24 +-------- Source/Integration/BlueprintErrors.h | 75 +------------------------- Source/Integration/FormatError.cpp | 16 +----- 4 files changed, 6 insertions(+), 113 deletions(-) diff --git a/Content/Tangibles/TAN_Character.uasset b/Content/Tangibles/TAN_Character.uasset index a21083fd..71302314 100644 --- a/Content/Tangibles/TAN_Character.uasset +++ b/Content/Tangibles/TAN_Character.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:44c36bc34f20fafc55fe69ab0da36aaa2fc0cd09edf0be35d3c2b7d2dba6f29a -size 319400 +oid sha256:85529b29f1e91b3eef85d9a6d027db4623adc7ba4602b6fb520ee2c4e3ed17ac +size 317298 diff --git a/Source/Integration/BlueprintErrors.cpp b/Source/Integration/BlueprintErrors.cpp index 95029434..e9a4c357 100644 --- a/Source/Integration/BlueprintErrors.cpp +++ b/Source/Integration/BlueprintErrors.cpp @@ -18,7 +18,7 @@ ELogVerbosity::Type UlxBlueprintErrorLibrary::ConvertElxLogVerbosity(ElxLogVerbo } } -void UlxBlueprintErrorLibrary::FormatErrorInternal(UObject *Context, ElxLogVerbosity Verbosity, ElxErrorDisplayDuration DisplayDuration, const FString &InPattern, TArray InArgs) +void UlxBlueprintErrorLibrary::FormatErrorInternal(UObject *Context, ElxLogVerbosity Verbosity, const FString &InPattern, TArray InArgs) { // Generate the formatted string. // @@ -26,21 +26,6 @@ void UlxBlueprintErrorLibrary::FormatErrorInternal(UObject *Context, ElxLogVerbo FText Message = FTextFormatter::Format(MoveTemp(InPatternText), MoveTemp(InArgs), false, false); FString MessageString = Message.ToString(); - // Convert the DisplayDuration enum into a number of seconds. - // - int Seconds = int(DisplayDuration); - if (Seconds > 100) Seconds = (Seconds - 100) * 60; - - // Choose a color appropriate to the verbosity level. - // - FLinearColor Color; - switch (Verbosity) { - case ElxLogVerbosity::Fatal : Color = FLinearColor(1.0, 0.6, 0.6); break; - case ElxLogVerbosity::Error : Color = FLinearColor(1.0, 0.6, 0.6); break; - case ElxLogVerbosity::Warning : Color = FLinearColor(0.9, 0.9, 0.6); break; - default: Color = FLinearColor(0.8, 0.8, 0.8); break; - } - // Get the blueprint name. // // Normally, the log function expects you to pass in a filename, and a log @@ -59,13 +44,6 @@ void UlxBlueprintErrorLibrary::FormatErrorInternal(UObject *Context, ElxLogVerbo auto BlueprintNameAnsi = StringCast(*BlueprintNameString); FLogCategoryName BlueprintNameLogCategory(Context->GetClass()->GetFName()); - // Output to Screen, if requested. - // - if (Seconds != 0) - { - UKismetSystemLibrary::PrintText(NULL, Message, true, false, Color, Seconds, NAME_None); - } - // Output to Log // ELogVerbosity::Type VerbosityValue = ConvertElxLogVerbosity(Verbosity); diff --git a/Source/Integration/BlueprintErrors.h b/Source/Integration/BlueprintErrors.h index 9b3a9285..0230d139 100644 --- a/Source/Integration/BlueprintErrors.h +++ b/Source/Integration/BlueprintErrors.h @@ -57,79 +57,6 @@ enum class ElxLogVerbosity : uint8 { Fatal, }; - -/** Display Duration: How long to display an error message in the game's viewport. - * - * Note: I know it is not traditional to use underscores in Unreal - * identifiers. However, without the underscores, the symbols aren't - * converted to reasonable human-readable names, and that's the whole point - * of this enum. - * - */ -UENUM(BlueprintType) -enum class ElxErrorDisplayDuration : uint8 { - - /* Do not display the message in the viewport */ - No_Show = 0, - - /* Display the message in the viewport for 1 seconds */ - Show_1_Seconds = 1, - - /* Display the message in the viewport for 2 seconds */ - Show_2_Seconds = 2, - - /* Display the message in the viewport for 3 seconds */ - Show_3_Seconds = 3, - - /* Display the message in the viewport for 4 seconds */ - Show_4_Seconds = 4, - - /* Display the message in the viewport for 5 seconds */ - Show_5_Seconds = 5, - - /* Display the message in the viewport for 10 seconds */ - Show_10_Seconds = 10, - - /* Display the message in the viewport for 20 seconds */ - Show_20_Seconds = 20, - - /* Display the message in the viewport for 30 seconds */ - Show_30_Seconds = 30, - - /* Display the message in the viewport for 40 seconds */ - Show_40_Seconds = 40, - - /* Display the message in the viewport for 50 seconds */ - Show_50_Seconds = 50, - - /* Display the message in the viewport for 60 seconds */ - Show_60_Seconds = 60, - - /* Display the message in the viewport for 70 seconds */ - Show_70_Seconds = 70, - - /* Display the message in the viewport for 80 seconds */ - Show_80_Seconds = 80, - - /* Display the message in the viewport for 90 seconds */ - Show_90_Seconds = 90, - - /* Display the message in the viewport for 1 minutes */ - Show_1_Minutes = 101, - - /* Display the message in the viewport for 2 minutes */ - Show_2_Minutes = 102, - - /* Display the message in the viewport for 3 minutes */ - Show_3_Minutes = 103, - - /* Display the message in the viewport for 4 minutes */ - Show_4_Minutes = 104, - - /* Display the message in the viewport for 5 minutes */ - Show_5_Minutes = 105, -}; - /* A library containing assorted useful functions for blueprint error handling. * */ @@ -144,7 +71,7 @@ public: // its own source file. // UFUNCTION(BlueprintCallable, meta=(WorldContext = "Context", BlueprintInternalUseOnly = "true")) - static void FormatErrorInternal(UObject *Context, ElxLogVerbosity Verbosity, ElxErrorDisplayDuration DisplayDuration, const FString &InPattern, TArray InArgs); + static void FormatErrorInternal(UObject *Context, ElxLogVerbosity Verbosity, const FString &InPattern, TArray InArgs); // A formatting routine for pins that were never connected. // diff --git a/Source/Integration/FormatError.cpp b/Source/Integration/FormatError.cpp index c32c2a79..f41f32f6 100644 --- a/Source/Integration/FormatError.cpp +++ b/Source/Integration/FormatError.cpp @@ -61,11 +61,6 @@ static bool IsVerbosityPin(const UEdGraphPin *Pin) { return (Pin->PinName == VerbosityPinName); } -static const FName DisplayDurationPinName(TEXT("DisplayDuration")); -static bool IsDisplayDurationPin(const UEdGraphPin *Pin) { - return (Pin->PinName == DisplayDurationPinName); -} - static const FName FormatPinName(TEXT("Format")); static bool IsFormatPin(const UEdGraphPin *Pin) { return (Pin->PinName == FormatPinName); @@ -116,12 +111,6 @@ void UK2Node_FormatMessage::CreateCorrectPins() P->DefaultValue = TEXT("Error"); P->AutogeneratedDefaultValue = P->DefaultValue; } - - if (FindPin(DisplayDurationPinName, EGPD_Input) == nullptr) { - UEdGraphPin *P = CreatePin(EGPD_Input, UEdGraphSchema_K2::PC_Byte, StaticEnum(), DisplayDurationPinName); - P->DefaultValue = TEXT("No_Show"); - P->AutogeneratedDefaultValue = P->DefaultValue; - } } // Transfer all Existing Argument pins to the Old Pins Map. @@ -210,7 +199,7 @@ FText UK2Node_FormatMessage::GetNodeTitle(ENodeTitleType::Type TitleType) const { if (IsFormatErrorMessage()) { - return LOCTEXT("FormatErrorMessage_Title", "Format Error Message"); + return LOCTEXT("FormatErrorMessage_Title", "Format Log Message"); } else { @@ -227,7 +216,7 @@ FText UK2Node_FormatMessage::GetPinDisplayName(const UEdGraphPin* Pin) const } // Many pins can go unlabeled if they have default values. - if (IsFormatPin(Pin) || IsVerbosityPin(Pin) || IsDisplayDurationPin(Pin)) + if (IsFormatPin(Pin) || IsVerbosityPin(Pin)) { if (Pin->LinkedTo.Num() == 0) { @@ -448,7 +437,6 @@ void UK2Node_FormatMessage::ExpandNode(class FKismetCompilerContext& CompilerCon if (IsFormatErrorMessage()) { CompilerContext.MovePinLinksToIntermediate(*FindPinChecked(VerbosityPinName), *CallFormatFunction->FindPinChecked(TEXT("Verbosity"))); - CompilerContext.MovePinLinksToIntermediate(*FindPinChecked(DisplayDurationPinName), *CallFormatFunction->FindPinChecked(TEXT("DisplayDuration"))); } else {