1
0
mirror of synced 2024-11-24 04:20:10 +01:00

song can be auto located in music order

This commit is contained in:
NotImplementedLife 2023-07-29 10:21:31 +03:00
parent 04a86f755a
commit 7a425a29b0
4 changed files with 46 additions and 2 deletions

View File

@ -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();
}
}
}

1
MainForm.Designer.cs generated
View File

@ -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
//

View File

@ -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;
}
}
}
}

View File

@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<History>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;</History>
<History>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;</History>
<LastFailureDetails />
</PropertyGroup>
</Project>