Ejemplo n.º 1
0
 public static void Postfix(ref StaticActions __result)
 {
     Logger.Debug("Clearing Default Bindings for enter Key");
     __result.Return.ClearBindings();
     Logger.Debug("Setting enter and others key as defaults for enter Key");
     __result.Return.AddDefaultBinding(new Key[]
     {
         Key.Return
     });
     __result.Return.AddDefaultBinding(new Key[]
     {
         Key.Shift,
         Key.Return
     });
     __result.Return.AddDefaultBinding(new Key[]
     {
         Key.RightShift,
         Key.Return
     });
     __result.Return.AddDefaultBinding(new Key[]
     {
         Key.LeftShift,
         Key.Return
     });
     Logger.Debug("Success setting enter and others key as defaults for enter Key");
 }
            public static void Postfix(ref StaticActions __result)
            {
                Logger.LogLine("Clearing Default Bindings for 'Escape' Key");
                __result.Escape.ClearBindings();
                Logger.LogLine("Setting Escape key as defaults for 'Escape'");
                __result.Escape.AddDefaultBinding(new Key[]
                {
                    Key.Escape
                });
                Logger.LogLine("Success Escape key as defaults for 'Escape'");
                if (BTMLAddBindableEscapeKey.ModSettings.EnableSpaceKey)
                {
                    Logger.LogLine("Setting Space Default for Escape");
                    __result.Escape.AddDefaultBinding(new Key[]
                    {
                        Key.Space
                    });
                    Logger.LogLine("Success Space Default for Escape");
                }
                if (BTMLAddBindableEscapeKey.ModSettings.EnableMouseButton)
                {
                    Logger.LogLine($"Setting Mouse{BTMLAddBindableEscapeKey.ModSettings._escapeMouseButtonInput} default for escape");
                    __result.Escape.AddDefaultBinding(new MouseBindingSource(BTMLAddBindableEscapeKey.ModSettings.EscapeMouseButton));
                    Logger.LogLine("New Mouse escape defaults set!");

                    foreach (int mouseButtonInt in BTMLAddBindableEscapeKey.ModSettings.__additionalMouseButtons)
                    {
                        if (mouseButtonInt >= 2 && mouseButtonInt <= 9)
                        {
                            Mouse mouseButtonFromInt = SettingsMouseHelper.GetButtonFromInt(mouseButtonInt);
                            Logger.LogLine($"Setting Mouse{mouseButtonInt} default for escape via __additionalMouseButtons");
                            __result.Escape.AddDefaultBinding(new MouseBindingSource(mouseButtonFromInt));
                            Logger.LogLine($"Success Mouse{mouseButtonInt} default for escape via __aditionalMouseButtons");
                        }
                    }
                }
            }