Skip to content

Commit

Permalink
Change menu toggle key behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
TheIndra55 committed Apr 3, 2022
1 parent 14c3448 commit 0b8ccd8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
11 changes: 4 additions & 7 deletions Hooking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -712,14 +712,11 @@ LRESULT hooked_RegularWndProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)

if (msg == WM_KEYUP && wparam == VK_F8)
{
// set menu focus
Hooking::GetInstance().GetMenu()->SetFocus(!Hooking::GetInstance().GetMenu()->IsFocus());
auto focus = menu->IsFocus();

// show menu if hidden
if (!menu->IsVisible())
{
menu->SetVisibility(true);
}
// set menu focus
menu->SetFocus(!focus);
menu->SetVisibility(!focus);

// disable game input
#if TRAE
Expand Down
6 changes: 6 additions & 0 deletions Menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,12 @@ void Menu::Process(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
if (msg == WM_KEYUP && wparam == VK_F7)
{
m_visible = !m_visible;

// if menu is focussed and being hidden also stop focus
if (m_focus && !m_visible)
{
m_focus = false;
}
}

if (msg == WM_KEYUP && wparam == VK_F5)
Expand Down

0 comments on commit 0b8ccd8

Please sign in to comment.