Shortcuts.cs 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*
  2. Copyright (c) 2021 Omar Duarte
  3. Unauthorized copying of this file, via any medium is strictly prohibited.
  4. Writen by Omar Duarte, 2021.
  5. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  6. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  8. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  9. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  10. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  11. THE SOFTWARE.
  12. */
  13. #if UNITY_2019_1_OR_NEWER
  14. using UnityEngine;
  15. namespace PluginMaster
  16. {
  17. public static partial class Shortcuts
  18. {
  19. #region TOGGLE TOOLS
  20. public const string PWB_TOGGLE_FLOOR_SHORTCUT_ID = "Prefab World Builder/Tools - Toggle Floor Tool";
  21. [UnityEditor.ShortcutManagement.Shortcut(PWB_TOGGLE_FLOOR_SHORTCUT_ID,
  22. KeyCode.F, UnityEditor.ShortcutManagement.ShortcutModifiers.Shift
  23. | UnityEditor.ShortcutManagement.ShortcutModifiers.Alt)]
  24. private static void ToggleFloor() => PWBIO.ToogleTool(ToolManager.PaintTool.FLOOR);
  25. public const string PWB_TOGGLE_WALL_SHORTCUT_ID = "Prefab World Builder/Tools - Toggle Wall Tool";
  26. [UnityEditor.ShortcutManagement.Shortcut(PWB_TOGGLE_WALL_SHORTCUT_ID,
  27. KeyCode.W, UnityEditor.ShortcutManagement.ShortcutModifiers.Shift
  28. | UnityEditor.ShortcutManagement.ShortcutModifiers.Alt)]
  29. private static void ToggleWall() => PWBIO.ToogleTool(ToolManager.PaintTool.WALL);
  30. public const string PWB_TOGGLE_PIN_SHORTCUT_ID = "Prefab World Builder/Tools - Toggle Pin Tool";
  31. [UnityEditor.ShortcutManagement.Shortcut(PWB_TOGGLE_PIN_SHORTCUT_ID,
  32. KeyCode.Alpha1, UnityEditor.ShortcutManagement.ShortcutModifiers.Shift
  33. | UnityEditor.ShortcutManagement.ShortcutModifiers.Alt)]
  34. private static void TogglePin() => PWBIO.ToogleTool(ToolManager.PaintTool.PIN);
  35. public const string PWB_TOGGLE_BRUSH_SHORTCUT_ID = "Prefab World Builder/Tools - Toggle Brush Tool";
  36. [UnityEditor.ShortcutManagement.Shortcut(PWB_TOGGLE_BRUSH_SHORTCUT_ID, KeyCode.Alpha2,
  37. UnityEditor.ShortcutManagement.ShortcutModifiers.Shift | UnityEditor.ShortcutManagement.ShortcutModifiers.Alt)]
  38. private static void ToggleBrush() => PWBIO.ToogleTool(ToolManager.PaintTool.BRUSH);
  39. public const string PWB_TOGGLE_GRAVITY_SHORTCUT_ID = "Prefab World Builder/Tools - Toggle Gravity Tool";
  40. [UnityEditor.ShortcutManagement.Shortcut(PWB_TOGGLE_GRAVITY_SHORTCUT_ID, KeyCode.Alpha3,
  41. UnityEditor.ShortcutManagement.ShortcutModifiers.Shift | UnityEditor.ShortcutManagement.ShortcutModifiers.Alt)]
  42. private static void ToggleGravity() => PWBIO.ToogleTool(ToolManager.PaintTool.GRAVITY);
  43. public const string PWB_TOGGLE_LINE_SHORTCUT_ID = "Prefab World Builder/Tools - Toggle Line Tool";
  44. [UnityEditor.ShortcutManagement.Shortcut(PWB_TOGGLE_LINE_SHORTCUT_ID, KeyCode.Alpha4,
  45. UnityEditor.ShortcutManagement.ShortcutModifiers.Shift | UnityEditor.ShortcutManagement.ShortcutModifiers.Alt)]
  46. private static void ToggleLine() => PWBIO.ToogleTool(ToolManager.PaintTool.LINE);
  47. public const string PWB_TOGGLE_SHAPE_SHORTCUT_ID = "Prefab World Builder/Tools - Toggle Shape Tool";
  48. [UnityEditor.ShortcutManagement.Shortcut(PWB_TOGGLE_SHAPE_SHORTCUT_ID, KeyCode.Alpha5,
  49. UnityEditor.ShortcutManagement.ShortcutModifiers.Shift | UnityEditor.ShortcutManagement.ShortcutModifiers.Alt)]
  50. private static void ToggleShape() => PWBIO.ToogleTool(ToolManager.PaintTool.SHAPE);
  51. public const string PWB_TOGGLE_TILING_SHORTCUT_ID = "Prefab World Builder/Tools - Toggle Tiling Tool";
  52. [UnityEditor.ShortcutManagement.Shortcut(PWB_TOGGLE_TILING_SHORTCUT_ID, KeyCode.Alpha6,
  53. UnityEditor.ShortcutManagement.ShortcutModifiers.Shift | UnityEditor.ShortcutManagement.ShortcutModifiers.Alt)]
  54. private static void ToggleTiling() => PWBIO.ToogleTool(ToolManager.PaintTool.TILING);
  55. public const string PWB_TOGGLE_REPLACER_SHORTCUT_ID = "Prefab World Builder/Tools - Toggle Replacer Tool";
  56. [UnityEditor.ShortcutManagement.Shortcut(PWB_TOGGLE_REPLACER_SHORTCUT_ID, KeyCode.Alpha7,
  57. UnityEditor.ShortcutManagement.ShortcutModifiers.Shift | UnityEditor.ShortcutManagement.ShortcutModifiers.Alt)]
  58. private static void ToggleReplacer() => PWBIO.ToogleTool(ToolManager.PaintTool.REPLACER);
  59. public const string PWB_TOGGLE_ERASER_SHORTCUT_ID = "Prefab World Builder/Tools - Toggle Eraser Tool";
  60. [UnityEditor.ShortcutManagement.Shortcut(PWB_TOGGLE_ERASER_SHORTCUT_ID, KeyCode.Alpha8,
  61. UnityEditor.ShortcutManagement.ShortcutModifiers.Shift | UnityEditor.ShortcutManagement.ShortcutModifiers.Alt)]
  62. private static void ToggleEraser() => PWBIO.ToogleTool(ToolManager.PaintTool.ERASER);
  63. public const string PWB_TOGGLE_SELECTION_SHORTCUT_ID = "Prefab World Builder/Tools - Toggle Selection Tool";
  64. [UnityEditor.ShortcutManagement.Shortcut(PWB_TOGGLE_SELECTION_SHORTCUT_ID, KeyCode.Alpha9,
  65. UnityEditor.ShortcutManagement.ShortcutModifiers.Shift | UnityEditor.ShortcutManagement.ShortcutModifiers.Alt)]
  66. private static void ToggleSelection() => PWBIO.ToogleTool(ToolManager.PaintTool.SELECTION);
  67. public const string PWB_TOGGLE_CIRCLE_SELECT_SHORTCUT_ID = "Prefab World Builder/Tools - Toggle Circle Selection Tool";
  68. [UnityEditor.ShortcutManagement.Shortcut(PWB_TOGGLE_CIRCLE_SELECT_SHORTCUT_ID, KeyCode.O,
  69. UnityEditor.ShortcutManagement.ShortcutModifiers.Shift | UnityEditor.ShortcutManagement.ShortcutModifiers.Alt)]
  70. private static void ToggleCircleSelect() => PWBIO.ToogleTool(ToolManager.PaintTool.CIRCLE_SELECT);
  71. public const string PWB_TOGGLE_EXTRUDE_SHORTCUT_ID = "Prefab World Builder/Tools - Toggle Extrude Tool";
  72. [UnityEditor.ShortcutManagement.Shortcut(PWB_TOGGLE_EXTRUDE_SHORTCUT_ID, KeyCode.X,
  73. UnityEditor.ShortcutManagement.ShortcutModifiers.Shift | UnityEditor.ShortcutManagement.ShortcutModifiers.Alt)]
  74. private static void ToggleExtrude() => PWBIO.ToogleTool(ToolManager.PaintTool.EXTRUDE);
  75. public const string PWB_TOGGLE_MIRROR_SHORTCUT_ID = "Prefab World Builder/Tools - Toggle Mirror Tool";
  76. [UnityEditor.ShortcutManagement.Shortcut(PWB_TOGGLE_MIRROR_SHORTCUT_ID, KeyCode.M,
  77. UnityEditor.ShortcutManagement.ShortcutModifiers.Shift | UnityEditor.ShortcutManagement.ShortcutModifiers.Alt)]
  78. private static void ToggleMirror() => PWBIO.ToogleTool(ToolManager.PaintTool.MIRROR);
  79. #endregion
  80. #region WINDOWS
  81. public const string PWB_CLOSE_ALL_WINDOWS_ID = "Prefab World Builder/Close All Windows";
  82. [UnityEditor.ShortcutManagement.Shortcut(PWB_CLOSE_ALL_WINDOWS_ID, KeyCode.End,
  83. UnityEditor.ShortcutManagement.ShortcutModifiers.Shift | UnityEditor.ShortcutManagement.ShortcutModifiers.Alt)]
  84. private static void PWBCloseAllWindows()
  85. {
  86. ToolManager.DeselectTool();
  87. PWBIO.CloseAllWindows();
  88. }
  89. #endregion
  90. }
  91. }
  92. #endif