Browse Source

Fixed aseprite defaults import and added more mappings

Krzysztof Krysiński 2 years ago
parent
commit
7ab77abef1

+ 27 - 115
src/PixiEditor/Data/ShortcutActionMaps/AsepriteShortcutMap.json

@@ -375,7 +375,7 @@
       },
       "Parameters": []
     },
-    "": {
+    "MergeDownLayer": {
       "Command": "PixiEditor.Layer.MergeWithBelow",
       "DefaultShortcut": {
         "key": "None",
@@ -383,67 +383,27 @@
       },
       "Parameters": []
     },
-    "": {
+    "Launch.path=/docs/.type=url": {
       "Command": "PixiEditor.Links.OpenDocumentation",
       "DefaultShortcut": {
-        "key": "None",
-        "modifiers": null
-      },
-      "Parameters": []
-    },
-    "": {
-      "Command": "PixiEditor.Links.OpenWebsite",
-      "DefaultShortcut": {
-        "key": "None",
-        "modifiers": null
-      },
-      "Parameters": []
-    },
-    "": {
-      "Command": "PixiEditor.Links.OpenRepository",
-      "DefaultShortcut": {
-        "key": "None",
-        "modifiers": null
-      },
-      "Parameters": []
-    },
-    "": {
-      "Command": "PixiEditor.Links.OpenLicense",
-      "DefaultShortcut": {
-        "key": "None",
-        "modifiers": null
-      },
-      "Parameters": []
-    },
-    "": {
-      "Command": "PixiEditor.Links.OpenOtherLicenses",
-      "DefaultShortcut": {
-        "key": "None",
-        "modifiers": null
-      },
-      "Parameters": []
-    },
-    "": {
-      "Command": "PixiEditor.Search.Toggle",
-      "DefaultShortcut": {
-        "key": "None",
+        "key": "B",
         "modifiers": null
       },
       "Parameters": []
     },
-    "": {
+    "MaskAll": {
       "Command": "PixiEditor.Selection.SelectAll",
       "DefaultShortcut": {
-        "key": "None",
-        "modifiers": null
+        "key": "A",
+        "modifiers": ["Ctrl"]
       },
       "Parameters": []
     },
-    "": {
+    "DeselectMask": {
       "Command": "PixiEditor.Selection.Clear",
       "DefaultShortcut": {
-        "key": "None",
-        "modifiers": null
+        "key": "D",
+        "modifiers": ["Ctrl"]
       },
       "Parameters": []
     },
@@ -463,83 +423,35 @@
       },
       "Parameters": []
     },
-    "": {
-      "Command": "PixiEditor.Stylus.StylusOutOfRange",
-      "DefaultShortcut": {
-        "key": "None",
-        "modifiers": null
-      },
-      "Parameters": []
-    },
-    "": {
-      "Command": "PixiEditor.Stylus.StylusSystemGesture",
-      "DefaultShortcut": {
-        "key": "None",
-        "modifiers": null
-      },
-      "Parameters": []
-    },
-    "": {
-      "Command": "PixiEditor.Stylus.StylusDown",
-      "DefaultShortcut": {
-        "key": "None",
-        "modifiers": null
-      },
-      "Parameters": []
-    },
-    "": {
-      "Command": "PixiEditor.Stylus.StylusUp",
-      "DefaultShortcut": {
-        "key": "None",
-        "modifiers": null
-      },
-      "Parameters": []
-    },
-    "": {
-      "Command": "PixiEditor.Tools.ApplyTransform",
-      "DefaultShortcut": {
-        "key": "None",
-        "modifiers": null
-      },
-      "Parameters": []
-    },
-    "": {
-      "Command": "PixiEditor.Tools.SelectTool",
-      "DefaultShortcut": {
-        "key": "None",
-        "modifiers": null
-      },
-      "Parameters": []
-    },
-    "": {
+    "ChangeBrush.change=increment-size": {
       "Command": "PixiEditor.Tools.IncreaseSize",
       "DefaultShortcut": {
-        "key": "None",
+        "key": "+",
         "modifiers": null
       },
       "Parameters": []
     },
-    "": {
+    "ChangeBrush.change=decrement-size": {
       "Command": "PixiEditor.Tools.DecreaseSize",
       "DefaultShortcut": {
-        "key": "None",
+        "key": "-",
         "modifiers": null
       },
       "Parameters": []
     },
-    "": {
+    "Redo": {
       "Command": "PixiEditor.Undo.Redo",
       "DefaultShortcut": {
         "key": "None",
-        "modifiers": null
+        "modifiers": ["Ctrl"]
       },
       "Parameters": []
     },
-    "": {
+    "Undo": {
       "Command": "PixiEditor.Undo.Undo",
       "DefaultShortcut": {
-        "key": "None",
-        "modifiers": null
+        "key": "Z",
+        "modifiers": ["Ctrl"]
       },
       "Parameters": []
     },
@@ -551,27 +463,27 @@
       },
       "Parameters": []
     },
-    "": {
+    "ShowGrid": {
       "Command": "PixiEditor.View.ToggleGrid",
       "DefaultShortcut": {
-        "key": "None",
-        "modifiers": null
+        "key": "'",
+        "modifiers": ["Ctrl"]
       },
       "Parameters": []
     },
-    "": {
+    "Zoom.action=in": {
       "Command": "PixiEditor.View.ZoomIn",
       "DefaultShortcut": {
-        "key": "None",
-        "modifiers": null
+        "key": "+",
+        "modifiers": ["Ctrl"]
       },
       "Parameters": []
     },
-    "": {
+    "Zoom.action=out": {
       "Command": "PixiEditor.View.Zoomout",
       "DefaultShortcut": {
-        "key": "None",
-        "modifiers": null
+        "key": "-",
+        "modifiers": ["Ctrl"]
       },
       "Parameters": []
     },

+ 3 - 3
src/PixiEditor/Models/Commands/Templates/Providers/Parsers/AsepriteKeysParser.cs

@@ -58,12 +58,12 @@ public class AsepriteKeysParser : KeysParser
     private void LoadCommands(XmlDocument document, List<KeyDefinition> keyDefinitions)
     {
         XmlNodeList commands = document.SelectNodes("keyboard/commands/key");
-        if(commands == null)
+        if(commands == null || commands.Count == 0)
         {
             ApplyDefaults(keyDefinitions, "PixiEditor");
             return;
         }
-        
+
         foreach (XmlNode commandNode in commands)
         {
             if(commandNode.Attributes == null) continue;
@@ -135,7 +135,7 @@ public class AsepriteKeysParser : KeysParser
     private void LoadTools(XmlDocument document, List<KeyDefinition> keyDefinitions)
     {
         XmlNodeList tools = document.SelectNodes("keyboard/tools/key");
-        if(tools == null)
+        if(tools == null || tools.Count == 0)
         {
             ApplyDefaults(keyDefinitions, "PixiEditor.Tools");
             return;