Button in model viewer to open embedded texture dict in YTD viewer

This commit is contained in:
dexyfex
2018-03-17 02:24:21 +11:00
Unverified
parent bcfeb4fa30
commit cda768eb22
2 changed files with 41 additions and 8 deletions
+26 -6
View File
@@ -533,12 +533,6 @@ namespace CodeWalker.Forms
Renderer.RenderCollisionMesh(Ybn.Bounds, null);
}
}
else if (Ypt != null)
{
if (Ypt.Loaded)
{
}
}
else if (Ynv != null)
{
if (Ynv.Loaded)
@@ -1512,5 +1506,31 @@ namespace CodeWalker.Forms
{
StatusStrip.Visible = StatusBarCheckBox.Checked;
}
private void TextureViewerButton_Click(object sender, EventArgs e)
{
TextureDictionary td = null;
if ((Ydr != null) && (Ydr.Loaded))
{
td = Ydr.Drawable?.ShaderGroup?.TextureDictionary;
}
else if ((Yft != null) && (Yft.Loaded))
{
td = Yft.Fragment?.Drawable?.ShaderGroup?.TextureDictionary;
}
if (td != null)
{
YtdForm f = new YtdForm();
f.Show();
f.LoadTexDict(td, fileName);
//f.LoadYtd(ytd);
}
else
{
MessageBox.Show("Couldn't find embedded texture dict.");
}
}
}
}