public void HandleHighlight() { Vector3 newPosition = _keyboardCursor.WorldLocation; if (InputHelper.IsNewKeyPress(Keys.NumPad3)) { newPosition += WorldDirection.East; } if (InputHelper.IsNewKeyPress(Keys.NumPad1)) { newPosition += WorldDirection.North; } if (InputHelper.IsNewKeyPress(Keys.NumPad7)) { newPosition += WorldDirection.West; } if (InputHelper.IsNewKeyPress(Keys.NumPad9)) { newPosition += WorldDirection.South; } if (InputHelper.IsNewKeyPress(Keys.Add)) { newPosition += WorldDirection.Up; } if (InputHelper.IsNewKeyPress(Keys.Subtract)) { newPosition += WorldDirection.Down; } // Following is for valid block ranges only. if (ParentSegmentManager.GetBlockMaskAt(new SegmentLocation(newPosition)) != BlockHelper.BlockMasks.Null) { if (newPosition != _keyboardCursor.WorldLocation) { // check for an object? int segmentX = (int)Math.Floor((double)newPosition.X / WorldGlobal.SegmentSize.X); int segmentZ = (int)Math.Floor((double)newPosition.Z / WorldGlobal.SegmentSize.Z); //_ItemsUnderCursor = ParentSegmentManager.Segments[segmentX, segmentZ].Items.FindItemsAt(newPosition); } _keyboardCursor = new SegmentLocation(newPosition); if (InputHelper.IsNewKeyPress(Keys.Delete)) { ParentSegmentManager.SetBlockMaskAt(_keyboardCursor, BlockHelper.BlockMasks.Air); } if (InputHelper.IsNewKeyPress(Keys.Insert)) { BlockMask maskAtCursor = ParentSegmentManager.GetBlockMaskAt(_keyboardCursor); switch (_selectedType) { case EditorType.Blocks: ParentSegmentManager.SetBlockMaskAt(_keyboardCursor, _activeBlockMask); break; case EditorType.BottomRamps: if (BlockHelper.HasTopRamp(maskAtCursor) && BlockHelper.GetRampBlockDirection(maskAtCursor) == _RampBlockDirection) { ParentSegmentManager.SetBlockMaskAt(_keyboardCursor, maskAtCursor | _activeBlockMask); } else { ParentSegmentManager.SetBlockMaskAt(_keyboardCursor, _activeBlockMask); } break; case EditorType.TopRamps: if (BlockHelper.HasBottomRamp(maskAtCursor) && BlockHelper.GetRampBlockDirection(maskAtCursor) == _RampBlockDirection) { ParentSegmentManager.SetBlockMaskAt(_keyboardCursor, maskAtCursor | _activeBlockMask); } else { ParentSegmentManager.SetBlockMaskAt(_keyboardCursor, _activeBlockMask); } break; default: _previewData = new BlockVertexData(); break; } } } else { DebugLog.Log("Can't move World Cursor to (" + newPosition.X + ", " + newPosition.Y + ", " + newPosition.Z + ") - Out of bounds", DebugMessageType.Warning); } }