/// <summary> /// This will be called automatically with <see cref="UIconfig.Update(float)"/> or <see cref="UItrigger.Update(float)"/> /// </summary> public void Update(float dt) { float dtMulti = UIelement.DTMultiply(dt); this.flash = Custom.LerpAndTick(this.flash, 0f, 0.03f, 0.166666672f * dtMulti); if (MouseOver) { this.sizeBump = Custom.LerpAndTick(this.sizeBump, 1f, 0.1f, 0.1f * dtMulti); this.sin += 1f * dtMulti; if (!this.flashBool) { this.flashBool = true; this.flash = 1f; } if (!this.greyedOut) { this.col = Mathf.Min(1f, this.col + 0.1f * dtMulti); this.extraSizeBump = Mathf.Min(1f, this.extraSizeBump + 0.1f * dtMulti); } } else { this.flashBool = false; this.sizeBump = Custom.LerpAndTick(this.sizeBump, 0f, 0.1f, 0.05f * dtMulti); this.col = Mathf.Max(0f, this.col - 0.0333333351f * dtMulti); this.extraSizeBump = 0f; } }
private void _RemoveItem(UIelement item) { while (this.items.Contains(item)) { this.items.Remove(item); } item.SetTab(null); }
private void _AddItem(UIelement item) { if (this.items.Contains(item)) { return; } this.items.Add(item); item.SetTab(this); }
private void _RemoveItem(UIelement item) { if (item.inScrollBox) { item.RemoveFromScrollBox(); } while (this.items.Contains(item)) { this.items.Remove(item); } item.SetTab(null); }
private void _AddItem(UIelement item) { if (this.items.Contains(item)) { return; } if (item.tab != null && item.tab != this) { RemoveItemsFromTab(item); } this.items.Add(item); item.SetTab(this); if (OptionScript.isOptionMenu && ConfigMenu.currentTab == this) { foreach (MenuObject obj in item.subObjects) { OptionScript.configMenu.pages[0].subObjects.Add(obj); } OptionScript.configMenu.pages[0].Container.AddChild(item.myContainer); } }
public void AddItem(UIelement item) { this._AddItem(item); }
public void RemoveItem(UIelement item) { _RemoveItem(item); }
public InvalidActionException(UIelement element, string message, string key = "") : base( string.Concat(element.GetType().Name, " threw exception : ", message, string.IsNullOrEmpty(key) ? string.Empty : string.Concat(" (Key : ", key, ")"))) { }
public InvalidGetPropertyException(UIelement element, string name) : base( string.Concat(element, element is UIconfig ? string.Concat($"(key: {(element as UIconfig).key})") : string.Empty, $" called {name} which is Invalid!")) { }
public InvaildGetPropertyException(UIelement element, string name) : base( string.Concat(element, element is UIconfig ? string.Concat("(key: ", (element as UIconfig).key, ")") : string.Empty, " called ", name, "which is invaild!")) { }
/// <summary> /// Mimics <see cref="Menu.ButtonBehavior"/> of vanilla Rain World UIs /// </summary> /// <param name="owner"><see cref="UIelement"/> owner</param> public BumpBehaviour(UIelement owner) { this.owner = owner; this._greyedOut = false; this._held = false; }