Update AudioEditor

This commit is contained in:
miku-666
2022-06-08 20:27:34 +02:00
parent fb1bde2257
commit ebd908b630
6 changed files with 217 additions and 336 deletions

View File

@@ -166,7 +166,6 @@ namespace PckStudio.Forms.Utilities
resources.ApplyResources(this.metroLabel2, "metroLabel2");
this.metroLabel2.Name = "metroLabel2";
this.metroLabel2.Theme = MetroFramework.MetroThemeStyle.Dark;
this.metroLabel2.Click += new System.EventHandler(this.metroLabel2_Click);
//
// metroLabel1
//

View File

@@ -23,7 +23,6 @@ namespace PckStudio.Forms.Utilities
public string defaultType = "yes";
public string cat;
public List<int> cats = new List<int>();
public List<int> totalCats = new List<int>();
public class NodeSorter : System.Collections.IComparer
{
@@ -69,11 +68,11 @@ namespace PckStudio.Forms.Utilities
}
PCKFile audioPCK;
bool isVita;
PCKFile.FileData mf;
public AudioEditor(PCKFile.FileData MineFile, bool littleEndian)
bool _isLittleEndian;
public AudioEditor(PCKFile.FileData MineFile, bool isLittleEndian)
{
isVita = littleEndian;
_isLittleEndian = isLittleEndian;
ImageList catImages = new ImageList();
catImages.ColorDepth = ColorDepth.Depth32Bit;
catImages.Images.Add(Properties.Resources.audio_0_overworld);
@@ -92,37 +91,32 @@ namespace PckStudio.Forms.Utilities
mf = MineFile;
using (var stream = new MemoryStream(mf.data))
{
audioPCK = PCKFileReader.Read(stream, isVita);
audioPCK = PCKFileReader.Read(stream, isLittleEndian);
}
if (!audioPCK.meta_data.ContainsKey("CUENAME"))
if (!audioPCK.meta_data.ContainsKey("CUENAME") || audioPCK.type != 1)
{
throw new Exception("This is not a valid audio.pck file");
}
//defaultType = audioPCK.meta_data["CUENAME"];
int index = 0;
List<PCKFile.FileData> tempMineFiles = audioPCK.file_entries;
foreach (PCKFile.FileData mineFile in tempMineFiles)
{
mineFile.name = getCatString(mineFile.type);
Console.WriteLine("Category Found: " + mineFile.name);
string CatString = getCatString(mineFile.type);
Console.WriteLine("Category Found: " + CatString);
if (cats.Contains(mineFile.type))
{
Console.WriteLine("Duplicate category found, " + getCatString(mineFile.type) + ". Combining...");
Console.WriteLine("Duplicate category found, " + CatString + ". Combining...");
audioPCK.file_entries.Remove(mineFile);
audioPCK.file_entries.Find(category => category.name == getCatString(mineFile.type)).properties = mineFile.properties;
}
else
{
TreeNode treeNode = new TreeNode();
treeNode.Text = mineFile.name;
TreeNode treeNode = new TreeNode(CatString);
treeNode.Tag = mineFile;
//treeNode.ImageIndex = mineFile.type;
//treeNode.SelectedImageIndex = mineFile.type;
treeView1.Nodes.Add(treeNode);
cats.Add((int)mineFile.type);
treeNode.ImageIndex = mineFile.type;
treeNode.SelectedImageIndex = mineFile.type;
treeView1.Nodes.Add(treeNode);
cats.Add(mineFile.type);
}
index++;
}
treeView1.TreeViewNodeSorter = new NodeSorter();
@@ -132,14 +126,13 @@ namespace PckStudio.Forms.Utilities
private void treeView2_AfterSelect(object sender, TreeViewEventArgs e)
{
comboBox1.Items.Clear(); //Resets metadata combobox of selectable entry names
if (e.Node.Tag == null) return;
var strings = (Tuple<string, string>)e.Node.Tag;
if (e.Node.Tag == null || !(e.Node.Tag is Tuple<string, string>)) return;
var strings = e.Node.Tag as Tuple<string, string>;
comboBox1.Text = strings.Item1;
textBox1.Text = strings.Item2;
foreach (var metaType in audioPCK.meta_data)
comboBox1.Items.Add(metaType.Key);
comboBox1.Text = strings.Item1;//Sets currently selected metadata type to type selected in selected metadata node
textBox1.Text = strings.Item2;//Sets currently selected metadata value to value selected in selected metadata node
}
private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
@@ -160,9 +153,9 @@ namespace PckStudio.Forms.Utilities
{
if (treeView2.SelectedNode != null)
{
//object[] strings = (object[])treeView2.SelectedNode.Tag;
//strings[1] = textBox1.Text;
}
//var strings = (Tuple<string, string>)treeView2.SelectedNode.Tag;
//strings[1] = textBox1.Text;
}
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
@@ -183,43 +176,47 @@ namespace PckStudio.Forms.Utilities
int check = Enumerable.Range(0, 8).Except(cats).First(); // Exclude Unused for now
if (0 <= check && check <= 8)
{
PckStudio.addCategory add = new PckStudio.addCategory(this);//sets category adding dialog
add.ShowDialog();//displays metadata adding dialog
addCategory add = new addCategory(this);//sets category adding dialog
if (add.ShowDialog() == DialogResult.OK)
add.Dispose();//diposes generated metadata adding dialog data
if (!cats.Contains(getCatID(cat))) cats.Add(getCatID(cat));
else return;
PCKFile.FileData mf = new PCKFile.FileData(cat, getCatID(cat)); //Creates new minefile template
TreeNode addNode = new TreeNode(mf.name) { Tag = mf };//creates node for minefile
//addNode.ImageIndex = mf.type;
//addNode.SelectedImageIndex = mf.type;
//audioPCKFile.FileDatas.Add(mf);
treeView1.Nodes.Add(addNode);
PCKFile.FileData mf = new PCKFile.FileData(cat, getCatID(cat));
TreeNode addNode = new TreeNode(mf.name) { Tag = mf };
audioPCK.file_entries.Add(mf);
treeView1.Nodes.Add(addNode);
treeView1.Sort();
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
MessageBox.Show("All possible categories are used", "There are no more categories that could be added");
}
}
private void addEntryMenuItem_Click(object sender, EventArgs e)
{
if (treeView1.SelectedNode == null) return;
if (treeView1.SelectedNode == null && !(treeView1.SelectedNode.Tag is PCKFile.FileData)) return;
var file = treeView1.SelectedNode.Tag as PCKFile.FileData;
TreeNode meta = new TreeNode("New Entry");
//meta.Tag = obj;
treeView2.Nodes.Add(meta);
//((PCKFile.FileData)treeView1.SelectedNode.Tag).properties.Add(defaultType, new List<string> { "New Entry" });
}
meta.Tag = file;
treeView2.Nodes.Add(meta);
file.properties.Add(new ValueTuple<string, string>(defaultType, "New Entry"));
}
public void treeView2_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Delete && treeView2.SelectedNode != null)
if (e.KeyCode == Keys.Delete && treeView2.SelectedNode != null &&
treeView2.SelectedNode.Tag is ValueTuple<string, string> &&
treeView1.SelectedNode.Tag is PCKFile.FileData)
{
if (treeView1.SelectedNode == null) return; // makes sure you don't run this if there is nothing to delete
//((PCKFile.FileData)treeView1.SelectedNode.Tag).properties.Remove((string)treeView2.SelectedNode.Tag);
treeView2.SelectedNode.Remove();
}
var file = treeView1.SelectedNode.Tag as PCKFile.FileData;
var property = (ValueTuple<string, string>)treeView2.SelectedNode.Tag;
file.properties.Remove(property);
treeView2.SelectedNode.Remove();
}
}
private void removeCategoryStripMenuItem_Click(object sender, EventArgs e)
@@ -249,136 +246,28 @@ namespace PckStudio.Forms.Utilities
private void Binka_DragDrop(object sender, DragEventArgs e)
{
if (treeView1.SelectedNode != null)
if (treeView1.SelectedNode != null &&
treeView1.SelectedNode.Tag is PCKFile.FileData)
{
string[] FileList = (string[])e.Data.GetData(DataFormats.FileDrop, false);
var file = treeView1.SelectedNode.Tag as PCKFile.FileData;
foreach (string binka in FileList)
{
if(System.IO.Path.GetExtension(binka) == ".binka")
if(Path.GetExtension(binka) == ".binka")
{
object[] obj = { };
TreeNode meta = new TreeNode();
meta.Text = "CUENAME";
meta.Tag = obj;
treeView2.Nodes.Add(meta);
((PCKFile.FileData)treeView1.SelectedNode.Tag).properties.Add(new Tuple<string, string>("CUENAME", Path.GetFileNameWithoutExtension(binka)));
TreeNode meta = new TreeNode("CUENAME");
var property = new ValueTuple<string, string>("CUENAME", Path.GetFileNameWithoutExtension(binka));
meta.Tag = property;
treeView2.Nodes.Add(meta);
file.properties.Add(property);
}
}
}
}
//private static void writeMinecraftString(FileOutput f, string str)
//{
// byte[] d = Encoding.BigEndianUnicode.GetBytes(str);
// f.writeInt(d.Length / 2);
// f.writeBytes(d);
// f.writeInt(0);
//}
//private static void writeMinecraftStringVita(FileOutput f, string str)
//{
// Console.WriteLine("WriteVita -- " + str);
// byte[] bytes = Encoding.Unicode.GetBytes(str);
// f.writeIntVita(bytes.Length / 2);
// f.writeBytes((bytes));
// f.writeIntVita(0);
//}
//public static byte[] buildAudioPCKVita(PCKFile pck)
//{
// FileOutput fileOutput = new FileOutput();
// fileOutput.Endian = Endianness.Big;
// fileOutput.writeIntVita(1);
// fileOutput.writeIntVita(pck.meta_data.Count);
//foreach (int num in pck.meta_data.Keys)
//{
// fileOutput.writeIntVita(num);
// writeMinecraftStringVita(fileOutput, pck.meta_data[num]);
//}
//fileOutput.writeIntVita(PCKFile.FileDatas.Count);
//foreach (PCKFile.FileData mineFile in PCKFile.FileDatas)
//{
// mineFile.name = "";
// fileOutput.writeIntVita(mineFile.data.Length);
// fileOutput.writeIntVita(mineFile.type);
// writeMinecraftStringVita(fileOutput, mineFile.name);
//}
//foreach (PCKFile.FileData mineFile2 in PCKFile.FileDatas)
//{
// string str = "";
// try
// {
// fileOutput.writeIntVita(mineFile2.properties.Count);
// foreach (var array in mineFile2.properties)
// {
// str = array.Key;
// fileOutput.writeIntVita(pck.typeCodes[array.Key]);
// writeMinecraftStringVita(fileOutput, array.Value);
// }
// fileOutput.writeBytes(mineFile2.data);
// }
// catch (Exception)
// {
// MessageBox.Show(str + " is not in the main metadatabase");
// break;
// }
//}
// return fileOutput.getBytes();
//}
public static byte[] buildAudioPCK(PCKFile pck)
{
//FileOutput f = new FileOutput();
//f.Endian = pck.isLittleEndian ? Endianness.Little : Endianness.Big;
//f.writeInt(1);
//f.writeInt(pck.meta_data.Count);
//foreach (int type in pck.meta_data.Keys)
//{
// f.writeInt(type);
// writeMinecraftString(f, pck.meta_data[type]);
//}
//f.writeInt(PCKFile.FileDatas.Count);
//Console.WriteLine(PCKFile.FileDatas.Count);
//foreach (PCKFile.FileData mf in PCKFile.FileDatas)
//{
// mf.name = "";
// f.writeInt(mf.data.Length);
// f.writeInt(mf.type);
// writeMinecraftString(f, mf.name);
//}
//foreach (PCKFile.FileData mf in PCKFile.FileDatas)
//{
// string missing = "";
// try
// {
// f.writeInt(mf.properties.Count);
// foreach (var entry in mf.properties)
// {
// missing = entry.Key;
// f.writeInt(pck.typeCodes[entry.Key]);
// writeMinecraftString(f, entry.Value);
// }
// f.writeBytes(mf.data);
// }
// catch (Exception)
// {
// MessageBox.Show(missing + " is not in the main metadatabase");
// break;
// }
//}
//return f.getBytes();
return new byte[0];
}
private void saveToolStripMenuItem1_Click(object sender, EventArgs e)
{
FormMain.treeViewToMineFiles(treeView1, audioPCK);
//FormMain.treeViewToMineFiles(treeView1, audioPCK);
if(!cats.Contains(0) || !cats.Contains(1) || !cats.Contains(2))
{
@@ -389,23 +278,21 @@ namespace PckStudio.Forms.Utilities
bool emptyCat = false;
foreach (PCKFile.FileData mf in audioPCK.file_entries)
emptyCat = mf.properties.Count == 0;
if(mf.properties.Count == 0) emptyCat = true;
if (emptyCat)
{
MessageBox.Show("The game will crash upon loading your pack if a category is empty", "Empty Category");
return;
}
//mf.data = isVita ? buildAudioPCKVita(audioPCK) : buildAudioPCK(audioPCK);
using(var stream = new MemoryStream())
{
PCKFileWriter.Write(stream, audioPCK, _isLittleEndian);
mf.SetData(stream.ToArray());
}
saved = true;
}
private void metroLabel2_Click(object sender, EventArgs e)
{
}
private void treeView2_DragEnter(object sender, DragEventArgs e)
{
e.Effect = DragDropEffects.All;

View File

@@ -125,43 +125,6 @@
<value>127, 8</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="contextMenuStrip1.Size" type="System.Drawing.Size, System.Drawing">
<value>169, 48</value>
</data>
<data name="&gt;&gt;contextMenuStrip1.Name" xml:space="preserve">
<value>contextMenuStrip1</value>
</data>
<data name="&gt;&gt;contextMenuStrip1.Type" xml:space="preserve">
<value>System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="treeView1.Location" type="System.Drawing.Point, System.Drawing">
<value>20, 84</value>
</data>
<data name="treeView1.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 0, 0, 0</value>
</data>
<data name="treeView1.MaximumSize" type="System.Drawing.Size, System.Drawing">
<value>205, 350</value>
</data>
<data name="treeView1.Size" type="System.Drawing.Size, System.Drawing">
<value>118, 230</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="treeView1.TabIndex" type="System.Int32, mscorlib">
<value>12</value>
</data>
<data name="&gt;&gt;treeView1.Name" xml:space="preserve">
<value>treeView1</value>
</data>
<data name="&gt;&gt;treeView1.Type" xml:space="preserve">
<value>System.Windows.Forms.TreeView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;treeView1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;treeView1.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="addCategoryStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
@@ -182,12 +145,74 @@
<data name="removeCategoryStripMenuItem.Text" xml:space="preserve">
<value>Remove Category</value>
</data>
<data name="contextMenuStrip1.Size" type="System.Drawing.Size, System.Drawing">
<value>169, 48</value>
</data>
<data name="&gt;&gt;contextMenuStrip1.Name" xml:space="preserve">
<value>contextMenuStrip1</value>
</data>
<data name="&gt;&gt;contextMenuStrip1.Type" xml:space="preserve">
<value>System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="treeView1.Location" type="System.Drawing.Point, System.Drawing">
<value>20, 84</value>
</data>
<data name="treeView1.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 0, 0, 0</value>
</data>
<data name="treeView1.Size" type="System.Drawing.Size, System.Drawing">
<value>128, 230</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="treeView1.TabIndex" type="System.Int32, mscorlib">
<value>12</value>
</data>
<data name="&gt;&gt;treeView1.Name" xml:space="preserve">
<value>treeView1</value>
</data>
<data name="&gt;&gt;treeView1.Type" xml:space="preserve">
<value>System.Windows.Forms.TreeView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;treeView1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;treeView1.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<metadata name="menuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>19, 8</value>
</metadata>
<data name="menuStrip.AutoSize" type="System.Boolean, mscorlib">
<value>False</value>
</data>
<data name="saveToolStripMenuItem1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
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
</value>
</data>
<data name="saveToolStripMenuItem1.Size" type="System.Drawing.Size, System.Drawing">
<value>98, 22</value>
</data>
<data name="saveToolStripMenuItem1.Text" xml:space="preserve">
<value>Save</value>
</data>
<data name="fileToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>37, 20</value>
</data>
<data name="fileToolStripMenuItem.Text" xml:space="preserve">
<value>File</value>
</data>
<data name="helpToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>44, 20</value>
</data>
<data name="helpToolStripMenuItem.Text" xml:space="preserve">
<value>Help</value>
</data>
<data name="menuStrip.Location" type="System.Drawing.Point, System.Drawing">
<value>20, 60</value>
</data>
@@ -212,70 +237,12 @@
<data name="&gt;&gt;menuStrip.ZOrder" xml:space="preserve">
<value>8</value>
</data>
<data name="fileToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>37, 20</value>
</data>
<data name="fileToolStripMenuItem.Text" xml:space="preserve">
<value>File</value>
</data>
<data name="saveToolStripMenuItem1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
vwAADr8BOAVTJAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4yMfEgaZUAAADfSURBVDhPYxg8
QLt++3yTGbf/Fm599P/Nh49wfPXxq/+rTt37f+Dak/8gOSBgAGEMANIMxGBFyAasPf/0v8GE8//z1t8C
y4HU4DIALIluwLpLL+HiMANAGKoNAWASCavv/n/57gPcgOvP3oENOXj7NViOoAFGU6791+k4ghWD5Aga
QCyGakMAkODcU89R/I8Ng9TgNADk14dPn/8/c+kqVgySgwUqVBsCwAx49urN/zsPHmPFIDmaGvAXJInN
38gYasBfqDYE0K7dOn/Wvut/sfkdGYPUgJI9VNuAAwYGAGn6yvdevWgPAAAAAElFTkSuQmCC
</value>
</data>
<data name="saveToolStripMenuItem1.Size" type="System.Drawing.Size, System.Drawing">
<value>98, 22</value>
</data>
<data name="saveToolStripMenuItem1.Text" xml:space="preserve">
<value>Save</value>
</data>
<data name="helpToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>44, 20</value>
</data>
<data name="helpToolStripMenuItem.Text" xml:space="preserve">
<value>Help</value>
</data>
<data name="treeView2.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Bottom</value>
<value>Top, Bottom, Left</value>
</data>
<metadata name="contextMenuStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>282, 8</value>
</metadata>
<data name="contextMenuStrip2.Size" type="System.Drawing.Size, System.Drawing">
<value>148, 48</value>
</data>
<data name="&gt;&gt;contextMenuStrip2.Name" xml:space="preserve">
<value>contextMenuStrip2</value>
</data>
<data name="&gt;&gt;contextMenuStrip2.Type" xml:space="preserve">
<value>System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="treeView2.Location" type="System.Drawing.Point, System.Drawing">
<value>141, 84</value>
</data>
<data name="treeView2.Size" type="System.Drawing.Size, System.Drawing">
<value>143, 230</value>
</data>
<data name="treeView2.TabIndex" type="System.Int32, mscorlib">
<value>13</value>
</data>
<data name="&gt;&gt;treeView2.Name" xml:space="preserve">
<value>treeView2</value>
</data>
<data name="&gt;&gt;treeView2.Type" xml:space="preserve">
<value>System.Windows.Forms.TreeView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;treeView2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;treeView2.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="addEntryMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
@@ -296,8 +263,38 @@
<data name="removeEntryMenuItem.Text" xml:space="preserve">
<value>Remove Entry</value>
</data>
<data name="contextMenuStrip2.Size" type="System.Drawing.Size, System.Drawing">
<value>148, 48</value>
</data>
<data name="&gt;&gt;contextMenuStrip2.Name" xml:space="preserve">
<value>contextMenuStrip2</value>
</data>
<data name="&gt;&gt;contextMenuStrip2.Type" xml:space="preserve">
<value>System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="treeView2.Location" type="System.Drawing.Point, System.Drawing">
<value>151, 84</value>
</data>
<data name="treeView2.Size" type="System.Drawing.Size, System.Drawing">
<value>133, 230</value>
</data>
<data name="treeView2.TabIndex" type="System.Int32, mscorlib">
<value>13</value>
</data>
<data name="&gt;&gt;treeView2.Name" xml:space="preserve">
<value>treeView2</value>
</data>
<data name="&gt;&gt;treeView2.Type" xml:space="preserve">
<value>System.Windows.Forms.TreeView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;treeView2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;treeView2.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="comboBox1.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Right</value>
<value>Top, Left, Right</value>
</data>
<data name="comboBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>290, 155</value>
@@ -321,7 +318,7 @@
<value>6</value>
</data>
<data name="textBox1.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Right</value>
<value>Top, Left, Right</value>
</data>
<data name="textBox1.Location" type="System.Drawing.Point, System.Drawing">
<value>290, 209</value>
@@ -416,6 +413,9 @@
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>450, 330</value>
</data>
<data name="$this.MinimumSize" type="System.Drawing.Size, System.Drawing">
<value>450, 330</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Music Editor</value>
</data>

View File

@@ -28,52 +28,52 @@
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(addCategory));
this.label2 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.SuspendLayout();
//
// label2
//
resources.ApplyResources(this.label2, "label2");
this.label2.ForeColor = System.Drawing.Color.White;
this.label2.Name = "label2";
//
// button1
//
resources.ApplyResources(this.button1, "button1");
this.button1.ForeColor = System.Drawing.Color.White;
this.button1.Name = "button1";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// comboBox1
//
this.comboBox1.FormattingEnabled = true;
resources.ApplyResources(this.comboBox1, "comboBox1");
this.comboBox1.Name = "comboBox1";
this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
//
// addCategory
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ControlBox = false;
this.Controls.Add(this.comboBox1);
this.Controls.Add(this.button1);
this.Controls.Add(this.label2);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "addCategory";
this.Resizable = false;
this.ShadowType = MetroFramework.Forms.MetroFormShadowType.DropShadow;
this.Style = MetroFramework.MetroColorStyle.Silver;
this.Theme = MetroFramework.MetroThemeStyle.Dark;
this.Load += new System.EventHandler(this.addCategory_Load);
this.ResumeLayout(false);
this.PerformLayout();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(addCategory));
this.label2 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.SuspendLayout();
//
// label2
//
resources.ApplyResources(this.label2, "label2");
this.label2.ForeColor = System.Drawing.Color.White;
this.label2.Name = "label2";
//
// button1
//
resources.ApplyResources(this.button1, "button1");
this.button1.ForeColor = System.Drawing.Color.White;
this.button1.Name = "button1";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// comboBox1
//
this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBox1.FormattingEnabled = true;
resources.ApplyResources(this.comboBox1, "comboBox1");
this.comboBox1.Name = "comboBox1";
//
// addCategory
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ControlBox = false;
this.Controls.Add(this.comboBox1);
this.Controls.Add(this.button1);
this.Controls.Add(this.label2);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "addCategory";
this.Resizable = false;
this.ShadowType = MetroFramework.Forms.MetroFormShadowType.DropShadow;
this.Style = MetroFramework.MetroColorStyle.Silver;
this.Theme = MetroFramework.MetroThemeStyle.Dark;
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion

