void kexConsole::ParseInput(void) { if(typeStrPos <= 0 || strlen(typeStr) <= 0) return; OutputTextLine(RGBA(192, 192, 192, 255), typeStr); command.Execute(typeStr); AddToHistory(); ResetInputText(); historyCur = (historyTop - 1); }
void kexConsole::Print(rcolor color, const char *text) { int strLength = strlen(text); char *curText = (char*)text; char tmpChar[CON_LINE_LENGTH]; while(strLength > 0) { int lineLength = kexStr::IndexOf(curText, "\n"); if(lineLength == -1) { lineLength = strLength; } strncpy(tmpChar, curText, lineLength); tmpChar[lineLength] = '\0'; OutputTextLine(color, tmpChar); curText = (char*)&text[lineLength+1]; strLength -= (lineLength+1); } }
void UConsole::OutputText(const FString& Text) { FString RemainingText = Text; int32 StringLength = Text.Len(); while(StringLength > 0) { // Find the number of characters in the next line of text. int32 LineLength = RemainingText.Find(TEXT("\n")); if(LineLength == -1) { // There aren't any more newlines in the string, assume there's a newline at the end of the string. LineLength = StringLength; } // Output the line to the console. OutputTextLine(RemainingText.Left(LineLength)); // Remove the line from the string. RemainingText = (RemainingText).Mid(LineLength + 1, MAX_int32); StringLength -= LineLength + 1; }; }