Beispiel #1
0
        /// <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;
            }
        }
Beispiel #2
0
 private void _RemoveItem(UIelement item)
 {
     while (this.items.Contains(item))
     {
         this.items.Remove(item);
     }
     item.SetTab(null);
 }
Beispiel #3
0
 private void _AddItem(UIelement item)
 {
     if (this.items.Contains(item))
     {
         return;
     }
     this.items.Add(item);
     item.SetTab(this);
 }
Beispiel #4
0
 private void _RemoveItem(UIelement item)
 {
     if (item.inScrollBox)
     {
         item.RemoveFromScrollBox();
     }
     while (this.items.Contains(item))
     {
         this.items.Remove(item);
     }
     item.SetTab(null);
 }
Beispiel #5
0
 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);
     }
 }
Beispiel #6
0
 public void AddItem(UIelement item)
 {
     this._AddItem(item);
 }
Beispiel #7
0
 public void RemoveItem(UIelement item)
 {
     _RemoveItem(item);
 }
Beispiel #8
0
 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, ")")))
 {
 }
Beispiel #9
0
 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!"))
 {
 }
Beispiel #10
0
 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!"))
 {
 }
Beispiel #11
0
 /// <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;
 }