Пример #1
0
        public override void GrafUpdate(float dt)
        {
            base.GrafUpdate(dt);
            Color c = bumpBehav.GetColor(color);

            label.color = c;
            float r = rad + 8f * (bumpBehav.sizeBump + 0.5f * Mathf.Sin(bumpBehav.extraSizeBump * Mathf.PI)) * ((!held) ? 1f : (0.5f + 0.5f * Mathf.Sin(pulse * Mathf.PI * 2f))) + 0.5f;

            for (int i = 0; i < circles.Length; i++)
            {
                circles[i].scale = r / 8f; circles[i].SetPosition(rad, rad);
            }
            circles[0].color = new Color(0.0196078438f, 0f, Mathf.Lerp(0.3f, 0.6f, bumpBehav.col));
            circles[1].color = c;
            circles[1].alpha = 2f / r;
            circles[2].scale = (r + 10f) / 8f;
            circles[2].alpha = Mathf.Clamp01(!isProgress ? filled : progress / 100f);
            circles[2].color = Color.Lerp(Color.white, color, 0.7f);
            circles[3].color = Color.Lerp(c, DyeableRect.MidToDark(c), 0.5f);
            circles[3].scale = (r + 15f) / 8f;
            circles[3].alpha = 2f / (r + 15f);
            float dim = 0.5f + 0.5f * Mathf.Sin(bumpBehav.sin / 30f * Mathf.PI * 2f);

            dim *= bumpBehav.sizeBump;
            if (greyedOut)
            {
                dim = 0f;
            }
            circles[4].scale = (r - 8f * bumpBehav.sizeBump) / 8f;
            circles[4].alpha = 2f / (r - 8f * bumpBehav.sizeBump);
            circles[4].color = new Color(0f, 0f, dim);
        }
Пример #2
0
        public override void GrafUpdate(float dt)
        {
            base.GrafUpdate(dt);
            if (greyedOut)
            {
                KeyboardOn             = false;
                this.label.label.color = DyeableRect.Grayscale(DyeableRect.MidToDark(this.colorText));
                this.cursor.alpha      = 0f;
                this.rect.color        = DyeableRect.Grayscale(DyeableRect.MidToDark(this.colorEdge));
                this.rect.colorF       = DyeableRect.Grayscale(DyeableRect.MidToDark(this.colorFill));
                return;
            }
            Color white = Menu.Menu.MenuRGB(Menu.Menu.MenuColors.White);

            //this.label.label.color = grey;
            //this.rect.color = grey;

            if (KeyboardOn)
            {
                this.col = Mathf.Min(1f, this.bumpBehav.col + 0.1f);
            }
            else
            {
                this.col = Mathf.Max(0f, this.bumpBehav.col - 0.0333333351f);
            }

            this.cursor.color = Color.Lerp(Menu.Menu.MenuRGB(Menu.Menu.MenuColors.White), this.colorText, this.bumpBehav.Sin());

            this.bumpBehav.col     = this.col;
            this.rect.fillAlpha    = Mathf.Lerp(0.5f, 0.8f, this.bumpBehav.col);
            this.rect.color        = this.bumpBehav.GetColor(this.colorEdge);
            this.rect.colorF       = this.colorFill;
            this.label.label.color = Color.Lerp(this.colorText, white, Mathf.Clamp(this.bumpBehav.flash, 0f, 1f));
        }
Пример #3
0
        public override void GrafUpdate(float dt)
        {
            base.GrafUpdate(dt);
            if (this.isHidden)
            {
                return;
            }

            this.bumpBehav.greyedOut = this.greyedOut;
            this.bumpBehav.Update(dt);

            if (greyedOut)
            {
                if (valueBool)
                {
                    this.symbolSprite.alpha = 1f;
                }
                else
                {
                    this.symbolSprite.alpha = 0f;
                }
                this.symbolSprite.color = DyeableRect.Grayscale(DyeableRect.MidToDark(this.colorEdge));
                this.rect.color         = DyeableRect.Grayscale(DyeableRect.MidToDark(this.colorEdge));
                this.rect.colorF        = DyeableRect.Grayscale(DyeableRect.MidToDark(this.colorFill));
                return;
            }

            Color ce = this.bumpBehav.GetColor(this.colorEdge);

            this.symbolSprite.color = ce;
            if (this.MouseOver)
            {
                this.symbolHalfVisible = Custom.LerpAndTick(this.symbolHalfVisible, 1f, 0.07f, 0.0166666675f * DTMultiply(dt));
                if (!this.valueBool)
                {
                    this.symbolSprite.color = Color.Lerp(DyeableRect.MidToDark(ce), ce, this.bumpBehav.Sin(10f));
                }
            }
            else
            {
                this.symbolHalfVisible = 0f;
            }

            this.rect.color = this.bumpBehav.GetColor(this.colorEdge);

            if (this.valueBool)
            {
                this.symbolSprite.alpha = 1f;
            }
            else
            {
                this.symbolSprite.alpha = this.symbolHalfVisible * 0.2f;
            }

            this.rect.fillAlpha = this.bumpBehav.FillAlpha;
            this.rect.addSize   = new Vector2(4f, 4f) * this.bumpBehav.AddSize;
            this.rect.colorF    = this.colorFill;
        }
Пример #4
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))));
        }
Пример #5
0
        public override void OnChange()
        {
            if (!init)
            {
                return;
            }
            base.OnChange();

            if (_inBox)
            {
                if (this.rect == null)
                {
                    this.rect = new DyeableRect(menu, owner, pos - new Vector2(size.x * 0.5f, 0f), size, true);
                    this.subObjects.Add(rect);
                    owner.subObjects.Add(rect);
                }
            }
            else if (this.rect != null)
            {
                this.subObjects.Remove(rect);
                owner.subObjects.Remove(rect);
                this.rect = null;
            }
        }
Пример #6
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;
        }