mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 14:38:18 +00:00
Fix broken key helper in callvote popup
This commit is contained in:
parent
834a433ca8
commit
583e37f418
|
@ -160,9 +160,9 @@ const char *CBinds::Get(int KeyID, int Modifier)
|
|||
return "";
|
||||
}
|
||||
|
||||
void CBinds::GetKey(const char *pBindStr, char aBuf[64], unsigned BufSize)
|
||||
void CBinds::GetKey(const char *pBindStr, char aKey[64], unsigned BufSize)
|
||||
{
|
||||
aBuf[0] = 0;
|
||||
aKey[0] = 0;
|
||||
for(int KeyID = 0; KeyID < KEY_LAST; KeyID++)
|
||||
{
|
||||
for(int m = 0; m < MODIFIER_COUNT; m++)
|
||||
|
@ -172,10 +172,14 @@ void CBinds::GetKey(const char *pBindStr, char aBuf[64], unsigned BufSize)
|
|||
continue;
|
||||
|
||||
if(str_comp(pBind, pBindStr) == 0)
|
||||
str_format(aBuf, BufSize, "key %s%s not found", Input()->KeyName(KeyID), GetModifierName(m));
|
||||
{
|
||||
str_format(aKey, BufSize, "%s%s", GetModifierName(m), Input()->KeyName(KeyID));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
str_copy(aKey, "key not found", BufSize);
|
||||
}
|
||||
|
||||
void CBinds::SetDefaults()
|
||||
{
|
||||
|
|
|
@ -42,7 +42,7 @@ public:
|
|||
void SetDefaults();
|
||||
void UnbindAll();
|
||||
const char *Get(int KeyID, int Modifier);
|
||||
void GetKey(const char *pBindStr, char aBuf[64], unsigned BufSize);
|
||||
void GetKey(const char *pBindStr, char aKey[64], unsigned BufSize);
|
||||
static const char *GetModifierName(int m);
|
||||
static int GetModifierMask(IInput *i);
|
||||
static int GetModifierMaskOfKey(int Key);
|
||||
|
|
Loading…
Reference in a new issue