View File

@@ -14,31 +14,26 @@ namespace PckStudio
{
public partial class addCategory : MetroFramework.Forms.MetroForm
{
PckStudio.Forms.Utilities.AudioEditor audio;
public addCategory(PckStudio.Forms.Utilities.AudioEditor audioIn)
public string Category { get; private set; }
public addCategory(Forms.Utilities.AudioEditor audioIn)
{
InitializeComponent();
audio = audioIn;
if(!audio.cats.Contains(0)) comboBox1.Items.Add("Overworld");
if(!audio.cats.Contains(1)) comboBox1.Items.Add("Nether");
if(!audio.cats.Contains(2)) comboBox1.Items.Add("End");
if(!audio.cats.Contains(3)) comboBox1.Items.Add("Creative");
if(!audio.cats.Contains(4)) comboBox1.Items.Add("Menu");
if(!audio.cats.Contains(5)) comboBox1.Items.Add("Battle");
if(!audio.cats.Contains(6)) comboBox1.Items.Add("Tumble");
if(!audio.cats.Contains(7)) comboBox1.Items.Add("Glide");
if(!audioIn.cats.Contains(0)) comboBox1.Items.Add("Overworld");
if(!audioIn.cats.Contains(1)) comboBox1.Items.Add("Nether");
if(!audioIn.cats.Contains(2)) comboBox1.Items.Add("End");
if(!audioIn.cats.Contains(3)) comboBox1.Items.Add("Creative");
if(!audioIn.cats.Contains(4)) comboBox1.Items.Add("Menu");
if(!audioIn.cats.Contains(5)) comboBox1.Items.Add("Battle");
if(!audioIn.cats.Contains(6)) comboBox1.Items.Add("Tumble");
if(!audioIn.cats.Contains(7)) comboBox1.Items.Add("Glide");
FormBorderStyle = FormBorderStyle.None;
}
private void button1_Click(object sender, EventArgs e)
{
audio.cat = comboBox1.Text;
if(comboBox1.SelectedIndex > -1) this.Close();
}
private void addCategory_Load(object sender, EventArgs e)
{
Category = comboBox1.Text;
DialogResult = DialogResult.OK;
if(comboBox1.SelectedIndex > -1) Close();
}
}

View File

@@ -151,7 +151,7 @@
<value>Flat</value>
</data>
<data name="button1.Location" type="System.Drawing.Point, System.Drawing">
<value>96, 78</value>
<value>94, 75</value>
</data>
<data name="button1.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
@@ -160,7 +160,7 @@
<value>4</value>
</data>
<data name="button1.Text" xml:space="preserve">
<value>Create</value>
<value>Add</value>
</data>
<data name="&gt;&gt;button1.Name" xml:space="preserve">
<value>button1</value>