MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / ProcessCurrentLine

Method ProcessCurrentLine

Sources/Jazz2/UI/InGameConsole.cpp:341–366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 6

_Function · 0.85
emplace_backMethod · 0.80
emptyMethod · 0.45
backMethod · 0.45
sizeMethod · 0.45
OnConsoleCommandMethod · 0.45

Tested by

no test coverage detected