Skip to content

Commit 924c206

Browse files
committed
InputManager: add sensitivity bypass & deadzone options
1 parent 9478197 commit 924c206

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

src/input_manager.cpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,9 @@ class InputManager
242242
uint32_t switch_previous;
243243
uint32_t switch_overlay;
244244

245+
// user settings
246+
bool BypassGameSensitivity = false;
247+
245248
public:
246249
~InputManager()
247250
{
@@ -510,7 +513,7 @@ class InputManager
510513
continue;
511514

512515
volumes[i] = vol;
513-
if (i == 0)
516+
if (i == 0 && !BypassGameSensitivity)
514517
{
515518
int cur = ceil(volumes[i].currentValue * 127.0f);
516519
int prev = ceil(volumes[i].previousValue * 127.0f);
@@ -843,6 +846,8 @@ class InputManager
843846
ImGuiWindowFlags_NoMove |
844847
ImGuiWindowFlags_AlwaysAutoResize))
845848
{
849+
ImGui::Text("Note: settings here currently aren't saved, fix soon.");
850+
846851
if (ImGui::BeginTable("Controllers", 2, ImGuiTableFlags_Borders))
847852
{
848853
ImGui::TableSetupColumn("Detected Controllers");
@@ -1075,6 +1080,14 @@ class InputManager
10751080
}
10761081
}
10771082

1083+
int deadzonePercent = Settings::SteeringDeadZone * 100.f;
1084+
if (ImGui::SliderInt("Steering Deadzone", &deadzonePercent, 5, 20, "%d%%"))
1085+
Settings::SteeringDeadZone = float(deadzonePercent) / 100.f;
1086+
1087+
ImGui::Checkbox("Bypass Sensitivity", &BypassGameSensitivity);
1088+
if(ImGui::IsItemHovered())
1089+
ImGui::SetTooltip("Passes steering input to the game directly, allows for more sensitive controls");
1090+
10781091
if (ImGui::Button("Return to game"))
10791092
dialogOpen = false;
10801093
ImGui::SameLine();
@@ -1088,6 +1101,8 @@ class InputManager
10881101
}
10891102
else
10901103
{
1104+
Settings::SteeringDeadZone = 0.2f;
1105+
BypassGameSensitivity = false;
10911106
setupDefaultBindings();
10921107
if (auto* controller = primary_gamepad())
10931108
setupGamepad(controller);

src/overlay/overlay.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ class GlobalsWindow : public OverlayWindow
5454
if (ImGui::Button("Open Draw Distance Debugger"))
5555
Game::DrawDistanceDebugEnabled = true;
5656

57+
#ifdef _DEBUG
5758
if (ImGui::Button("Open Binding Dialog"))
5859
Overlay::IsBindingDialogActive = true;
60+
#endif
5961

6062
ImGui::Separator();
6163
ImGui::Text("Gameplay");

0 commit comments

Comments
 (0)