FullscreenUI: Fix binding immediately when activating with controller

This commit is contained in:
Connor McLaughlin 2021-02-08 00:57:56 +10:00
parent 4f75f2d266
commit 537f833658
1 changed files with 5 additions and 3 deletions

View File

@ -801,14 +801,15 @@ void BeginInputBinding(InputBindingType type, const std::string_view& section, c
{ {
if (hook.type == ControllerInterface::Hook::Type::Axis) if (hook.type == ControllerInterface::Hook::Type::Axis)
value.Format("Controller%d/+Axis%d", hook.controller_index, hook.button_or_axis_number); value.Format("Controller%d/+Axis%d", hook.controller_index, hook.button_or_axis_number);
else if (hook.type == ControllerInterface::Hook::Type::Button) else if (hook.type == ControllerInterface::Hook::Type::Button && std::get<float>(hook.value) > 0.0f)
value.Format("Controller%d/Button%d", hook.controller_index, hook.button_or_axis_number); value.Format("Controller%d/Button%d", hook.controller_index, hook.button_or_axis_number);
} }
break; break;
case InputBindingType::Rumble: case InputBindingType::Rumble:
{ {
value.Format("Controller%d", hook.controller_index); if (hook.type == ControllerInterface::Hook::Type::Button && std::get<float>(hook.value) > 0.0f)
value.Format("Controller%d", hook.controller_index);
} }
break; break;
@ -2589,7 +2590,8 @@ HostDisplayTexture* GetCoverForCurrentGame()
static ImDrawList* GetDrawListForOverlay() static ImDrawList* GetDrawListForOverlay()
{ {
// If we're in the landing page, draw the OSD over the windows (since it covers it) // If we're in the landing page, draw the OSD over the windows (since it covers it)
return (s_current_main_window != MainWindowType::None) ? ImGui::GetForegroundDrawList() : ImGui::GetBackgroundDrawList(); return (s_current_main_window != MainWindowType::None) ? ImGui::GetForegroundDrawList() :
ImGui::GetBackgroundDrawList();
} }
void DrawStatsOverlay() void DrawStatsOverlay()