MCPcopy Create free account
hub / github.com/ddnet/ddnet / PossibleArgumentsCompleteCallback

Method PossibleArgumentsCompleteCallback

src/game/client/components/console.cpp:495–509  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

493}
494
495void CGameConsole::CInstance::PossibleArgumentsCompleteCallback(int Index, const char *pStr, void *pUser)
496{
497 CGameConsole::CInstance *pInstance = (CGameConsole::CInstance *)pUser;
498 if(pInstance->m_CompletionChosenArgument == Index)
499 {
500 // get command
501 char aBuf[IConsole::CMDLINE_LENGTH];
502 str_copy(aBuf, pInstance->GetString(), pInstance->m_CompletionArgumentPosition);
503 str_append(aBuf, " ");
504
505 // append argument
506 str_append(aBuf, pStr);
507 pInstance->m_Input.Set(aBuf);
508 }
509}
510
511bool CGameConsole::CInstance::OnInput(const IInput::CEvent &Event)
512{

Callers

nothing calls this directly

Calls 4

str_copyFunction · 0.50
str_appendFunction · 0.50
GetStringMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected