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

ordered existing sounds by unique id

This commit is contained in:
NotImplementedLife 2023-07-29 08:58:11 +03:00
parent 71c7899d58
commit b5d6746bf7
3 changed files with 20 additions and 4 deletions

View File

@ -26,6 +26,18 @@ namespace TaikoSoundEditor.Controls
CurrentPage = CurrentPage; CurrentPage = CurrentPage;
} }
public void RemoveSong(MusicOrder mo)
{
SongCards.RemoveAll(c => c.MusicOrder == mo);
Selection.RemoveWhere(c => c.MusicOrder == mo);
CutSelection.RemoveWhere(c => c.MusicOrder == mo);
PasteActive = CutSelection.Count > 0;
CutActive = Selection.Count > 0;
if (!PasteActive) PasteMode = false;
Invalidate();
}
private int _CurrentPage = 0; private int _CurrentPage = 0;
public int CurrentPage public int CurrentPage
{ {

View File

@ -103,7 +103,7 @@ namespace TaikoSoundEditor
Logger.Info($"Setting LoadedMusicBox DataSource"); Logger.Info($"Setting LoadedMusicBox DataSource");
LoadedMusicBinding = new BindingSource(); LoadedMusicBinding = new BindingSource();
var cleanList = MusicInfos.Items.Where(mi => mi.UniqueId != 0).ToList(); var cleanList = MusicInfos.Items.Where(mi => mi.UniqueId != 0).OrderBy(_ => _.UniqueId).ToList();
LoadedMusicBinding.DataSource = cleanList; LoadedMusicBinding.DataSource = cleanList;
LoadedMusicBox.DataSource = LoadedMusicBinding; LoadedMusicBox.DataSource = LoadedMusicBinding;
@ -111,7 +111,7 @@ namespace TaikoSoundEditor
MusicOrderViewer.WordList = WordList; MusicOrderViewer.WordList = WordList;
foreach (var musicOrder in MusicOrders.Items) foreach (var musicOrder in MusicOrders.Items.Where(_ => MusicInfos.Items.Any(mi => mi.UniqueId == _.UniqueId)))
{ {
MusicOrderViewer.AddSong(musicOrder); MusicOrderViewer.AddSong(musicOrder);
} }

View File

@ -169,6 +169,9 @@ namespace TaikoSoundEditor
LoadedMusicBox.SelectedItem = null; LoadedMusicBox.SelectedItem = null;
LoadedMusicBox.SelectedIndex = sel; LoadedMusicBox.SelectedIndex = sel;
Logger.Info("Removing from music orders");
MusicOrderViewer.RemoveSong(mo);
return; return;
} }
}); });
@ -177,6 +180,7 @@ namespace TaikoSoundEditor
{ {
if(SoundViewTab.SelectedTab==MusicOrderTab) if(SoundViewTab.SelectedTab==MusicOrderTab)
{ {
MusicOrderViewer.Invalidate();
return; return;
} }