mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-22 20:43:09 +00:00
Add option to toggle SRGB for ftex
This commit is contained in:
parent
add182f902
commit
95d434a058
10 changed files with 43 additions and 2 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -57,11 +57,47 @@ namespace Switch_Toolbox.Library.Forms
|
|||
{
|
||||
if (GetEditor() == 0)
|
||||
UpdateHexView();
|
||||
|
||||
if (GetEditor() == 1)
|
||||
UpdateFileEditor();
|
||||
if (GetEditor() == 2)
|
||||
UpdateTextView();
|
||||
}
|
||||
|
||||
private void UpdateFileEditor()
|
||||
{
|
||||
var File = ArchiveFileInfo.FileFormat;
|
||||
if (File == null)
|
||||
File = ArchiveFileInfo.OpenFile();
|
||||
|
||||
UserControl control = GetEditorForm(File);
|
||||
if (control != null)
|
||||
{
|
||||
AddControl(control);
|
||||
|
||||
// if (CheckActiveType(control.GetType()))
|
||||
// AddControl(control);
|
||||
}
|
||||
}
|
||||
|
||||
private bool CheckActiveType(Type type)
|
||||
{
|
||||
return stPanel1.Controls.Count > 0 && stPanel1.Controls[0].GetType() != type;
|
||||
}
|
||||
|
||||
public UserControl GetEditorForm(IFileFormat fileFormat)
|
||||
{
|
||||
Type objectType = fileFormat.GetType();
|
||||
foreach (var inter in objectType.GetInterfaces())
|
||||
{
|
||||
if (inter.IsGenericType && inter.GetGenericTypeDefinition() == typeof(IEditor<>))
|
||||
{
|
||||
System.Reflection.MethodInfo method = objectType.GetMethod("OpenForm");
|
||||
return (UserControl)method.Invoke(fileFormat, new object[0]);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void UpdateTextView()
|
||||
{
|
||||
TextEditor editor = (TextEditor)GetActiveEditor(typeof(TextEditor));
|
||||
|
|
|
@ -530,7 +530,7 @@ namespace Switch_Toolbox.Library
|
|||
return;
|
||||
}
|
||||
|
||||
private UserControl GetEditorForm(IFileFormat fileFormat)
|
||||
public UserControl GetEditorForm(IFileFormat fileFormat)
|
||||
{
|
||||
Type objectType = fileFormat.GetType();
|
||||
foreach (var inter in objectType.GetInterfaces())
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -5580,6 +5580,11 @@
|
|||
Gets or sets the pixel swizzling stride.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Syroot.NintenTools.Bfres.Texture.UseSRGB">
|
||||
<summary>
|
||||
Gets or sets the desired texture data buffer format.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:Syroot.NintenTools.Bfres.Texture.Format">
|
||||
<summary>
|
||||
Gets or sets the desired texture data buffer format.
|
||||
|
|
Loading…
Reference in a new issue