diff --git a/HaRepacker/GUI/MainForm.cs b/HaRepacker/GUI/MainForm.cs index 1fed0954..5f5fb429 100644 --- a/HaRepacker/GUI/MainForm.cs +++ b/HaRepacker/GUI/MainForm.cs @@ -539,9 +539,16 @@ private string GetOutputDirectory() private void rawDataToolStripMenuItem_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; + if (dialog.ShowDialog() != DialogResult.OK) + return; + string outPath = GetOutputDirectory(); - if (outPath == "") return; + if (outPath == string.Empty) + { + MessageBox.Show(Properties.Resources.MainWzExportError, Properties.Resources.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + WzPngMp3Serializer serializer = new WzPngMp3Serializer(); threadDone = false; runningThread = new Thread(new ParameterizedThreadStart(RunWzFilesExtraction)); @@ -552,9 +559,16 @@ private void rawDataToolStripMenuItem_Click(object sender, EventArgs e) private void imgToolStripMenuItem_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; + if (dialog.ShowDialog() != DialogResult.OK) + return; + string outPath = GetOutputDirectory(); - if (outPath == "") return; + if (outPath == string.Empty) + { + MessageBox.Show(Properties.Resources.MainWzExportError, Properties.Resources.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + WzImgSerializer serializer = new WzImgSerializer(); threadDone = false; runningThread = new Thread(new ParameterizedThreadStart(RunWzFilesExtraction)); @@ -565,7 +579,12 @@ private void imgToolStripMenuItem_Click(object sender, EventArgs e) private void imgToolStripMenuItem1_Click(object sender, EventArgs e) { string outPath = GetOutputDirectory(); - if (outPath == "") return; + if (outPath == string.Empty) + { + MessageBox.Show(Properties.Resources.MainWzExportError, Properties.Resources.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + List dirs = new List(); List imgs = new List(); foreach (WzNode node in MainPanel.DataTree.SelectedNodes) @@ -583,7 +602,12 @@ private void imgToolStripMenuItem1_Click(object sender, EventArgs e) private void pNGsToolStripMenuItem_Click(object sender, EventArgs e) { string outPath = GetOutputDirectory(); - if (outPath == "") return; + if (outPath == string.Empty) + { + MessageBox.Show(Properties.Resources.MainWzExportError, Properties.Resources.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + List objs = new List(); foreach (WzNode node in MainPanel.DataTree.SelectedNodes) if (node.Tag is WzObject) @@ -598,8 +622,11 @@ private void pNGsToolStripMenuItem_Click(object sender, EventArgs e) private void privateServerToolStripMenuItem_Click(object sender, EventArgs e) { string outPath = GetOutputDirectory(); - if (outPath == "") + if (outPath == string.Empty) + { + MessageBox.Show(Properties.Resources.MainWzExportError, Properties.Resources.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning); return; + } List dirs = new List(); List imgs = new List(); @@ -619,8 +646,12 @@ private void privateServerToolStripMenuItem_Click(object sender, EventArgs e) private void classicToolStripMenuItem_Click(object sender, EventArgs e) { string outPath = GetOutputDirectory(); - if (outPath == "") + if (outPath == string.Empty) + { + MessageBox.Show(Properties.Resources.MainWzExportError, Properties.Resources.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning); return; + } + List dirs = new List(); List imgs = new List(); foreach (WzNode node in MainPanel.DataTree.SelectedNodes) @@ -639,8 +670,14 @@ private void classicToolStripMenuItem_Click(object sender, EventArgs e) private void newToolStripMenuItem1_Click(object sender, EventArgs e) { - SaveFileDialog dialog = new SaveFileDialog() { Title = HaRepacker.Properties.Resources.SelectOutXml, Filter = string.Format("{0}|*.xml", HaRepacker.Properties.Resources.XmlFilter) }; - if (dialog.ShowDialog() != DialogResult.OK) return; + SaveFileDialog dialog = new SaveFileDialog() { + Title = HaRepacker.Properties.Resources.SelectOutXml, + Filter = string.Format("{0}|*.xml", HaRepacker.Properties.Resources.XmlFilter) + }; + + if (dialog.ShowDialog() != DialogResult.OK) + return; + List objs = new List(); foreach (WzNode node in MainPanel.DataTree.SelectedNodes) if (node.Tag is WzObject) diff --git a/HaRepacker/Properties/Resources.Designer.cs b/HaRepacker/Properties/Resources.Designer.cs index 64ddf14d..8853975c 100644 --- a/HaRepacker/Properties/Resources.Designer.cs +++ b/HaRepacker/Properties/Resources.Designer.cs @@ -625,6 +625,15 @@ internal static string MainUpdateTitle { } } + /// + /// Looks up a localized string similar to Export directory not found. Please specify it under Tools -> Options. + /// + internal static string MainWzExportError { + get { + return ResourceManager.GetString("MainWzExportError", resourceCulture); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/HaRepacker/Properties/Resources.resx b/HaRepacker/Properties/Resources.resx index 6a754b90..c824a218 100644 --- a/HaRepacker/Properties/Resources.resx +++ b/HaRepacker/Properties/Resources.resx @@ -374,4 +374,7 @@ Click "Yes" to download the new version. Error importing {0}.img file. Are you sure you have selected the correct WZ encryption? + + Export directory not found. Please specify it under Tools -> Options + \ No newline at end of file diff --git a/HaRepacker/Properties/Resources.zh-CHS.resx b/HaRepacker/Properties/Resources.zh-CHS.resx index 27d24e49..d55983a8 100644 --- a/HaRepacker/Properties/Resources.zh-CHS.resx +++ b/HaRepacker/Properties/Resources.zh-CHS.resx @@ -267,6 +267,9 @@ 新版本 + + Export directory not found. Please specify it under Tools -> Options + MPEG-1 Audio Layer 3 (*.mp3) diff --git a/HaRepacker/Properties/Resources.zh-CHT.resx b/HaRepacker/Properties/Resources.zh-CHT.resx index 41a6da37..273289cb 100644 --- a/HaRepacker/Properties/Resources.zh-CHT.resx +++ b/HaRepacker/Properties/Resources.zh-CHT.resx @@ -268,6 +268,9 @@ 新版本 + + Export directory not found. Please specify it under Tools -> Options + MPEG-1 Audio Layer 3 (*.mp3)