예제 #1
0
        public Dictionary <MusicPack, List <Song> > getLocationSpecificMusic()
        {
            Dictionary <MusicPack, List <Song> > listOfValidDictionaries = new Dictionary <MusicPack, List <Song> >();

            //StardewSymphony.ModMonitor.Log(SongSpecifics.getCurrentConditionalString(true));

            foreach (var v in this.musicPacks)
            {
                try
                {
                    var songList = v.Value.songInformation.getSongList(SongSpecifics.getCurrentConditionalString(true)).Value;
                    if (songList == null)
                    {
                        return(null);
                    }
                    if (songList.Count > 0)
                    {
                        listOfValidDictionaries.Add(v.Value, songList);
                    }
                }
                catch (Exception err)
                {
                    err.ToString();
                }
            }
            return(listOfValidDictionaries);
        }
예제 #2
0
 /// <summary>Choose a new song when a delay runs out.</summary>
 private void OnTimerFinished(object source, ElapsedEventArgs e)
 {
     this.Timer.Enabled = false;
     if (!this.CurrentMusicPack.IsPlaying())
     {
         this.selectMusic(SongSpecifics.getCurrentConditionalString());
     }
 }
예제 #3
0
        /// <summary>
        /// Selects a new song when the timer delay runs out.
        /// </summary>
        /// <param name="source"></param>
        /// <param name="e"></param>
        public void onTimerFinished(System.Object source, ElapsedEventArgs e)
        {
            if (this.currentMusicPack.isPlaying())
            {
                timer.Enabled = false;
                timer         = null;
                return;
            }
            //StardewSymphony.ModMonitor.Log("AHH THE TIMER FINISHED!");
            timer.Enabled  = false;
            timer.Elapsed -= onTimerFinished;



            selectMusic(SongSpecifics.getCurrentConditionalString());
            timer = null;
        }
예제 #4
0
 public void onTimerFinished(System.Object source, ElapsedEventArgs e)
 {
     timer.Enabled = false;
     selectMusic(SongSpecifics.getCurrentConditionalString());
 }