- consolidation of defbinds definitions.

Putting all the generic definitions in files used by all games greatly reduces the clutter and chance for errors.
This commit is contained in:
Christoph Oelckers 2019-11-26 21:06:43 +01:00
parent 0f4d80b5d3
commit 1adceb82ef
28 changed files with 167 additions and 1367 deletions

View file

@ -649,7 +649,7 @@ CCMD(rebind)
//
//=============================================================================
void ReadBindings(int lump)
void ReadBindings(int lump, bool override)
{
FScanner sc(lump);
@ -675,20 +675,26 @@ void ReadBindings(int lump)
}
key = GetConfigKeyFromName(sc.String);
sc.MustGetString();
dest->SetBind(key, sc.String);
dest->SetBind(key, sc.String, override);
}
}
void CONFIG_SetDefaultKeys(const char* baseconfig)
{
auto lump = fileSystem.GetFile(baseconfig);
ReadBindings(lump);
auto lump = fileSystem.GetFile("demolition/commonbinds.txt", ELookupMode::FullName, 0);
if (lump >= 0) ReadBindings(lump, true);
int lastlump = 0;
while ((lump = fileSystem.Iterate(baseconfig, &lastlump)) != -1)
{
if (fileSystem.GetFileContainer(lump) > 0) break;
ReadBindings(lump, true);
}
while ((lump = fileSystem.Iterate("defbinds.txt", &lastlump)) != -1)
{
ReadBindings(lump);
ReadBindings(lump, false);
}
}