diff --git a/BizHawk.MultiClient/movie/Movie.cs b/BizHawk.MultiClient/movie/Movie.cs index 6d423db5e4..703b4af97f 100644 --- a/BizHawk.MultiClient/movie/Movie.cs +++ b/BizHawk.MultiClient/movie/Movie.cs @@ -335,6 +335,7 @@ namespace BizHawk.MultiClient while (frame < Log.Length()) { // TODO: Correct mnemonics, using Log.GetFrame(frame))? + break; } lastLog = frame; } diff --git a/BizHawk.MultiClient/movie/MovieImport.cs b/BizHawk.MultiClient/movie/MovieImport.cs index a62e4ebbe9..2e8ba5e2ea 100644 --- a/BizHawk.MultiClient/movie/MovieImport.cs +++ b/BizHawk.MultiClient/movie/MovieImport.cs @@ -71,6 +71,25 @@ namespace BizHawk.MultiClient return str; } + private static bool AddSubtitle(ref Movie m, string subtitleStr) + { + if (subtitleStr.Length == 0) + return false; + Subtitle s = new Subtitle(); + int x = subtitleStr.IndexOf(' '); + if (x <= 0) + return false; + // Remove the "subtitle" header from the string. + string sub = subtitleStr.Substring(x + 1, subtitleStr.Length - x - 1); + x = sub.IndexOf(' '); + if (x <= 0) + return false; + // The frame and message are separated by a space. + string frame = sub.Substring(0, x); + string message = sub.Substring(x + 1, sub.Length - x - 1); + m.Subtitles.AddSubtitle("subtitle " + frame + " 0 0 200 16777215 " + message); + return true; + } private static Movie ImportText(string path, out string errorMsg, string emulator) { @@ -130,7 +149,7 @@ namespace BizHawk.MultiClient } else if (str.StartsWith("subtitle") || str.StartsWith("sub")) { - m.Subtitles.AddSubtitle(str); + AddSubtitle(ref m, str); } else if (str[0] == '|') { diff --git a/BizHawk.MultiClient/movie/SubtitleList.cs b/BizHawk.MultiClient/movie/SubtitleList.cs index 52e72d0152..2912dfdd89 100644 --- a/BizHawk.MultiClient/movie/SubtitleList.cs +++ b/BizHawk.MultiClient/movie/SubtitleList.cs @@ -136,9 +136,7 @@ namespace BizHawk.MultiClient } catch { - s.Message = str; //Assume it is a FCEUX subtitle - subs.Add(s); - return true; + return false; } x = str.IndexOf(' ');