mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
ImguiSystem: add method for checking if we have an active surface
This commit is contained in:
parent
02a0088deb
commit
fd04eef1ce
@ -60,7 +60,7 @@ LRESULT CGame::ImguiWindowProc(HWND hWnd, UINT& uMsg, WPARAM wParam, LPARAM lPar
|
||||
}
|
||||
}
|
||||
|
||||
if (g_Console.IsActivated() || g_Browser.IsActivated())
|
||||
if (ImguiSystem()->IsSurfaceActive())
|
||||
{//////////////////////////////////////////////////////////////////////////////
|
||||
hr = ImguiSystem()->MessageHandler(hWnd, uMsg, wParam, lParam);
|
||||
|
||||
|
@ -173,6 +173,20 @@ void CImguiSystem::RenderFrame()
|
||||
ImGui_ImplDX11_RenderDrawData(&m_snapshotData.DrawData);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Checks whether we have an active surface.
|
||||
//-----------------------------------------------------------------------------
|
||||
bool CImguiSystem::IsSurfaceActive() const
|
||||
{
|
||||
FOR_EACH_VEC(m_surfaceList, i)
|
||||
{
|
||||
if (m_surfaceList[i]->IsActivated())
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Window procedure handler.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -24,6 +24,8 @@ public:
|
||||
void SampleFrame();
|
||||
void RenderFrame();
|
||||
|
||||
bool IsSurfaceActive() const;
|
||||
|
||||
// statics:
|
||||
static LRESULT MessageHandler(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
|
@ -301,13 +301,13 @@ bool LoadTextureBuffer(unsigned char* buffer, int len, ID3D11ShaderResourceView*
|
||||
|
||||
void ResetInput()
|
||||
{
|
||||
g_pInputSystem->EnableInput( // Enables the input system when both are not drawn.
|
||||
!g_Browser.IsActivated() && !g_Console.IsActivated());
|
||||
// Enables the input system when no imgui surface is drawn.
|
||||
g_pInputSystem->EnableInput(!ImguiSystem()->IsSurfaceActive());
|
||||
}
|
||||
|
||||
bool PanelsVisible()
|
||||
{
|
||||
if (g_Browser.IsActivated() || g_Console.IsActivated())
|
||||
if (ImguiSystem()->IsSurfaceActive())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user