mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-08-20 08:59:21 +08:00
Merge pull request #5 from neos7/master
GtxdFile: Added Xml parser for gtxd.meta
This commit is contained in:
commit
983d53d37a
@ -5,6 +5,7 @@ using System.IO;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using System.Xml;
|
||||||
|
|
||||||
namespace CodeWalker.GameFiles
|
namespace CodeWalker.GameFiles
|
||||||
{
|
{
|
||||||
@ -133,7 +134,24 @@ namespace CodeWalker.GameFiles
|
|||||||
|
|
||||||
private void LoadMapParentTxds(string xml)
|
private void LoadMapParentTxds(string xml)
|
||||||
{
|
{
|
||||||
//TODO...
|
XmlDocument xmldoc = new XmlDocument();
|
||||||
|
xmldoc.LoadXml(xml);
|
||||||
|
XmlNodeList items = xmldoc.SelectNodes("CMapParentTxds/txdRelationships/Item");
|
||||||
|
|
||||||
|
CMapParentTxds = new Dictionary<string, string>();
|
||||||
|
for (int i = 0; i < items.Count; i++)
|
||||||
|
{
|
||||||
|
string parentstr = Xml.GetChildInnerText(items[i], "parent");
|
||||||
|
string childstr = Xml.GetChildInnerText(items[i], "child");
|
||||||
|
|
||||||
|
if ((!string.IsNullOrEmpty(parentstr)) && (!string.IsNullOrEmpty(childstr)))
|
||||||
|
{
|
||||||
|
if (!CMapParentTxds.ContainsKey(childstr))
|
||||||
|
{
|
||||||
|
CMapParentTxds.Add(childstr, parentstr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user