private void PopulateInfoStageBGM(MyMusicStageBGM myMusicStageBGM) { this.groupMusicStageBGM.Visible = myMusicStageBGM != null; if (myMusicStageBGM == null) { return; } _CurrentMyMusicStageBGM = myMusicStageBGM; _CurrentMyMusicStageBGMOriginal = _CurrentMyMusicStageOriginal.BGMs.Find(p => p.BGMID == myMusicStageBGM.BGMID); this.btnRestoreMyMusicProperties.Visible = _CurrentMyMusicStageBGMOriginal != null; BGMEntry sEntryBGM = SoundEntryCollection.SoundEntriesBGMsPerID[myMusicStageBGM.BGMID]; lblBGMIDValue.Text = myMusicStageBGM.BGMID.ToString(); lblBGMNameValue.Text = sEntryBGM.BGMTitle; _ListMyMusic.VGMStreamFile = SoundEntryCollection.GetBGMFullPath(sEntryBGM.BGMFilename); //Properties supporting binding ClearBindings(this); txtBGMIndex.DataBindings.Add("Text", myMusicStageBGM, "Index"); txtBGMSubIndex.DataBindings.Add("Text", myMusicStageBGM, "SubIndex"); txtRarity.DataBindings.Add("Text", myMusicStageBGM, "Rarity"); txtUnk3.DataBindings.Add("Text", myMusicStageBGM, "Unk3"); txtUnk4.DataBindings.Add("Text", myMusicStageBGM, "Unk4"); txtPlayDelay.DataBindings.Add("Text", myMusicStageBGM, "PlayDelay"); txtUnk6.DataBindings.Add("Text", myMusicStageBGM, "Unk6"); txtUnk7.DataBindings.Add("Text", myMusicStageBGM, "Unk7"); txtUnk8.DataBindings.Add("Text", myMusicStageBGM, "Unk8"); txtUnk9.DataBindings.Add("Text", myMusicStageBGM, "Unk9"); }
private void _ListMyMusic_ItemAdded(object sender, EventHandlers.ListEntryArgs e) { BGMEntry sEntryBGM = e.ListEntry as BGMEntry; if (sEntryBGM != null) { MyMusicStageBGM myMusicStageBGM = SoundEntryCollection.CreateMyMusicStageBGM(sEntryBGM.BGMID, (ushort)_CurrentMyMusicStage.BGMs.Count); _CurrentMyMusicStage.BGMs.Add(myMusicStageBGM); if (_CurrentSoundDBStage != null) { foreach (SoundDBStageSoundEntry sDBStageSoundEntry in _CurrentSoundDBStage.SoundEntries) { if (sDBStageSoundEntry.SoundEntry.BGMFiles.Find(p => p.BGMEntry == sEntryBGM) != null) { return; } } if (MessageBox.Show(Strings.WARNING_COPY_MYMUSIC, Strings.CAPTION_WARNING, MessageBoxButtons.YesNo) == DialogResult.Yes) { foreach (SoundEntry sEntry in SoundEntryCollection.SoundEntries) { if (sEntry.BGMFiles.Find(p => p.BGMID == sEntryBGM.BGMID) != null) { _CurrentSoundDBStage.SoundEntries.Add(new SoundDBStageSoundEntry(SoundEntryCollection, sEntry.SoundID)); break; } } _ListSoundDB.RefreshItems(); } } } }
private void btnRestoreMyMusicStageList_Click(object sender, EventArgs e) { if (_CurrentMyMusicStageOriginal != null && MessageBox.Show(Strings.WARNING_RESTORE_DATA, Strings.CAPTION_WARNING, MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes) { _CurrentMyMusicStage.BGMs.Clear(); foreach (MyMusicStageBGM myMusicStageBGM in _CurrentMyMusicStageOriginal.BGMs) { MyMusicStageBGM nMyMusicStageBGM = (MyMusicStageBGM)myMusicStageBGM.Clone(); nMyMusicStageBGM.SoundEntryCollection = SoundEntryCollection; _CurrentMyMusicStage.BGMs.Add(nMyMusicStageBGM); } _ListMyMusic.RefreshItems(); } }
private void _ListSoundDB_ItemAdded(object sender, EventHandlers.ListEntryArgs e) { SoundEntry sEntry = e.ListEntry as SoundEntry; if (sEntry != null) { foreach (SoundDBStageSoundEntry sSoundDBStageSoundEntry in _CurrentSoundDBStage.SoundEntries) { if (sEntry.SoundID == sSoundDBStageSoundEntry.SoundEntry.SoundID) { MessageBox.Show(Strings.ERROR_SOUND_ADD, Strings.CAPTION_ERROR); return; } } _CurrentSoundDBStage.SoundEntries.Add(new SoundDBStageSoundEntry(SoundEntryCollection, sEntry.SoundID)); //Check if bgms need to be added bool needAdd = false; List <BGMEntry> myMusicEntryBGMs = new List <BGMEntry>(); foreach (MyMusicStageBGM myMusicStageBGM in _CurrentMyMusicStage.BGMs) { myMusicEntryBGMs.Add(myMusicStageBGM.BGMEntry); } foreach (SoundEntryBGM sEntryBGM in sEntry.BGMFiles) { if (myMusicEntryBGMs.Find(p => p.BGMID == sEntryBGM.BGMID) == null) { needAdd = true; break; } } if (needAdd && MessageBox.Show(Strings.WARNING_COPY_SOUND, Strings.CAPTION_WARNING, MessageBoxButtons.YesNo) == DialogResult.Yes) { foreach (SoundEntryBGM sEntryBGM in sEntry.BGMFiles) { if (myMusicEntryBGMs.Find(p => p.BGMID == sEntryBGM.BGMID) == null) { MyMusicStageBGM myMusicStageBGM = SoundEntryCollection.CreateMyMusicStageBGM(sEntryBGM.BGMID, (ushort)_CurrentMyMusicStage.BGMs.Count); _CurrentMyMusicStage.BGMs.Add(myMusicStageBGM); } } _ListMyMusic.RefreshItems(); } } }