From 2dee3d459cce25839a78026abb68a5e83b365e69 Mon Sep 17 00:00:00 2001 From: nomeu Date: Tue, 27 Jan 2015 12:45:34 +0900 Subject: [PATCH] rename TSONode#name to path. --- Form1.cs | 2 +- MqoWriter.cs | 2 +- TSOFile.cs | 20 ++++++++++---------- TSOGenerator.cs | 2 +- TSOGeneratorOneBone.cs | 2 +- TSOWriter.cs | 6 +++--- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Form1.cs b/Form1.cs index 7ca74ea..133f92d 100644 --- a/Form1.cs +++ b/Form1.cs @@ -249,7 +249,7 @@ namespace Tso2MqoGui private void BuildBoneTree(TreeNodeCollection nodes, TSONode node) { - TreeNode tn = nodes.Add(node.ShortName); + TreeNode tn = nodes.Add(node.Name); tn.Tag = node; if (node.children != null) diff --git a/MqoWriter.cs b/MqoWriter.cs index 06bb5c1..82e11b8 100644 --- a/MqoWriter.cs +++ b/MqoWriter.cs @@ -202,7 +202,7 @@ namespace Tso2MqoGui { MqoBone bone = new MqoBone(); bone.id = node.id+1; - bone.name = node.ShortName; + bone.name = node.Name; bone.tail = node.children.Count == 0; if (node.parent == null) diff --git a/TSOFile.cs b/TSOFile.cs index 6f0d696..0937ced 100644 --- a/TSOFile.cs +++ b/TSOFile.cs @@ -59,21 +59,21 @@ namespace Tso2MqoGui { nodes[i] = new TSONode(); nodes[i].id = i; - nodes[i].name = ReadString(); - nodes[i].sname = nodes[i].name.Substring(nodes[i].name.LastIndexOf('|') + 1); - nodemap.Add(nodes[i].name, nodes[i]); + nodes[i].path = ReadString(); + nodes[i].name = nodes[i].path.Substring(nodes[i].path.LastIndexOf('|') + 1); + nodemap.Add(nodes[i].path, nodes[i]); - WriteLine(i + ": " + nodes[i].name); + WriteLine(i + ": " + nodes[i].path); } for (int i = 0; i < count; ++i) { - int index = nodes[i].name.LastIndexOf('|'); + int index = nodes[i].path.LastIndexOf('|'); if (index <= 0) continue; - string pname = nodes[i].name.Substring(0, index); + string pname = nodes[i].path.Substring(0, index); WriteLine(pname); nodes[i].parent = nodemap[pname]; nodes[i].parent.children.Add(nodes[i]); @@ -235,8 +235,8 @@ namespace Tso2MqoGui public class TSONode { internal int id; + internal string path; internal string name; - internal string sname; internal Matrix44 matrix; internal Matrix44 world; internal List children = new List(); @@ -245,9 +245,9 @@ namespace Tso2MqoGui [Category("General")] public int ID { get { return id; } } [Category("General")] - public string Name { get { return name; } } + public string Path { get { return path; } } [Category("General")] - public string ShortName { get { return sname; } } + public string Name { get { return name; } } [Category("Detail")] public Matrix44 Matrix { get { return matrix; } set { matrix = value; } } [Category("Detail")] @@ -256,7 +256,7 @@ namespace Tso2MqoGui public override string ToString() { StringBuilder sb = new StringBuilder(); - sb.Append("Name: ").AppendLine(name); + sb.Append("Path: ").AppendLine(path); sb.Append("Matrix: ").AppendLine(matrix.ToString()); sb.Append("Children.Count: ").AppendLine(children.Count.ToString()); return sb.ToString(); diff --git a/TSOGenerator.cs b/TSOGenerator.cs index 38bb509..9b69a36 100644 --- a/TSOGenerator.cs +++ b/TSOGenerator.cs @@ -122,7 +122,7 @@ namespace Tso2MqoGui bw.Write(tsoref.nodes.Length); foreach (TSONode i in tsoref.nodes) - WriteString(bw, i.Name); + WriteString(bw, i.Path); } else if (mqx != null) { diff --git a/TSOGeneratorOneBone.cs b/TSOGeneratorOneBone.cs index 0c03044..6463cdd 100644 --- a/TSOGeneratorOneBone.cs +++ b/TSOGeneratorOneBone.cs @@ -22,7 +22,7 @@ namespace Tso2MqoGui foreach (TSONode i in tsoref.nodes) { - node_idmap.Add(i.ShortName, i.ID); + node_idmap.Add(i.Name, i.ID); } } diff --git a/TSOWriter.cs b/TSOWriter.cs index 1571c15..4db0ec1 100644 --- a/TSOWriter.cs +++ b/TSOWriter.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using System.Text; @@ -45,7 +45,7 @@ namespace Tso2MqoGui public static void Write(BinaryWriter bw, TSONode item) { - Write(bw, item.Name); + Write(bw, item.Path); } public static void Write(BinaryWriter bw, Matrix44 item) @@ -166,4 +166,4 @@ namespace Tso2MqoGui } } } -} \ No newline at end of file +} -- 2.11.0