YCD form improvement

This commit is contained in:
dexyfex
2017-10-04 14:35:39 +11:00
Unverified
parent 2e60ed5dc9
commit 2062f1e7f7
4 changed files with 135 additions and 11 deletions
+11 -1
View File
@@ -1,11 +1,13 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CodeWalker.GameFiles
{
[TypeConverter(typeof(ExpandableObjectConverter))]
public class YcdFile : GameFile, PackedFile
{
public ClipDictionary ClipDictionary { get; set; }
@@ -81,11 +83,11 @@ namespace CodeWalker.GameFiles
}
}
foreach (var cme in ClipMap.Values)
{
var clip = cme.Clip;
if (clip == null) continue;
clip.Ycd = this;
if (string.IsNullOrEmpty(clip.Name)) continue;
string name = clip.Name.Replace('\\', '/');
var slidx = name.LastIndexOf('/');
@@ -98,9 +100,11 @@ namespace CodeWalker.GameFiles
{
name = name.Substring(0, didx);
}
clip.ShortName = name;
name = name.ToLowerInvariant();
JenkIndex.Ensure(name);
//if (name.EndsWith("_uv_0")) //hash for these entries match string with this removed, +1
//{
//}
@@ -109,6 +113,12 @@ namespace CodeWalker.GameFiles
//}
}
foreach (var ame in AnimMap.Values)
{
var anim = ame.Animation;
if (anim == null) continue;
anim.Ycd = this;
}
ClipMapEntries = ClipMap.Values.ToArray();
+8 -2
View File
@@ -295,6 +295,9 @@ namespace CodeWalker.GameFiles
public ResourceSimpleList64Ptr BoneIdsPtr { get; set; }
public AnimationBoneId[] BoneIds { get; set; }
public YcdFile Ycd { get; set; }
public override void Read(ResourceDataReader reader, params object[] parameters)
{
// read structure data
@@ -652,6 +655,9 @@ namespace CodeWalker.GameFiles
public ClipTagList Tags { get; set; }
public ClipPropertyMap Properties { get; set; }
public YcdFile Ycd { get; set; }
public string ShortName { get; set; }
public override void Read(ResourceDataReader reader, params object[] parameters)
{
// read structure data
@@ -1001,7 +1007,7 @@ namespace CodeWalker.GameFiles
public override string ToString()
{
return "Count: " + AllProperties?.Length.ToString() ?? "0";
return "Count: " + (AllProperties?.Length ?? 0).ToString();
}
}
[TypeConverter(typeof(ExpandableObjectConverter))] public class ClipPropertyMapEntry : ResourceSystemBlock
@@ -1604,7 +1610,7 @@ namespace CodeWalker.GameFiles
public override string ToString()
{
return "Count: " + AllTags?.Length.ToString() ?? "0";
return "Count: " + (AllTags?.Length ?? 0).ToString();
}
}
[TypeConverter(typeof(ExpandableObjectConverter))] public class ClipTag : ClipProperty