Example #1
0
        public static void WriteConfiguration()
        {
            foreach (KeyValuePair <Bindings, Keys> na in BindingDictionary)
            {
                ConfigManager.Configuration["key" + na.Key] = na.Value.ToString();
            }

            BindingManagerMania.WriteConfiguration();
        }
Example #2
0
        public static void Initialize(bool skipConfig = false)
        {
            BindingDictionary = new Dictionary <Bindings, Keys>();
            KeyDictionaries   = new Dictionary <BindingTarget, Dictionary <Keys, Bindings> >();

            foreach (BindingTarget bt in Enum.GetValues(typeof(BindingTarget)))
            {
                KeyDictionaries[bt] = new Dictionary <Keys, Bindings>();
            }

            SetUnsafe(Bindings.OsuLeft, Keys.Z);
            SetUnsafe(Bindings.OsuRight, Keys.X);
            SetUnsafe(Bindings.OsuSmoke, Keys.C);
            SetUnsafe(Bindings.FruitsDash, Keys.LeftShift);
            SetUnsafe(Bindings.FruitsLeft, Keys.Left);
            SetUnsafe(Bindings.FruitsRight, Keys.Right);
            SetUnsafe(Bindings.TaikoInnerLeft, Keys.X);
            SetUnsafe(Bindings.TaikoInnerRight, Keys.C);
            SetUnsafe(Bindings.TaikoOuterLeft, Keys.Z);
            SetUnsafe(Bindings.TaikoOuterRight, Keys.V);
            SetUnsafe(Bindings.Pause, Keys.Escape);
            SetUnsafe(Bindings.Skip, Keys.Space);
            SetUnsafe(Bindings.ToggleScoreboard, Keys.Tab);
            SetUnsafe(Bindings.ToggleChat, Keys.F8);
            SetUnsafe(Bindings.ToggleExtendedChat, Keys.F9);
            SetUnsafe(Bindings.Screenshot, Keys.F12);
            SetUnsafe(Bindings.IncreaseAudioOffset, Keys.OemPlus);
            SetUnsafe(Bindings.DecreaseAudioOffset, Keys.OemMinus);
            SetUnsafe(Bindings.QuickRetry, Keys.OemTilde);
            SetUnsafe(Bindings.IncreaseSpeed, Keys.F4);
            SetUnsafe(Bindings.DecreaseSpeed, Keys.F3);
            SetUnsafe(Bindings.ToggleFrameLimiter, Keys.F7);
            SetUnsafe(Bindings.VolumeIncrease, Keys.Up);
            SetUnsafe(Bindings.VolumeDecrease, Keys.Down);
            SetUnsafe(Bindings.DisableMouseButtons, Keys.F10);
            SetUnsafe(Bindings.BossKey, Keys.Insert);
            SetUnsafe(Bindings.SelectTool, Keys.D1);
            SetUnsafe(Bindings.NormalTool, Keys.D2);
            SetUnsafe(Bindings.SliderTool, Keys.D3);
            SetUnsafe(Bindings.SpinnerTool, Keys.D4);
            SetUnsafe(Bindings.NewComboToggle, Keys.Q);
            SetUnsafe(Bindings.WhistleToggle, Keys.W);
            SetUnsafe(Bindings.FinishToggle, Keys.E);
            SetUnsafe(Bindings.ClapToggle, Keys.R);
            SetUnsafe(Bindings.GridSnapToggle, Keys.T);
            SetUnsafe(Bindings.DistSnapToggle, Keys.Y);
            SetUnsafe(Bindings.NoteLockToggle, Keys.L);
            SetUnsafe(Bindings.NudgeLeft, Keys.J);
            SetUnsafe(Bindings.NudgeRight, Keys.K);
            SetUnsafe(Bindings.HelpToggle, Keys.H);
            SetUnsafe(Bindings.JumpToBegin, Keys.Z);
            SetUnsafe(Bindings.PlayFromBegin, Keys.X);
            SetUnsafe(Bindings.AudioPause, Keys.C);
            SetUnsafe(Bindings.JumpToEnd, Keys.V);
            SetUnsafe(Bindings.GridChange, Keys.G);
            SetUnsafe(Bindings.TimingSection, Keys.None);
            SetUnsafe(Bindings.InheritingSection, Keys.None);
            SetUnsafe(Bindings.RemoveSection, Keys.None);
            SetUnsafe(Bindings.Easy, Keys.Q);
            SetUnsafe(Bindings.NoFail, Keys.W);
            SetUnsafe(Bindings.HalfTime, Keys.E);
            SetUnsafe(Bindings.HardRock, Keys.A);
            SetUnsafe(Bindings.SuddenDeath, Keys.S);
            SetUnsafe(Bindings.DoubleTime, Keys.D);
            SetUnsafe(Bindings.Hidden, Keys.F);
            SetUnsafe(Bindings.Flashlight, Keys.G);
            SetUnsafe(Bindings.Relax, Keys.Z);
            SetUnsafe(Bindings.Autopilot, Keys.X);
            SetUnsafe(Bindings.SpunOut, Keys.C);
            SetUnsafe(Bindings.Auto, Keys.V);

            if (!skipConfig)
            {
                string[] bindInternalNames = Enum.GetNames(typeof(Bindings));

                BindingTarget currentTarget = BindingTarget.Universal;
                for (int i = 1; i < bindInternalNames.Length; i++)
                {
                    string na = bindInternalNames[i];
                    if (na[0] == '_')
                    {
                        continue;
                    }

                    object m;
                    try
                    {
                        if (ConfigManager.Configuration.TryGetValue("key" + na, out m))
                        {
                            Set((Bindings)i, (Keys)Enum.Parse(typeof(Keys), m.ToString(), true));
                        }
                    }
                    catch { }
                }

                CheckBindings();

                BindingManagerMania.Initialize();
            }
        }