Skip to content
Snippets Groups Projects
Commit 7b8867c0 authored by Ehret's avatar Ehret
Browse files

minor improvement to error message boxes

parent 729a8c20
No related branches found
No related tags found
No related merge requests found
...@@ -95,8 +95,8 @@ void FVAPlugin::ProcessException(const FString Location, const CVAException Exce ...@@ -95,8 +95,8 @@ void FVAPlugin::ProcessException(const FString Location, const CVAException Exce
void FVAPlugin::ProcessException(const FString Location, const FString ExceptionString) void FVAPlugin::ProcessException(const FString Location, const FString ExceptionString)
{ {
FString output = "[FVAPlugin::ProcessException()]: Exception from ["; FString output = "Exception from [";
output.Append(Location).Append("] with error message: ").Append(ExceptionString); output.Append(Location).Append("] with error message:\n").Append(ExceptionString);
FVAUtils::LogStuff(output, true); FVAUtils::LogStuff(output, true);
FVAUtils::OpenMessageBox(output, true); FVAUtils::OpenMessageBox(output, true);
} }
......
...@@ -15,38 +15,10 @@ void FVAUtils::OpenMessageBox(const FString Text, const bool bError) ...@@ -15,38 +15,10 @@ void FVAUtils::OpenMessageBox(const FString Text, const bool bError)
return; return;
} }
FString TrueStatement; FText Title = FText::FromString(FString(bError?"ERROR":"Message"));
if (bError) FMessageDialog::Open(EAppMsgType::Ok, FText::FromString(Text), &Title);
{
TrueStatement = "TRUE";
} }
else
{
TrueStatement = "FALSE";
}
LogStuff("[FVAUtils::OpenMessageBox(ERROR = " + TrueStatement + ")]: Opening Message Box with message: " + Text);
if (bError)
{
FMessageDialog::Open(EAppMsgType::Ok, FText::FromString(AddExclamationMarkAroundChar(Text)));
}
else
{
FMessageDialog::Open(EAppMsgType::Ok, FText::FromString(Text));
}
}
FString FVAUtils::AddExclamationMarkAroundChar(const FString Text)
{
size_t Length = Text.Len();
FString ReturnedString = FString("!!!!!");
ReturnedString.Append(Text).Append("!!!!!");
return ReturnedString;
}
bool FVAUtils::CheckLibraryHandle(const void* LibraryHandle) bool FVAUtils::CheckLibraryHandle(const void* LibraryHandle)
{ {
......
...@@ -18,7 +18,6 @@ public: ...@@ -18,7 +18,6 @@ public:
// Open Message Box with Text. bool error expresses whether to use excl. marks ++ // // Open Message Box with Text. bool error expresses whether to use excl. marks ++ //
static void OpenMessageBox(FString Text, bool bError = false); static void OpenMessageBox(FString Text, bool bError = false);
static FString AddExclamationMarkAroundChar(FString Text);
// Checking LibraryHandle // // Checking LibraryHandle //
static bool CheckLibraryHandle(const void* LibraryHandle); static bool CheckLibraryHandle(const void* LibraryHandle);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment