BizHawk/BizHawk.Client.Common/movie/bk2/Bk2FloatConstants.cs

61 lines
1.4 KiB
C#
Raw Normal View History

using System.Collections.Generic;
namespace BizHawk.Client.Common
{
public class Bk2FloatConstants
{
public string this[string button]
{
get
{
var key = button
2017-05-10 11:45:23 +00:00
.Replace("P1 ", "")
.Replace("P2 ", "")
.Replace("P3 ", "")
.Replace("P4 ", "")
.Replace("Key ", "");
2017-05-19 18:17:07 +00:00
if (_systemOverrides.ContainsKey(Global.Emulator.SystemId) && _systemOverrides[Global.Emulator.SystemId].ContainsKey(key))
{
2017-05-19 18:17:07 +00:00
return _systemOverrides[Global.Emulator.SystemId][key];
}
2017-05-19 18:17:07 +00:00
if (_baseMnemonicLookupTable.ContainsKey(key))
{
2017-05-19 18:17:07 +00:00
return _baseMnemonicLookupTable[key];
}
return button;
}
}
2017-05-19 18:17:07 +00:00
private readonly Dictionary<string, string> _baseMnemonicLookupTable = new Dictionary<string, string>
2017-05-17 16:53:42 +00:00
{
2017-05-19 18:17:07 +00:00
["Zapper X"] = "zapX",
["Zapper Y"] = "zapY",
["Paddle"] = "Pad",
["Pen"] = "Pen",
["Mouse X"] = "mX",
["Mouse Y"] = "mY",
["Lightgun X"] = "lX",
["Lightgun Y"] = "lY",
["X Axis"] = "aX",
["Y Axis"] = "aY",
["LStick X"] = "lsX",
["LStick Y"] = "lsY",
["RStick X"] = "rsX",
["RStick Y"] = "rsY",
["Disc Select"] = "Disc"
2017-05-17 16:53:42 +00:00
};
2017-05-19 18:17:07 +00:00
private readonly Dictionary<string, Dictionary<string, string>> _systemOverrides = new Dictionary<string, Dictionary<string, string>>
2017-05-17 16:53:42 +00:00
{
2017-05-19 18:17:07 +00:00
["A78"] = new Dictionary<string, string>
{
2017-05-19 18:17:07 +00:00
["VPos"] = "X",
["HPos"] = "Y"
}
2017-05-17 16:53:42 +00:00
};
}
}