mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2026-05-14 15:24:49 +08:00
YVR/XML and YWR/XML conversions
This commit is contained in:
@@ -276,8 +276,8 @@ namespace CodeWalker
|
||||
InitFileType(".gfx", "Scaleform Flash", 7);
|
||||
InitFileType(".ynd", "Path Nodes", 8, FileTypeAction.ViewYnd, true);
|
||||
InitFileType(".ynv", "Nav Mesh", 9, FileTypeAction.ViewModel, true);
|
||||
InitFileType(".yvr", "Vehicle Record", 9, FileTypeAction.ViewYvr);
|
||||
InitFileType(".ywr", "Waypoint Record", 9, FileTypeAction.ViewYwr);
|
||||
InitFileType(".yvr", "Vehicle Record", 9, FileTypeAction.ViewYvr, true);
|
||||
InitFileType(".ywr", "Waypoint Record", 9, FileTypeAction.ViewYwr, true);
|
||||
InitFileType(".fxc", "Compiled Shaders", 9, FileTypeAction.ViewFxc);
|
||||
InitFileType(".yed", "Expression Dictionary", 9, FileTypeAction.ViewYed, true);
|
||||
InitFileType(".yld", "Cloth Dictionary", 9, FileTypeAction.ViewYld, true);
|
||||
@@ -2745,6 +2745,14 @@ namespace CodeWalker
|
||||
{
|
||||
mformat = MetaFormat.Yed;
|
||||
}
|
||||
if (fnamel.EndsWith(".ywr.xml"))
|
||||
{
|
||||
mformat = MetaFormat.Ywr;
|
||||
}
|
||||
if (fnamel.EndsWith(".yvr.xml"))
|
||||
{
|
||||
mformat = MetaFormat.Yvr;
|
||||
}
|
||||
if (fnamel.EndsWith(".awc.xml"))
|
||||
{
|
||||
mformat = MetaFormat.Awc;
|
||||
@@ -2939,6 +2947,28 @@ namespace CodeWalker
|
||||
data = yed.Save();
|
||||
break;
|
||||
}
|
||||
case MetaFormat.Ywr:
|
||||
{
|
||||
var ywr = XmlYwr.GetYwr(doc, fpathin);
|
||||
if (ywr.Waypoints == null)
|
||||
{
|
||||
MessageBox.Show(fname + ": Schema not supported.", "Cannot import YWR XML");
|
||||
continue;
|
||||
}
|
||||
data = ywr.Save();
|
||||
break;
|
||||
}
|
||||
case MetaFormat.Yvr:
|
||||
{
|
||||
var yvr = XmlYvr.GetYvr(doc, fpathin);
|
||||
if (yvr.Records == null)
|
||||
{
|
||||
MessageBox.Show(fname + ": Schema not supported.", "Cannot import YVR XML");
|
||||
continue;
|
||||
}
|
||||
data = yvr.Save();
|
||||
break;
|
||||
}
|
||||
case MetaFormat.Awc:
|
||||
{
|
||||
var awc = XmlAwc.GetAwc(doc, fpathin);
|
||||
|
||||
@@ -69,11 +69,11 @@ namespace CodeWalker.Forms
|
||||
sb.AppendLine("PositionX, PositionY, PositionZ, Time, VelocityX, VelocityY, VelocityZ, RightX, RightY, RightZ, TopX, TopY, TopZ, SteeringAngle, GasPedalPower, BrakePedalPower, HandbrakeUsed");
|
||||
foreach (var entry in yvr.Records.Entries.data_items)
|
||||
{
|
||||
sb.Append(FloatUtil.ToString(entry.PositionX));
|
||||
sb.Append(FloatUtil.ToString(entry.Position.X));
|
||||
sb.Append(", ");
|
||||
sb.Append(FloatUtil.ToString(entry.PositionY));
|
||||
sb.Append(FloatUtil.ToString(entry.Position.Y));
|
||||
sb.Append(", ");
|
||||
sb.Append(FloatUtil.ToString(entry.PositionZ));
|
||||
sb.Append(FloatUtil.ToString(entry.Position.Z));
|
||||
sb.Append(", ");
|
||||
sb.Append(entry.Time.ToString());
|
||||
sb.Append(", ");
|
||||
@@ -114,9 +114,9 @@ namespace CodeWalker.Forms
|
||||
{
|
||||
string[] row =
|
||||
{
|
||||
FloatUtil.ToString(entry.PositionX),
|
||||
FloatUtil.ToString(entry.PositionY),
|
||||
FloatUtil.ToString(entry.PositionZ),
|
||||
FloatUtil.ToString(entry.Position.X),
|
||||
FloatUtil.ToString(entry.Position.Y),
|
||||
FloatUtil.ToString(entry.Position.Z),
|
||||
entry.Time.ToString(),
|
||||
entry.VelocityX.ToString(),
|
||||
entry.VelocityY.ToString(),
|
||||
|
||||
@@ -72,11 +72,11 @@ namespace CodeWalker.Forms
|
||||
sb.AppendLine("PositionX, PositionY, PositionZ, Unk0, Unk1, Unk2, Unk3");
|
||||
foreach (var entry in ywr.Waypoints.Entries)
|
||||
{
|
||||
sb.Append(FloatUtil.ToString(entry.PositionX));
|
||||
sb.Append(FloatUtil.ToString(entry.Position.X));
|
||||
sb.Append(", ");
|
||||
sb.Append(FloatUtil.ToString(entry.PositionY));
|
||||
sb.Append(FloatUtil.ToString(entry.Position.Y));
|
||||
sb.Append(", ");
|
||||
sb.Append(FloatUtil.ToString(entry.PositionZ));
|
||||
sb.Append(FloatUtil.ToString(entry.Position.Z));
|
||||
sb.Append(", ");
|
||||
sb.Append(entry.Unk0.ToString());
|
||||
sb.Append(", ");
|
||||
@@ -97,9 +97,9 @@ namespace CodeWalker.Forms
|
||||
{
|
||||
string[] row =
|
||||
{
|
||||
FloatUtil.ToString(entry.PositionX),
|
||||
FloatUtil.ToString(entry.PositionY),
|
||||
FloatUtil.ToString(entry.PositionZ),
|
||||
FloatUtil.ToString(entry.Position.X),
|
||||
FloatUtil.ToString(entry.Position.Y),
|
||||
FloatUtil.ToString(entry.Position.Z),
|
||||
entry.Unk0.ToString(),
|
||||
entry.Unk1.ToString(),
|
||||
entry.Unk2.ToString(),
|
||||
|
||||
Reference in New Issue
Block a user