Exemple #1
0
 public override void OnReleased(GlobalAction action)
 {
     if (action == GlobalAction.SelectPreviousRandom)
     {
         rewindSearch = false;
     }
 }
Exemple #2
0
    public static GlobalAction CreateGlobalAction(GlobalItemTrack track, Type type, string name, float firetime)
    {
        GameObject   item   = new GameObject(name);
        GlobalAction action = item.AddComponent(type) as GlobalAction;

        SortedDictionary <float, GlobalAction> sortedActions = new SortedDictionary <float, GlobalAction>();

        foreach (GlobalAction a in track.Actions)
        {
            sortedActions.Add(a.Firetime, a);
        }

        float latestTime = firetime;
        float length     = DEFAULT_GLOBAL_ACTION_LENGTH;

        foreach (GlobalAction a in sortedActions.Values)
        {
            if (latestTime >= a.Firetime)
            {
                latestTime = Mathf.Max(latestTime, a.Firetime + a.Duration);
            }
            else
            {
                length = a.Firetime - latestTime;
                break;
            }
        }

        action.Firetime       = latestTime;
        action.Duration       = length;
        item.transform.parent = track.transform;
        track.Manager.recache();
        return(action);
    }
 private void ButtonChangeStatus_Click(object sender, RoutedEventArgs e)
 {
     if (CurrentAction == GlobalAction.users)
     {
         CurrentAction = GlobalAction.status;
     }
 }
 private void ButtonNewUser_Click(object sender, RoutedEventArgs e)
 {
     if (CurrentAction == GlobalAction.users)
     {
         CurrentAction = GlobalAction.createUser;
     }
 }
 private void ButtonAccountSettings_Click(object sender, RoutedEventArgs e)
 {
     if (CurrentAction == GlobalAction.users)
     {
         CurrentAction = GlobalAction.settings;
     }
 }
        public Home(Core core)
        {
            Core = core;

            InitializeComponent();

            Core.MainUserStatusSet += Core_MainUserStatusSet;
            Core.User.GetResult    += User_GetResult;

            SetMainUserInfo();

            Status st = new Status();

            st.StatusGet += St_StatusGet;
            st.User_id    = Core.User.Id;
            st.Get(Core.Token);

            CurrentAction = GlobalAction.users;

            DispatcherTimer usersAutoUpdate = new DispatcherTimer();

            usersAutoUpdate.Tick    += usersAutoUpdate_Tick;
            usersAutoUpdate.Interval = new TimeSpan(0, 0, 5);
            usersAutoUpdate.Start();

            DispatcherTimer statusAutoUpdate = new DispatcherTimer();

            statusAutoUpdate.Tick    += statusAutoUpdate_Tick;
            statusAutoUpdate.Interval = new TimeSpan(0, 0, 2);
            statusAutoUpdate.Start();
        }
        public bool Adjust(GlobalAction action)
        {
            switch (action)
            {
            case GlobalAction.DecreaseVolume:
                if (State == Visibility.Hidden)
                {
                    Show();
                }
                else
                {
                    volumeMeterMaster.Decrease();
                }
                return(true);

            case GlobalAction.IncreaseVolume:
                if (State == Visibility.Hidden)
                {
                    Show();
                }
                else
                {
                    volumeMeterMaster.Increase();
                }
                return(true);

            case GlobalAction.ToggleMute:
                Show();
                muteButton.Current.Value = !muteButton.Current;
                return(true);
            }

            return(false);
        }
