Example #1
0
 private void btnFakeOGG_Click(object sender, EventArgs e)
 {
     if (selectedExport != null)
     {
         SoundwaveTools.ImportOgg(selectedExport, "fake");
         treeMain_AfterSelect(treeMain, new TreeViewEventArgs(treeMain.SelectedNode));
     }
 }
Example #2
0
        private void setAllVolumeMultipliersToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (!PackageSelected())
            {
                return;
            }

            string input = Microsoft.VisualBasic.Interaction.InputBox(String.Format("New VolumeMultiplier for all SoundCues in {0}: \nFormat: x,xx", selectedPackage.Filename));

            float num;

            if (input == "" || !Single.TryParse(input, out num))
            {
                logger.Info("No/Invalid input");
            }
            else
            {
                logger.Trace(num);
                SoundwaveTools.SetAllVolumes(selectedPackage, num);
                logger.Info("Set Volumes for {0} to {1}.", selectedPackage.Filename, num);
            }
        }
Example #3
0
        private void btnExtractOGG_Click(object sender, EventArgs e)
        {
            if (selectedExport != null && selectedExport.ClassName == "Core.SoundNodeWave")
            {
                var path = MiscFuncs.GenerateSaveDialog(selectedExport.ObjectName, ".ogg");
                if (path != "")
                {
                    SoundwaveTools.ExportOgg(selectedExport, path);
                }
            }
            else if (selectedPackage != null && selectedClass == "Core.SoundNodeWave")
            {
                List <GpkExport> exports = selectedPackage.GetExportsByClass(selectedClass);

                if (exports.Count == 0)
                {
                    logger.Info("No oggs found for class {0}.", selectedClass);
                    return;
                }


                FolderBrowserDialog dialog = new FolderBrowserDialog();
                dialog.SelectedPath = Path.GetDirectoryName(Settings.Default.SaveDir);
                DialogResult result = dialog.ShowDialog();

                if (result == DialogResult.OK)
                {
                    Settings.Default.SaveDir = dialog.SelectedPath;

                    foreach (GpkExport exp in exports)
                    {
                        SoundwaveTools.ExportOgg(exp, String.Format("{0}\\{1}.ogg", dialog.SelectedPath, exp.ObjectName));
                        logger.Trace("ogg save for " + exp.UID);
                    }

                    logger.Info("Mass export to {0} was successful.", dialog.SelectedPath);
                }
            }
        }
Example #4
0
        private void customToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (!PackageSelected())
            {
                return;
            }

            try
            {
                string className = Microsoft.VisualBasic.Interaction.InputBox("Classname UID?\nWrite #all to select every object.\nSupported types: Int, Float (x,xx), Bool, String");
                string propName  = Microsoft.VisualBasic.Interaction.InputBox("Proprty Name to edit?");
                string propValue = Microsoft.VisualBasic.Interaction.InputBox("Proprty Value:");

                List <GpkExport> exports = selectedPackage.GetExportsByClass(className);

                SoundwaveTools.SetPropertyDetails(exports, propName, propValue);

                logger.Info("Custom set success for {0} Objects.", exports.Count);
            }
            catch (Exception ex)
            {
                logger.Fatal("Custom update fail. Ex " + ex);
            }
        }
Example #5
0
        private void btnImportOgg_Click(object sender, EventArgs e)
        {
            try
            {
                if (selectedExport != null)
                {
                    String[] files = MiscFuncs.GenerateOpenDialog();
                    if (files.Length == 0)
                    {
                        return;
                    }

                    if (File.Exists(files[0]))
                    {
                        SoundwaveTools.ImportOgg(selectedExport, files[0]);
                        treeMain_AfterSelect(treeMain, new TreeViewEventArgs(treeMain.SelectedNode));
                        logger.Info("Import successful.");
                    }
                    else
                    {
                        logger.Info("File not found.");
                    }
                }
                else if (selectedPackage != null && selectedClass == "Core.SoundNodeWave")
                {
                    List <GpkExport> exports = selectedPackage.GetExportsByClass(selectedClass);

                    FolderBrowserDialog dialog = new FolderBrowserDialog();
                    dialog.SelectedPath = Path.GetDirectoryName(Settings.Default.SaveDir);
                    DialogResult result = dialog.ShowDialog();

                    if (result == DialogResult.OK)
                    {
                        Settings.Default.SaveDir = dialog.SelectedPath;

                        string[] files = Directory.GetFiles(dialog.SelectedPath);

                        foreach (string file in files)
                        {
                            string filename = Path.GetFileName(file); //AttackL_02.ogg
                            string oggname  = filename.Remove(filename.Length - 4);

                            if (oggname == "")
                            {
                                continue;
                            }

                            foreach (GpkExport exp in exports)
                            {
                                if (exp.ObjectName == oggname)
                                {
                                    SoundwaveTools.ImportOgg(exp, file);
                                    logger.Trace("Matched file {0} to export {1}!", filename, exp.ObjectName);
                                    break;
                                }
                            }
                        }


                        logger.Info("Mass import to {0} was successful.", dialog.SelectedPath);
                    }
                }
            }
            catch (Exception ex)
            {
                logger.FatalException("Import failure! " + ex, ex);
            }
        }