public void CommitChange() { if (CurrentToolMode == ToolMode.AdjustSegmentation) { TileManager.CommmitAdjustChange(); } else if (CurrentToolMode == ToolMode.SplitSegmentation) { TileManager.CommmitSplitChange(); } }
public override void OnKeyDown(System.Windows.Input.KeyEventArgs keyEventArgs, int width, int height) { var p = new Vector2(0.5f, 0.5f); switch (keyEventArgs.Key) { case System.Windows.Input.Key.W: mCurrentlyMovingZ = true; break; case System.Windows.Input.Key.S: mCurrentlyMovingZ = true; break; case System.Windows.Input.Key.Q: mTileManager.ToggleShowBoundaryLines(); break; case System.Windows.Input.Key.A: mTileManager.ToggleShowSegmentation(); break; case System.Windows.Input.Key.E: mTileManager.IncreaseSegmentationVisibility(); break; case System.Windows.Input.Key.D: mTileManager.DecreaseSegmentationVisibility(); break; case System.Windows.Input.Key.Z: if (keyEventArgs.KeyboardDevice.Modifiers == System.Windows.Input.ModifierKeys.Control) { mTileManager.UndoChange(); mTileManager.PrepForSplit(p); } break; case System.Windows.Input.Key.Y: if (keyEventArgs.KeyboardDevice.Modifiers == System.Windows.Input.ModifierKeys.Control) { mTileManager.RedoChange(); mTileManager.PrepForSplit(p); } break; case System.Windows.Input.Key.N: if (keyEventArgs.KeyboardDevice.Modifiers == System.Windows.Input.ModifierKeys.Control) { mTileManager.SelectNewId(); mTileManager.PrepForSplit(p); } break; case System.Windows.Input.Key.Tab: mTileManager.CommmitSplitChange(); keyEventArgs.Handled = true; break; case System.Windows.Input.Key.Escape: mTileManager.CancelSplitChange(); break; case System.Windows.Input.Key.OemComma: case System.Windows.Input.Key.OemMinus: case System.Windows.Input.Key.Subtract: mTileManager.DecreaseBrushSize(); break; case System.Windows.Input.Key.OemPeriod: case System.Windows.Input.Key.OemPlus: case System.Windows.Input.Key.Add: mTileManager.IncreaseBrushSize(); break; } base.OnKeyDown(keyEventArgs, width, height); }