From 6891d8829472c9b4ef70f4539c3ba3f2cafad8bc Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sat, 8 Jul 2023 13:28:44 +0200 Subject: [PATCH] Add usage text to modsystem cvar init Allow adding usage texts as well. Renamed 'helpString' field to 'helpText'. --- r5dev/pluginsystem/modsystem.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/r5dev/pluginsystem/modsystem.cpp b/r5dev/pluginsystem/modsystem.cpp index 32359bf2..024db33d 100644 --- a/r5dev/pluginsystem/modsystem.cpp +++ b/r5dev/pluginsystem/modsystem.cpp @@ -188,8 +188,9 @@ CModSystem::ModInstance_t::ModInstance_t(const fs::path& basePath) : m_szName(st for (KeyValues* pSubKey = pConVars->GetFirstSubKey(); pSubKey != nullptr; pSubKey = pSubKey->GetNextKey()) { const char* pszName = pSubKey->GetName(); - const char* pszHelpString = pSubKey->GetString("helpString"); const char* pszFlagsString = pSubKey->GetString("flags", "NONE"); + const char* pszHelpString = pSubKey->GetString("helpText"); + const char* pszUsageString = pSubKey->GetString("usageText"); KeyValues* pValues = pSubKey->FindKey("Values"); @@ -219,8 +220,9 @@ CModSystem::ModInstance_t::ModInstance_t(const fs::path& basePath) : m_szName(st } int flags = FCVAR_NONE; + if (ConVar_ParseFlagString(pszFlagsString, flags, pszName)) - ConVar::StaticCreate(pszName, pszDefaultValue, flags, pszHelpString, bMin, fMin, bMax, fMax, nullptr, nullptr); + ConVar::StaticCreate(pszName, pszDefaultValue, flags, pszHelpString, bMin, fMin, bMax, fMax, nullptr, pszUsageString); } }