public TreeNode ToTree(int MyIndex, PCCObject pcc) { string s = ""; if (Text.Length != 0) { s = Text.Substring(0, Text.Length - 1); } TreeNode res = new TreeNode(MyIndex + " : " + s + " " + TalkFiles.findDataById(refText)); TreeNode t = new TreeNode("Reply List"); for (int i = 0; i < ReplyList.Count; i++) { EntryListReplyListStruct e = ReplyList[i]; string par = e.Paraphrase; if (par.Length != 0 && par[par.Length - 1] == '\0') { par = par.Substring(0, par.Length - 1); } t.Nodes.Add(i + " : " + par + " " + e.refParaphrase + " " + TalkFiles.findDataById(e.refParaphrase) + " " + e.Index + " " + pcc.getNameEntry(e.CategoryType) + " " + pcc.getNameEntry(e.CategoryValue)); } res.Nodes.Add(t); TreeNode t2 = new TreeNode("Speaker List"); for (int i = 0; i < SpeakerList.Count; i++) { t2.Nodes.Add(i + " : " + SpeakerList[i]); } res.Nodes.Add(t2); res.Nodes.Add("SpeakerIndex : " + SpeakerIndex); res.Nodes.Add("ListenerIndex : " + ListenerIndex); res.Nodes.Add("ConditionalFunc : " + ConditionalFunc); res.Nodes.Add("ConditionalParam : " + ConditionalParam); res.Nodes.Add("StateTransition : " + StateTransition); res.Nodes.Add("StateTransitionParam : " + StateTransitionParam); res.Nodes.Add("ExportID : " + ExportID); res.Nodes.Add("ScriptIndex : " + ScriptIndex); res.Nodes.Add("CameraIntimacy : " + CameraIntimacy); res.Nodes.Add("Skippable : " + Skippable); res.Nodes.Add("FireConditional : " + FireConditional); res.Nodes.Add("Ambient : " + Ambient); res.Nodes.Add("NonTextline : " + NonTextline); res.Nodes.Add("IgnoreBodyGestures : " + IgnoreBodyGestures); res.Nodes.Add("AlwaysHideSubtitle : " + AlwaysHideSubtitle); res.Nodes.Add("Text : " + Text); res.Nodes.Add("refText : " + refText + " " + TalkFiles.findDataById(refText, true)); res.Nodes.Add("GUIStyle : (" + pcc.getNameEntry(GUIStyleType) + ") " + pcc.getNameEntry(GUIStyleValue)); return(res); }
private void ReadEntryList() { EntryList = new List <EntryListStuct>(); int f = FindPropByName("m_EntryList"); if (f == -1) { return; } byte[] buff = Props[f].raw; int count = BitConverter.ToInt32(buff, 0x18); int pos = 0x1C; for (int i = 0; i < count; i++) { List <PropertyReader.Property> p = PropertyReader.ReadProp(pcc, buff, pos); EntryListStuct e = new EntryListStuct(); foreach (PropertyReader.Property pp in p) { string name = pcc.getNameEntry(pp.Name); switch (name) { case "ReplyListNew": byte[] buff2 = pp.raw; int count2 = BitConverter.ToInt32(buff2, 0x18); int pos2 = 0x1C; e.ReplyList = new List <EntryListReplyListStruct>(); for (int j = 0; j < count2; j++) { List <PropertyReader.Property> p2 = PropertyReader.ReadProp(pcc, buff2, pos2); EntryListReplyListStruct r = new EntryListReplyListStruct(); foreach (PropertyReader.Property ppp in p2) { switch (pcc.getNameEntry(ppp.Name)) { case "sParaphrase": r.Paraphrase = ppp.Value.StringValue; break; case "nIndex": r.Index = ppp.Value.IntValue; break; case "srParaphrase": r.refParaphrase = ppp.Value.IntValue; break; case "Category": r.CategoryType = BitConverter.ToInt32(ppp.raw, 24); r.CategoryValue = BitConverter.ToInt32(ppp.raw, 32); break; } } e.ReplyList.Add(r); pos2 = p2[p2.Count - 1].offend; } break; case "aSpeakerList": buff2 = pp.raw; count2 = BitConverter.ToInt32(buff2, 0x18); e.SpeakerList = new List <int>(); for (int j = 0; j < count2; j++) { e.SpeakerList.Add(BitConverter.ToInt32(buff2, 0x1C + 4 * j)); } break; case "nSpeakerIndex": e.SpeakerIndex = pp.Value.IntValue; break; case "nListenerIndex": e.ListenerIndex = pp.Value.IntValue; break; case "bSkippable": e.Skippable = (pp.raw[pp.raw.Length - 1] == 1); break; case "sText": e.Text = pp.Value.StringValue; break; case "srText": e.refText = pp.Value.IntValue; break; case "nConditionalFunc": e.ConditionalFunc = pp.Value.IntValue; break; case "nConditionalParam": e.ConditionalParam = pp.Value.IntValue; break; case "nStateTransition": e.StateTransition = pp.Value.IntValue; break; case "nStateTransitionParam": e.StateTransitionParam = pp.Value.IntValue; break; case "nExportID": e.ExportID = pp.Value.IntValue; break; case "nScriptIndex": e.ScriptIndex = pp.Value.IntValue; break; case "nCameraIntimacy": e.CameraIntimacy = pp.Value.IntValue; break; case "bFireConditional": e.FireConditional = (pp.raw[pp.raw.Length - 1] == 1); break; case "bAmbient": e.Ambient = (pp.raw[pp.raw.Length - 1] == 1); break; case "bNonTextLine": e.NonTextline = (pp.raw[pp.raw.Length - 1] == 1); break; case "bIgnoreBodyGestures": e.IgnoreBodyGestures = (pp.raw[pp.raw.Length - 1] == 1); break; case "bAlwaysHideSubtitle": e.AlwaysHideSubtitle = (pp.raw[pp.raw.Length - 1] == 1); break; case "eGUIStyle": e.GUIStyleType = BitConverter.ToInt32(pp.raw, 24); e.GUIStyleValue = BitConverter.ToInt32(pp.raw, 32); break; } } EntryList.Add(e); pos = p[p.Count - 1].offend; } }
private void ReadEntryList() { EntryList = new List<EntryListStuct>(); int f = FindPropByName("m_EntryList"); if (f == -1) return; byte[] buff = Props[f].raw; int count = BitConverter.ToInt32(buff, 0x18); int pos = 0x1C; for (int i = 0; i < count; i++) { List<PropertyReader.Property> p = PropertyReader.ReadProp(pcc, buff, pos); EntryListStuct e = new EntryListStuct(); foreach (PropertyReader.Property pp in p) { switch (pcc.getNameEntry(pp.Name)) { case"ReplyListNew": byte[] buff2 = pp.raw; int count2 = BitConverter.ToInt32(buff2, 0x18); int pos2 = 0x1C; e.ReplyList = new List<EntryListReplyListStruct>(); for (int j = 0; j < count2; j++) { List<PropertyReader.Property> p2 = PropertyReader.ReadProp(pcc, buff2, pos2); EntryListReplyListStruct r = new EntryListReplyListStruct(); foreach(PropertyReader.Property ppp in p2) switch (pcc.getNameEntry(ppp.Name)) { case "sParaphrase": r.Paraphrase = ppp.Value.StringValue; break; case "nIndex": r.Index = ppp.Value.IntValue; break; case "srParaphrase": r.refParaphrase = ppp.Value.IntValue; break; case "Category": r.CategoryValue = BitConverter.ToInt32(ppp.raw, 24); break; case "None": break; } e.ReplyList.Add(r); pos2 = p2[p2.Count - 1].offend; } break; case "aSpeakerList": buff2 = pp.raw; count2 = BitConverter.ToInt32(buff2, 0x18); e.SpeakerList = new List<int>(); for (int j = 0; j < count2; j++) e.SpeakerList.Add(BitConverter.ToInt32(buff2, 0x1C + 4 * j)); break; case "nSpeakerIndex": e.SpeakerIndex = pp.Value.IntValue; break; case "nListenerIndex": e.ListenerIndex = pp.Value.IntValue; break; case "bSkippable": e.Skippable = (pp.Value.IntValue == 1); break; case "sText": e.Text = pp.Value.StringValue; break; case "srText": e.refText = pp.Value.IntValue; break; case "nConditionalFunc": e.ConditionalFunc = pp.Value.IntValue; break; case "nConditionalParam": e.ConditionalParam = pp.Value.IntValue; break; case "nStateTransition": e.StateTransition = pp.Value.IntValue; break; case "nStateTransitionParam": e.StateTransitionParam = pp.Value.IntValue; break; case "nExportID": e.ExportID = pp.Value.IntValue; break; case "nScriptIndex": e.ScriptIndex = pp.Value.IntValue; break; case "nCameraIntimacy": e.CameraIntimacy = pp.Value.IntValue; break; case "bFireConditional": e.FireConditional = (pp.Value.IntValue == 1); break; case "bAmbient": e.Ambient = (pp.Value.IntValue == 1); break; case "bNonTextLine": e.NonTextline = (pp.Value.IntValue == 1); break; case "bIgnoreBodyGestures": e.IgnoreBodyGestures = (pp.Value.IntValue == 1); break; case "eGUIStyle": e.GUIStyleValue = BitConverter.ToInt32(pp.raw, 24); break; case "None": break; } } EntryList.Add(e); pos = p[p.Count - 1].offend; } }