Use `int?` in `IJoypadApi.SetAnalog` to match `Set`

This commit is contained in:
YoshiRulz 2022-02-04 03:38:31 +10:00
parent d3e439982b
commit e621b878b8
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
3 changed files with 5 additions and 5 deletions

View File

@ -89,12 +89,12 @@ namespace BizHawk.Client.Common
}
}
public void SetAnalog(IReadOnlyDictionary<string, int?> controls, object controller = null)
public void SetAnalog(IReadOnlyDictionary<string, int?> controls, int? controller = null)
{
foreach (var (k, v) in controls) SetAnalog(k, v, controller);
}
public void SetAnalog(string control, int? value = null, object controller = null)
public void SetAnalog(string control, int? value = null, int? controller = null)
{
try
{

View File

@ -10,7 +10,7 @@ namespace BizHawk.Client.Common
void SetFromMnemonicStr(string inputLogEntry);
void Set(IReadOnlyDictionary<string, bool> buttons, int? controller = null);
void Set(string button, bool? state = null, int? controller = null);
void SetAnalog(IReadOnlyDictionary<string, int?> controls, object controller = null);
void SetAnalog(string control, int? value = null, object controller = null);
void SetAnalog(IReadOnlyDictionary<string, int?> controls, int? controller = null);
void SetAnalog(string control, int? value = null, int? controller = null);
}
}

View File

@ -43,7 +43,7 @@ namespace BizHawk.Client.Common
[LuaMethodExample("joypad.setanalog( { [ \"Tilt X\" ] = -63, [ \"Tilt Y\" ] = 127 } );")]
[LuaMethod("setanalog", "sets the given analog controls to their provided values for the current frame. Note that unlike set() there is only the logic of overriding with the given value.")]
public void SetAnalog(LuaTable controls, object controller = null)
public void SetAnalog(LuaTable controls, int? controller = null)
{
var dict = new Dictionary<string, int?>();
foreach (var (k, v) in _th.EnumerateEntries<object, object>(controls))