Pass Left+Right feedback bind through until PrepareHapticsForHost
This commit is contained in:
parent
d254c8121d
commit
d3733c1fda
|
@ -110,7 +110,10 @@ namespace BizHawk.Client.Common
|
||||||
{
|
{
|
||||||
if (_haptics.TryGetValue(kvp.Key, out var strength))
|
if (_haptics.TryGetValue(kvp.Key, out var strength))
|
||||||
{
|
{
|
||||||
finalHostController.SetHapticChannelStrength(kvp.Value.GamepadPrefix + kvp.Value.Channel, (int) ((double) strength * kvp.Value.Prescale));
|
foreach (var hostChannel in kvp.Value.Channels!.Split('+'))
|
||||||
|
{
|
||||||
|
finalHostController.SetHapticChannelStrength(kvp.Value.GamepadPrefix + hostChannel, (int) ((double) strength * kvp.Value.Prescale));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,8 @@ namespace BizHawk.Client.Common
|
||||||
{
|
{
|
||||||
public struct FeedbackBind
|
public struct FeedbackBind
|
||||||
{
|
{
|
||||||
public string? Channel;
|
/// <remarks>may be a '+'-delimited list (e.g. <c>"Left+Right"</c>), which will be passed through the input pipeline to <see cref="Controller.PrepareHapticsForHost"/></remarks>
|
||||||
|
public string? Channels;
|
||||||
|
|
||||||
/// <remarks>"X# "/"J# " (with the trailing space)</remarks>
|
/// <remarks>"X# "/"J# " (with the trailing space)</remarks>
|
||||||
public string? GamepadPrefix;
|
public string? GamepadPrefix;
|
||||||
|
@ -16,10 +17,10 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
public float Prescale;
|
public float Prescale;
|
||||||
|
|
||||||
public FeedbackBind(string prefix, string channel, float prescale)
|
public FeedbackBind(string prefix, string channels, float prescale)
|
||||||
{
|
{
|
||||||
GamepadPrefix = prefix;
|
GamepadPrefix = prefix;
|
||||||
Channel = channel;
|
Channels = channels;
|
||||||
Prescale = prescale;
|
Prescale = prescale;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
public FeedbackBindControl(string vChannel, FeedbackBind existingBind, IHostInputAdapter hostInputAdapter)
|
public FeedbackBindControl(string vChannel, FeedbackBind existingBind, IHostInputAdapter hostInputAdapter)
|
||||||
{
|
{
|
||||||
BoundChannels = existingBind.Channel ?? string.Empty;
|
BoundChannels = existingBind.Channels ?? string.Empty;
|
||||||
BoundGamepadPrefix = existingBind.GamepadPrefix ?? string.Empty;
|
BoundGamepadPrefix = existingBind.GamepadPrefix ?? string.Empty;
|
||||||
Prescale = existingBind.IsZeroed ? 1.0f : existingBind.Prescale;
|
Prescale = existingBind.IsZeroed ? 1.0f : existingBind.Prescale;
|
||||||
VChannelName = vChannel;
|
VChannelName = vChannel;
|
||||||
|
|
|
@ -36,10 +36,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
foreach (var c in _flpMain.Controls.OfType<FeedbackBindControl>())
|
foreach (var c in _flpMain.Controls.OfType<FeedbackBindControl>())
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(c.BoundGamepadPrefix)) continue;
|
if (string.IsNullOrEmpty(c.BoundGamepadPrefix)) continue;
|
||||||
foreach (var channel in c.BoundChannels.Split('+'))
|
saveTo[c.VChannelName] = new(c.BoundGamepadPrefix, c.BoundChannels, c.Prescale);
|
||||||
{
|
|
||||||
saveTo[c.VChannelName] = new(c.BoundGamepadPrefix, channel, c.Prescale);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue