Пример #1
0
        private async void LoadAcb(string path)
        {
            var controller = await this.ShowProgressAsync($"Loading \"{System.IO.Path.GetFileName(path)}\"...", $"", false, new MetroDialogSettings()
            {
                AnimateHide = false, AnimateShow = false, DialogTitleFontSize = 15, DialogMessageFontSize = 12
            });

            controller.SetIndeterminate();

            try
            {
                await Task.Run(() =>
                {
                    AcbFile = new ACB_Wrapper(ACB_File.Load(path));
                });

                controller.CloseAsync();
                UndoManager.Instance.Clear();

                if (AcbFile != null)
                {
                    AcbPath = path;

                    if (AcbFile.AcbFile.TableValidationFailed)
                    {
                        await this.ShowMessageAsync("Validation Failed", "This file contains unknown data that could not be loaded and was skipped. Continuing at this point may very likely result in this ACB becoming corrupt.\n\nYou've been warned!", MessageDialogStyle.Affirmative, new MetroDialogSettings()
                        {
                            AnimateShow = false, AnimateHide = false
                        });
                    }
                    if (AcbFile.AcbFile.ExternalAwbError)
                    {
                        await this.ShowMessageAsync("Validation Failed", "There should be an external AWB file with this ACB, but none was found. Because of this some tracks could not be loaded.", MessageDialogStyle.Affirmative, new MetroDialogSettings()
                        {
                            AnimateShow = false, AnimateHide = false
                        });
                    }
                }
            }
            catch (Exception ex)
            {
                controller.CloseAsync();
                ExceptionDispatchInfo.Capture(ex.InnerException).Throw();
            }
        }
Пример #2
0
        public MusicInstaller(Install_NEW _install, string musicPackagePath)
        {
            install      = _install;
            musicPackage = ACB_File.Load(install.zipManager.GetFileFromArchive(GeneralInfo.GetPathInZipDataDir(musicPackagePath)), null, false, true);
            bgmAcb       = (ACB_File)install.GetParsedFile <ACB_File>(BGM_PATH, false);

            if (musicPackage.MusicPackageType == MusicPackageType.NewOption)
            {
                oblFile = (OBL_File)install.GetParsedFile <OBL_File>(OBL_PATH, false);

                for (int i = 0; i < GeneralInfo.LanguageSuffix.Length; i++)
                {
                    msgFiles.Add((MSG_File)install.GetParsedFile <MSG_File>($"{OPTION_MSG_PATH}{GeneralInfo.LanguageSuffix[i]}", false));
                }
            }

            Install();
        }
Пример #3
0
        public AcbInstaller(Install _install, string musicPackagePath)
        {
            install      = _install;
            musicPackage = ACB_File.Load(install.zipManager.GetFileFromArchive(GeneralInfo.GetPathInZipDataDir(musicPackagePath)), null, false, true);

            if (musicPackage.MusicPackageType == MusicPackageType.BGM_Direct || musicPackage.MusicPackageType == MusicPackageType.BGM_NewOption)
            {
                LoadMusicFiles();
                InstallMusic();
            }
            else if (musicPackage.MusicPackageType == MusicPackageType.CSS_Voice)
            {
                LoadCssFiles();
                InstallCss();
            }
            else
            {
                throw new InvalidOperationException($"Unknown MusicPackage Type: {musicPackage.MusicPackageType}");
            }
        }
Пример #4
0
        private async void LoadAcb(string path, bool forceLoad = false)
        {
            AcbFormatHelper.Instance.AcbFormatHelperMain.ForceLoad = forceLoad;

            var controller = await this.ShowProgressAsync($"Loading \"{System.IO.Path.GetFileName(path)}\"...", $"", false, DialogSettings.Default);

            controller.SetIndeterminate();

            try
            {
                await Task.Run(() =>
                {
                    AcbFile = new ACB_Wrapper(ACB_File.Load(path));
                });

                UndoManager.Instance.Clear();

                if (AcbFile != null)
                {
                    AcbPath = path;

                    if (AcbFile.AcbFile.TableValidationFailed)
                    {
                        await this.ShowMessageAsync("Validation Failed", "This file contains unknown data that could not be loaded and was skipped. Continuing at this point may very likely result in this ACB losing data or becoming corrupt.\n\nYou've been warned!", MessageDialogStyle.Affirmative, DialogSettings.Default);
                    }
                    if (AcbFile.AcbFile.ExternalAwbError)
                    {
                        await this.ShowMessageAsync("Validation Failed", "There should be an external AWB file with this ACB, but none was found. Because of this some tracks could not be loaded.", MessageDialogStyle.Affirmative, DialogSettings.Default);
                    }
                }
            }
            finally
            {
                controller.CloseAsync();
            }
        }