mirror of
https://github.com/kevinporetti/UnrealImGui.git
synced 2025-01-18 00:10:32 +00:00
Removed from the context proxy unused IsMouseHoveringAnyWindow property and moved code for WantsMouseCapture to be updated in the same scope as other context information.
This commit is contained in:
parent
5a7c81b4e3
commit
62a739ac9f
@ -134,14 +134,16 @@ void FImGuiContextProxy::Tick(float DeltaSeconds)
|
||||
EndFrame();
|
||||
}
|
||||
|
||||
// Update context information (some data, like mouse cursor, may be cleaned in new frame, so we should collect it
|
||||
// beforehand).
|
||||
// Update context information (some data need to be collected before starting a new frame while some other data
|
||||
// may need to be collected after).
|
||||
bHasActiveItem = ImGui::IsAnyItemActive();
|
||||
bIsMouseHoveringAnyWindow = ImGui::IsWindowHovered(ImGuiHoveredFlags_AnyWindow);
|
||||
MouseCursor = ImGuiInterops::ToSlateMouseCursor(ImGui::GetMouseCursor());
|
||||
|
||||
// Begin a new frame and set the context back to a state in which it allows to draw controls.
|
||||
BeginFrame(DeltaSeconds);
|
||||
|
||||
// Update remaining context information.
|
||||
bWantsMouseCapture = ImGui::GetIO().WantCaptureMouse;
|
||||
}
|
||||
}
|
||||
|
||||
@ -173,8 +175,6 @@ void FImGuiContextProxy::BeginFrame(float DeltaTime)
|
||||
|
||||
ImGui::NewFrame();
|
||||
|
||||
bWantsMouseCapture = IO.WantCaptureMouse;
|
||||
|
||||
bIsFrameStarted = true;
|
||||
bIsDrawEarlyDebugCalled = false;
|
||||
bIsDrawDebugCalled = false;
|
||||
|
@ -50,10 +50,7 @@ public:
|
||||
// Whether this context has an active item (read once per frame during context update).
|
||||
bool HasActiveItem() const { return bHasActiveItem; }
|
||||
|
||||
// Whether this context has mouse hovering any window (read once per frame during context update).
|
||||
bool IsMouseHoveringAnyWindow() const { return bIsMouseHoveringAnyWindow; }
|
||||
|
||||
// Whether ImGui will use the mouse inputs.
|
||||
// Whether ImGui will use the mouse inputs (read once per frame during context update).
|
||||
bool WantsMouseCapture() const { return bWantsMouseCapture; }
|
||||
|
||||
// Cursor type desired by this context (updated once per frame during context update).
|
||||
@ -93,14 +90,12 @@ private:
|
||||
|
||||
EMouseCursor::Type MouseCursor = EMouseCursor::None;
|
||||
bool bHasActiveItem = false;
|
||||
bool bIsMouseHoveringAnyWindow = false;
|
||||
bool bWantsMouseCapture = false;
|
||||
|
||||
bool bIsFrameStarted = false;
|
||||
bool bIsDrawEarlyDebugCalled = false;
|
||||
bool bIsDrawDebugCalled = false;
|
||||
|
||||
bool bWantsMouseCapture = false;
|
||||
|
||||
FImGuiInputState InputState;
|
||||
|
||||
TArray<FImGuiDrawList> DrawLists;
|
||||
|
Loading…
Reference in New Issue
Block a user