Disabled InputCommand processing while you fiddle with editor UI elements
This commit is contained in:
@@ -45,7 +45,7 @@ void InputProxy::Update(double dt)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputProxy::Process()
|
void InputProxy::Process(bool suppressNewEvents /*= false*/)
|
||||||
{
|
{
|
||||||
for (auto& pair : m_CommandHandlers) {
|
for (auto& pair : m_CommandHandlers) {
|
||||||
const std::string& command = pair.first;
|
const std::string& command = pair.first;
|
||||||
@@ -62,8 +62,10 @@ void InputProxy::Process()
|
|||||||
e.PlayerID = -1;
|
e.PlayerID = -1;
|
||||||
e.Command = command;
|
e.Command = command;
|
||||||
e.Value = currentValue;
|
e.Value = currentValue;
|
||||||
m_EventBroker->Publish(e);
|
if (!suppressNewEvents || e.Value == 0) {
|
||||||
//LOG_DEBUG("Input: Published command %s=%f for player %i", e.Command.c_str(), e.Value, e.PlayerID);
|
m_EventBroker->Publish(e);
|
||||||
|
LOG_DEBUG("Input: Published command %s=%f for player %i", e.Command.c_str(), e.Value, e.PlayerID);
|
||||||
|
}
|
||||||
m_LastCommandValues[command] = currentValue;
|
m_LastCommandValues[command] = currentValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -78,8 +80,10 @@ void InputProxy::Process()
|
|||||||
e.Value += value;
|
e.Value += value;
|
||||||
}
|
}
|
||||||
//e.Value = std::max(-1.f, std::min(e.Value, 1.f));
|
//e.Value = std::max(-1.f, std::min(e.Value, 1.f));
|
||||||
m_EventBroker->Publish(e);
|
if (!suppressNewEvents || e.Value == 0) {
|
||||||
//LOG_DEBUG("Input: Published command %s=%f for player %i", e.Command.c_str(), e.Value, e.PlayerID);
|
m_EventBroker->Publish(e);
|
||||||
|
LOG_DEBUG("Input: Published command %s=%f for player %i", e.Command.c_str(), e.Value, e.PlayerID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
m_CommandQueue.clear();
|
m_CommandQueue.clear();
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -218,7 +218,7 @@ void Game::Tick()
|
|||||||
PerformanceTimer::StartTimerAndStopPrevious("InputProxy");
|
PerformanceTimer::StartTimerAndStopPrevious("InputProxy");
|
||||||
m_InputProxy->Update(dt);
|
m_InputProxy->Update(dt);
|
||||||
m_EventBroker->Swap();
|
m_EventBroker->Swap();
|
||||||
m_InputProxy->Process();
|
m_InputProxy->Process(ImGui::GetIO().WantCaptureKeyboard || ImGui::GetIO().WantCaptureMouse);
|
||||||
m_EventBroker->Swap();
|
m_EventBroker->Swap();
|
||||||
|
|
||||||
PerformanceTimer::StartTimerAndStopPrevious("SoundManager");
|
PerformanceTimer::StartTimerAndStopPrevious("SoundManager");
|
||||||
|
|||||||
Reference in New Issue
Block a user