diff --git a/DungeonShooting_Godot/resource/map/tileMaps/Test1/battle/Battle2/Preview.png b/DungeonShooting_Godot/resource/map/tileMaps/Test1/battle/Battle2/Preview.png index dda6011..4feb157 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/Test1/battle/Battle2/Preview.png +++ b/DungeonShooting_Godot/resource/map/tileMaps/Test1/battle/Battle2/Preview.png Binary files differ diff --git a/DungeonShooting_Godot/resource/map/tileMaps/Test1/battle/Battle2/TileInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/Test1/battle/Battle2/TileInfo.json index 25fca17..6b29eda 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/Test1/battle/Battle2/TileInfo.json +++ b/DungeonShooting_Godot/resource/map/tileMaps/Test1/battle/Battle2/TileInfo.json @@ -1 +1 @@ -{"NavigationVertices":[{"X":250,"Y":146},{"X":-106,"Y":146},{"X":-106,"Y":-106},{"X":250,"Y":-106}],"NavigationPolygon":[[0,1,2,3]],"Floor":[-7,-7,0,3,-7,-6,0,3,-7,-5,0,3,-7,-4,0,3,-7,-3,0,3,-7,-2,0,3,-7,-1,0,3,-7,0,0,3,-7,1,0,3,-7,2,0,3,-7,3,0,3,-7,4,0,3,-7,5,0,3,-7,6,0,3,-7,7,0,3,-7,8,0,3,-6,7,0,3,-6,8,0,3,-5,7,0,3,-5,8,0,3,-4,7,0,3,-4,8,0,3,-3,7,0,3,-3,8,0,3,-2,7,0,3,-2,8,0,3,-1,7,0,3,-1,8,0,3,0,7,0,3,0,8,0,3,1,7,0,3,1,8,0,3,2,7,0,3,2,8,0,3,3,7,0,3,3,8,0,3,4,7,0,3,4,8,0,3,5,7,0,3,5,8,0,3,6,7,0,3,6,8,0,3,7,7,0,3,7,8,0,3,8,7,0,3,8,8,0,3,9,7,0,3,9,8,0,3,10,7,0,3,10,8,0,3,11,7,0,3,11,8,0,3,12,7,0,3,12,8,0,3,13,7,0,3,13,8,0,3,14,7,0,3,14,8,0,3,15,-7,0,3,15,-6,0,3,15,-5,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,2,13,-9,63,1,13,-8,2,2,14,-9,63,1,14,-8,2,2,15,-9,63,1,15,-8,2,2],"Top":[-9,-10,511,1,-9,-9,511,1,-9,-8,511,1,-9,-7,511,1,-9,-6,511,1,-9,-5,511,1,-9,-4,511,1,-9,-3,511,1,-9,-2,511,1,-9,-1,511,1,-9,0,511,1,-9,1,511,1,-9,2,511,1,-9,3,511,1,-9,4,511,1,-9,5,511,1,-9,6,511,1,-9,7,511,1,-9,8,511,1,-9,9,511,1,-9,10,511,1,-8,-10,511,1,-8,-9,255,1,-8,-8,219,1,-8,-7,219,1,-8,-6,219,1,-8,-5,219,1,-8,-4,219,1,-8,-3,219,1,-8,-2,219,1,-8,-1,219,1,-8,0,219,1,-8,1,219,1,-8,2,219,1,-8,3,219,1,-8,4,219,1,-8,5,219,1,-8,6,219,1,-8,7,219,1,-8,8,219,1,-8,9,507,1,-8,10,511,1,-7,-10,511,1,-7,9,504,1,-7,10,511,1,-6,-10,511,1,-6,9,504,1,-6,10,511,1,-5,-10,511,1,-5,9,504,1,-5,10,511,1,-4,-10,511,1,-4,9,504,1,-4,10,511,1,-3,-10,511,1,-3,9,504,1,-3,10,511,1,-2,-10,511,1,-2,9,504,1,-2,10,511,1,-1,-10,511,1,-1,9,504,1,-1,10,511,1,0,-10,511,1,0,9,504,1,0,10,511,1,1,-10,511,1,1,9,504,1,1,10,511,1,2,-10,511,1,2,9,504,1,2,10,511,1,3,-10,511,1,3,9,504,1,3,10,511,1,4,-10,511,1,4,9,504,1,4,10,511,1,5,-10,511,1,5,9,504,1,5,10,511,1,6,-10,511,1,6,9,504,1,6,10,511,1,7,-10,511,1,7,9,504,1,7,10,511,1,8,-10,511,1,8,9,504,1,8,10,511,1,9,-10,511,1,9,9,504,1,9,10,511,1,10,-10,511,1,10,9,504,1,10,10,511,1,11,-10,511,1,11,9,504,1,11,10,511,1,12,-10,511,1,12,9,504,1,12,10,511,1,13,-10,511,1,13,9,504,1,13,10,511,1,14,-10,511,1,14,9,504,1,14,10,511,1,15,-10,511,1,15,9,504,1,15,10,511,1,16,-10,511,1,16,-9,447,1,16,-8,438,1,16,-7,438,1,16,-6,438,1,16,-5,438,1,16,-4,438,1,16,-3,438,1,16,-2,438,1,16,-1,438,1,16,0,438,1,16,1,438,1,16,2,438,1,16,3,438,1,16,4,438,1,16,5,438,1,16,6,438,1,16,7,438,1,16,8,438,1,16,9,510,1,16,10,511,1,17,-10,511,1,17,-9,511,1,17,-8,511,1,17,-7,511,1,17,-6,511,1,17,-5,511,1,17,-4,511,1,17,-3,511,1,17,-2,511,1,17,-1,511,1,17,0,511,1,17,1,511,1,17,2,511,1,17,3,511,1,17,4,511,1,17,5,511,1,17,6,511,1,17,7,511,1,17,8,511,1,17,9,511,1,17,10,511,1],"CustomFloor1":[3,3,2,2,7,2,3,2,2,7,3,4,2,2,7,2,4,2,2,7,3,5,2,2,7,2,5,2,2,7,1,5,2,2,7,1,4,2,2,7,2,6,2,2,7,1,6,2,2,7,3,6,2,2,7,4,5,2,2,7,4,6,2,2,7,5,5,2,2,7,5,6,2,2,7,10,4,2,2,7,9,4,2,2,7,11,4,2,2,7,11,3,2,2,7,10,3,2,2,7,11,2,2,2,7,10,2,2,2,7,10,1,2,2,7,10,0,2,2,7,10,-1,2,2,7,8,4,2,2,7,5,4,2,2,7,4,4,2,2,7,4,3,2,2,7,5,3,2,2,7,8,2,2,2,7,8,3,2,2,7,9,2,2,2,7,9,3,2,2,7,9,1,2,2,7,5,-1,2,2,7,6,-1,2,2,7,8,-1,2,2,7,9,-1,2,2,7,9,0,2,2,7,-1,2,2,2,7,-2,2,2,2,7,-1,3,2,2,7,-2,3,2,2,7,-1,4,2,2,7,-2,4,2,2,7,-1,5,2,2,7,-2,5,2,2,7,0,4,2,2,7,0,5,2,2,7,0,6,2,2,7,-1,6,2,2,7,-2,6,2,2,7,0,2,2,2,7,0,3,2,2,7,1,3,2,2,7,4,-2,2,2,7,3,-2,2,2,7,4,-3,2,2,7,3,-3,2,2,7,4,-4,2,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2,8,-4,8,2,2,8,-3,8,2,2,8,-2,8,2,2,8,-1,8,2,2,8,-7,8,2,1,8,-7,7,2,1,7,-7,6,2,1,7,-7,5,2,1,7,-7,4,2,1,7,-7,3,2,1,7,-7,2,2,1,7,-7,1,2,1,7,-7,0,2,1,7,-7,-1,2,1,7,-7,-2,2,1,7,-7,-3,2,1,7,-7,-4,2,1,7,-7,-5,2,1,7,-5,-7,2,2,6,-6,-7,2,2,6,-7,-6,2,1,7,-7,-7,2,1,6],"CustomFloor2":[],"CustomFloor3":[],"CustomMiddle1":[],"CustomMiddle2":[],"CustomTop":[]} \ No newline at end of file +{"NavigationVertices":[{"X":250,"Y":146},{"X":-106,"Y":146},{"X":-106,"Y":-106},{"X":250,"Y":-106}],"NavigationPolygon":[[0,1,2,3]],"Floor":[-7,-7,0,3,-7,-6,0,3,-7,-5,0,3,-7,-4,0,3,-7,-3,0,3,-7,-2,0,3,-7,-1,0,3,-7,0,0,3,-7,1,0,3,-7,2,0,3,-7,3,0,3,-7,4,0,3,-7,5,0,3,-7,6,0,3,-7,7,0,3,-7,8,0,3,-6,7,0,3,-6,8,0,3,-5,7,0,3,-5,8,0,3,-4,7,0,3,-4,8,0,3,-3,7,0,3,-3,8,0,3,-2,7,0,3,-2,8,0,3,-1,7,0,3,-1,8,0,3,0,7,0,3,0,8,0,3,1,7,0,3,1,8,0,3,2,7,0,3,2,8,0,3,3,7,0,3,3,8,0,3,4,7,0,3,4,8,0,3,5,7,0,3,5,8,0,3,6,7,0,3,6,8,0,3,7,7,0,3,7,8,0,3,8,7,0,3,8,8,0,3,9,7,0,3,9,8,0,3,10,7,0,3,10,8,0,3,11,7,0,3,11,8,0,3,12,7,0,3,12,8,0,3,13,7,0,3,13,8,0,3,14,7,0,3,14,8,0,3,15,-7,0,3,15,-6,0,3,15,-5,0,3,15,-4,0,3,15,-3,0,3,15,-2,0,3,15,-1,0,3,15,0,0,3,15,1,0,3,15,2,0,3,15,3,0,3,15,4,0,3,15,5,0,3,15,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-3,0,3,10,-2,0,3,10,-1,0,3,10,0,0,3,10,1,0,3,10,2,0,3,10,3,0,3,10,4,0,3,10,5,0,3,10,6,0,3,11,-7,0,3,11,-6,0,3,11,-5,0,3,11,-4,0,3,11,-3,0,3,11,-2,0,3,11,-1,0,3,11,0,0,3,11,1,0,3,11,2,0,3,11,3,0,3,11,4,0,3,11,5,0,3,11,6,0,3,12,-7,0,3,12,-6,0,3,12,-5,0,3,12,-4,0,3,12,-3,0,3,12,-2,0,3,12,-1,0,3,12,0,0,3,12,1,0,3,12,2,0,3,12,3,0,3,12,4,0,3,12,5,0,3,12,6,0,3,13,-7,0,3,13,-5,0,3,13,-4,0,3,13,-3,0,3,13,-2,0,3,13,-1,0,3,13,0,0,3,13,1,0,3,13,2,0,3,13,3,0,3,13,4,0,3,13,5,0,3,13,6,0,3,14,-7,0,3,14,-6,0,3,14,-5,0,3,14,-4,0,3,14,-3,0,3,14,-2,0,3,14,-1,0,3,14,0,0,3,14,1,0,3,14,2,0,3,14,3,0,3,14,4,0,3,14,5,0,3,14,6,0,3,13,-6,0,3],"Middle":[-7,-9,63,1,-7,-8,2,2,-6,-9,63,1,-6,-8,2,2,-5,-9,63,1,-5,-8,2,2,-4,-9,63,1,-4,-8,2,2,-3,-9,63,1,-3,-8,2,2,-2,-9,63,1,-2,-8,2,2,-1,-9,63,1,-1,-8,2,2,0,-9,63,1,0,-8,2,2,1,-9,63,1,1,-8,2,2,2,-9,63,1,2,-8,2,2,3,-9,63,1,3,-8,2,2,4,-9,63,1,4,-8,2,2,5,-9,63,1,5,-8,2,2,6,-9,63,1,6,-8,2,2,7,-9,63,1,7,-8,2,2,8,-9,63,1,8,-8,2,2,9,-9,63,1,9,-8,2,2,10,-9,63,1,10,-8,2,2,11,-9,63,1,11,-8,2,2,12,-9,63,1,12,-8,2,2,13,-9,63,1,13,-8,2,2,14,-9,63,1,14,-8,2,2,15,-9,63,1,15,-8,2,2],"Top":[-9,-10,511,1,-9,-9,511,1,-9,-8,511,1,-9,-7,511,1,-9,-6,511,1,-9,-5,511,1,-9,-4,511,1,-9,-3,511,1,-9,-2,511,1,-9,-1,511,1,-9,0,511,1,-9,1,511,1,-9,2,511,1,-9,3,511,1,-9,4,511,1,-9,5,511,1,-9,6,511,1,-9,7,511,1,-9,8,511,1,-9,9,511,1,-9,10,511,1,-8,-10,511,1,-8,-9,255,1,-8,-8,219,1,-8,-7,219,1,-8,-6,219,1,-8,-5,219,1,-8,-4,219,1,-8,-3,219,1,-8,-2,219,1,-8,-1,219,1,-8,0,219,1,-8,1,219,1,-8,2,219,1,-8,3,219,1,-8,4,219,1,-8,5,219,1,-8,6,219,1,-8,7,219,1,-8,8,219,1,-8,9,507,1,-8,10,511,1,-7,-10,511,1,-7,9,504,1,-7,10,511,1,-6,-10,511,1,-6,9,504,1,-6,10,511,1,-5,-10,511,1,-5,9,504,1,-5,10,511,1,-4,-10,511,1,-4,9,504,1,-4,10,511,1,-3,-10,511,1,-3,9,504,1,-3,10,511,1,-2,-10,511,1,-2,9,504,1,-2,10,511,1,-1,-10,511,1,-1,9,504,1,-1,10,511,1,0,-10,511,1,0,9,504,1,0,10,511,1,1,-10,511,1,1,9,504,1,1,10,511,1,2,-10,511,1,2,9,504,1,2,10,511,1,3,-10,511,1,3,9,504,1,3,10,511,1,4,-10,511,1,4,9,504,1,4,10,511,1,5,-10,511,1,5,9,504,1,5,10,511,1,6,-10,511,1,6,9,504,1,6,10,511,1,7,-10,511,1,7,9,504,1,7,10,511,1,8,-10,511,1,8,9,504,1,8,10,511,1,9,-10,511,1,9,9,504,1,9,10,511,1,10,-10,511,1,10,9,504,1,10,10,511,1,11,-10,511,1,11,9,504,1,11,10,511,1,12,-10,511,1,12,9,504,1,12,10,511,1,13,-10,511,1,13,9,504,1,13,10,511,1,14,-10,511,1,14,9,504,1,14,10,511,1,15,-10,511,1,15,9,504,1,15,10,511,1,16,-10,511,1,16,-9,447,1,16,-8,438,1,16,-7,438,1,16,-6,438,1,16,-5,438,1,16,-4,438,1,16,-3,438,1,16,-2,438,1,16,-1,438,1,16,0,438,1,16,1,438,1,16,2,438,1,16,3,438,1,16,4,438,1,16,5,438,1,16,6,438,1,16,7,438,1,16,8,438,1,16,9,510,1,16,10,511,1,17,-10,511,1,17,-9,511,1,17,-8,511,1,17,-7,511,1,17,-6,511,1,17,-5,511,1,17,-4,511,1,17,-3,511,1,17,-2,511,1,17,-1,511,1,17,0,511,1,17,1,511,1,17,2,511,1,17,3,511,1,17,4,511,1,17,5,511,1,17,6,511,1,17,7,511,1,17,8,511,1,17,9,511,1,17,10,511,1],"CustomFloor1":[3,3,2,2,7,2,3,2,2,7,3,4,2,2,7,2,4,2,2,7,3,5,2,2,7,2,5,2,2,7,1,5,2,2,7,1,4,2,2,7,2,6,2,2,7,1,6,2,2,7,3,6,2,2,7,4,5,2,2,7,4,6,2,2,7,5,5,2,2,7,5,6,2,2,7,10,4,2,2,7,9,4,2,2,7,11,4,2,2,7,11,3,2,2,7,10,3,2,2,7,11,2,2,2,7,10,2,2,2,7,10,1,2,2,7,10,0,2,2,7,8,4,2,2,7,5,4,2,2,7,4,4,2,2,7,4,3,2,2,7,5,3,2,2,7,8,2,2,2,7,8,3,2,2,7,9,2,2,2,7,9,3,2,2,7,9,1,2,2,7,5,-1,2,2,7,6,-1,2,2,7,8,-1,2,2,7,9,-1,2,2,7,9,0,2,2,7,-1,2,2,2,7,-2,2,2,1,7,-1,3,2,2,7,-2,3,2,5,9,-1,4,2,2,7,-2,4,2,2,7,-1,5,2,2,7,-2,5,2,2,7,0,4,2,2,7,0,5,2,2,7,0,6,2,2,7,-1,6,2,2,7,-2,6,2,2,7,0,2,2,2,7,0,3,2,2,7,1,3,2,2,7,4,-2,2,2,7,3,-2,2,2,7,4,-3,2,2,7,3,-3,2,2,7,4,-4,2,2,7,3,-4,2,2,7,5,-4,2,2,7,5,-3,2,2,7,6,-4,2,2,7,6,-3,2,2,7,7,-4,2,2,7,7,-3,2,2,7,8,-4,2,2,7,8,-3,2,2,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-2,1,8,6,-4,-2,1,7,6,-4,-3,1,7,5,-3,1,1,8,5,-3,2,1,8,6,-4,2,1,7,6,-4,1,1,7,5,10,-2,1,18,11,10,-4,1,18,11,10,-3,1,18,12,11,-4,1,19,11,11,-3,1,19,12,10,-1,1,18,12,11,-2,1,19,11,11,-1,1,19,12],"CustomFloor2":[0,-4,1,6,14,0,-3,1,6,15,0,-2,1,6,14,0,-1,1,6,15,0,0,1,6,14,0,1,1,6,15,0,2,1,6,14,0,3,1,6,15,1,-4,1,7,14,1,-3,1,7,15,1,-2,1,7,14,1,-1,1,7,15,1,0,1,7,14,1,1,1,7,15,1,2,1,7,14,1,3,1,7,15,2,-4,1,8,14,2,-3,1,8,15,2,-2,1,8,14,2,-1,1,8,15,2,0,1,8,14,2,1,1,8,15,2,2,1,8,14,2,3,1,8,15,3,-4,1,6,14,3,-3,1,6,15,3,-2,1,6,14,3,-1,1,6,15,3,0,1,6,14,3,1,1,6,15,3,2,1,6,14,3,3,1,6,15,4,-4,1,7,14,4,-3,1,7,15,4,-2,1,7,14,4,-1,1,7,15,4,0,1,7,14,4,1,1,7,15,4,2,1,7,14,4,3,1,7,15,5,-4,1,8,14,5,-3,1,8,15,5,-2,1,8,14,5,-1,1,8,15,5,0,1,8,14,5,1,1,8,15,5,2,1,8,14,5,3,1,8,15],"CustomFloor3":[],"CustomMiddle1":[],"CustomMiddle2":[],"CustomTop":[]} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs b/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs index 128a7b4..51bd318 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs @@ -165,6 +165,12 @@ /// public Texture2D CurrBrushTexture { get; private set; } + private int _brushStartX = 0; + private int _brushStartY = 0; + //笔刷宽度, 单位: 格 + private int _brushWidth = 0; + //笔刷高度, 单位: 格 + private int _brushHeight = 0; //笔刷偏移, 单位: 格 private Vector2I _brushOffset = Vector2I.Zero; //淡化其它层级 @@ -365,8 +371,46 @@ temp.Y -= size.Y; } - var pos = cellPos * size; - canvasItem.DrawRect(new Rect2(pos, _mousePosition - pos + temp), Colors.White, false, 2f / Scale.X); + var p = cellPos * size; + var s = _mousePosition.AsVector2I() - p + temp; + + if (s.X < 0) + { + p.X += s.X; + s.X *= -1; + } + + if (s.Y < 0) + { + p.Y += s.Y; + s.Y *= -1; + } + + //绘制边框 + canvasItem.DrawRect(new Rect2(p, s), Colors.White, false, 2f / Scale.X); + + if (CurrLayer.Layer != MapLayer.AutoFloorLayer && (CurrBrushType == TileMapDrawMode.Free || CurrBrushType == TileMapDrawMode.Combination)) //自由绘制 或者 绘制组合 + { + if (_isLeftPressed) //左键绘制 + { + var w = s.X / GameConfig.TileCellSize; + var h = s.Y / GameConfig.TileCellSize; + for (var i = 0; i < w; i++) + { + for (var j = 0; j < h; j++) + { + var x = i % _brushWidth + _brushStartX; + var y = j % _brushHeight + _brushStartY; + if (CurrBrush.TryGetValue(new Vector2I(x, y), out var v)) + { + var rect = new Rect2(p + (new Vector2I(i, j)) * GameConfig.TileCellSize, GameConfig.TileCellSize, GameConfig.TileCellSize); + var srcRect = new Rect2(v * GameConfig.TileCellSize, GameConfig.TileCellSize, GameConfig.TileCellSize); + canvasItem.DrawTextureRectRegion(CurrBrushTexture, rect, srcRect, new Color(1, 1, 1, 0.3f)); + } + } + } + } + } } else //绘制单格 { @@ -547,7 +591,11 @@ xEnd = Mathf.Max(cell.X, xEnd); yEnd = Mathf.Max(cell.Y, yEnd); } - + + _brushStartX = xStart; + _brushStartY = yStart; + _brushWidth = xEnd - xStart + 1; + _brushHeight = yEnd - yStart + 1; _brushOffset = new Vector2I(-(xStart + (xEnd - xStart) / 2), -(yStart + (yEnd - yStart) / 2)); } } @@ -884,11 +932,7 @@ } else if (CurrBrushType == TileMapDrawMode.Terrain) //绘制地形 { - if (CurrTerrain == null) //未选择地形 - { - return; - } - else if (!CurrTerrain.TerrainInfo.Ready) //存在错误就不绘制了 + if (CurrTerrain == null || !CurrTerrain.TerrainInfo.Ready) //未选择地形或者存在错误就不绘制了 { return; } @@ -924,8 +968,6 @@ //绘制区域贴图 private void SetRectCell(Vector2I start, Vector2I end) { - ResetGenerateTimer(); - if (start.X > end.X) { var temp = end.X; @@ -941,16 +983,73 @@ var width = end.X - start.X + 1; var height = end.Y - start.Y + 1; - for (var i = 0; i < width; i++) + + if (CurrLayer.Layer == MapLayer.AutoFloorLayer) //选择自动地板层, 那么不管笔刷类型, 通通使用 Main Source 中的 Main Terrain { - for (var j = 0; j < height; j++) + ResetGenerateTimer(); + for (var i = 0; i < width; i++) { - var tileCellData = _autoTileConfig.Floor; - SetCell(MapLayer.AutoFloorLayer, new Vector2I(start.X + i, start.Y + j), tileCellData.SourceId, tileCellData.AutoTileCoords); + for (var j = 0; j < height; j++) + { + var tileCellData = _autoTileConfig.Floor; + SetCell(MapLayer.AutoFloorLayer, new Vector2I(start.X + i, start.Y + j), tileCellData.SourceId, tileCellData.AutoTileCoords); + } + } + + _autoCellLayerGrid.SetRect(start, new Vector2I(width, height), true); + } + else //自定义层 + { + var dirty = false; + if (CurrBrushType == TileMapDrawMode.Free || CurrBrushType == TileMapDrawMode.Combination) //自由绘制 或者 组合 + { + dirty = CurrBrush.Count > 0; + for (var i = 0; i < width; i++) + { + for (var j = 0; j < height; j++) + { + var x = i % _brushWidth + _brushStartX; + var y = j % _brushHeight + _brushStartY; + if (CurrBrush.TryGetValue(new Vector2I(x, y), out var v)) + { + SetCell(CurrLayer.Layer, new Vector2I(start.X + i, start.Y + j), CurrSourceIndex, v); + } + } + } + } + else if (CurrBrushType == TileMapDrawMode.Terrain) //绘制地形 + { + if (CurrTerrain == null || !CurrTerrain.TerrainInfo.Ready) //未选择地形或者存在错误就不绘制了 + { + return; + } + + var arr = new Array(); + for (var i = 0; i < width; i++) + { + for (var j = 0; j < height; j++) + { + arr.Add(new Vector2I(start.X + i, start.Y + j)); + } + } + + if (CurrTerrain.TerrainInfo.TerrainType == 0) //3x3地形 + { + SetCellsTerrainConnect(CurrLayer.Layer, arr, CurrTerrain.TerrainSetIndex, 0); + } + else if (CurrTerrain.TerrainInfo.TerrainType == 1) //2x2地形 + { + SetCellsTerrainConnect(CurrLayer.Layer, arr, CurrTerrain.TerrainSetIndex, 0, false); + } + dirty = true; + } + + if (dirty) + { + //标记有修改数据 + EventManager.EmitEvent(EventEnum.OnTileMapDirty); } } - - _autoCellLayerGrid.SetRect(start, new Vector2I(width, height), true); } //擦除单个图块 @@ -980,57 +1079,57 @@ { EraseCell(CurrLayer.Layer, position); - var arr2 = new Array(); + var arr = new Array(); //这里需要判断周围8格是否是同terrainSet if (EqualsTerrainSet(position + new Vector2I(-1, -1))) { EraseCell(CurrLayer.Layer, position + new Vector2I(-1, -1)); - arr2.Add(position + new Vector2I(-1, -1)); + arr.Add(position + new Vector2I(-1, -1)); } if (EqualsTerrainSet(position + new Vector2I(0, -1))) { EraseCell(CurrLayer.Layer, position + new Vector2I(0, -1)); - arr2.Add(position + new Vector2I(0, -1)); + arr.Add(position + new Vector2I(0, -1)); } if (EqualsTerrainSet(position + new Vector2I(1, -1))) { EraseCell(CurrLayer.Layer, position + new Vector2I(1, -1)); - arr2.Add(position + new Vector2I(1, -1)); + arr.Add(position + new Vector2I(1, -1)); } if (EqualsTerrainSet(position + new Vector2I(-1, 0))) { EraseCell(CurrLayer.Layer, position + new Vector2I(-1, 0)); - arr2.Add(position + new Vector2I(-1, 0)); + arr.Add(position + new Vector2I(-1, 0)); } if (EqualsTerrainSet(position + new Vector2I(1, 0))) { EraseCell(CurrLayer.Layer, position + new Vector2I(1, 0)); - arr2.Add(position + new Vector2I(1, 0)); + arr.Add(position + new Vector2I(1, 0)); } if (EqualsTerrainSet(position + new Vector2I(-1, 1))) { EraseCell(CurrLayer.Layer, position + new Vector2I(-1, 1)); - arr2.Add(position + new Vector2I(-1, 1)); + arr.Add(position + new Vector2I(-1, 1)); } if (EqualsTerrainSet(position + new Vector2I(0, 1))) { EraseCell(CurrLayer.Layer, position + new Vector2I(0, 1)); - arr2.Add(position + new Vector2I(0, 1)); + arr.Add(position + new Vector2I(0, 1)); } if (EqualsTerrainSet(position + new Vector2I(1, 1))) { EraseCell(CurrLayer.Layer, position + new Vector2I(1, 1)); - arr2.Add(position + new Vector2I(1, 1)); + arr.Add(position + new Vector2I(1, 1)); } - SetCellsTerrainConnect(CurrLayer.Layer, arr2, CurrTerrain.TerrainSetIndex, 0, false); + SetCellsTerrainConnect(CurrLayer.Layer, arr, CurrTerrain.TerrainSetIndex, 0, false); } } //标记有修改数据 @@ -1041,8 +1140,6 @@ //擦除一个区域内的贴图 private void EraseRectCell(Vector2I start, Vector2I end) { - ResetGenerateTimer(); - if (start.X > end.X) { var temp = end.X; @@ -1058,14 +1155,59 @@ var width = end.X - start.X + 1; var height = end.Y - start.Y + 1; - for (var i = 0; i < width; i++) + + if (CurrLayer.Layer == MapLayer.AutoFloorLayer) //选择自动地板层 { - for (var j = 0; j < height; j++) + ResetGenerateTimer(); + for (var i = 0; i < width; i++) { - EraseCell(MapLayer.AutoFloorLayer, new Vector2I(start.X + i, start.Y + j)); + for (var j = 0; j < height; j++) + { + EraseCell(MapLayer.AutoFloorLayer, new Vector2I(start.X + i, start.Y + j)); + } } + _autoCellLayerGrid.RemoveRect(start, new Vector2I(width, height)); } - _autoCellLayerGrid.RemoveRect(start, new Vector2I(width, height)); + else //自定义层 + { + if (CurrBrushType == TileMapDrawMode.Free || CurrBrushType == TileMapDrawMode.Combination || + (CurrBrushType == TileMapDrawMode.Terrain && CurrTerrain == null)) //自由绘制 或者 组合 或者 未选择地形 + { + for (var i = 0; i < width; i++) + { + for (var j = 0; j < height; j++) + { + EraseCell(CurrLayer.Layer, new Vector2I(start.X + i, start.Y + j)); + } + } + } + else if (CurrBrushType == TileMapDrawMode.Terrain) //绘制地形 + { + var arr = new Array(); + //需要检测矩形向外一格的Cell + for (var i = -1; i < width + 1; i++) + { + for (var j = -1; j < height + 1; j++) + { + var pos = new Vector2I(start.X + i, start.Y + j); + if (i >= 0 && i < width && j >= 0 && j < height) + { + EraseCell(CurrLayer.Layer, pos); + } + else if (EqualsTerrainSet(pos)) + { + EraseCell(CurrLayer.Layer, pos); + arr.Add(pos); + } + } + } + + SetCellsTerrainConnect(CurrLayer.Layer, arr, CurrTerrain.TerrainSetIndex, 0, false); + } + + //标记有修改数据 + EventManager.EmitEvent(EventEnum.OnTileMapDirty); + } } //重置计时器