/// <summary> /// /// </summary> /// <param name="fighter"></param> /// <param name="archive"></param> /// <param name="bgm"></param> private static void InstallFighterMusic(MEXFighter fighter, ZipArchive archive, MEXMusic bgm) { var music = MEX.BackgroundMusic.FirstOrDefault(e => e.FileName == bgm.FileName); if (music != null) { bgm.FileName = music.FileName; bgm.Label = music.Label; } else { // find music in zip var musicFile = archive.GetFile(Path.GetFileName(bgm.FileName)); if (musicFile != null) { MEX.ImageResource.AddFile("audio\\" + Path.GetFileName(bgm.FileName), musicFile); // add music MEX.BackgroundMusic.Add(bgm); } } }
/// <summary> /// /// </summary> /// <param name="music"></param> public void RemoveMusic(MEXMusic music) { Entries.RemoveAll(e => e.Music == music); }