movie code cleanup
This commit is contained in:
parent
ab7225c955
commit
74f0cf4615
|
@ -9,7 +9,6 @@ namespace BizHawk.Client.Common
|
||||||
{
|
{
|
||||||
public class Bk2Controller : IMovieController
|
public class Bk2Controller : IMovieController
|
||||||
{
|
{
|
||||||
private readonly string _logKey = "";
|
|
||||||
private readonly WorkingDictionary<string, bool> _myBoolButtons = new WorkingDictionary<string, bool>();
|
private readonly WorkingDictionary<string, bool> _myBoolButtons = new WorkingDictionary<string, bool>();
|
||||||
private readonly WorkingDictionary<string, float> _myAxisControls = new WorkingDictionary<string, float>();
|
private readonly WorkingDictionary<string, float> _myAxisControls = new WorkingDictionary<string, float>();
|
||||||
|
|
||||||
|
@ -18,15 +17,19 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
public Bk2Controller(string key, ControllerDefinition definition) : this(definition)
|
public Bk2Controller(string key, ControllerDefinition definition) : this(definition)
|
||||||
{
|
{
|
||||||
_logKey = key;
|
if (!string.IsNullOrEmpty(key))
|
||||||
SetLogOverride();
|
{
|
||||||
|
var groups = key.Split(new[] { "#" }, StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
|
||||||
|
_type.ControlsFromLog = groups
|
||||||
|
.Select(group => group.Split(new[] { "|" }, StringSplitOptions.RemoveEmptyEntries).ToList())
|
||||||
|
.ToList();;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Bk2Controller(ControllerDefinition definition)
|
public Bk2Controller(ControllerDefinition definition)
|
||||||
{
|
{
|
||||||
_type = new Bk2ControllerDefinition(definition);
|
_type = new Bk2ControllerDefinition(definition);
|
||||||
SetLogOverride();
|
|
||||||
|
|
||||||
_controlsOrdered = Definition.ControlsOrdered
|
_controlsOrdered = Definition.ControlsOrdered
|
||||||
.SelectMany(c => c)
|
.SelectMany(c => c)
|
||||||
.Select(c => new ControlMap
|
.Select(c => new ControlMap
|
||||||
|
@ -145,19 +148,6 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private void SetLogOverride()
|
|
||||||
{
|
|
||||||
if (!string.IsNullOrEmpty(_logKey))
|
|
||||||
{
|
|
||||||
var groups = _logKey.Split(new[] { "#" }, StringSplitOptions.RemoveEmptyEntries);
|
|
||||||
var controls = groups
|
|
||||||
.Select(group => group.Split(new[] { "|" }, StringSplitOptions.RemoveEmptyEntries).ToList())
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
_type.ControlsFromLog = controls;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private class ControlMap
|
private class ControlMap
|
||||||
{
|
{
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
|
@ -8,17 +8,7 @@ namespace BizHawk.Client.Common
|
||||||
public new string this[string key]
|
public new string this[string key]
|
||||||
{
|
{
|
||||||
get => ContainsKey(key) ? base[key] : "";
|
get => ContainsKey(key) ? base[key] : "";
|
||||||
set
|
set => base[key] = value;
|
||||||
{
|
|
||||||
if (ContainsKey(key))
|
|
||||||
{
|
|
||||||
base[key] = value;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Add(key, value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
|
|
Loading…
Reference in New Issue