Beispiel #1
0
        /// <summary>
        /// Grab Reactive Color with BumpBehav
        /// </summary>
        /// <param name="orig">Original Color</param>
        /// <returns>Reactive Color</returns>
        public Color GetColor(Color orig)
        {
            if (greyedOut)
            {
                return(DyeableRect.Grayscale(DyeableRect.MidToVeryDark(orig)));
            }

            return(Color.Lerp(orig, Menu.Menu.MenuRGB(Menu.Menu.MenuColors.White), Mathf.Max(Mathf.Min(this.col, this.held ? 0.5f : 0.8f) / 2f, Mathf.Clamp01(this.flash))));
        }
Beispiel #2
0
        public override void GrafUpdate(float dt)
        {
            base.GrafUpdate(dt);

            if (!this.held)
            {
                if (this.MouseOver && !this.greyedOut)
                {
                    ConfigMenu.description = this.description;
                }

                this.rect.color     = this.bumpBehav.GetColor(this.colorEdge);
                this.rect.colorF    = DyeableRect.MidToVeryDark(this.colorEdge);
                this.rect.addSize   = new Vector2(4f, 4f) * this.bumpBehav.AddSize;
                this.rect.fillAlpha = this.bumpBehav.FillAlpha;
                return;
            }
            ConfigMenu.description = this.description;

            this.rect.color     = this.colorEdge;
            this.rect.colorF    = Menu.Menu.MenuRGB(Menu.Menu.MenuColors.Black);
            this.rect.addSize   = Vector2.zero;
            this.rect.fillAlpha = 1f;
        }