private void OnSongQueueUpdate(object source, HuntingHornSongEventArgs args) { if (args.IsCastingSongs) { return; } Dispatcher.BeginInvoke(DispatcherPriority.Render, new Action(() => { if (SongQueue.Children.Count == args.SongsQueued) { int index = args.RawSongIndexesQueue[args.LastSongIndex]; if (args.Songs.Length < index + 1 || index < 0) { return; } sHuntingHornSong song = args.Songs[index]; SongComponent songComponent = new SongComponent() { SongName = GStrings.GetAbnormalityByID("HUNTINGHORN", song.BuffId, 0) }; songComponent.SetSong(song.Notes, cachedBrushes); SongQueue.Children.Insert(0, songComponent); SongQueue.Children.RemoveAt(SongQueue.Children.Count - 1); } else { bool insert = SongQueue.Children.Count > 0; // Add remaning songs to the queue based on the SongQueue length for (int i = 0; SongQueue.Children.Count < args.SongsQueued; i++) { int index = args.SongIndexesQueue[i]; sHuntingHornSong song = args.Songs[index]; SongComponent songComponent = new SongComponent() { SongName = GStrings.GetAbnormalityByID("HUNTINGHORN", song.BuffId, 0) }; songComponent.SetSong(song.Notes, cachedBrushes); if (insert) { SongQueue.Children.Insert(0, songComponent); } else { SongQueue.Children.Add(songComponent); } } } })); }
private void ReconstructQueue() { for (int i = 0; SongQueue.Children.Count < Context.SongsQueued; i++) { int index = Context.SongIndexesQueue[i]; sHuntingHornSong song = Context.Songs[index]; SongComponent songComponent = new SongComponent() { SongName = GStrings.GetAbnormalityByID("HUNTINGHORN", song.BuffId, 0) }; songComponent.SetSong(song.Notes, cachedBrushes); SongQueue.Children.Add(songComponent); } }
private void ReconstructQueue() { for (int i = 0; SongQueue.Children.Count < Context.SongsQueued; i++) { int index = Context.SongIndexesQueue[i]; sHuntingHornSong song = Context.Songs[index]; SongComponent songComponent = new SongComponent() { SongName = GMD.GetMusicSkillNameById(song.BuffId) }; songComponent.SetSong(song.Notes, cachedBrushes); SongQueue.Children.Add(songComponent); } }