Made debug camera detect UI focus properly
This commit is contained in:
@@ -14,9 +14,11 @@ public:
|
|||||||
|
|
||||||
virtual bool OnCommand(const Events::InputCommand& e) override
|
virtual bool OnCommand(const Events::InputCommand& e) override
|
||||||
{
|
{
|
||||||
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
|
|
||||||
if (e.Command == "PrimaryFire") {
|
if (e.Command == "PrimaryFire") {
|
||||||
if (e.Value > 0) {
|
if (e.Value > 0) {
|
||||||
if (!ImGui::IsMouseHoveringAnyWindow()) {
|
if (!io.WantCaptureMouse) {
|
||||||
LockMouse();
|
LockMouse();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -25,7 +27,7 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_MouseLocked || e.Value == 0) {
|
if (!io.WantCaptureKeyboard) {
|
||||||
if (e.Command == "Right") {
|
if (e.Command == "Right") {
|
||||||
float value = std::max(-1.f, std::min(e.Value, 1.f));
|
float value = std::max(-1.f, std::min(e.Value, 1.f));
|
||||||
m_Velocity.x = value;
|
m_Velocity.x = value;
|
||||||
|
|||||||
Reference in New Issue
Block a user