Add option to toggle SRGB for ftex
This commit is contained in:
parent
add182f902
commit
95d434a058
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)
|
if (GetEditor() == 0)
|
||||||
UpdateHexView();
|
UpdateHexView();
|
||||||
|
if (GetEditor() == 1)
|
||||||
|
UpdateFileEditor();
|
||||||
if (GetEditor() == 2)
|
if (GetEditor() == 2)
|
||||||
UpdateTextView();
|
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()
|
private void UpdateTextView()
|
||||||
{
|
{
|
||||||
TextEditor editor = (TextEditor)GetActiveEditor(typeof(TextEditor));
|
TextEditor editor = (TextEditor)GetActiveEditor(typeof(TextEditor));
|
||||||
|
@ -530,7 +530,7 @@ namespace Switch_Toolbox.Library
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
private UserControl GetEditorForm(IFileFormat fileFormat)
|
public UserControl GetEditorForm(IFileFormat fileFormat)
|
||||||
{
|
{
|
||||||
Type objectType = fileFormat.GetType();
|
Type objectType = fileFormat.GetType();
|
||||||
foreach (var inter in objectType.GetInterfaces())
|
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.
|
Gets or sets the pixel swizzling stride.
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</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">
|
<member name="P:Syroot.NintenTools.Bfres.Texture.Format">
|
||||||
<summary>
|
<summary>
|
||||||
Gets or sets the desired texture data buffer format.
|
Gets or sets the desired texture data buffer format.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user