Made debug camera detect UI focus properly

This commit is contained in:
2015-12-13 23:39:59 +01:00
parent 7bc492134d
commit b8620eac26
@@ -14,9 +14,11 @@ public:
virtual bool OnCommand(const Events::InputCommand& e) override
{
ImGuiIO& io = ImGui::GetIO();
if (e.Command == "PrimaryFire") {
if (e.Value > 0) {
if (!ImGui::IsMouseHoveringAnyWindow()) {
if (!io.WantCaptureMouse) {
LockMouse();
}
} else {
@@ -25,7 +27,7 @@ public:
return false;
}
if (m_MouseLocked || e.Value == 0) {
if (!io.WantCaptureKeyboard) {
if (e.Command == "Right") {
float value = std::max(-1.f, std::min(e.Value, 1.f));
m_Velocity.x = value;