mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-05-26 19:46:28 +00:00
fixed small saving bug in AudioEditor
This commit is contained in:
@@ -122,7 +122,6 @@ namespace PckStudio.Forms.Editor
|
||||
//
|
||||
resources.ApplyResources(this.saveToolStripMenuItem1, "saveToolStripMenuItem1");
|
||||
this.saveToolStripMenuItem1.Name = "saveToolStripMenuItem1";
|
||||
this.saveToolStripMenuItem1.Click += new System.EventHandler(this.saveToolStripMenuItem1_Click);
|
||||
//
|
||||
// toolsToolStripMenuItem
|
||||
//
|
||||
|
||||
@@ -77,6 +77,9 @@ namespace PckStudio.Forms.Editor
|
||||
public AudioEditor(PCKFile.FileData file, LOCFile locFile, bool isLittleEndian)
|
||||
{
|
||||
InitializeComponent();
|
||||
// so the Creative songs aren't combined until after the forms are closed.
|
||||
// this will prevent potential problems with editing the categories after merging.
|
||||
this.saveToolStripMenuItem1.Click += (sender, e) => saveToolStripMenuItem1_Click(sender, e, false);
|
||||
loc = locFile;
|
||||
tempDir = Path.Combine(Directory.GetCurrentDirectory(), "temp");
|
||||
_isLittleEndian = isLittleEndian;
|
||||
@@ -350,7 +353,7 @@ namespace PckStudio.Forms.Editor
|
||||
}
|
||||
}
|
||||
|
||||
private void saveToolStripMenuItem1_Click(object sender, EventArgs e)
|
||||
private void saveToolStripMenuItem1_Click(object sender, EventArgs e, bool combineCreative)
|
||||
{
|
||||
if(!audioFile.HasCategory(PCKAudioFile.AudioCategory.EAudioType.Overworld) ||
|
||||
!audioFile.HasCategory(PCKAudioFile.AudioCategory.EAudioType.Nether) ||
|
||||
@@ -364,7 +367,7 @@ namespace PckStudio.Forms.Editor
|
||||
foreach (var category in audioFile.Categories)
|
||||
{
|
||||
category.Name = "";
|
||||
if (playOverworldInCreative.Checked && category.audioType == PCKAudioFile.AudioCategory.EAudioType.Creative)
|
||||
if (combineCreative && category.audioType == PCKAudioFile.AudioCategory.EAudioType.Creative)
|
||||
{
|
||||
foreach (var name in overworldCategory.SongNames)
|
||||
{
|
||||
@@ -419,7 +422,7 @@ namespace PckStudio.Forms.Editor
|
||||
|
||||
private void AudioEditor_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
if (saved) saveToolStripMenuItem1_Click(sender, e);
|
||||
if (saved) saveToolStripMenuItem1_Click(sender, e, playOverworldInCreative.Checked);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user