Skip to content

Commit

Permalink
Add Tool for convert nxfile
Browse files Browse the repository at this point in the history
[HaRepacker] Add converter to menu item
[MapleLib] Add wzfile to nxfile serializer
  • Loading branch information
taida957789 committed Sep 22, 2021
1 parent e1e73c5 commit b9f8e49
Show file tree
Hide file tree
Showing 6 changed files with 686 additions and 213 deletions.
11 changes: 10 additions & 1 deletion HaRepacker/GUI/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 28 additions & 1 deletion HaRepacker/GUI/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
using static MapleLib.Configuration.UserSettings;
using HaSharedLibrary;
using MapleLib.MapleCryptoLib;
using MapleLib.WzLib.Nx;

namespace HaRepacker.GUI
{
Expand Down Expand Up @@ -1014,7 +1015,7 @@ private void RunWzFilesExtraction(object param)

string[] wzFilesToDump = (string[])((object[])param)[0];
string baseDir = (string)((object[])param)[1];
WzMapleVersion version = GetWzMapleVersionByWzEncryptionBoxSelection( ((int[])param)[2]);
WzMapleVersion version = GetWzMapleVersionByWzEncryptionBoxSelection((int)(((object[])param)[2]));
IWzFileSerializer serializer = (IWzFileSerializer)((object[])param)[3];
UpdateProgressBar(MainPanel.mainProgressBar, 0, false, true);
UpdateProgressBar(MainPanel.mainProgressBar, wzFilesToDump.Length, true, true);
Expand Down Expand Up @@ -1901,5 +1902,31 @@ private void WzImporterThread(object param)

threadDone = true;
}

private void nXForamtToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFileDialog dialog = new OpenFileDialog()
{
Title = HaRepacker.Properties.Resources.SelectWz,
Filter = string.Format("{0}|*.wz", HaRepacker.Properties.Resources.WzFilter),
Multiselect = true
};

if (dialog.ShowDialog() != DialogResult.OK)
return;

string outPath = GetOutputDirectory();
if (outPath == string.Empty)
{
MessageBox.Show(Properties.Resources.MainWzExportError, Properties.Resources.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}

WzToNxSerializer serializer = new WzToNxSerializer();
threadDone = false;
runningThread = new Thread(new ParameterizedThreadStart(RunWzFilesExtraction));
runningThread.Start((object)new object[] { dialog.FileNames, outPath, encryptionBox.SelectedIndex, serializer });
new Thread(new ParameterizedThreadStart(ProgressBarThread)).Start(serializer);
}
}
}
Loading

0 comments on commit b9f8e49

Please sign in to comment.