예제 #1
0
        protected override void OnRightMouseButtonMove(LevelMapEditor editor, TileLocation location, Keys modifierKeys)
        {
            if (editor.LayerMode == LayerMode.LowerLayer)
            {
                modifierKeys |= Keys.Shift;
            }
            switch (modifierKeys)
            {
            case Keys.Alt | Keys.Shift:
                editor.RightTile = editor.Level.LowerLayer[location];
                break;

            case Keys.Alt:
                editor.RightTile = editor.Level.UpperLayer[location];
                break;

            case Keys.Shift:
                editor.SetLowerLayerTile(location, editor.RightTile);
                break;

            default:
                editor.SetUpperLayerTile(location, editor.RightTile);
                break;
            }
            editor.TileLocationHistory.Add(location);
        }
예제 #2
0
        protected override void OnLeftMouseButtonMove(LevelMapEditor editor, TileLocation location, Keys modifierKeys)
        {
            if (editor.LayerMode == LayerMode.LowerLayer)
            {
                modifierKeys |= Keys.Shift;
            }
            if (!InitializeLocations(editor, out TileLocation lastLocation, out TileLocation secondLastLocation))
            {
                if (modifierKeys == Keys.Shift)
                {
                    editor.SetLowerLayerTile(location, editor.LeftTile);
                }
                else
                {
                    editor.SetUpperLayerTile(location, editor.LeftTile);
                }
                editor.TileLocationHistory.Add(location);
                return;
            }
            var tile         = editor.LeftTile;
            var previousTile = Control.ModifierKeys == Keys.Shift ? editor.Level.LowerLayer[lastLocation] : editor.Level.UpperLayer[lastLocation];

            UpdateTiles(location, ref tile, lastLocation, ref previousTile, secondLastLocation);
            editor.LeftTile = tile;
            if ((Control.ModifierKeys & Keys.Shift) == Keys.Shift || editor.LayerMode == LayerMode.LowerLayer)
            {
                editor.SetLowerLayerTile(lastLocation, previousTile);
                editor.SetLowerLayerTile(location, tile);
            }
            else
            {
                editor.SetUpperLayerTile(lastLocation, previousTile);
                editor.SetUpperLayerTile(location, tile);
            }
            editor.TileLocationHistory.Add(location);
        }