mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-22 04:23:09 +00:00
Add support for very old switch bfres and some ptcl color adjustments
This commit is contained in:
parent
3769cc12c2
commit
c1d30f40fc
9 changed files with 62 additions and 10 deletions
Binary file not shown.
|
@ -1232,6 +1232,13 @@ namespace FirstPlugin
|
|||
|
||||
string Name = resFile.ExternalFileDict.GetKey(index++);
|
||||
|
||||
//Bfsha changes versioons alot so ignore these for now
|
||||
if (Utils.GetExtension(Name) == ".bfsha")
|
||||
{
|
||||
externalFilesFolder.AddNode(new ExternalFileData(Name, anim.Data));
|
||||
continue;
|
||||
}
|
||||
|
||||
var file = STFileLoader.OpenFileFormat(Name, anim.Data, false, true);
|
||||
|
||||
//Only do once. There's usually one bntx embedded but incase there are multiple
|
||||
|
|
|
@ -9,7 +9,7 @@ using System.Windows.Forms;
|
|||
|
||||
namespace FirstPlugin
|
||||
{
|
||||
public class EFF : TreeNodeFile,IFileFormat, IContextMenuNode
|
||||
public class EFF : TreeNodeFile, IFileFormat, IContextMenuNode
|
||||
{
|
||||
public FileType FileType { get; set; } = FileType.Effect;
|
||||
|
||||
|
|
|
@ -278,7 +278,7 @@ namespace FirstPlugin
|
|||
}
|
||||
}
|
||||
|
||||
public class TextureFolder : TreeNodeCustom, IContextMenuNode
|
||||
public class TextureFolder : TreeNodeCustom, IContextMenuNode, ITextureIconLoader
|
||||
{
|
||||
public TextureFolder(string text)
|
||||
{
|
||||
|
@ -293,6 +293,19 @@ namespace FirstPlugin
|
|||
};
|
||||
}
|
||||
|
||||
public List<STGenericTexture> IconTextureList
|
||||
{
|
||||
get
|
||||
{
|
||||
List<STGenericTexture> textures = new List<STGenericTexture>();
|
||||
foreach (STGenericTexture node in Nodes)
|
||||
textures.Add(node);
|
||||
|
||||
return textures;
|
||||
}
|
||||
set { }
|
||||
}
|
||||
|
||||
private void ExportAll(object sender, EventArgs args)
|
||||
{
|
||||
List<string> Formats = new List<string>();
|
||||
|
|
|
@ -23,8 +23,6 @@ namespace FirstPlugin
|
|||
{
|
||||
public class BNTX : TreeNodeFile, IFileFormat, IContextMenuNode
|
||||
{
|
||||
public List<STGenericTexture> IconTextureList { get; set; }
|
||||
|
||||
public FileType FileType { get; set; } = FileType.Image;
|
||||
|
||||
public bool CanSave { get; set; }
|
||||
|
@ -57,6 +55,20 @@ namespace FirstPlugin
|
|||
return types.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
public List<STGenericTexture> IconTextureList
|
||||
{
|
||||
get
|
||||
{
|
||||
List<STGenericTexture> textures = new List<STGenericTexture>();
|
||||
foreach (STGenericTexture node in Nodes)
|
||||
textures.Add(node);
|
||||
|
||||
return textures;
|
||||
}
|
||||
set { }
|
||||
}
|
||||
|
||||
class MenuExt : IFileMenuExtension
|
||||
{
|
||||
public STToolStripItem[] NewFileMenuExtensions => newFileExt;
|
||||
|
|
|
@ -51,7 +51,10 @@ namespace FirstPlugin
|
|||
alphaControl.AlphaFunction = ParseAlphaFunction(renderInfo.ValueString);
|
||||
break;
|
||||
case "gsys_alpha_test_value":
|
||||
alphaControl.AlphaTestRef = renderInfo.ValueFloat[0];
|
||||
if (renderInfo.ValueFloat != null)
|
||||
alphaControl.AlphaTestRef = renderInfo.ValueFloat[0];
|
||||
if (renderInfo.ValueString != null)
|
||||
float.TryParse(renderInfo.ValueString[0], out alphaControl.AlphaTestRef);
|
||||
break;
|
||||
case "gsys_color_blend_alpha_dst_func":
|
||||
break;
|
||||
|
|
|
@ -194,17 +194,34 @@ namespace FirstPlugin
|
|||
ColorDialog dialog = new ColorDialog();
|
||||
if (dialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
if (button.Name.Contains("color0"))
|
||||
ActiveEmitter.Color0Array[index].Color = dialog.Color;
|
||||
else
|
||||
ActiveEmitter.Color1Array[index].Color = dialog.Color;
|
||||
Color output;
|
||||
|
||||
button.Color = dialog.Color;
|
||||
if (button.Name.Contains("color0"))
|
||||
output = SetColor(ActiveEmitter.Color0Array[index].Color, dialog.Color);
|
||||
else
|
||||
output = SetColor(ActiveEmitter.Color1Array[index].Color, dialog.Color);
|
||||
|
||||
SetEmitterColor(output, index, button.Name.Contains("color0"));
|
||||
|
||||
button.Color = output;
|
||||
RefreshColorBoxes();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SetEmitterColor(Color color, int index, bool IsColor0)
|
||||
{
|
||||
if (IsColor0)
|
||||
ActiveEmitter.Color0Array[index].Color = color;
|
||||
else
|
||||
ActiveEmitter.Color1Array[index].Color = color;
|
||||
}
|
||||
|
||||
public Color SetColor(Color input, Color output)
|
||||
{
|
||||
return Color.FromArgb(input.A, output.R, output.G, output.B);
|
||||
}
|
||||
|
||||
private void hexTB_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsColorsLoaded)
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue