-Subtitles seem to work perfectly now.

-Included System.Globalization in a using statement to be more consistent with the rest of the uses of System.
-Removed trailing whitespace while I was at it. I'm OCD and it deeply bothers me, so I'll remove it on all the files that I commit in the future. Can't imagine anyone would object.
This commit is contained in:
brandman211 2012-02-16 00:55:07 +00:00
parent 80d8b617a5
commit a6a81bb76a
1 changed files with 8 additions and 8 deletions

View File

@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Drawing; using System.Drawing;
@ -58,7 +59,7 @@ namespace BizHawk.MultiClient
/// </summary> /// </summary>
/// <param name="frame"></param> /// <param name="frame"></param>
/// <returns></returns> /// <returns></returns>
public string GetSubtitleMessage(int frame) public string GetSubtitleMessage(int frame)
{ {
if (subs.Count == 0) return ""; if (subs.Count == 0) return "";
@ -110,13 +111,13 @@ namespace BizHawk.MultiClient
//remove "subtitle" //remove "subtitle"
string str = subtitleStr.Substring(x + 1, subtitleStr.Length - x - 1); string str = subtitleStr.Substring(x + 1, subtitleStr.Length - x - 1);
x = str.IndexOf(' '); x = str.IndexOf(' ');
if (x <= 0) return false; if (x <= 0) return false;
string frame = str.Substring(0, x); string frame = str.Substring(0, x);
str = str.Substring(x + 1, str.Length - x - 1); str = str.Substring(x + 1, str.Length - x - 1);
try try
{ {
s.Frame = int.Parse(frame); s.Frame = int.Parse(frame);
@ -165,20 +166,19 @@ namespace BizHawk.MultiClient
return false; return false;
} }
//TODO: parse hex!
x = str.IndexOf(' '); x = str.IndexOf(' ');
if (x <= 0) return false; if (x <= 0) return false;
string Color = str.Substring(0, x); string Color = str.Substring(0, x);
str = str.Substring(x + 1, str.Length - x - 1); str = str.Substring(x + 1, str.Length - x - 1);
try try
{ {
s.Color = uint.Parse(Color, System.Globalization.NumberStyles.HexNumber); s.Color = uint.Parse(Color, NumberStyles.HexNumber);
} }
catch catch
{ {
return false; return false;
} }
s.Message = str; s.Message = str;
subs.Add(s); subs.Add(s);
@ -211,4 +211,4 @@ namespace BizHawk.MultiClient
} }
} }
} }
} }