| 339 | } |
| 340 | |
| 341 | void InGameConsole::ProcessCurrentLine() |
| 342 | { |
| 343 | if (_currentLine[0] == '\0') { |
| 344 | // Empty line |
| 345 | return; |
| 346 | } |
| 347 | |
| 348 | StringView line = _currentLine; |
| 349 | if (_commandHistory.empty() || _commandHistory.back() != line) { |
| 350 | _commandHistory.emplace_back(line); |
| 351 | } |
| 352 | _historyIndex = _commandHistory.size(); |
| 353 | |
| 354 | if (line == "/clear"_s || line == "/cls"_s) { |
| 355 | Clear(); |
| 356 | } else { |
| 357 | if (!_levelHandler->OnConsoleCommand(line)) { |
| 358 | WriteLine(MessageLevel::Echo, line); |
| 359 | WriteLine(MessageLevel::Error, _("Unknown command")); |
| 360 | } |
| 361 | } |
| 362 | |
| 363 | _currentLine[0] = '\0'; |
| 364 | _textCursor = 0; |
| 365 | _carretAnim = 0.0f; |
| 366 | } |
| 367 | |
| 368 | void InGameConsole::PruneLogHistory() |
| 369 | { |
nothing calls this directly
no test coverage detected