mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-22 20:43:09 +00:00
Update editor properly.
This commit is contained in:
parent
bb691dcd0b
commit
afe0fc2e3f
6 changed files with 9 additions and 7 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -18,17 +18,18 @@ namespace Switch_Toolbox.Library.Forms
|
|||
|
||||
private bool _IsLoaded = false;
|
||||
|
||||
public ArchiveFilePanel(ArchiveFileInfo archiveFileInfo)
|
||||
public ArchiveFilePanel()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
ArchiveFileInfo = archiveFileInfo;
|
||||
|
||||
ReloadEditors();
|
||||
|
||||
_IsLoaded = true;
|
||||
}
|
||||
|
||||
public void LoadFile(ArchiveFileInfo archiveFileInfo) {
|
||||
ArchiveFileInfo = archiveFileInfo;
|
||||
}
|
||||
|
||||
private void ReloadEditors()
|
||||
{
|
||||
stComboBox1.Items.Clear();
|
||||
|
|
|
@ -85,13 +85,13 @@ namespace Switch_Toolbox.Library
|
|||
for (int i = 0; i < Files.Length; i++)
|
||||
{
|
||||
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]);
|
||||
|
||||
//Don't add the root file name
|
||||
if (parentNode.FullPath != string.Empty || !(parentNode is ArchiveRootNodeWrapper))
|
||||
{
|
||||
File.ArchiveFileInfo.FileName = Path.Combine(parentNode.FullPath, FileName);
|
||||
}
|
||||
else
|
||||
File.ArchiveFileInfo.FileName = FileName;
|
||||
|
||||
|
|
|
@ -537,11 +537,12 @@ namespace Switch_Toolbox.Library
|
|||
ArchiveFilePanel editor = (ArchiveFilePanel)LibraryGUI.Instance.GetActiveContent(typeof(ArchiveFilePanel));
|
||||
if (editor == null)
|
||||
{
|
||||
editor = new ArchiveFilePanel(ArchiveFileInfo);
|
||||
editor = new ArchiveFilePanel();
|
||||
editor.Dock = DockStyle.Fill;
|
||||
LibraryGUI.Instance.LoadEditor(editor);
|
||||
}
|
||||
|
||||
editor.LoadFile(ArchiveFileInfo);
|
||||
editor.UpdateEditor();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue