Esempio n. 1
0
                /// <summary>
                /// Removes the control at the index specified.
                /// </summary>
                private void RemoveControl(int index)
                {
                    List <IControl> combo = new List <IControl>(bind.GetCombo());

                    if (index < combo.Count)
                    {
                        if (index == 0 && combo.Count == 1)
                        {
                            bind.ClearCombo();
                            UpdateBindText();
                        }
                        else
                        {
                            combo.RemoveAt(index);

                            if (bind.TrySetCombo(combo.ToArray(), false))
                            {
                                UpdateBindText();
                            }
                        }
                    }
                }
        /// <summary>
        /// Opens the rebind dialog for the control at the specified position.
        /// </summary>
        private void UpdateBindInternal(IBind bind, int bindPos, Action CallbackFunc = null)
        {
            BindManager.BlacklistMode = SeBlacklistModes.AllKeys;
            HudMain.EnableCursor      = true;

            stopwatch.Restart();
            Open       = true;
            newControl = null;

            this.bind         = bind;
            this.CallbackFunc = CallbackFunc;

            combo        = bind.GetCombo();
            controlIndex = MathHelper.Clamp(bindPos, 0, combo.Count);
        }
Esempio n. 3
0
        private static string GetBindString(IBind bind)
        {
            IList <IControl> combo      = bind.GetCombo();
            string           bindString = "";

            for (int n = 0; n < combo.Count; n++)
            {
                if (n != combo.Count - 1)
                {
                    bindString += combo[n].DisplayName + " + ";
                }
                else
                {
                    bindString += combo[n].DisplayName;
                }
            }

            return(bindString);
        }