1
0
mirror of synced 2024-11-13 16:40:46 +01:00

created songs appear in music info

This commit is contained in:
NotImplementedLife 2023-07-29 09:15:24 +03:00
parent b5d6746bf7
commit 9983bc2705
3 changed files with 37 additions and 3 deletions

View File

@ -109,6 +109,21 @@ namespace TaikoSoundEditor
LoadedMusicBox.DataSource = LoadedMusicBinding;
TabControl.SelectedIndex = 1;
WordList.Items.RemoveAll(w =>
{
var key = w.Key;
var prefixes = new string[] { "song_sub_", "song_detail_", "song_" };
for (int i = 0; i < 3; i++)
if (key.StartsWith(prefixes[i]))
{
key = key.Substring(prefixes[i].Length);
break;
}
return !MusicInfos.Items.Any(mi => mi.Id == key);
});
MusicOrderViewer.WordList = WordList;
foreach (var musicOrder in MusicOrders.Items.Where(_ => MusicInfos.Items.Any(mi => mi.UniqueId == _.UniqueId)))

View File

@ -295,7 +295,16 @@ namespace TaikoSoundEditor
TabControl.SelectedIndex = 1;
FeedbackBox.Clear();
});
Logger.Info("Adding to music orders");
WordList.Items.Add(ns.Word);
WordList.Items.Add(ns.WordDetail);
WordList.Items.Add(ns.WordSub);
MusicAttributes.Items.Add(ns.MusicAttribute);
MusicOrderViewer.AddSong(mo);
});
private static void CreateTmpDir()

View File

@ -129,9 +129,18 @@ namespace TaikoSoundEditor
if (NewSoundsBox.SelectedItem != null)
{
Logger.Info("Removing newly added song");
AddedMusic.Remove(NewSoundsBox.SelectedItem as NewSongData);
var ns = NewSoundsBox.SelectedItem as NewSongData;
AddedMusic.Remove(ns);
Logger.Info("Refreshing list");
AddedMusicBinding.ResetBindings(false);
MusicOrderViewer.RemoveSong(ns.MusicOrder);
Logger.Info("Removing from wordlist & music_attributes");
WordList.Items.Remove(ns.Word);
WordList.Items.Remove(ns.WordDetail);
WordList.Items.Remove(ns.WordSub);
MusicAttributes.Items.Remove(ns.MusicAttribute);
return;
}
@ -171,7 +180,8 @@ namespace TaikoSoundEditor
LoadedMusicBox.SelectedIndex = sel;
Logger.Info("Removing from music orders");
MusicOrderViewer.RemoveSong(mo);
MusicOrderViewer.RemoveSong(mo);
return;
}
});