/// <summary> /// バイナリデータより指定範囲のログを列挙します。 /// </summary> /// <param name="logData"></param> /// <param name="enc"></param> /// <returns></returns> public static IEnumerable<FFXIVLog> GetLogs(byte[] logData, Encoding enc, FFXIVProcess ff14) { var buf = logData .SkipWhile(a => a != 0x30) .ToArray(); var input = enc.GetString(TABConvertor.TabEscape(buf)); var matchs = regex.Matches(input); var strArray = regex.Split(input); for (var j = 1; j < strArray.Length; j++) { var strArray2 = strArray[j].Split(new char[] { ':' }, 2, StringSplitOptions.None); var strType = matchs[j - 1].Value.TrimEnd(new char[] { ':' }); var numType = int.Parse(strType, NumberStyles.AllowHexSpecifier); var strWho = strArray2[0].Replace("\0", "").Trim(); var strMes = strArray2[1].Replace("\0", ""); var item = new FFXIVLog(ff14, numType, strWho, strMes); yield return item; } }
private Color GetLogColor(FFXIVLog log) { switch (log.MessageType) { case FFXIVLog.FFXILogMessageType.TALK_SAY: return this.fontsettingfrm.SayColor; case FFXIVLog.FFXILogMessageType.TALK_TELL: return this.fontsettingfrm.TELLColor; case FFXIVLog.FFXILogMessageType.TALK_PARTY: return this.fontsettingfrm.PARTYColor; case FFXIVLog.FFXILogMessageType.TALK_LS1: return this.fontsettingfrm.LINKSHELL1Color; case FFXIVLog.FFXILogMessageType.TALK_LS2: return this.fontsettingfrm.LINKSHELL2Color; case FFXIVLog.FFXILogMessageType.TALK_LS3: return this.fontsettingfrm.LINKSHELL3Color; case FFXIVLog.FFXILogMessageType.TALK_LS4: return this.fontsettingfrm.LINKSHELL4Color; case FFXIVLog.FFXILogMessageType.TALK_LS5: return this.fontsettingfrm.LINKSHELL5Color; case FFXIVLog.FFXILogMessageType.TALK_LS6: return this.fontsettingfrm.LINKSHELL6Color; case FFXIVLog.FFXILogMessageType.TALK_LS7: return this.fontsettingfrm.LINKSHELL7Color; case FFXIVLog.FFXILogMessageType.TALK_LS8: return this.fontsettingfrm.LINKSHELL8Color; case FFXIVLog.FFXILogMessageType.TALK_TELL_SELF: return this.fontsettingfrm.TELLColor; case FFXIVLog.FFXILogMessageType.TALK_LS1_CURRENT: return this.fontsettingfrm.LINKSHELL1Color; case FFXIVLog.FFXILogMessageType.TALK_LS2_CURRENT: return this.fontsettingfrm.LINKSHELL2Color; case FFXIVLog.FFXILogMessageType.TALK_LS3_CURRENT: return this.fontsettingfrm.LINKSHELL3Color; case FFXIVLog.FFXILogMessageType.TALK_LS4_CURRENT: return this.fontsettingfrm.LINKSHELL4Color; case FFXIVLog.FFXILogMessageType.TALK_LS5_CURRENT: return this.fontsettingfrm.LINKSHELL5Color; case FFXIVLog.FFXILogMessageType.TALK_LS6_CURRENT: return this.fontsettingfrm.LINKSHELL6Color; case FFXIVLog.FFXILogMessageType.TALK_LS7_CURRENT: return this.fontsettingfrm.LINKSHELL7Color; case FFXIVLog.FFXILogMessageType.TALK_LS8_CURRENT: return this.fontsettingfrm.LINKSHELL8Color; case FFXIVLog.FFXILogMessageType.TALK_EMOTE: return this.fontsettingfrm.EmoteColor; } return this.fontsettingfrm.SayColor; }
private int GetLineCount(FFXIVLog[] LogList, int height, ref Point p) { Graphics g = Graphics.FromImage(new Bitmap(this.pictureBox1.Width - 20, this.pictureBox1.Height)); for (int i = LogList.Length - 1; i >= 0; i--) { string text = LogList[i].ToString(); text = this.tabjp.GetJapanese(text); Font font = this.GetFont(LogList[i]); p = this.DrawString(g, text, font, Brushes.Black, p, this.pictureBox1.Width - 20, font.Height, false); if (p.Y > height) { return (LogList.Length - i); } } return LogList.Length; }
private Font GetFont(FFXIVLog log) { switch (log.MessageType) { case FFXIVLog.FFXILogMessageType.TALK_SAY: return this.fontsettingfrm.FontSay; case FFXIVLog.FFXILogMessageType.TALK_TELL: return this.fontsettingfrm.FontTELL; case FFXIVLog.FFXILogMessageType.TALK_PARTY: return this.fontsettingfrm.FontPARTY; case FFXIVLog.FFXILogMessageType.TALK_LS1: return this.fontsettingfrm.FontLINKSHELL1; case FFXIVLog.FFXILogMessageType.TALK_LS2: return this.fontsettingfrm.FontLINKSHELL2; case FFXIVLog.FFXILogMessageType.TALK_LS3: return this.fontsettingfrm.FontLINKSHELL3; case FFXIVLog.FFXILogMessageType.TALK_LS4: return this.fontsettingfrm.FontLINKSHELL4; case FFXIVLog.FFXILogMessageType.TALK_LS5: return this.fontsettingfrm.FontLINKSHELL5; case FFXIVLog.FFXILogMessageType.TALK_LS6: return this.fontsettingfrm.FontLINKSHELL6; case FFXIVLog.FFXILogMessageType.TALK_LS7: return this.fontsettingfrm.FontLINKSHELL7; case FFXIVLog.FFXILogMessageType.TALK_LS8: return this.fontsettingfrm.FontLINKSHELL8; case FFXIVLog.FFXILogMessageType.TALK_TELL_SELF: return this.fontsettingfrm.FontTELL; case FFXIVLog.FFXILogMessageType.TALK_LS1_CURRENT: return this.fontsettingfrm.FontLINKSHELL1; case FFXIVLog.FFXILogMessageType.TALK_LS2_CURRENT: return this.fontsettingfrm.FontLINKSHELL2; case FFXIVLog.FFXILogMessageType.TALK_LS3_CURRENT: return this.fontsettingfrm.FontLINKSHELL3; case FFXIVLog.FFXILogMessageType.TALK_LS4_CURRENT: return this.fontsettingfrm.FontLINKSHELL4; case FFXIVLog.FFXILogMessageType.TALK_LS5_CURRENT: return this.fontsettingfrm.FontLINKSHELL5; case FFXIVLog.FFXILogMessageType.TALK_LS6_CURRENT: return this.fontsettingfrm.FontLINKSHELL6; case FFXIVLog.FFXILogMessageType.TALK_LS7_CURRENT: return this.fontsettingfrm.FontLINKSHELL7; case FFXIVLog.FFXILogMessageType.TALK_LS8_CURRENT: return this.fontsettingfrm.FontLINKSHELL8; case FFXIVLog.FFXILogMessageType.TALK_EMOTE: return this.fontsettingfrm.FontEmote; } return this.fontsettingfrm.FontSay; }
private bool GetEnableLog(FFXIVLog log) { switch (log.MessageType) { case FFXIVLog.FFXILogMessageType.TALK_SAY: return this.fontsettingfrm.SayEnable; case FFXIVLog.FFXILogMessageType.TALK_TELL: return this.fontsettingfrm.TELLEnable; case FFXIVLog.FFXILogMessageType.TALK_PARTY: return this.fontsettingfrm.PARTYEnable; case FFXIVLog.FFXILogMessageType.TALK_LS1: return this.fontsettingfrm.LINKSHELL1Enable; case FFXIVLog.FFXILogMessageType.TALK_LS2: return this.fontsettingfrm.LINKSHELL2Enable; case FFXIVLog.FFXILogMessageType.TALK_LS3: return this.fontsettingfrm.LINKSHELL3Enable; case FFXIVLog.FFXILogMessageType.TALK_LS4: return this.fontsettingfrm.LINKSHELL4Enable; case FFXIVLog.FFXILogMessageType.TALK_LS5: return this.fontsettingfrm.LINKSHELL5Enable; case FFXIVLog.FFXILogMessageType.TALK_LS6: return this.fontsettingfrm.LINKSHELL6Enable; case FFXIVLog.FFXILogMessageType.TALK_LS7: return this.fontsettingfrm.LINKSHELL7Enable; case FFXIVLog.FFXILogMessageType.TALK_LS8: return this.fontsettingfrm.LINKSHELL8Enable; case FFXIVLog.FFXILogMessageType.TALK_TELL_SELF: return this.fontsettingfrm.TELLEnable; case FFXIVLog.FFXILogMessageType.TALK_LS1_CURRENT: return this.fontsettingfrm.LINKSHELL1Enable; case FFXIVLog.FFXILogMessageType.TALK_LS2_CURRENT: return this.fontsettingfrm.LINKSHELL2Enable; case FFXIVLog.FFXILogMessageType.TALK_LS3_CURRENT: return this.fontsettingfrm.LINKSHELL3Enable; case FFXIVLog.FFXILogMessageType.TALK_LS4_CURRENT: return this.fontsettingfrm.LINKSHELL4Enable; case FFXIVLog.FFXILogMessageType.TALK_LS5_CURRENT: return this.fontsettingfrm.LINKSHELL5Enable; case FFXIVLog.FFXILogMessageType.TALK_LS6_CURRENT: return this.fontsettingfrm.LINKSHELL6Enable; case FFXIVLog.FFXILogMessageType.TALK_LS7_CURRENT: return this.fontsettingfrm.LINKSHELL7Enable; case FFXIVLog.FFXILogMessageType.TALK_LS8_CURRENT: return this.fontsettingfrm.LINKSHELL8Enable; case FFXIVLog.FFXILogMessageType.TALK_EMOTE: return this.fontsettingfrm.EmoteEnable; } return false; }
/// <summary> /// microdataをToFFXIVLogに変換します。 /// </summary> /// <param name="el"></param> /// <returns></returns> public static FFXIVLog ToFFXIVLogOld(this XElement microdata) { var p = microdata.ToItemPropertyDictionary(); var time = (DateTime)(p["time"].Attribute(XN.datetime)); var source = p["source"]; var sp = source.ToItemPropertyDictionary(); var item = new FFXIVLog { Time = time, MessageTypeID = int.Parse(sp["actId"].Value), Who = p["sender"].Value, Message = sp["message"].Value }; return item; }