Exemple #8
0
        public override string getHTML(GlobalAction parent)
        {
            if (parent == null)
            {
                StringBuilder htmlBuilder = new StringBuilder();

                htmlBuilder.AppendLine("<span class=\"dropdown\">");
                htmlBuilder.AppendLine(String.Format("<button class=\"btn btn-{0} navbar-btn dropdown-toggle\" " +
                                                     "data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\"type=\"button\" " +
                                                     "id=\"globalDropdown{2}\">{1} <span class=\"caret\"></span></button>", color, title, id));

                htmlBuilder.AppendLine(String.Format("<ul class=\"dropdown-menu\" aria-labelledby=\"globalDropdown{0}\">", id));

                foreach (GlobalAction action in actions)
                {
                    htmlBuilder.Append(action.getHTML(this));
                }

                htmlBuilder.AppendLine("</ul>");
                htmlBuilder.AppendLine("</span>");

                return(htmlBuilder.ToString());
            }

            throw new ArgumentException("Parents for Dropdowns must be null!");
        }
Exemple #9
0
        public bool Adjust(GlobalAction action)
        {
            switch (action)
            {
            case GlobalAction.DecreaseVolume:
                if (State == Visibility.Hidden)
                {
                    Show();
                }
                else
                {
                    volumeMeterMaster.Decrease();
                }
                return(true);

            case GlobalAction.IncreaseVolume:
                if (State == Visibility.Hidden)
                {
                    Show();
                }
                else
                {
                    volumeMeterMaster.Increase();
                }
                return(true);
            }

            return(false);
        }
Exemple #10
0
    // public static GameState instance {
    //  get {
    //      if (!gameManager) {
    //          gameManager = FindObjectOfType (typeof(GameState)) as GameState;

    //          if (!gameManager) {
    //              Debug.LogError ("There needs to be one active EventManger script on a GameObject in your scene.");
    //          } else {
    //              gameManager.Init ();
    //          }
    //      }

    //      return gameManager;
    //  }
    // }


    public void GlobalCall(GlobalAction action)
    {
        foreach (EntityState i in Entities)
        {
            action(i);
//			if(i.Creations)
        }
    }
Exemple #11
0
        public bool Adjust(GlobalAction action, float amount = 1, bool isPrecise = false)
        {
            if (!IsLoaded)
            {
                return(false);
            }

            switch (action)
            {
            case GlobalAction.DecreaseVolume:
                if (State.Value == Visibility.Hidden)
                {
                    Show();
                }
                else if (volumeMeterMusic.IsHovered)
                {
                    volumeMeterMusic.Decrease(amount, isPrecise);
                }
                else if (volumeMeterEffect.IsHovered)
                {
                    volumeMeterEffect.Decrease(amount, isPrecise);
                }
                else
                {
                    volumeMeterMaster.Decrease(amount, isPrecise);
                }
                return(true);

            case GlobalAction.IncreaseVolume:
                if (State.Value == Visibility.Hidden)
                {
                    Show();
                }
                else if (volumeMeterMusic.IsHovered)
                {
                    volumeMeterMusic.Increase(amount, isPrecise);
                }
                else if (volumeMeterEffect.IsHovered)
                {
                    volumeMeterEffect.Increase(amount, isPrecise);
                }
                else
                {
                    volumeMeterMaster.Increase(amount, isPrecise);
                }
                return(true);

            case GlobalAction.ToggleMute:
                Show();
                muteButton.Current.Value = !muteButton.Current.Value;
                return(true);
            }

            return(false);
        }
Exemple #12
0
        public bool Adjust(GlobalAction action, float amount = 1, bool isPrecise = false)
        {
            if (!IsLoaded)
            {
                return(false);
            }

            switch (action)
            {
            case GlobalAction.DecreaseVolume:
                if (State.Value == Visibility.Hidden)
                {
                    Show();
                }
                else
                {
                    volumeMeters.Selected?.Decrease(amount, isPrecise);
                }
                return(true);

            case GlobalAction.IncreaseVolume:
                if (State.Value == Visibility.Hidden)
                {
                    Show();
                }
                else
                {
                    volumeMeters.Selected?.Increase(amount, isPrecise);
                }
                return(true);

            case GlobalAction.NextVolumeMeter:
                if (State.Value == Visibility.Visible)
                {
                    volumeMeters.SelectNext();
                }
                Show();
                return(true);

            case GlobalAction.PreviousVolumeMeter:
                if (State.Value == Visibility.Visible)
                {
                    volumeMeters.SelectPrevious();
                }
                Show();
                return(true);

            case GlobalAction.ToggleMute:
                Show();
                muteButton.Current.Value = !muteButton.Current.Value;
                return(true);
            }

            return(false);
        }
        public bool OnPressed(GlobalAction action)
        {
            switch (action)
            {
            case GlobalAction.Back:
                return(goBack());

            default:
                return(false);
            }
        }
