mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-16 01:11:44 +00:00
When binding a key, take care of processing one-to-many binds properly in menu.
This means that the "Keyboard Setup" should now properly reflect the bindings, except in the theoretical case of one gamefunc being bound more than two keys. (What was fixed is the one key to many gamefuncs case.) git-svn-id: https://svn.eduke32.com/eduke32@3126 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
27c0c9c342
commit
935f3ec50d
1 changed files with 22 additions and 6 deletions
|
@ -1012,16 +1012,32 @@ static int32_t osdcmd_bind(const osdfuncparm_t *parm)
|
|||
|
||||
KeyBindings[ConsoleKeys[i].id].key=ConsoleKeys[i].name;
|
||||
|
||||
// populate the keyboard config menu based on the bind
|
||||
if (!Bstrncasecmp(tempbuf, "gamefunc_", 9))
|
||||
{
|
||||
j = CONFIG_FunctionNameToNum(tempbuf+9);
|
||||
char *cp = tempbuf;
|
||||
|
||||
if (j != -1)
|
||||
// Populate the keyboard config menu based on the bind.
|
||||
// Take care of processing one-to-many bindings properly, too.
|
||||
while ((cp = Bstrstr(cp, "gamefunc_")))
|
||||
{
|
||||
ud.config.KeyboardKeys[j][1] = ud.config.KeyboardKeys[j][0];
|
||||
ud.config.KeyboardKeys[j][0] = ConsoleKeys[i].id;
|
||||
char *semi;
|
||||
|
||||
cp += 9; // skip the "gamefunc_"
|
||||
|
||||
semi = Bstrchr(cp, ';');
|
||||
if (semi)
|
||||
*semi = 0;
|
||||
|
||||
j = CONFIG_FunctionNameToNum(cp);
|
||||
|
||||
if (semi)
|
||||
cp = semi+1;
|
||||
|
||||
if (j != -1)
|
||||
{
|
||||
ud.config.KeyboardKeys[j][1] = ud.config.KeyboardKeys[j][0];
|
||||
ud.config.KeyboardKeys[j][0] = ConsoleKeys[i].id;
|
||||
// CONTROL_MapKey(j, ConsoleKeys[i].id, ud.config.KeyboardKeys[j][0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue