Пример #1
0
            public override void GrafUpdate(float dt)
            {
                base.GrafUpdate(dt);

                this.label.label.rotation = -90f;
                this.label.text           = string.IsNullOrEmpty(this.name) ? index.ToString() : this.name;

                if (greyedOut)
                {
                    Color cg = this.active ? this.color : DyeableRect.Grayscale(this.color);
                    cg = Color.Lerp(DyeableRect.MidToDark(cg), cg, this.darken);
                    this.rect.color        = cg;
                    this.rect.colorF       = DyeableRect.MidToVeryDark(cg);
                    this.rectH.color       = cg;
                    this.label.label.color = cg;
                    return;
                }

                Color color = this.bumpBehav.GetColor(this.color);

                this.label.label.color = Color.Lerp(DyeableRect.MidToDark(color), color, Mathf.Lerp(this.darken, 1f, 0.6f));
                color            = Color.Lerp(DyeableRect.MidToDark(color), color, this.darken);
                this.rect.color  = color;
                this.rect.colorF = DyeableRect.MidToVeryDark(color);

                this.rect.fillAlpha = this.bumpBehav.FillAlpha;
                float addSize = this.active ? 1f : this.bumpBehav.AddSize;

                this.rect.addSize = new Vector2(8f, 4f) * addSize;
                this.rect.pos     = this.pos + new Vector2(-this.rect.addSize.x * 0.5f, 0f);
                this.label.pos.x  = this.pos.x - addSize * 4f;

                this.rectH.color   = color;
                this.rectH.addSize = new Vector2(4f, -4f) * addSize;
                this.rectH.pos     = this.pos + new Vector2(-this.rectH.addSize.x * 0.5f, 0f);
                float highlight = this.MouseOver ? (0.5f + 0.5f * this.bumpBehav.Sin(10f)) * addSize : 0f;

                for (int j = 0; j < 8; j++)
                {
                    this.rectH.sprites[j].alpha = active ? 1f : highlight;
                }
            }
Пример #2
0
 public override void Update(float dt)
 {
     base.Update(dt);
     foreach (UIelement element in this.subElements)
     {
         element.Update(dt);
         if (element is Selector selector && selector.active)
         {
             ConfigMenu.instance.modCanvasBound.colorEdge = selector.colorCanvas;
             ConfigMenu.instance.modCanvasBound.colorFill = DyeableRect.MidToVeryDark(selector.colorCanvas);
         }
     }
     if (MenuTab.logMode || mode == TabMode.NULL)
     {
         ConfigMenu.instance.modCanvasBound.colorEdge = Menu.Menu.MenuRGB(Menu.Menu.MenuColors.MediumGrey);
         ConfigMenu.instance.modCanvasBound.colorFill = Menu.Menu.MenuRGB(Menu.Menu.MenuColors.VeryDarkGrey);
     }
     else if (mode == TabMode.single)
     {
         ConfigMenu.instance.modCanvasBound.colorEdge = ConfigMenu.currentTab.colorCanvas;
         ConfigMenu.instance.modCanvasBound.colorFill = DyeableRect.MidToVeryDark(ConfigMenu.currentTab.colorCanvas);
     }
 }