- set up the Witchaven specific controls and their menu entries.

Sorry, no text file yet.
This commit is contained in:
Christoph Oelckers 2020-10-31 08:16:13 +01:00
parent 7f921be824
commit fd3303ab2b
11 changed files with 96 additions and 9 deletions

View file

@ -681,6 +681,17 @@ void ReadBindings(int lump, bool override)
FKeyBindings* dest = &Bindings;
int key;
if (sc.Compare("unbind"))
{
sc.MustGetString();
if (override)
{
// This is only for games to clear unsuitable base defaults, not for mods.
dest->UnbindKey(sc.String);
}
continue;
}
// bind destination is optional and is the same as the console command
if (sc.Compare("bind"))
{
@ -711,7 +722,18 @@ void ReadBindings(int lump, bool override)
void C_SetDefaultKeys(const char* baseconfig)
{
auto lump = fileSystem.CheckNumForFullName("engine/commonbinds.txt");
if (lump >= 0) ReadBindings(lump, true);
if (lump >= 0)
{
// Bail out if a mod tries to override this. Main game resources are allowed to do this, though.
auto fileno2 = fileSystem.GetFileContainer(lump);
if (fileno2 > fileSystem.GetMaxIwadNum())
{
I_FatalError("File %s is overriding core lump %s.",
fileSystem.GetResourceFileFullName(fileno2), "engine/commonbinds.txt");
}
ReadBindings(lump, true);
}
int lastlump = 0;
while ((lump = fileSystem.FindLumpFullName(baseconfig, &lastlump)) != -1)