Beispiel #1
0
 /// <summary>
 /// Initializes a setting that can change different options in Pulsarc.
 /// </summary>
 /// <param name="title">Name of the Setting</param>
 /// <param name="more"></param>
 /// <param name="position">Setting's position.</param>
 /// <param name="texture">The texture for the Setting.</param>
 /// <param name="anchor">The anchor position for this Setting.</param>
 /// <param name="baseValue">The value this setting starts with.</param>
 /// <param name="type">The type of variable this setting changes.</param>
 public Setting(string title, string more, Vector2 position, Texture2D texture, Anchor anchor, dynamic baseValue, string type)
     : base(texture, position, anchor: anchor)
 {
     Value = baseValue;
     Type  = type;
     PulsarcLogger.Important($"{type} set for {title}", LogType.Runtime);
     Text  = title;
     Title = new TextDisplayElement(title, new Vector2(position.X - 50, position.Y), anchor: Anchor.CenterRight);
 }
Beispiel #2
0
        /// <summary>
        /// Change the the audio rate to the one defined
        /// in the config.
        /// </summary>
        public static void UpdateRate()
        {
            if (active)
            {
                // Save the position and audio path.
                double time  = GetTime();
                string audio = songPath;
                Stop();

                // Find the audio rate.
                songPath  = audio;
                audioRate = Config.GetFloat("Gameplay", "SongRate");
                StartLazyPlayer();

                // Play the rate-changed song at the time saved earlier.
                if (time != 0)
                {
                    DeltaTime((long)time);
                }

                PulsarcLogger.Important($"Now Playing: {songPath} at {audioRate} rate", LogType.Runtime);
            }
        }