Lots of refactoring in IntegrationGameModeBase

This commit is contained in:
2023-09-05 03:20:11 -04:00
parent cfc536011e
commit 1482e5e43f
6 changed files with 109 additions and 51 deletions

View File

@@ -144,24 +144,6 @@ namespace DebugPrintControl {
//
//////////////////////////////////////////////////////////////
void FConsoleOutput::Append(const FString& text) {
if (!text.IsEmpty()) {
Content += text;
Truncate();
Dirty = true;
}
}
void FConsoleOutput::AppendLine(const FString& text) {
int csize = Content.Len();
if ((csize > 0) && (Content[csize - 1] != '\n')) {
Content += TEXT("\n");
}
Content += text;
Content += TEXT("\n");
Truncate();
Dirty = true;
}
void FConsoleOutput::Truncate() {
int lines = 50;
@@ -178,3 +160,41 @@ void FConsoleOutput::Truncate() {
}
}
bool FConsoleOutput::MaybeAppendNewline() {
int csize = Content.Len();
if ((csize > 0) && (Content[csize - 1] != '\n')) {
Content += TEXT("\n");
return true;
}
else {
return false;
}
}
bool FConsoleOutput::MaybeAppendText(const FString& text) {
if (!text.IsEmpty()) {
Content += text;
return true;
}
else {
return false;
}
}
void FConsoleOutput::Append(const FString& text) {
bool modified = MaybeAppendText(text);
if (modified) {
Dirty = true;
Truncate();
}
}
void FConsoleOutput::AppendLine(const FString& text) {
bool modified = MaybeAppendNewline();
modified |= MaybeAppendText(text);
modified |= MaybeAppendNewline();
if (modified) {
Dirty = true;
Truncate();
}
}