Lots of refactoring in IntegrationGameModeBase
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user