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();