Ejemplo n.º 1
0
        public ManageStrings(DieselStrings strings)
        {
            InitializeComponent();

            this._original = strings.strings;
        }
        public ManageStrings(DieselStrings strings)
        {
            InitializeComponent();

            this._original = strings.strings;
        }
        private void ConfigureReplacementButton_Click(object sender, EventArgs e)
        {
            /*
             * File Replacement
             * Patch Script
             * Strings Patch
             * Sound Bank Patch
             */

            ulong path, extension;
            uint language;

            switch(this.fileReplacementType_ComboBox.Text)
            {
                case ("File Replacement"):
                    return;
                case ("Strings Patch"):
                    if (!this.CheckBundleFileName(this.BundleFileName.Text.ToLower().Replace('\\', '/'), out path, out extension, out language))
                    {
                        return;
                    }
                    BundleRewriteItem tempBRI = new BundleRewriteItem(path, language, extension);
                    tempBRI.IsLanguageSpecific = (Path.GetFileName(this.BundleFileName.Text).Split('.').Length == 3);

                    BundleRewriter br = new BundleRewriter(StaticStorage.settings.AssetsFolder);
                    MemoryStream stringsStream = new MemoryStream();
                    br.RetrieveFile(tempBRI, out stringsStream);
                    DieselStrings ds = new DieselStrings(stringsStream);

                    ManageStrings msForm = new ManageStrings(ds);
                    msForm.ShowDialog(this);
                    /*
                    FileControl filecontrolForm = new FileControl();
                    filecontrolForm.filecontrolDictionary = filecontrolDictionary;
                    filecontrolForm.filecontrolSelectedDictionary = filecontrolSelectedDictionary;
                    filecontrolForm.ShowDialog(this);

                    filecontrolSelectedDictionary = filecontrolForm.filecontrolSelectedDictionary;
                    */
                    break;
                case ("Sound Bank Patch"):

                    if (!this.CheckBundleFileName(this.BundleFileName.Text.ToLower().Replace('\\', '/'), out path, out extension, out language))
                    {
                        return;
                    }
                    BundleRewriteItem soundtempBRI = new BundleRewriteItem(path, language, extension);
                    soundtempBRI.IsLanguageSpecific = (Path.GetFileName(this.BundleFileName.Text).Split('.').Length == 3);

                    BundleRewriter soundbr = new BundleRewriter(StaticStorage.settings.AssetsFolder);
                    MemoryStream soundStream = new MemoryStream();

                    soundbr.RetrieveFile(soundtempBRI, out soundStream);

                    SoundPatch spForm = new SoundPatch(Path.GetFileNameWithoutExtension(this.BundleFileName.Text.ToLower()), soundStream);
                    spForm.ShowDialog(this);

                    break;
                default:
                break;
            }
        }