More fixes for param exporting and filters
This commit is contained in:
parent
35f6b182e1
commit
6d03b4da88
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -119,7 +119,7 @@ namespace Bfres.Structs
|
||||
{
|
||||
OpenFileDialog ofd = new OpenFileDialog();
|
||||
if (IsWiiU)
|
||||
ofd.Filter = FileFilters.FSHU_REPLACE;
|
||||
ofd.Filter = FileFilters.GetFilter(typeof(FSHU), MaterialAnimation.AnimationType.ShaderParam);
|
||||
else
|
||||
ofd.Filter = FileFilters.FMAA;
|
||||
ofd.Multiselect = true;
|
||||
@ -141,7 +141,7 @@ namespace Bfres.Structs
|
||||
{
|
||||
OpenFileDialog ofd = new OpenFileDialog();
|
||||
if (IsWiiU)
|
||||
ofd.Filter = FileFilters.FSHU_REPLACE;
|
||||
ofd.Filter = FileFilters.GetFilter(typeof(FSHU), MaterialAnimation.AnimationType.Color);
|
||||
else
|
||||
ofd.Filter = FileFilters.FMAA;
|
||||
ofd.Multiselect = true;
|
||||
@ -163,7 +163,7 @@ namespace Bfres.Structs
|
||||
{
|
||||
OpenFileDialog ofd = new OpenFileDialog();
|
||||
if (IsWiiU)
|
||||
ofd.Filter = FileFilters.FSHU_REPLACE;
|
||||
ofd.Filter = FileFilters.GetFilter(typeof(FSHU), MaterialAnimation.AnimationType.TextureSrt);
|
||||
else
|
||||
ofd.Filter = FileFilters.FMAA;
|
||||
ofd.Multiselect = true;
|
||||
@ -173,9 +173,9 @@ namespace Bfres.Structs
|
||||
|
||||
BFRESGroupNode group = null;
|
||||
if (IsWiiU)
|
||||
group = GetOrCreateFolder<FSHU>(MaterialAnimation.AnimationType.ShaderParam);
|
||||
group = GetOrCreateFolder<FSHU>(MaterialAnimation.AnimationType.TextureSrt);
|
||||
else
|
||||
group = GetOrCreateFolder<FMAA>(MaterialAnimation.AnimationType.ShaderParam);
|
||||
group = GetOrCreateFolder<FMAA>(MaterialAnimation.AnimationType.TextureSrt);
|
||||
|
||||
group.Import(ofd.FileNames, GetResFile(), GetResFileU());
|
||||
AddFolder(group);
|
||||
|
@ -32,8 +32,8 @@ namespace Bfres.Structs
|
||||
Materials.Add(mat);
|
||||
}
|
||||
|
||||
public override string ExportFilter => FileFilters.FSHU_EXPORT;
|
||||
public override string ReplaceFilter => FileFilters.FSHU_REPLACE;
|
||||
public override string ExportFilter => FileFilters.GetFilter(typeof(FSHU), AnimType, true);
|
||||
public override string ReplaceFilter => FileFilters.GetFilter(typeof(FSHU), AnimType);
|
||||
|
||||
public override void OnClick(TreeView treeView) => UpdateEditor();
|
||||
|
||||
@ -64,7 +64,7 @@ namespace Bfres.Structs
|
||||
ShaderParamAnim.Import(FileName, resFile, ShaderParamAnimType.Color);
|
||||
LoadAnim(ShaderParamAnim, AnimationType.Color);
|
||||
}
|
||||
if (ext == ".bftxp")
|
||||
if (ext == ".bftsh")
|
||||
{
|
||||
ShaderParamAnim.Import(FileName, resFile, ShaderParamAnimType.TextureSRT);
|
||||
LoadAnim(ShaderParamAnim, AnimationType.TexturePattern);
|
||||
@ -78,6 +78,26 @@ namespace Bfres.Structs
|
||||
ShaderParamAnim.Name = Text;
|
||||
}
|
||||
|
||||
public override void Export(string FileName)
|
||||
{
|
||||
string ext = Utils.GetExtension(FileName);
|
||||
if (ext == ".bfshu")
|
||||
{
|
||||
ShaderParamAnim.Export(FileName, GetResFile(), ShaderParamAnimType.ShaderParameter);
|
||||
}
|
||||
if (ext == ".bfcsh")
|
||||
{
|
||||
ShaderParamAnim.Export(FileName, GetResFile(), ShaderParamAnimType.Color);
|
||||
}
|
||||
if (ext == ".bftsh")
|
||||
{
|
||||
ShaderParamAnim.Export(FileName, GetResFile(), ShaderParamAnimType.TextureSRT);
|
||||
}
|
||||
if (ext == ".clr0")
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public FSHU(ShaderParamAnim anim, AnimationType type) {
|
||||
LoadAnim(anim ,type);
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ namespace FirstPlugin.Forms
|
||||
materialCB.Items.Clear();
|
||||
|
||||
foreach (var material in anim.Materials) {
|
||||
materialCB.Items.Add(anim.Text);
|
||||
materialCB.Items.Add(material.Text);
|
||||
}
|
||||
|
||||
if (materialCB.Items.Count > 0)
|
||||
|
@ -25,8 +25,13 @@ namespace FirstPlugin
|
||||
public static string FSKA_REPLACE = GetFilter(".bfska", ".chr0");
|
||||
|
||||
public static string FMAA = GetFilter(".bfmaa", ".gif");
|
||||
public static string FSHU_REPLACE = GetFilter(".bfshu", "clr0");
|
||||
public static string FSHU_EXPORT = GetFilter(".bfshu");
|
||||
|
||||
public static string FSHU_REPLACE_PARAM = GetFilter(".bfshu");
|
||||
public static string FSHU_REPLACE_SRT = GetFilter(".bftsh");
|
||||
public static string FSHU_REPLACE_COLOR = GetFilter(".bfcsh", ".clr0");
|
||||
public static string FSHU_EXPORT_PARAM = GetFilter(".bfshu");
|
||||
public static string FSHU_EXPORT_SRT = GetFilter(".bftsh");
|
||||
public static string FSHU_EXPORT_COLOR = GetFilter(".bfcsh");
|
||||
|
||||
public static string FCLH = GetFilter(".bfcsh");
|
||||
public static string FSTH = GetFilter(".bfsth");
|
||||
@ -56,26 +61,31 @@ namespace FirstPlugin
|
||||
else if (type == typeof(FTEX)) return FTEX;
|
||||
else if (type == typeof(FSHU))
|
||||
{
|
||||
if (CheckAnimEffect is FSHU.AnimationType)
|
||||
if (IsExporting)
|
||||
{
|
||||
var animType = (MaterialAnimation.AnimationType)CheckAnimEffect;
|
||||
|
||||
if (animType == MaterialAnimation.AnimationType.Color) return FCLH;
|
||||
if (animType == MaterialAnimation.AnimationType.TextureSrt) return FSTH;
|
||||
else return FSHA;
|
||||
if (CheckAnimEffect is FSHU.AnimationType)
|
||||
{
|
||||
var animType = (MaterialAnimation.AnimationType)CheckAnimEffect;
|
||||
if (animType == MaterialAnimation.AnimationType.Color) return FSHU_EXPORT_COLOR;
|
||||
if (animType == MaterialAnimation.AnimationType.TextureSrt) return FSHU_EXPORT_SRT;
|
||||
else return FSHU_EXPORT_PARAM;
|
||||
}
|
||||
}
|
||||
if (CheckAnimEffect is VisibiltyAnimType)
|
||||
else
|
||||
{
|
||||
var animType = (VisibiltyAnimType)CheckAnimEffect;
|
||||
|
||||
if (animType == VisibiltyAnimType.Material) return FMTV;
|
||||
else return FBNV;
|
||||
if (CheckAnimEffect is FSHU.AnimationType)
|
||||
{
|
||||
var animType = (MaterialAnimation.AnimationType)CheckAnimEffect;
|
||||
if (animType == MaterialAnimation.AnimationType.Color) return FSHU_REPLACE_COLOR;
|
||||
if (animType == MaterialAnimation.AnimationType.TextureSrt) return FSHU_REPLACE_SRT;
|
||||
else return FSHU_REPLACE_PARAM;
|
||||
}
|
||||
}
|
||||
|
||||
if (IsExporting)
|
||||
return FSHU_EXPORT;
|
||||
return FSHU_EXPORT_PARAM;
|
||||
else
|
||||
return FSHU_REPLACE;
|
||||
return FSHU_REPLACE_PARAM;
|
||||
}
|
||||
else if (type == typeof(FVIS))
|
||||
{
|
||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user