Beispiel #1
0
        internal static AnimatedColors Create(AnimatedColorsManager mngr, int durationPerColor, Color[] colors)
        {
            var def = new AnimatedColors(durationPerColor, colors);

            mngr.AddAnimation(def);

            return(def);
        }
Beispiel #2
0
 internal AnimatedColorsManager()
 {
     this.Alert  = AnimatedColors.Create(this, 16, new Color[] { Color.Yellow, Color.Gray });
     this.Strobe = AnimatedColors.Create(this, 16, new Color[] { Color.Black, Color.White });
     this.Fire   = AnimatedColors.Create(this, 16, new Color[] { Color.Red, Color.Yellow });
     this.Water  = AnimatedColors.Create(this, 16, new Color[] { Color.Blue, Color.Turquoise });
     this.Air    = AnimatedColors.Create(this, 16, new Color[] { Color.White, Color.Gray });
 }
        ////////////////

        internal AnimatedColorsManager()
        {
            var mymod = ModHelpersMod.Instance;

            this.Alert  = AnimatedColors.Create(this, 16, new Color[] { Color.Yellow, Color.Gray });
            this.Strobe = AnimatedColors.Create(this, 16, new Color[] { Color.Black, Color.White });
            this.Fire   = AnimatedColors.Create(this, 16, new Color[] { Color.Red, Color.Yellow });
            this.Water  = AnimatedColors.Create(this, 16, new Color[] { Color.Blue, Color.Turquoise });
            this.Air    = AnimatedColors.Create(this, 16, new Color[] { Color.White, Color.Gray });
            this.Ether  = AnimatedColors.Create(this, 16, new Color[] { Color.MediumSpringGreen, Color.Gray });
            Color green  = Color.Lime;                  // The colors lie!
            Color indigo = new Color(147, 0, 255, 255);
            Color violet = new Color(255, 139, 255, 255);

            this.Disco     = AnimatedColors.Create(this, 56, new Color[] { Color.Red, Color.Orange, Color.Yellow, green, Color.Blue, indigo, violet });
            this.DiscoFast = AnimatedColors.Create(this, 8, new Color[] { Color.Red, Color.Orange, Color.Yellow, green, Color.Blue, indigo, violet });

            this.OnTickGet = Timers.Timers.MainOnTickGet();
            Main.OnTick   += AnimatedColorsManager._Update;
        }
Beispiel #4
0
        ////////////////

        /// <summary>
        /// Creates an animated color object.
        /// </summary>
        /// <param name="durationPerColor">Ticks of time to spend between each color.</param>
        /// <param name="colors">Sequence of colors to loop through.</param>
        /// <returns></returns>
        public static AnimatedColors Create(int durationPerColor, Color[] colors)
        {
            return(AnimatedColors.Create(ModHelpersMod.Instance.AnimatedColors, durationPerColor, colors));
        }
Beispiel #5
0
        ////////////////

        public void AddAnimation(AnimatedColors animation)
        {
            this.Defs.Add(animation);
        }
Beispiel #6
0
        ////////////////

        public static AnimatedColors Create(int duration_per_color, Color[] colors)
        {
            return(AnimatedColors.Create(HamstarHelpersMod.Instance.AnimatedColors, duration_per_color, colors));
        }