diff --git a/DungeonShooting_Godot/resource/map/tileSet/TileSet2/TileSet.json b/DungeonShooting_Godot/resource/map/tileSet/TileSet2/TileSet.json index 4a8fc8a..2ba5a4c 100644 --- a/DungeonShooting_Godot/resource/map/tileSet/TileSet2/TileSet.json +++ b/DungeonShooting_Godot/resource/map/tileSet/TileSet2/TileSet.json @@ -142,6 +142,26 @@ ] }, "TerrainType": 1 + }, + { + "Name": "Test3", + "F": {}, + "M": {}, + "T": { + "341": [ + 32, + 48 + ], + "272": [ + 16, + 64 + ], + "276": [ + 16, + 80 + ] + }, + "TerrainType": 1 } ], "Combination": [ diff --git a/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/TileSetEditorTerrainPanel.cs b/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/TileSetEditorTerrainPanel.cs index 682a90e..5354e15 100644 --- a/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/TileSetEditorTerrainPanel.cs +++ b/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/TileSetEditorTerrainPanel.cs @@ -100,24 +100,24 @@ { _refreshGridConnect = false; - var terrainList = EditorPanel.TileSetSourceInfo.Terrain; - for (var i = 0; i < terrainList.Count; i++) - { - var terrain = terrainList[i]; - if (terrain.TerrainType == 0) //选中47格Terrain - { - TerrainGrid3x3.ForEach(cell => RefreshConnectTerrainCell(i, terrain, cell)); - if (EditorPanel.TileSetSourceIndex == 0 && CurrTerrainIndex == 0) //选中Main Source - { - TerrainGridMiddle.ForEach(cell => RefreshConnectTerrainCell(i, terrain, cell)); - TerrainGridFloor.ForEach(cell => RefreshConnectTerrainCell(i, terrain, cell)); - } - } - else //选中13格Terrain - { - TerrainGrid2x2.ForEach(cell => RefreshConnectTerrainCell(i, terrain, cell)); - } - } + // var terrainList = EditorPanel.TileSetSourceInfo.Terrain; + // for (var i = 0; i < terrainList.Count; i++) + // { + // var terrain = terrainList[i]; + // if (terrain.TerrainType == 0) //选中47格Terrain + // { + // TerrainGrid3x3.ForEach(cell => RefreshConnectTerrainCell(i, terrain, cell)); + // if (EditorPanel.TileSetSourceIndex == 0 && CurrTerrainIndex == 0) //选中Main Source + // { + // TerrainGridMiddle.ForEach(cell => RefreshConnectTerrainCell(i, terrain, cell)); + // TerrainGridFloor.ForEach(cell => RefreshConnectTerrainCell(i, terrain, cell)); + // } + // } + // else //选中13格Terrain + // { + // TerrainGrid2x2.ForEach(cell => RefreshConnectTerrainCell(i, terrain, cell)); + // } + // } } } @@ -277,6 +277,11 @@ S_TopBg.Instance.SetHoverCell(null); S_BottomBg.Instance.SetHoverCell(null); + MaskGrid.ForEach(cell => + { + ((MaskCell)cell).SetConnectTerrainCell(null, -1); + }); + var terrain = CurrTerrain; if (terrain != null) { @@ -293,6 +298,25 @@ { TerrainGrid2x2.ForEach(cell => SetTerrainCellData(terrain, cell)); } + + var terrainList = EditorPanel.TileSetSourceInfo.Terrain; + for (var i = 0; i < terrainList.Count; i++) + { + var terrainInfo = terrainList[i]; + if (terrainInfo.TerrainType == 0) //选中47格Terrain + { + TerrainGrid3x3.ForEach(cell => RefreshConnectTerrainCell(i, terrainInfo, cell)); + if (EditorPanel.TileSetSourceIndex == 0 && CurrTerrainIndex == 0) //选中Main Source + { + TerrainGridMiddle.ForEach(cell => RefreshConnectTerrainCell(i, terrainInfo, cell)); + TerrainGridFloor.ForEach(cell => RefreshConnectTerrainCell(i, terrainInfo, cell)); + } + } + else //选中13格Terrain + { + TerrainGrid2x2.ForEach(cell => RefreshConnectTerrainCell(i, terrainInfo, cell)); + } + } } if (index >= 0) diff --git a/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/down/MaskCell.cs b/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/down/MaskCell.cs index 63d4477..9db8882 100644 --- a/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/down/MaskCell.cs +++ b/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/down/MaskCell.cs @@ -63,7 +63,7 @@ private void Draw() { - if (Hover || (ConnectTerrainCell != null && ConnectTerrainCell.Hover)) + if (Hover || (ConnectTerrainCell != null && ConnectTerrainCell.Hover && CellNode.UiPanel.CurrTerrainIndex == ConnectTerrainIndex)) { CellNode.Instance.DrawRect( new Rect2(Vector2.Zero, CellNode.Instance.Size), diff --git a/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/up/TerrainCell.cs b/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/up/TerrainCell.cs index 888d565..19bb987 100644 --- a/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/up/TerrainCell.cs +++ b/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/up/TerrainCell.cs @@ -133,7 +133,7 @@ private void OnDraw() { - if (ConnectMaskCell != null && (Hover || ConnectMaskCell.Hover)) + if (ConnectMaskCell != null && (Hover || (ConnectMaskCell.Hover && CellNode.UiPanel.CurrTerrainIndex == ConnectMaskCell.ConnectTerrainIndex))) { CellNode.Instance.DrawRect( new Rect2(Vector2.Zero, CellNode.Instance.Size),