mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
Make Key_GetBinding take an imt instead of a name.
This commit is contained in:
parent
c25fd410a5
commit
7c16acf4aa
2 changed files with 5 additions and 6 deletions
|
@ -533,7 +533,7 @@ void Key_Init (struct cbuf_s *cb);
|
|||
void Key_Init_Cvars (void);
|
||||
void Key_WriteBindings (QFile *f);
|
||||
void Key_ClearStates (void);
|
||||
const char *Key_GetBinding (const char *imt_name, knum_t key);
|
||||
const char *Key_GetBinding (imt_t *imt, knum_t key);
|
||||
void Key_SetBinding (imt_t *imt, knum_t keynum, const char *binding);
|
||||
void Key_SetKeyDest(keydest_t kd);
|
||||
typedef void keydest_callback_t (keydest_t);
|
||||
|
|
|
@ -944,6 +944,7 @@ static void
|
|||
Key_GIB_Bind_Get_f (void)
|
||||
{
|
||||
const char *key, *cmd;
|
||||
imt_t *imt;
|
||||
int k;
|
||||
|
||||
if (GIB_Argc () != 2) {
|
||||
|
@ -958,7 +959,8 @@ Key_GIB_Bind_Get_f (void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (!(cmd = Key_GetBinding ("IMT_MOD", k)))
|
||||
imt = Key_FindIMT ("imt_mod");
|
||||
if (!imt || !(cmd = Key_GetBinding (imt, k)))
|
||||
GIB_Return ("");
|
||||
else
|
||||
GIB_Return (cmd);
|
||||
|
@ -1319,11 +1321,8 @@ Key_Init_Cvars (void)
|
|||
}
|
||||
|
||||
const char *
|
||||
Key_GetBinding (const char *imt_name, knum_t key)
|
||||
Key_GetBinding (imt_t *imt, knum_t key)
|
||||
{
|
||||
imt_t *imt;
|
||||
|
||||
imt = Key_FindIMT (imt_name);
|
||||
if (imt) {
|
||||
return imt->bindings[key].str;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue