Browse Source

Added Action Display Message to tools

CPK 4 years ago
parent
commit
a2aaa5a815

+ 17 - 0
PixiEditor/Models/Tools/Tools/BrightnessTool.cs

@@ -21,6 +21,7 @@ namespace PixiEditor.Models.Tools.Tools
 
         public BrightnessTool()
         {
+            ActionDisplay = "Draw on pixel to make it brighter. Hold Ctrl to darken.";
             Tooltip = "Makes pixel brighter or darker pixel (U). Hold Ctrl to make pixel darker.";
             Toolbar = new BrightnessToolToolbar(CorrectionFactor);
         }
@@ -34,6 +35,22 @@ namespace PixiEditor.Models.Tools.Tools
             pixelsVisited.Clear();
         }
 
+        public override void OnKeyDown(KeyEventArgs e)
+        {
+            if (e.Key == Key.LeftCtrl)
+            {
+                ActionDisplay = "Draw on pixel to make it darker. Release Ctrl to brighten.";
+            }
+        }
+
+        public override void OnKeyUp(KeyEventArgs e)
+        {
+            if (e.Key == Key.LeftCtrl)
+            {
+                ActionDisplay = "Draw on pixel to make it brighter. Hold Ctrl to darken.";
+            }
+        }
+
         public override LayerChange[] Use(Layer layer, Coordinates[] coordinates, Color color)
         {
             int toolSize = Toolbar.GetSetting<SizeSetting>("ToolSize").Value;

+ 18 - 0
PixiEditor/Models/Tools/Tools/CircleTool.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Windows.Input;
 using System.Windows.Media;
 using PixiEditor.Helpers.Extensions;
 using PixiEditor.Models.DataHolders;
@@ -14,11 +15,28 @@ namespace PixiEditor.Models.Tools.Tools
     {
         public CircleTool()
         {
+            ActionDisplay = "Click and move mouse to draw a circle. Hold Shift to draw an even one.";
             Tooltip = "Draws circle on canvas (C). Hold Shift to draw even circle.";
         }
 
         public override ToolType ToolType => ToolType.Circle;
 
+        public override void OnKeyDown(KeyEventArgs e)
+        {
+            if (e.Key == Key.LeftShift)
+            {
+                ActionDisplay = "Click and move mouse to draw an even circle.";
+            }
+        }
+
+        public override void OnKeyUp(KeyEventArgs e)
+        {
+            if (e.Key == Key.LeftShift)
+            {
+                ActionDisplay = "Click and move mouse to draw a circle. Hold Shift to draw an even one.";
+            }
+        }
+
         public override LayerChange[] Use(Layer layer, Coordinates[] coordinates, Color color)
         {
             int thickness = Toolbar.GetSetting<SizeSetting>("ToolSize").Value;

+ 1 - 0
PixiEditor/Models/Tools/Tools/ColorPickerTool.cs

@@ -10,6 +10,7 @@ namespace PixiEditor.Models.Tools.Tools
         public ColorPickerTool()
         {
             HideHighlight = true;
+            ActionDisplay = "Press on pixel to make it the primary color.";
             Tooltip = "Swaps primary color with selected on canvas. (O)";
         }
 

+ 1 - 0
PixiEditor/Models/Tools/Tools/EraserTool.cs

@@ -13,6 +13,7 @@ namespace PixiEditor.Models.Tools.Tools
 
         public EraserTool()
         {
+            ActionDisplay = "Draw to remove color from a pixel";
             Tooltip = "Erasers color from pixel (E)";
             Toolbar = new BasicToolbar();
         }

+ 1 - 0
PixiEditor/Models/Tools/Tools/FloodFill.cs

@@ -11,6 +11,7 @@ namespace PixiEditor.Models.Tools.Tools
     {
         public FloodFill()
         {
+            ActionDisplay = "Press on a area to fill it";
             Tooltip = "Fills area with color (G)";
         }
 

+ 18 - 0
PixiEditor/Models/Tools/Tools/LineTool.cs

@@ -1,5 +1,6 @@
 using System.Collections.Generic;
 using System.Linq;
+using System.Windows.Input;
 using System.Windows.Media;
 using PixiEditor.Models.DataHolders;
 using PixiEditor.Models.Enums;
@@ -16,6 +17,7 @@ namespace PixiEditor.Models.Tools.Tools
 
         public LineTool()
         {
+            ActionDisplay = "Click and move to draw a line. Hold Shift to draw an even one";
             Tooltip = "Draws line on canvas (L). Hold Shift to draw even line.";
             Toolbar = new BasicToolbar();
             circleTool = new CircleTool();
@@ -23,6 +25,22 @@ namespace PixiEditor.Models.Tools.Tools
 
         public override ToolType ToolType => ToolType.Line;
 
+        public override void OnKeyDown(KeyEventArgs e)
+        {
+            if (e.Key == Key.LeftShift)
+            {
+                ActionDisplay = "Click and move mouse to draw an even line";
+            }
+        }
+
+        public override void OnKeyUp(KeyEventArgs e)
+        {
+            if (e.Key == Key.LeftShift)
+            {
+                ActionDisplay = "Click and move to draw a line. Hold Shift to draw an even one";
+            }
+        }
+
         public override LayerChange[] Use(Layer layer, Coordinates[] coordinates, Color color)
         {
             BitmapPixelChanges pixels =

+ 17 - 0
PixiEditor/Models/Tools/Tools/MoveTool.cs

@@ -30,6 +30,7 @@ namespace PixiEditor.Models.Tools.Tools
 
         public MoveTool()
         {
+            ActionDisplay = "Hold mouse to move selected pixels. Hold Ctrl to move all layers";
             Tooltip = "Moves selected pixels (V). Hold Ctrl to move all layers";
             Cursor = Cursors.Arrow;
             HideHighlight = true;
@@ -41,6 +42,22 @@ namespace PixiEditor.Models.Tools.Tools
 
         public override ToolType ToolType => ToolType.Move;
 
+        public override void OnKeyDown(KeyEventArgs e)
+        {
+            if (e.Key == Key.LeftCtrl)
+            {
+                ActionDisplay = "Hold mouse to move all selected layers";
+            }
+        }
+
+        public override void OnKeyUp(KeyEventArgs e)
+        {
+            if (e.Key == Key.LeftCtrl)
+            {
+                ActionDisplay = "Hold mouse to move selected pixels. Hold Ctrl to move all layers";
+            }
+        }
+
         public override void AfterAddedUndo()
         {
             if (currentSelection != null && currentSelection.Length != 0)

+ 1 - 0
PixiEditor/Models/Tools/Tools/MoveViewportTool.cs

@@ -13,6 +13,7 @@ namespace PixiEditor.Models.Tools.Tools
         {
             HideHighlight = true;
             Cursor = Cursors.SizeAll;
+            ActionDisplay = "Click and move to pan viewport";
             Tooltip = "Move viewport. (H)";
         }
 

+ 1 - 0
PixiEditor/Models/Tools/Tools/PenTool.cs

@@ -16,6 +16,7 @@ namespace PixiEditor.Models.Tools.Tools
         public PenTool()
         {
             Cursor = Cursors.Pen;
+            ActionDisplay = "Click and move to draw";
             Tooltip = "Standard brush (B)";
             Toolbar = new BasicToolbar();
             toolSizeSetting = Toolbar.GetSetting<SizeSetting>("ToolSize");

+ 18 - 0
PixiEditor/Models/Tools/Tools/RectangleTool.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Windows.Input;
 using System.Windows.Media;
 using PixiEditor.Helpers.Extensions;
 using PixiEditor.Models.DataHolders;
@@ -14,6 +15,7 @@ namespace PixiEditor.Models.Tools.Tools
     {
         public RectangleTool()
         {
+            ActionDisplay = "Click and move to draw a rectangle.  Hold Shift to draw square.";
             Tooltip = "Draws rectangle on canvas (R). Hold Shift to draw square.";
         }
 
@@ -21,6 +23,22 @@ namespace PixiEditor.Models.Tools.Tools
 
         public bool Filled { get; set; } = false;
 
+        public override void OnKeyDown(KeyEventArgs e)
+        {
+            if (e.Key == Key.LeftShift)
+            {
+                ActionDisplay = "Click and move to draw a square.";
+            }
+        }
+
+        public override void OnKeyUp(KeyEventArgs e)
+        {
+            if (e.Key == Key.LeftShift)
+            {
+                ActionDisplay = "Click and move to draw a rectangle.  Hold Shift to draw square.";
+            }
+        }
+
         public override LayerChange[] Use(Layer layer, Coordinates[] coordinates, Color color)
         {
             int thickness = Toolbar.GetSetting<SizeSetting>("ToolSize").Value;

+ 1 - 0
PixiEditor/Models/Tools/Tools/SelectTool.cs

@@ -19,6 +19,7 @@ namespace PixiEditor.Models.Tools.Tools
 
         public SelectTool()
         {
+            ActionDisplay = "Click and move to select an area";
             Tooltip = "Selects area. (M)";
             Toolbar = new SelectToolToolbar();
         }

+ 17 - 0
PixiEditor/Models/Tools/Tools/ZoomTool.cs

@@ -19,12 +19,29 @@ namespace PixiEditor.Models.Tools.Tools
         {
             HideHighlight = true;
             CanStartOutsideCanvas = true;
+            ActionDisplay = "Click and move to zoom. Click to zoom in, hold alt and click to zoom out.";
             Tooltip = "Zooms viewport (Z). Click to zoom in, hold alt and click to zoom out.";
             pixelsPerZoomMultiplier = workAreaWidth / ZoomSensitivityMultiplier;
         }
 
         public override ToolType ToolType => ToolType.Zoom;
 
+        public override void OnKeyDown(KeyEventArgs e)
+        {
+            if (e.Key == Key.LeftAlt)
+            {
+                ActionDisplay = "Click and move to zoom. Click to zoom out, release alt and click to zoom in.";
+            }
+        }
+
+        public override void OnKeyUp(KeyEventArgs e)
+        {
+            if (e.Key == Key.LeftAlt)
+            {
+                ActionDisplay = "Click and move to zoom. Click to zoom in, hold alt and click to zoom out.";
+            }
+        }
+
         public override void OnRecordingLeftMouseDown(MouseEventArgs e)
         {
             startingX = MousePositionConverter.GetCursorPosition().X;