public MusicUninstaller(Uninstall _uninstall, _File _file) { file = _file; uninstall = _uninstall; bgmAcb = (ACB_File)uninstall.GetParsedFile <ACB_File>(MusicInstaller.BGM_PATH, false); if (_file.filePath == MusicInstaller.OPTION_INSTALL_TYPE) { oblFile = (OBL_File)uninstall.GetParsedFile <OBL_File>(MusicInstaller.OBL_PATH, false); for (int i = 0; i < GeneralInfo.LanguageSuffix.Length; i++) { msgFiles.Add((MSG_File)uninstall.GetParsedFile <MSG_File>($"{MusicInstaller.OPTION_MSG_PATH}{GeneralInfo.LanguageSuffix[i]}", false)); } } else if (_file.filePath == MusicInstaller.DIRECT_INSTALL_TYPE) { if (cpkAcbFile == null) { cpkAcbFile = (ACB_File)uninstall.GetParsedFile <ACB_File>(MusicInstaller.BGM_PATH, true); } } Uninstall(); }
private void CssUninstall() { acbFile = (ACB_File)uninstall.GetParsedFile <ACB_File>(file.filePath, false); acbFile.CleanTablesOnSave = false; //Too slow on CS_ALL Section section = file.GetSection(Sections.ACB_Cue); foreach (string id in section.IDs) { uint intId; if (uint.TryParse(id, out intId)) { ACB_Cue cue = acbFile.Cues.FirstOrDefault(x => x.ID == intId); if (cue != null) { //Mark cue as free, in same manner as xv2ins cue.Name = "X2_FREE"; var waveforms = acbFile.GetWaveformsFromCue(cue); if (waveforms.Count == 1) { var awbEntry = acbFile.GetAfs2Entry(waveforms[0].AwbId); if (awbEntry != null) { awbEntry.bytes = Properties.Resources.silence; } } } } } /* * //Removed. As above, this is too slow to do on CS_ALL * * //Delete all trailing free cues * for (int i = acbFile.Cues.Count - 1; i >= 0; i--) * { * if(acbFile.Cues[i].Name == "X2_FREE") * { * acbFile.Cues.RemoveAt(i); * } * else * { * break; * } * } */ }