Exemple #14
0
        public override bool OnPressed(GlobalAction action)
        {
            switch (action)
            {
            case GlobalAction.Select:
                CurrentDialog?.Buttons.OfType <PopupDialogOkButton>().FirstOrDefault()?.Click();
                return(true);
            }

            return(base.OnPressed(action));
        }
 private void SelectedUser_DeleteResult(object sender, User.StandardEventArgs e)
 {
     Application.Current.Dispatcher.Invoke(delegate
     {
         SetVidowStatus(e.Message);
         if (e.ResponseCode == HttpStatusCode.OK)
         {
             CurrentAction = GlobalAction.users;
         }
     });
 }
        public bool OnReleased(GlobalAction action)
        {
            switch (action)
            {
            case GlobalAction.Back:
                return(true);

            default:
                return(false);
            }
        }
Exemple #17
0
        public virtual string getHTML(GlobalAction parent)
        {
            if (parent is GlobalActionDropdown)
            {
                return(string.Format("<li><a href=\"#\" onclick=\"{0}\">{1}</a></li>",
                                     OnClick, Title, Color));
            }

            return(string.Format("<button class=\"btn btn-{2} navbar-btn\" type=\"button\" onclick=\"{0}\">{1}</button>",
                                 OnClick, Title, Color));
        }
Exemple #18
0
        public override bool OnPressed(GlobalAction action)
        {
            rewindSearch = action == GlobalAction.SelectPreviousRandom;

            if (action != GlobalAction.SelectNextRandom && action != GlobalAction.SelectPreviousRandom)
            {
                return(false);
            }

            TriggerClick();
            return(true);
        }
Exemple #19
0
        public override bool OnPressed(GlobalAction action)
        {
            if (action == GlobalAction.Back)
            {
                if (Text.Length > 0)
                {
                    Text = string.Empty;
                    return(true);
                }
            }

            return(base.OnPressed(action));
        }
Exemple #20
0
        private static bool PerformGlobalAction(GlobalAction action)
        {
            AutoGlobal.Instance.EnsureAccessibilityServiceEnabled();

            if (AutoAccessibilityService.Instance == null)
            {
                return(false);
            }

            var service = AutoAccessibilityService.Instance;

            return(service.PerformGlobalAction(action));
        }
Exemple #21
0
        /// <summary>
        /// Retrieve all user-defined key combinations (in a format that can be displayed) for a specific action.
        /// </summary>
        /// <param name="globalAction">The action to lookup.</param>
        /// <returns>A set of display strings for all the user's key configuration for the action.</returns>
        public IEnumerable <string> GetReadableKeyCombinationsFor(GlobalAction globalAction)
        {
            foreach (var action in Query().Where(b => (GlobalAction)b.Action == globalAction))
            {
                string str = action.KeyCombination.ReadableString();

                // even if found, the readable string may be empty for an unbound action.
                if (str.Length > 0)
                {
                    yield return(str);
                }
            }
        }
Exemple #22
0
        public bool OnPressed(GlobalAction action)
        {
            switch (action)
            {
            case GlobalAction.Back:
                return(goBack());

            case GlobalAction.Select:
                logo?.TriggerClick();
                return(true);

            default:
                return(false);
            }
        }
