Exemple #1
0
        public bool IsActive(bool wasActive)
        {
            bool hasActiveTriggers = Combos.Any(x =>
                                                (EnvironmentAPI.Input.WasButtonPressed(x.Mouse) && EnvironmentAPI.Input.IsKeyPressed(x.Keyboard) && EnvironmentAPI.Input.IsKeyPressed(x.Keyboard2)) ||
                                                (EnvironmentAPI.Input.IsButtonPressed(x.Mouse) && EnvironmentAPI.Input.WasKeyPressed(x.Keyboard) && EnvironmentAPI.Input.IsKeyPressed(x.Keyboard2)) ||
                                                (EnvironmentAPI.Input.IsButtonPressed(x.Mouse) && EnvironmentAPI.Input.IsKeyPressed(x.Keyboard) && EnvironmentAPI.Input.WasKeyPressed(x.Keyboard2))
                                                );

            if (ActivationOnStart && !wasActive && hasActiveTriggers && !IsContinious)
            {
                return(true);
            }
            if (!ActivationOnStart && wasActive && !hasActiveTriggers && !IsContinious)
            {
                return(true);
            }
            if (ActivationOnStart && hasActiveTriggers && IsContinious)
            {
                return(true);
            }
            if (!ActivationOnStart && !hasActiveTriggers && IsContinious)
            {
                return(true);
            }
            return(false);
        }