mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 22:48:18 +00:00
Add toggling for string options
This commit is contained in:
parent
ed8effdec8
commit
5941755832
|
@ -734,6 +734,14 @@ void CConsole::ConToggle(IConsole::IResult *pResult, void *pUser)
|
||||||
pConsole->ExecuteLine(aBuf);
|
pConsole->ExecuteLine(aBuf);
|
||||||
aBuf[0] = 0;
|
aBuf[0] = 0;
|
||||||
}
|
}
|
||||||
|
else if(pfnCallback == StrVariableCommand)
|
||||||
|
{
|
||||||
|
CStrVariableData *pData = static_cast<CStrVariableData *>(pUserData);
|
||||||
|
const char *pStr = !str_comp(pData->m_pStr, pResult->GetString(1)) ? pResult->GetString(2) : pResult->GetString(1);
|
||||||
|
str_format(aBuf, sizeof(aBuf), "%s %s", pResult->GetString(0), pStr);
|
||||||
|
pConsole->ExecuteLine(aBuf);
|
||||||
|
aBuf[0] = 0;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
str_format(aBuf, sizeof(aBuf), "Invalid command: '%s'.", pResult->GetString(0));
|
str_format(aBuf, sizeof(aBuf), "Invalid command: '%s'.", pResult->GetString(0));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue