1
0
mirror of synced 2025-02-26 06:49:45 +01:00

Update editor properly.

This commit is contained in:
KillzXGaming 2019-06-09 20:16:11 -04:00
parent bb691dcd0b
commit afe0fc2e3f
6 changed files with 9 additions and 7 deletions

Binary file not shown.

View File

@ -18,17 +18,18 @@ namespace Switch_Toolbox.Library.Forms
private bool _IsLoaded = false; private bool _IsLoaded = false;
public ArchiveFilePanel(ArchiveFileInfo archiveFileInfo) public ArchiveFilePanel()
{ {
InitializeComponent(); InitializeComponent();
ArchiveFileInfo = archiveFileInfo;
ReloadEditors(); ReloadEditors();
_IsLoaded = true; _IsLoaded = true;
} }
public void LoadFile(ArchiveFileInfo archiveFileInfo) {
ArchiveFileInfo = archiveFileInfo;
}
private void ReloadEditors() private void ReloadEditors()
{ {
stComboBox1.Items.Clear(); stComboBox1.Items.Clear();

View File

@ -85,13 +85,13 @@ namespace Switch_Toolbox.Library
for (int i = 0; i < Files.Length; i++) for (int i = 0; i < Files.Length; i++)
{ {
var File = ArchiveFileWrapper.FromPath(Files[i], archiveFile); var File = ArchiveFileWrapper.FromPath(Files[i], archiveFile);
File.ArchiveFileInfo = new ArchiveFileInfo();
File.ArchiveFileInfo.FileData = System.IO.File.ReadAllBytes(Files[i]);
string FileName = Path.GetFileName(Files[i]); string FileName = Path.GetFileName(Files[i]);
//Don't add the root file name //Don't add the root file name
if (parentNode.FullPath != string.Empty || !(parentNode is ArchiveRootNodeWrapper)) if (parentNode.FullPath != string.Empty || !(parentNode is ArchiveRootNodeWrapper))
{
File.ArchiveFileInfo.FileName = Path.Combine(parentNode.FullPath, FileName); File.ArchiveFileInfo.FileName = Path.Combine(parentNode.FullPath, FileName);
}
else else
File.ArchiveFileInfo.FileName = FileName; File.ArchiveFileInfo.FileName = FileName;

View File

@ -537,11 +537,12 @@ namespace Switch_Toolbox.Library
ArchiveFilePanel editor = (ArchiveFilePanel)LibraryGUI.Instance.GetActiveContent(typeof(ArchiveFilePanel)); ArchiveFilePanel editor = (ArchiveFilePanel)LibraryGUI.Instance.GetActiveContent(typeof(ArchiveFilePanel));
if (editor == null) if (editor == null)
{ {
editor = new ArchiveFilePanel(ArchiveFileInfo); editor = new ArchiveFilePanel();
editor.Dock = DockStyle.Fill; editor.Dock = DockStyle.Fill;
LibraryGUI.Instance.LoadEditor(editor); LibraryGUI.Instance.LoadEditor(editor);
} }
editor.LoadFile(ArchiveFileInfo);
editor.UpdateEditor(); editor.UpdateEditor();
} }