Browse Source

Added aseprite defaults and fixed bug

CPKreuz 3 years ago
parent
commit
1339d8578f

+ 1 - 1
PixiEditor/Models/Commands/CommandController.cs

@@ -49,7 +49,7 @@ namespace PixiEditor.Models.Commands
             {
                 foreach (var command in shortcut.Value)
                 {
-                    Commands[command].Shortcut = shortcut.Key;
+                    ReplaceShortcut(Commands[command], shortcut.Key);
                 }
             }
             

+ 28 - 0
PixiEditor/Models/Commands/Templates/Providers/AsepriteProvider.cs

@@ -0,0 +1,28 @@
+using System.Windows.Input;
+
+namespace PixiEditor.Models.Commands.Templates;
+
+public partial class ShortcutProvider
+{
+    public static AsepriteProvider Aseprite { get; } = new();
+    
+    public class AsepriteProvider : ShortcutProvider, IShortcutDefaults
+    {
+        public AsepriteProvider() : base("Aseprite")
+        {
+        }
+
+        public ShortcutCollection DefaultShortcuts { get; } = new()
+        {
+            { "PixiEditor.File.SaveAsNew", Key.S, ModifierKeys.Control | ModifierKeys.Alt },
+            { "PixiEditor.Window.OpenSettingsWindow", Key.K, ModifierKeys.Control },
+            // Tools
+            { "PixiEditor.Tools.Select.CircleTool", Key.U, ModifierKeys.Shift },
+            { "PixiEditor.Tools.Select.ColorPickerTool", Key.I, ModifierKeys.None },
+            { "PixiEditor.Tools.Select.RectangleTool", Key.U, ModifierKeys.None },
+            { "PixiEditor.Tools.Select.SelectTool", Key.V, ModifierKeys.None },
+            // Not actually in aseprite, but should be included
+            { "PixiEditor.Search.Toggle", Key.OemComma, ModifierKeys.Control }
+        };
+    }
+}

+ 1 - 1
PixiEditor/Models/Commands/Templates/DebugProvider.cs → PixiEditor/Models/Commands/Templates/Providers/DebugProvider.cs

@@ -5,7 +5,7 @@ namespace PixiEditor.Models.Commands.Templates;
 
 public partial class ShortcutProvider
 {
-    private static DebugProvider Debug { get; } = new DebugProvider();
+    private static DebugProvider Debug { get; } = new();
     
     public class DebugProvider : ShortcutProvider, IShortcutDefaults, IShortcutFile, IShortcutInstallation
     {

+ 2 - 1
PixiEditor/Models/Commands/Templates/ShortcutProvider.cs

@@ -32,10 +32,11 @@ public partial class ShortcutProvider
         Name = name;
     }
 
-    public static IEnumerable<ShortcutProvider> GetProviders() => new[]
+    public static IEnumerable<ShortcutProvider> GetProviders() => new ShortcutProvider[]
     {
         #if DEBUG
         Debug,
         #endif
+        Aseprite
     };
 }