diff --git a/PCK-Studio/Forms/Editor/AudioEditor.Designer.cs b/PCK-Studio/Forms/Editor/AudioEditor.Designer.cs index 5ed58ebc..4eb84bce 100644 --- a/PCK-Studio/Forms/Editor/AudioEditor.Designer.cs +++ b/PCK-Studio/Forms/Editor/AudioEditor.Designer.cs @@ -59,6 +59,7 @@ namespace PckStudio.Forms.Editor this.playOverworldInCreative = new MetroFramework.Controls.MetroCheckBox(); this.compressionUpDown = new System.Windows.Forms.NumericUpDown(); this.metroLabel1 = new MetroFramework.Controls.MetroLabel(); + this.organizeTracksToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.contextMenuStrip1.SuspendLayout(); this.menuStrip.SuspendLayout(); this.contextMenuStrip2.SuspendLayout(); @@ -148,7 +149,8 @@ namespace PckStudio.Forms.Editor this.creditsEditorToolStripMenuItem, this.deleteUnusedBINKAsToolStripMenuItem, this.openDataFolderToolStripMenuItem, - this.bulkReplaceExistingTracksToolStripMenuItem}); + this.bulkReplaceExistingTracksToolStripMenuItem, + this.organizeTracksToolStripMenuItem}); this.toolsToolStripMenuItem.ForeColor = System.Drawing.Color.White; this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem"; resources.ApplyResources(this.toolsToolStripMenuItem, "toolsToolStripMenuItem"); @@ -297,6 +299,12 @@ namespace PckStudio.Forms.Editor this.metroLabel1.Name = "metroLabel1"; this.metroLabel1.Theme = MetroFramework.MetroThemeStyle.Dark; // + // organizeTracksToolStripMenuItem + // + this.organizeTracksToolStripMenuItem.Name = "organizeTracksToolStripMenuItem"; + resources.ApplyResources(this.organizeTracksToolStripMenuItem, "organizeTracksToolStripMenuItem"); + this.organizeTracksToolStripMenuItem.Click += new System.EventHandler(this.organizeTracksToolStripMenuItem_Click); + // // AudioEditor // resources.ApplyResources(this, "$this"); @@ -352,5 +360,6 @@ namespace PckStudio.Forms.Editor private System.Windows.Forms.ToolStripMenuItem openDataFolderToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem bulkReplaceExistingTracksToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem changeCategoryToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem organizeTracksToolStripMenuItem; } } \ No newline at end of file diff --git a/PCK-Studio/Forms/Editor/AudioEditor.cs b/PCK-Studio/Forms/Editor/AudioEditor.cs index d651577a..d10a2207 100644 --- a/PCK-Studio/Forms/Editor/AudioEditor.cs +++ b/PCK-Studio/Forms/Editor/AudioEditor.cs @@ -574,5 +574,31 @@ namespace PckStudio.Forms.Editor MessageBox.Show("There are no categories that aren't already used", "All possible categories are used"); } } + + private void organizeTracksToolStripMenuItem_Click(object sender, EventArgs e) + { + if(MessageBox.Show("This function will move all binka files in the \"Data\" folder into a \"Music\" folder, to keep your data better organized. Would you like to continue?", "Move tracks?", MessageBoxButtons.YesNo) == DialogResult.Yes) + { + if (treeView1.Nodes.Count < 1 || !parent.CreateDataFolder()) return; + string musicdir = Path.Combine(parent.GetDataPath(), "Music"); + Directory.CreateDirectory(musicdir); + foreach (var category in audioFile.Categories) + { + for (var i = 0; i < category.SongNames.Count; i++) // using standard for loop so the list can be modified + { + string song = category.SongNames[i]; + string songpath = Path.Combine(parent.GetDataPath(), song + ".binka"); + if (File.Exists(songpath)) + { + File.Move(songpath, Path.Combine(musicdir, song + ".binka")); + } + + category.SongNames[i] = Path.Combine("Music", song.Replace(song, Path.GetFileNameWithoutExtension(songpath))); + } + } + treeView2.Nodes.Clear(); + treeView1.SelectedNode = null; + } + } } } diff --git a/PCK-Studio/Forms/Editor/AudioEditor.resx b/PCK-Studio/Forms/Editor/AudioEditor.resx index 0f797f69..8240c774 100644 --- a/PCK-Studio/Forms/Editor/AudioEditor.resx +++ b/PCK-Studio/Forms/Editor/AudioEditor.resx @@ -125,32 +125,6 @@ 127, 8 - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - vAAADrwBlbxySQAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMkMEa+wAAABSSURBVDhP5c0x - DsAgDENRxt7/wmkNSpRGf0CCCZAegxNMM7MlGMp3dIU6dxhKf/QMNxRogeQC8ivw5Vn7C0heJlFA+kL5 - jWAohxRkde4wnGftBS90axNmphIGAAAAAElFTkSuQmCC - - - - 168, 22 - - - Add Category - - - 168, 22 - - - Remove Category - - - 168, 22 - - - Set Category - 169, 70 @@ -410,28 +384,38 @@ 5 + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + vAAADrwBlbxySQAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMkMEa+wAAABSSURBVDhP5c0x + DsAgDENRxt7/wmkNSpRGf0CCCZAegxNMM7MlGMp3dIU6dxhKf/QMNxRogeQC8ivw5Vn7C0heJlFA+kL5 + jWAohxRkde4wnGftBS90axNmphIGAAAAAElFTkSuQmCC + + + + 168, 22 + + + Add Category + + + 168, 22 + + + Remove Category + + + 168, 22 + + + Set Category + 19, 8 False - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - vAAADrwBlbxySQAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4yMfEgaZUAAADfSURBVDhPYxg8 - QLt++3yTGbf/Fm599P/Nh49wfPXxq/+rTt37f+Dak/8gOSBgAGEMANIMxGBFyAasPf/0v8GE8//z1t8C - y4HU4DIALIluwLpLL+HiMANAGKoNAWASCavv/n/57gPcgOvP3oENOXj7NViOoAFGU6791+k4ghWD5Aga - QCyGakMAkODcU89R/I8Ng9TgNADk14dPn/8/c+kqVgySgwUqVBsCwAx49urN/zsPHmPFIDmaGvAXJInN - 38gYasBfqDYE0K7dOn/Wvut/sfkdGYPUgJI9VNuAAwYGAGn6yvdevWgPAAAAAElFTkSuQmCC - - - - 98, 22 - - - Save - 37, 20 @@ -462,42 +446,18 @@ Bulk Replace Existing Tracks + + 220, 22 + + + Organize Tracks + 46, 20 Tools - - 243, 22 - - - How to add songs - - - 243, 22 - - - What are the categories? - - - 243, 22 - - - How to edit credits - - - 243, 22 - - - How to optimize the Data folder - - - 243, 22 - - - BINKA Compression - 44, 20 @@ -528,38 +488,58 @@ 7 + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + vAAADrwBlbxySQAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4yMfEgaZUAAADfSURBVDhPYxg8 + QLt++3yTGbf/Fm599P/Nh49wfPXxq/+rTt37f+Dak/8gOSBgAGEMANIMxGBFyAasPf/0v8GE8//z1t8C + y4HU4DIALIluwLpLL+HiMANAGKoNAWASCavv/n/57gPcgOvP3oENOXj7NViOoAFGU6791+k4ghWD5Aga + QCyGakMAkODcU89R/I8Ng9TgNADk14dPn/8/c+kqVgySgwUqVBsCwAx49urN/zsPHmPFIDmaGvAXJInN + 38gYasBfqDYE0K7dOn/Wvut/sfkdGYPUgJI9VNuAAwYGAGn6yvdevWgPAAAAAElFTkSuQmCC + + + + 98, 22 + + + Save + + + 243, 22 + + + How to add songs + + + 243, 22 + + + What are the categories? + + + 243, 22 + + + How to edit credits + + + 243, 22 + + + How to optimize the Data folder + + + 243, 22 + + + BINKA Compression + Top, Bottom, Left, Right 282, 8 - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - vAAADrwBlbxySQAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMkMEa+wAAABSSURBVDhP5c0x - DsAgDENRxt7/wmkNSpRGf0CCCZAegxNMM7MlGMp3dIU6dxhKf/QMNxRogeQC8ivw5Vn7C0heJlFA+kL5 - jWAohxRkde4wnGftBS90axNmphIGAAAAAElFTkSuQmCC - - - - 173, 22 - - - Add Entry - - - 173, 22 - - - Remove Entry - - - 173, 22 - - - Verify File Location - 174, 70 @@ -590,6 +570,32 @@ 6 + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + vAAADrwBlbxySQAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMkMEa+wAAABSSURBVDhP5c0x + DsAgDENRxt7/wmkNSpRGf0CCCZAegxNMM7MlGMp3dIU6dxhKf/QMNxRogeQC8ivw5Vn7C0heJlFA+kL5 + jWAohxRkde4wnGftBS90axNmphIGAAAAAElFTkSuQmCC + + + + 173, 22 + + + Add Entry + + + 173, 22 + + + Remove Entry + + + 173, 22 + + + Verify File Location + True @@ -806,6 +812,12 @@ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + organizeTracksToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + AudioEditor