Allow fine controller sensitivity adjustments

The controller sensitivity slider advanced in steps of 0.5 and displayed
only whole numbers, hiding the selected fractional value.

Use 0.1 steps, matching the granularity of the earlier local controller
slider while retaining master's 1-10 sensitivity scale and speed mapping.
Add an optional decimal precision field to menu sliders and display one
decimal for controller look sensitivity. Other sliders retain their default
integer formatting; the renderer caps requested precision at six places.

Validation: the play build, targeted formatting and diff checks passed.
Temporary probes verified the controller menu's inherited slider definition,
its 1-10 bounds and 0.1 step, decimal precision, and preservation of fractional
sensitivity through settings sanitization. No permanent tests were added.
This commit is contained in:
awsms
2026-10-01 07:34:07 +02:00
parent 05e8075c59
commit e8d07d1a12
3 changed files with 7 additions and 3 deletions
+2
View File
@@ -99,6 +99,8 @@ pub struct MenuSlider {
#[serde(default)]
pub display_range: Option<[f32; 2]>,
#[serde(default)]
pub decimals: u8,
#[serde(default)]
pub suffix: String,
}
+2 -1
View File
@@ -440,7 +440,8 @@ pub(crate) fn update_script_menus(
let displayed = slider
.display_range
.map_or(value, |[min, max]| min + fraction * (max - min));
label.text_key = format!("{displayed:.0}{}", slider.suffix);
let decimals = usize::from(slider.decimals.min(6));
label.text_key = format!("{displayed:.decimals$}{}", slider.suffix);
label.rect.x += item.rect.w + 8.0;
label.rect.w = 36.0;
slider_parts.push(label);
+3 -2
View File
@@ -307,9 +307,10 @@
"slider": {
"min": 1,
"max": 10,
"step": 0.5,
"step": 0.1,
"display_range": null,
"suffix": ""
"suffix": "",
"decimals": 1
},
"name": "ui_pad_sensitivity"
}