From b4ca2f9de8c23056c274c92693ed6f3a3af94bff Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Sat, 7 May 2022 22:29:31 +1000 Subject: [PATCH] Increase precision when tweaking axis sens./deadzone (resolves #3038) not sure how you trigger `LargeChange` but I set a value anyway --- .../AnalogBindControl.Designer.cs | 20 +++++++++++-------- .../ControllerConfig/AnalogBindControl.cs | 12 +++++------ 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindControl.Designer.cs b/src/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindControl.Designer.cs index d1d6e6bf89..40bbcab808 100644 --- a/src/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindControl.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindControl.Designer.cs @@ -59,13 +59,13 @@ // // trackBarSensitivity // - this.trackBarSensitivity.LargeChange = 20; + this.trackBarSensitivity.LargeChange = 4; this.trackBarSensitivity.Location = new System.Drawing.Point(267, 21); - this.trackBarSensitivity.Maximum = 20; - this.trackBarSensitivity.Minimum = -20; + this.trackBarSensitivity.Maximum = 40; + this.trackBarSensitivity.Minimum = -40; this.trackBarSensitivity.Name = "trackBarSensitivity"; - this.trackBarSensitivity.Size = new System.Drawing.Size(104, 45); - this.trackBarSensitivity.SmallChange = 10; + this.trackBarSensitivity.Size = new System.Drawing.Size(160, 45); + this.trackBarSensitivity.SmallChange = 1; this.trackBarSensitivity.TabIndex = 2; this.trackBarSensitivity.TickFrequency = 10; this.trackBarSensitivity.ValueChanged += new System.EventHandler(this.TrackBarSensitivity_ValueChanged); @@ -92,11 +92,15 @@ // // trackBarDeadzone // + this.trackBarDeadzone.LargeChange = 5; this.trackBarDeadzone.Location = new System.Drawing.Point(267, 51); + this.trackBarDeadzone.Maximum = 25; + this.trackBarDeadzone.Minimum = 0; this.trackBarDeadzone.Name = "trackBarDeadzone"; - this.trackBarDeadzone.Size = new System.Drawing.Size(104, 45); + this.trackBarDeadzone.Size = new System.Drawing.Size(160, 45); + this.trackBarDeadzone.SmallChange = 1; this.trackBarDeadzone.TabIndex = 5; - this.trackBarDeadzone.TickFrequency = 2; + this.trackBarDeadzone.TickFrequency = 5; this.trackBarDeadzone.ValueChanged += new System.EventHandler(this.TrackBarDeadzone_ValueChanged); // // labelDeadzone @@ -139,7 +143,7 @@ this.Controls.Add(this.labelButtonName); this.Controls.Add(this.textBox1); this.Name = "AnalogBindControl"; - this.Size = new System.Drawing.Size(378, 99); + this.Size = new System.Drawing.Size(434, 99); ((System.ComponentModel.ISupportInitialize)(this.trackBarSensitivity)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.trackBarDeadzone)).EndInit(); this.ResumeLayout(false); diff --git a/src/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindControl.cs b/src/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindControl.cs index a874ace0cd..d0d200456d 100644 --- a/src/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindControl.cs +++ b/src/BizHawk.Client.EmuHawk/config/ControllerConfig/AnalogBindControl.cs @@ -18,8 +18,8 @@ namespace BizHawk.Client.EmuHawk _bind = bind; ButtonName = buttonName; labelButtonName.Text = buttonName; - trackBarSensitivity.Value = (int)(bind.Mult * 10.0f); - trackBarDeadzone.Value = (int)(bind.Deadzone * 20.0f); + trackBarSensitivity.Value = (int) Math.Round(bind.Mult * 20.0); + trackBarDeadzone.Value = (int) Math.Round(bind.Deadzone * 50.0); TrackBarSensitivity_ValueChanged(null, null); TrackBarDeadzone_ValueChanged(null, null); textBox1.Text = bind.Value; @@ -65,14 +65,14 @@ namespace BizHawk.Client.EmuHawk private void TrackBarSensitivity_ValueChanged(object sender, EventArgs e) { - _bind.Mult = trackBarSensitivity.Value / 10.0f; - labelSensitivity.Text = $"Sensitivity: {Bind.Mult * 100}%"; + _bind.Mult = trackBarSensitivity.Value / 20.0f; + labelSensitivity.Text = $"Sensitivity: {_bind.Mult:P0}"; } private void TrackBarDeadzone_ValueChanged(object sender, EventArgs e) { - _bind.Deadzone = trackBarDeadzone.Value / 20.0f; - labelDeadzone.Text = $"Deadzone: {Bind.Deadzone * 100}%"; + _bind.Deadzone = trackBarDeadzone.Value / 50.0f; + labelDeadzone.Text = $"Deadzone: {_bind.Deadzone:P0}"; } private void ButtonFlip_Click(object sender, EventArgs e)