mirror of
https://github.com/ZDoom/Raze.git
synced 2025-06-02 02:01:31 +00:00
- 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:
parent
0f4d80b5d3
commit
1adceb82ef
28 changed files with 167 additions and 1367 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue