diff --git a/Controls/MusicOrderViewer.cs b/Controls/MusicOrderViewer.cs index 385b5f2..fa53685 100644 --- a/Controls/MusicOrderViewer.cs +++ b/Controls/MusicOrderViewer.cs @@ -379,7 +379,7 @@ namespace TaikoSoundEditor.Controls if (Selection.Count == 0) return; - var message = $"Are you sure you want to remove {toRemove.Count} song{(toRemove.Count>0?"s":"")}?"; + var message = $"Are you sure you want to remove {toRemove.Count} song{(toRemove.Count!=1?"s":"")}?"; if (MessageBox.Show(message, "Remove?", MessageBoxButtons.YesNo) != DialogResult.Yes) return; @@ -425,5 +425,25 @@ namespace TaikoSoundEditor.Controls CurrentPage += 10; MusicOrdersPanel.Invalidate(); } + + public bool Locate(MusicOrder mo) + { + var card = SongCards.Where(c => c.MusicOrder == mo).FirstOrDefault(); + if (card == null) return false; + var index = SongCards.IndexOf(card); + Select(index); + return true; + } + + private void Select(int index) + { + CurrentPage = index / ItemsPerPage; + + SongCards[index].IsSelected = true; + Selection.Add(SongCards[index]); + + CutActive = RemoveActive = true; + MusicOrdersPanel.Invalidate(); + } } } diff --git a/MainForm.Designer.cs b/MainForm.Designer.cs index 800af6a..a7ffe89 100644 --- a/MainForm.Designer.cs +++ b/MainForm.Designer.cs @@ -410,6 +410,7 @@ this.LocateInMusicOrderButton.TabIndex = 11; this.LocateInMusicOrderButton.Text = "Locate in Music Order"; this.LocateInMusicOrderButton.UseVisualStyleBackColor = true; + this.LocateInMusicOrderButton.Click += new System.EventHandler(this.LocateInMusicOrderButton_Click); // // groupBox11 // diff --git a/MainForm.cs b/MainForm.cs index 23e20fd..c174487 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -283,5 +283,28 @@ namespace TaikoSoundEditor } throw new InvalidOperationException("Nothing to remove."); }); + + private void LocateInMusicOrderButton_Click(object sender, EventArgs e) + { + if (LoadedMusicBox.SelectedItem != null) + { + var item = LoadedMusicBox.SelectedItem as MusicInfo; + var mo = MusicOrders.GetByUniqueId(item.UniqueId); + if (MusicOrderViewer.Locate(mo)) + { + SoundViewTab.SelectedTab = MusicOrderTab; + } + return; + } + else if (NewSoundsBox.SelectedItem != null) + { + var item = NewSoundsBox.SelectedItem as NewSongData; + if (MusicOrderViewer.Locate(item.MusicOrder)) + { + SoundViewTab.SelectedTab = MusicOrderTab; + } + return; + } + } } } \ No newline at end of file diff --git a/Properties/PublishProfiles/FolderProfile.pubxml.user b/Properties/PublishProfiles/FolderProfile.pubxml.user index f99835d..1aca6d7 100644 --- a/Properties/PublishProfiles/FolderProfile.pubxml.user +++ b/Properties/PublishProfiles/FolderProfile.pubxml.user @@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. --> - True|2023-07-28T16:30:15.3174413Z;True|2023-07-22T19:07:39.3718711+03:00;True|2023-07-22T19:06:41.2393088+03:00;True|2023-07-22T12:07:26.2620601+03:00;True|2023-07-22T12:06:39.9230498+03:00;True|2023-07-22T11:29:18.0153916+03:00;True|2023-07-22T08:23:07.5000923+03:00;True|2023-07-21T20:03:15.6598520+03:00;True|2023-07-21T19:41:13.2800435+03:00;True|2023-07-19T13:08:33.4726289+03:00;True|2023-07-19T12:08:17.2430335+03:00;True|2023-07-18T09:38:50.7615921+03:00;True|2023-07-18T09:25:23.0403589+03:00;True|2023-07-17T17:57:08.1469738+03:00;True|2023-07-17T11:28:41.9554245+03:00;True|2023-07-17T11:15:26.2194507+03:00; + True|2023-07-29T07:05:26.6712083Z;True|2023-07-28T19:30:15.3174413+03:00;True|2023-07-22T19:07:39.3718711+03:00;True|2023-07-22T19:06:41.2393088+03:00;True|2023-07-22T12:07:26.2620601+03:00;True|2023-07-22T12:06:39.9230498+03:00;True|2023-07-22T11:29:18.0153916+03:00;True|2023-07-22T08:23:07.5000923+03:00;True|2023-07-21T20:03:15.6598520+03:00;True|2023-07-21T19:41:13.2800435+03:00;True|2023-07-19T13:08:33.4726289+03:00;True|2023-07-19T12:08:17.2430335+03:00;True|2023-07-18T09:38:50.7615921+03:00;True|2023-07-18T09:25:23.0403589+03:00;True|2023-07-17T17:57:08.1469738+03:00;True|2023-07-17T11:28:41.9554245+03:00;True|2023-07-17T11:15:26.2194507+03:00; \ No newline at end of file