From 8001a49afd1730817d6df252ca1ae50e67408fb8 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 21 Jun 2014 18:25:16 +0000 Subject: [PATCH] Bk2 - tweaks to input log and input diplay logic --- .../movie/bk2/Bk2ControllerAdapter.cs | 16 ++++++++++++---- .../movie/bk2/Bk2LogEntryGenerator.cs | 6 +++--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/BizHawk.Client.Common/movie/bk2/Bk2ControllerAdapter.cs b/BizHawk.Client.Common/movie/bk2/Bk2ControllerAdapter.cs index 85331203ec..a7a702f77f 100644 --- a/BizHawk.Client.Common/movie/bk2/Bk2ControllerAdapter.cs +++ b/BizHawk.Client.Common/movie/bk2/Bk2ControllerAdapter.cs @@ -141,11 +141,19 @@ namespace BizHawk.Client.Common } else if (def.FloatControls.Contains(buttons[i])) { - var temp = trimmed.Substring(iterator, 3); - var val = int.Parse(temp); + string temp; + try + { + temp = trimmed.Substring(iterator, 4); + var val = int.Parse(temp.Trim()); + MyFloatControls[buttons[i]] = val; + } + catch (Exception ex) + { + int zzz = 0; + } - MyFloatControls[buttons[i]] = val; - iterator += 4; + iterator += 5; floatIt++; } } diff --git a/BizHawk.Client.Common/movie/bk2/Bk2LogEntryGenerator.cs b/BizHawk.Client.Common/movie/bk2/Bk2LogEntryGenerator.cs index 68903a21e8..11d280df60 100644 --- a/BizHawk.Client.Common/movie/bk2/Bk2LogEntryGenerator.cs +++ b/BizHawk.Client.Common/movie/bk2/Bk2LogEntryGenerator.cs @@ -44,7 +44,7 @@ namespace BizHawk.Client.Common return GenerateLogEntry() .Replace(".", " ") .Replace("|", "") - .Replace("000,000", " "); + .Replace(" 0, 0,", " "); } public bool IsEmpty @@ -104,12 +104,12 @@ namespace BizHawk.Client.Common { if (createEmpty) { - sb.Append("000,"); + sb.Append(" 0,"); } else { var val = (int)_source.GetFloat(button); - sb.Append(val.ToString().PadLeft(3, '0')).Append(','); + sb.Append(val.ToString().PadLeft(4, ' ')).Append(','); } } else if (_source.Type.BoolButtons.Contains(button))