og-northstar-launcher/primedev/core/convar/cvar.cpp
Jack f5ab6fb5e8
Folder restructuring from primedev (#624)
Copies of over the primedev folder structure for easier cherry-picking of further changes

Co-authored-by: F1F7Y <filip.bartos07@proton.me>
2023-12-27 01:32:01 +01:00

26 lines
818 B
C++

#include "cvar.h"
#include "convar.h"
#include "concommand.h"
//-----------------------------------------------------------------------------
// Purpose: returns all ConVars
//-----------------------------------------------------------------------------
std::unordered_map<std::string, ConCommandBase*> CCvar::DumpToMap()
{
std::stringstream ss;
CCVarIteratorInternal* itint = FactoryInternalIterator(); // Allocate new InternalIterator.
std::unordered_map<std::string, ConCommandBase*> allConVars;
for (itint->SetFirst(); itint->IsValid(); itint->Next()) // Loop through all instances.
{
ConCommandBase* pCommand = itint->Get();
const char* pszCommandName = pCommand->m_pszName;
allConVars[pszCommandName] = pCommand;
}
return allConVars;
}
SourceInterface<CCvar>* g_pCVarInterface;
CCvar* g_pCVar;