void CmdCommandList_f() { gConsole.Output("Full command list:"); for (int i=0;i<gConsole.m_CommandList.Size();i++) { if ( gConsole.m_CommandList[i]->IsCommand() ) { gConsole.Output(" %s", gConsole.m_CommandList[i]->GetName() ); } } }
void CmdCvarList_f() { gConsole.Output("Full CVar list:"); for (int i=0;i<gConsole.m_CommandList.Size();i++) { if ( !gConsole.m_CommandList[i]->IsCommand() ) { gConsole.Output(" %s = %s", ((CVar*)gConsole.m_CommandList[i])->GetName(), ((CVar*)gConsole.m_CommandList[i])->GetString() ); } } }
int __cdecl CP_vprintf( int iDebugLevel, const char *format, va_list args) { int iRet; if( (iDebugLevel < DEBUG_THRESHOLD) || (iDebugLevel < 0) || (iDebugLevel >= N_PRINT_LEVELS)) return 0; iRet = _vsnprintf( x_szTmp, MAX_STR_LEN, format, args); // Did some error, but not buffer overflow occur? if( (iRet < 0) && (iRet != -1) ) { return iRet; } // Set text color x_CmdWnd.Color( x_awDebugColors[iDebugLevel] ); x_CmdWnd.Output(x_szTmp); // strcat( g_szLogBuffer, x_szTmp ); // add to the log string return iRet; }
void CmdExec_f() { if ( gConsole.GetArgumentCount() < 2 ) return; std::ifstream file( gConsole.GetArgument(1), ios::in ); if ( !file.is_open() ) { gConsole.Output("Unable to exec '%s'", gConsole.GetArgument(1) ); return; } std::string str((std::istreambuf_iterator<char>(file)), std::istreambuf_iterator<char>()); gConsole.AddCommand("\n"); gConsole.AddCommand( (char*)str.c_str()); gConsole.AddCommand("\n"); file.close(); }
void CmdEcho_f() { if ( gConsole.GetArgumentCount() < 2 ) return; gConsole.Output( gConsole.GetArgument(1) ); }