Exemple #23
0
        public override bool OnPressed(GlobalAction action)
        {
            if (!IsCurrentScreen)
            {
                return(false);
            }

            switch (action)
            {
            case GlobalAction.Select:
                FinaliseSelection();
                return(true);
            }

            return(base.OnPressed(action));
        }
Exemple #24
0
        private bool adjustDistanceSpacing(GlobalAction action, float amount)
        {
            if (DistanceSpacingMultiplier.Disabled)
            {
                return(false);
            }

            if (action == GlobalAction.EditorIncreaseDistanceSpacing)
            {
                DistanceSpacingMultiplier.Value += amount;
            }
            else if (action == GlobalAction.EditorDecreaseDistanceSpacing)
            {
                DistanceSpacingMultiplier.Value -= amount;
            }

            return(true);
        }
Exemple #25
0
        public override bool OnPressed(GlobalAction action)
        {
            switch (action)
            {
            case GlobalAction.Back:
                if (Current.Value == null)
                {
                    Hide();
                }
                else
                {
                    Current.Value = null;
                }

                return(true);
            }

            return(false);
        }
Exemple #26
0
        public bool OnPressed(GlobalAction action)
        {
            if (!UserScrollSpeedAdjustment)
            {
                return(false);
            }

            switch (action)
            {
            case GlobalAction.IncreaseScrollSpeed:
                this.TransformBindableTo(TimeRange, TimeRange.Value - time_span_step, 200, Easing.OutQuint);
                return(true);

            case GlobalAction.DecreaseScrollSpeed:
                this.TransformBindableTo(TimeRange, TimeRange.Value + time_span_step, 200, Easing.OutQuint);
                return(true);
            }

            return(false);
        }
    public override void Draw(DirectorControlState state)
    {
        GlobalAction action = Wrapper.Behaviour as GlobalAction;

        if (action == null)
        {
            return;
        }

        if (IsSelected)
        {
            GUI.Box(controlPosition, GUIContent.none, TimelineTrackControl.styles.GlobalTrackItemSelectedStyle);
        }
        else
        {
            GUI.Box(controlPosition, GUIContent.none, TimelineTrackControl.styles.GlobalTrackItemStyle);
        }

        DrawRenameLabel(action.name, controlPosition);
    }
        public bool OnPressed(GlobalAction action)
        {
            if (!UserScrollSpeedAdjustment)
            {
                return(false);
            }

            switch (action)
            {
            case GlobalAction.IncreaseScrollSpeed:
                scheduleScrollSpeedAdjustment(1);
                return(true);

            case GlobalAction.DecreaseScrollSpeed:
                scheduleScrollSpeedAdjustment(-1);
                return(true);
            }

            return(false);
        }
Exemple #29
0
        public IReadOnlyList <string> GetReadableKeyCombinationsFor(GlobalAction globalAction)
        {
            List <string> combinations = new List <string>();

            realm.Run(context =>
            {
                foreach (var action in context.All <RealmKeyBinding>().Where(b => string.IsNullOrEmpty(b.RulesetName) && (GlobalAction)b.ActionInt == globalAction))
                {
                    string str = keyCombinationProvider.GetReadableString(action.KeyCombination);

                    // even if found, the readable string may be empty for an unbound action.
                    if (str.Length > 0)
                    {
                        combinations.Add(str);
                    }
                }
            });

            return(combinations);
        }
Exemple #30
0
        public IReadOnlyList <string> GetReadableKeyCombinationsFor(GlobalAction globalAction)
        {
            List <string> combinations = new List <string>();

            using (var context = realmFactory.CreateContext())
            {
                foreach (var action in context.All <RealmKeyBinding>().Where(b => b.RulesetID == null && (GlobalAction)b.ActionInt == globalAction))
                {
                    string str = action.KeyCombination.ReadableString();

                    // even if found, the readable string may be empty for an unbound action.
                    if (str.Length > 0)
                    {
                        combinations.Add(str);
                    }
                }
            }

            return(combinations);
        }