mirror of
https://github.com/ZDoom/Raze.git
synced 2025-05-30 17:01:03 +00:00
- transitioned the combat macros to the new config and made them independent for all games, so that everything can use the original text. (But considering that they are a multiplayer feature I'm not sure how much that is worth.)
- sort the config output alphabetically. - do not use [=] as key names for the bindings.
This commit is contained in:
parent
ef9f50aa12
commit
4b5ec2aabb
27 changed files with 86 additions and 229 deletions
|
@ -51,8 +51,6 @@
|
|||
//#include "menu/menu.h"
|
||||
//#include "vm.h"
|
||||
|
||||
#define CVAR_NOSAVE 0x100 // duplicate name, put in header later
|
||||
|
||||
struct FLatchedValue
|
||||
{
|
||||
FBaseCVar *Variable;
|
||||
|
@ -1387,23 +1385,36 @@ void C_SetCVarsToDefaults (void)
|
|||
}
|
||||
}
|
||||
|
||||
static int cvarcmp(const void* a, const void* b)
|
||||
{
|
||||
FBaseCVar** A = (FBaseCVar**)a;
|
||||
FBaseCVar** B = (FBaseCVar**)b;
|
||||
return strcmp((*A)->GetName(), (*B)->GetName());
|
||||
}
|
||||
|
||||
void C_ArchiveCVars (FConfigFile *f, uint32_t filter)
|
||||
{
|
||||
FBaseCVar *cvar = CVars;
|
||||
TArray<FBaseCVar*> cvarlist;
|
||||
|
||||
while (cvar)
|
||||
{
|
||||
if ((cvar->Flags &
|
||||
(CVAR_GLOBALCONFIG|CVAR_ARCHIVE|CVAR_AUTO|CVAR_SERVERINFO|CVAR_NOSAVE))
|
||||
(CVAR_GLOBALCONFIG|CVAR_ARCHIVE|CVAR_AUTO|CVAR_SERVERINFO|CVAR_USERINFO|CVAR_NOSAVE))
|
||||
== filter)
|
||||
{
|
||||
const char *const value = (cvar->Flags & CVAR_ISDEFAULT)
|
||||
? cvar->GetGenericRep(CVAR_String).String
|
||||
: cvar->SafeValue.GetChars();
|
||||
f->SetValueForKey(cvar->GetName(), value);
|
||||
cvarlist.Push(cvar);
|
||||
}
|
||||
cvar = cvar->m_Next;
|
||||
}
|
||||
qsort(cvarlist.Data(), cvarlist.Size(), sizeof(FBaseCVar*), cvarcmp);
|
||||
for (auto cvar : cvarlist)
|
||||
{
|
||||
const char* const value = (cvar->Flags & CVAR_ISDEFAULT)
|
||||
? cvar->GetGenericRep(CVAR_String).String
|
||||
: cvar->SafeValue.GetChars();
|
||||
f->SetValueForKey(cvar->GetName(), value);
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue