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)); }
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; }
/// <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)))); }