Bk2MnemonicConstants - pass in system id

This commit is contained in:
adelikat 2020-04-14 18:12:07 -05:00
parent c325286169
commit 27605f4828
4 changed files with 10 additions and 10 deletions

View File

@ -4,7 +4,7 @@ namespace BizHawk.Client.Common
{
internal static class Bk2AxisMnemonicConstants
{
public static string Lookup(string button)
public static string Lookup(string button, string systemId)
{
var key = button
.Replace("P1 ", "")
@ -13,9 +13,9 @@ namespace BizHawk.Client.Common
.Replace("P4 ", "")
.Replace("Key ", "");
if (SystemOverrides.ContainsKey(Global.Emulator.SystemId) && SystemOverrides[Global.Emulator.SystemId].ContainsKey(key))
if (SystemOverrides.ContainsKey(systemId) && SystemOverrides[systemId].ContainsKey(key))
{
return SystemOverrides[Global.Emulator.SystemId][key];
return SystemOverrides[systemId][key];
}
if (BaseMnemonicLookupTable.ContainsKey(key))

View File

@ -56,11 +56,11 @@ namespace BizHawk.Client.Common
{
if (_source.Definition.BoolButtons.Contains(button))
{
dict.Add(button, Bk2MnemonicConstants.Lookup(button).ToString());
dict.Add(button, Bk2MnemonicConstants.Lookup(button, Global.Emulator.SystemId).ToString());
}
else if (_source.Definition.AxisControls.Contains(button))
{
dict.Add(button, Bk2AxisMnemonicConstants.Lookup(button));
dict.Add(button, Bk2AxisMnemonicConstants.Lookup(button, Global.Emulator.SystemId));
}
}
}
@ -115,7 +115,7 @@ namespace BizHawk.Client.Common
}
else
{
sb.Append(_source.IsPressed(button) ? Bk2MnemonicConstants.Lookup(button) : forInputDisplay ? ' ' : '.');
sb.Append(_source.IsPressed(button) ? Bk2MnemonicConstants.Lookup(button, Global.Emulator.SystemId) : forInputDisplay ? ' ' : '.');
}
}
}

View File

@ -5,7 +5,7 @@ namespace BizHawk.Client.Common
{
internal static class Bk2MnemonicConstants
{
public static char Lookup(string button)
public static char Lookup(string button, string systemId)
{
var key = button.Replace("Key ", "");
if (key.StartsWith("P"))
@ -21,9 +21,9 @@ namespace BizHawk.Client.Common
}
if (SystemOverrides.ContainsKey(Global.Emulator.SystemId) && SystemOverrides[Global.Emulator.SystemId].ContainsKey(key))
if (SystemOverrides.ContainsKey(systemId) && SystemOverrides[systemId].ContainsKey(key))
{
return SystemOverrides[Global.Emulator.SystemId][key];
return SystemOverrides[systemId][key];
}
if (BaseMnemonicLookupTable.ContainsKey(key))

View File

@ -97,7 +97,7 @@ namespace BizHawk.Client.Common
if (adapter.Definition.BoolButtons.Contains(buttonName))
{
return adapter.IsPressed(buttonName)
? Bk2MnemonicConstants.Lookup(buttonName).ToString()
? Bk2MnemonicConstants.Lookup(buttonName, Global.Emulator.SystemId).ToString()
: "";
}