bind related fixes

This commit is contained in:
rei-2
2024-12-21 11:50:47 -05:00
parent b3245643c2
commit a2f01aed76
2 changed files with 9 additions and 5 deletions
+8 -4
View File
@@ -64,14 +64,18 @@ void CBinds::Run(CTFPlayer* pLocal, CTFWeaponBase* pWeapon)
const bool bShouldUse = !I::EngineVGui->IsGameUIVisible() && !I::MatSystemSurface->IsCursorVisible()
|| F::Menu.IsOpen && !ImGui::GetIO().WantTextInput && !F::Menu.InKeybind; // allow in menu
bKey = bShouldUse && bKey;
if (tBind.Not)
bKey = !bKey;
switch (tBind.Info)
{
case 0: tBind.Active = bKey; break;
case 0:
if (tBind.Not)
bKey = !bKey;
tBind.Active = bKey;
break;
case 1:
case 2: if (bKey) tBind.Active = !tBind.Active;
case 2:
if (bKey)
tBind.Active = !tBind.Active;
}
break;
}
+1 -1
View File
@@ -1598,7 +1598,7 @@ namespace ImGui
int iKeyPressed = 0;
for (short iKey = 0; iKey < 255; iKey++)
{
if (U::KeyHandler.Pressed(iKey) && iKey != VK_LBUTTON)
if (U::KeyHandler.Pressed(iKey))
{
iKeyPressed = iKey;
break;