Beispiel #1
0
        public static bool DelayedButton(InputButton k, ButtonTrigger trigger = ButtonTrigger.None)
        {
            bool ret = Button(k, trigger);

            if (ret)
            {
                ResetInputLimit();
            }
            return(ret);
        }
Beispiel #2
0
        public InputButton Clone()
        {
            InputButton i = (InputButton)MemberwiseClone();

            i.Combo = new List <InputButton>(Combo.Count);
            foreach (InputButton item in Combo)
            {
                i.Combo.Add(item.Clone());
            }
            return(i);
        }
Beispiel #3
0
        public override bool Equals(object obj)
        {
            InputButton o = (InputButton)obj;

            if (o.Key == Key &&
                o.MouseButton == MouseButton &&
                o.GamePadButton == GamePadButton &&
                //(o.Trigger & Trigger)!=0 &&
                (o.Combo == null || o.Combo.Equals(Combo)))
            {
                return(true);
            }
            return(false);
        }
Beispiel #4
0
 public virtual bool ButtonTriggered(InputButton test, ButtonTrigger trigger = ButtonTrigger.None)
 {
     if (Memory.IsActive)
     {
         if (!bLimitInput || (trigger.HasFlag(ButtonTrigger.Force) ? trigger : (test.Trigger | trigger)).HasFlag(ButtonTrigger.IgnoreDelay))
         {
             if (Keyboard.ButtonTriggered(test, trigger))
             {
                 return(true);
             }
             else if (Mouse.ButtonTriggered(test, trigger))
             {
                 return(true);
             }
             else if (GamePad.ButtonTriggered(test, trigger))
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Beispiel #5
0
 public virtual bool ButtonTriggered(InputButton test, ButtonTrigger trigger = ButtonTrigger.None)
 {
     if (Memory.IsActive)
     {
         if (!bLimitInput || ((test.Trigger | trigger) & ButtonTrigger.IgnoreDelay) != 0)
         {
             if (Keyboard.ButtonTriggered(test, trigger))
             {
                 return(true);
             }
             if (Mouse.ButtonTriggered(test, trigger))
             {
                 return(true);
             }
             if (GamePad.ButtonTriggered(test, trigger))
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Beispiel #6
0
 public static bool Button(InputButton k, ButtonTrigger trigger = ButtonTrigger.None) => main?.ButtonTriggered(k, trigger) ?? false;