diff --git a/src/engine/sys_mainwind.cpp b/src/engine/sys_mainwind.cpp index 37b7d0f7..65c01f41 100644 --- a/src/engine/sys_mainwind.cpp +++ b/src/engine/sys_mainwind.cpp @@ -30,8 +30,18 @@ void CGame::PlayStartupVideos(void) //----------------------------------------------------------------------------- LRESULT CGame::WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { - if (!ImguiSystem()->IsInitialized()) - return CGame__WindowProc(hWnd, uMsg, wParam, lParam); + if (ImguiSystem()->IsInitialized()) + ImguiWindowProc(hWnd, uMsg, wParam, lParam); + + return CGame__WindowProc(hWnd, uMsg, wParam, lParam); +} + +//----------------------------------------------------------------------------- +// Purpose: imgui windows procedure +//----------------------------------------------------------------------------- +LRESULT CGame::ImguiWindowProc(HWND hWnd, UINT& uMsg, WPARAM wParam, LPARAM lParam) +{ + LRESULT hr = NULL; if (uMsg == WM_KEYDOWN || uMsg == WM_SYSKEYDOWN) { @@ -53,7 +63,7 @@ LRESULT CGame::WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) if (g_Console.IsActivated() || g_Browser.IsActivated()) {////////////////////////////////////////////////////////////////////////////// g_bBlockInput = true; - ImguiSystem()->MessageHandler(hWnd, uMsg, wParam, lParam); + hr = ImguiSystem()->MessageHandler(hWnd, uMsg, wParam, lParam); switch (uMsg) { @@ -75,7 +85,7 @@ LRESULT CGame::WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) g_bBlockInput = false; } - return CGame__WindowProc(hWnd, uMsg, wParam, lParam); + return hr; } //----------------------------------------------------------------------------- diff --git a/src/engine/sys_mainwind.h b/src/engine/sys_mainwind.h index 189c5761..64216f7b 100644 --- a/src/engine/sys_mainwind.h +++ b/src/engine/sys_mainwind.h @@ -18,8 +18,9 @@ class CGame { public: static void PlayStartupVideos(void); - static LRESULT WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); + static LRESULT WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); + static LRESULT ImguiWindowProc(HWND hWnd, UINT& uMsg, WPARAM wParam, LPARAM lParam); inline HWND GetWindow() const { return m_hWindow; } void GetWindowRect(int* const x, int* const y, int* const w, int* const h) const;