diff --git a/assets/config_menu/general.rml b/assets/config_menu/general.rml index 93c8e74..b32f80d 100644 --- a/assets/config_menu/general.rml +++ b/assets/config_menu/general.rml @@ -92,6 +92,7 @@ /> +
+ Applies a deadzone to joystick inputs. +
+
Turns on autosaving and prevents owl saves from being deleted on load. Autosaves act as owl saves and take up the same slot as they do.
diff --git a/include/recomp_input.h b/include/recomp_input.h
index 44946e9..b95d53e 100644
--- a/include/recomp_input.h
+++ b/include/recomp_input.h
@@ -129,10 +129,10 @@ namespace recomp {
// Gyro and mouse sensitivities range from 0 to 100.
int get_gyro_sensitivity();
int get_mouse_sensitivity();
- float get_joystick_deadzone();
+ int get_joystick_deadzone();
void set_gyro_sensitivity(int strength);
void set_mouse_sensitivity(int strength);
- void set_joystick_deadzone(float value);
+ void set_joystick_deadzone(int strength);
enum class TargetingMode {
Switch,
diff --git a/src/game/config.cpp b/src/game/config.cpp
index b6d5a07..3216f1f 100644
--- a/src/game/config.cpp
+++ b/src/game/config.cpp
@@ -175,7 +175,7 @@ void set_general_settings_from_json(const nlohmann::json& config_json) {
recomp::set_rumble_strength(from_or_default(config_json, "rumble_strength", 25));
recomp::set_gyro_sensitivity(from_or_default(config_json, "gyro_sensitivity", 50));
recomp::set_mouse_sensitivity(from_or_default(config_json, "mouse_sensitivity", is_steam_deck ? 50 : 0));
- recomp::set_joystick_deadzone(from_or_default(config_json, "joystick_deadzone", 0.0f));
+ recomp::set_joystick_deadzone(from_or_default(config_json, "joystick_deadzone", 5));
recomp::set_autosave_mode(from_or_default(config_json, "autosave_mode", recomp::AutosaveMode::On));
recomp::set_debug_mode_enabled(from_or_default(config_json, "debug_mode", false));
}
diff --git a/src/ui/ui_config.cpp b/src/ui/ui_config.cpp
index 35eff4c..d8d20a4 100644
--- a/src/ui/ui_config.cpp
+++ b/src/ui/ui_config.cpp
@@ -274,7 +274,7 @@ struct ControlOptionsContext {
int rumble_strength; // 0 to 100
int gyro_sensitivity; // 0 to 100
int mouse_sensitivity; // 0 to 100
- float joystick_deadzone;
+ int joystick_deadzone; // 0 to 100
recomp::TargetingMode targeting_mode;
recomp::BackgroundInputMode background_input_mode;
recomp::AutosaveMode autosave_mode;
@@ -301,7 +301,7 @@ int recomp::get_mouse_sensitivity() {
return control_options_context.mouse_sensitivity;
}
-float recomp::get_joystick_deadzone() {
+int recomp::get_joystick_deadzone() {
return control_options_context.joystick_deadzone;
}
@@ -319,9 +319,9 @@ void recomp::set_mouse_sensitivity(int sensitivity) {
}
}
-void recomp::set_joystick_deadzone(float value) {
- control_options_context.joystick_deadzone = value;
- if(general_model_handle) {
+void recomp::set_joystick_deadzone(int deadzone) {
+ control_options_context.joystick_deadzone = deadzone;
+ if (general_model_handle) {
general_model_handle.DirtyVariable("joystick_deadzone");
}
}