diff --git a/DungeonShooting_Godot/prefab/ui/TileSetEditor.tscn b/DungeonShooting_Godot/prefab/ui/TileSetEditor.tscn index f5e017b..10dbbfe 100644 --- a/DungeonShooting_Godot/prefab/ui/TileSetEditor.tscn +++ b/DungeonShooting_Godot/prefab/ui/TileSetEditor.tscn @@ -77,11 +77,16 @@ size_flags_horizontal = 3 [node name="VBoxContainer" type="VBoxContainer" parent="Bg/VBoxContainer/HBoxContainer/LeftRoot"] -layout_mode = 2 +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 offset_left = 2.0 -offset_top = 5.0 -offset_right = 272.0 -offset_bottom = 1008.0 +offset_top = 2.0 +offset_right = -2.0 +offset_bottom = -2.0 +grow_horizontal = 2 +grow_vertical = 2 [node name="HBoxContainer" type="HBoxContainer" parent="Bg/VBoxContainer/HBoxContainer/LeftRoot/VBoxContainer"] custom_minimum_size = Vector2(0, 50) diff --git a/DungeonShooting_Godot/prefab/ui/TileSetEditorTerrain.tscn b/DungeonShooting_Godot/prefab/ui/TileSetEditorTerrain.tscn index a3f6801..0ca53e3 100644 --- a/DungeonShooting_Godot/prefab/ui/TileSetEditorTerrain.tscn +++ b/DungeonShooting_Godot/prefab/ui/TileSetEditorTerrain.tscn @@ -207,9 +207,9 @@ grow_horizontal = 0 item_count = 2 selected = 0 -popup/item_0/text = "47格(3*3)" +popup/item_0/text = "3x3(47格)" popup/item_0/id = 0 -popup/item_1/text = "13格(2*2)" +popup/item_1/text = "2x2(13格)" popup/item_1/id = 1 [node name="PanelBottom" type="Panel" parent="VSplitContainer"] diff --git a/DungeonShooting_Godot/resource/map/tileSet/TileSet1/TileSet.json b/DungeonShooting_Godot/resource/map/tileSet/TileSet1/TileSet.json index 5bb1ccf..3d57d81 100644 --- a/DungeonShooting_Godot/resource/map/tileSet/TileSet1/TileSet.json +++ b/DungeonShooting_Godot/resource/map/tileSet/TileSet1/TileSet.json @@ -218,7 +218,8 @@ 32, 16 ] - } + }, + "TerrainType": 0 }, "Combination": [] } diff --git a/DungeonShooting_Godot/resource/map/tileSet/TileSet2/TileSet.json b/DungeonShooting_Godot/resource/map/tileSet/TileSet2/TileSet.json index 526109a..63d531e 100644 --- a/DungeonShooting_Godot/resource/map/tileSet/TileSet2/TileSet.json +++ b/DungeonShooting_Godot/resource/map/tileSet/TileSet2/TileSet.json @@ -307,21 +307,73 @@ "F": {}, "M": {}, "T": { - "272": [ - 128, - 0 + "17": [ + 176, + 48 ], "80": [ 176, 0 ], + "20": [ + 128, + 48 + ], + "272": [ + 128, + 0 + ], + "144": [ + 0, + 0 + ], + "176": [ + 16, + 0 + ], + "184": [ + 32, + 0 + ], + "152": [ + 48, + 0 + ], + "341": [ + 144, + 32 + ], "336": [ 160, 0 ], + "81": [ + 176, + 32 + ], + "273": [ + 144, + 48 + ], "276": [ 128, 16 + ], + "340": [ + 80, + 16 + ], + "337": [ + 96, + 16 + ], + "277": [ + 80, + 32 + ], + "85": [ + 96, + 32 ] }, "TerrainType": 1 diff --git a/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/TileSetEditorTerrainPanel.cs b/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/TileSetEditorTerrainPanel.cs index 2d0e61d..00fea1b 100644 --- a/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/TileSetEditorTerrainPanel.cs +++ b/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/TileSetEditorTerrainPanel.cs @@ -46,6 +46,8 @@ OnSetTileTexture(EditorPanel.Texture); OnChangeTileSetBgColor(EditorPanel.BgColor); + + S_TopBg.Instance.ChangeTerrainType(0, false); } public override void OnDestroyUi() @@ -62,12 +64,20 @@ _refreshGridConnect = false; var terrain = EditorPanel.TileSetSourceInfo.Terrain; - TerrainGrid3x3.ForEach(cell => RefreshConnectTerrainCell(terrain, cell)); - if (EditorPanel.TileSetSourceIndex == 0) //必须选中Main Source + if (EditorPanel.TileSetSourceIndex == 0) //选中Main Source { + TerrainGrid3x3.ForEach(cell => RefreshConnectTerrainCell(terrain, cell)); TerrainGridMiddle.ForEach(cell => RefreshConnectTerrainCell(terrain, cell)); TerrainGridFloor.ForEach(cell => RefreshConnectTerrainCell(terrain, cell)); } + else if (terrain.TerrainType == 0) //选中47格Terrain + { + TerrainGrid3x3.ForEach(cell => RefreshConnectTerrainCell(terrain, cell)); + } + else //选中13格Terrain + { + TerrainGrid2x2.ForEach(cell => RefreshConnectTerrainCell(terrain, cell)); + } } } diff --git a/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/down/TileEditArea.cs b/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/down/TileEditArea.cs index 4353e24..8fc6143 100644 --- a/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/down/TileEditArea.cs +++ b/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/down/TileEditArea.cs @@ -26,12 +26,12 @@ { MaskCell cell = null; var _panel = UiNode.UiPanel; - if (_panel.S_BottomBg.Instance.IsMouseInRect() && _panel.S_TileTexture.Instance.IsMouseInRect()) + if (!_panel.MaskGrid.IsDestroyed && _panel.S_BottomBg.Instance.IsMouseInRect() && _panel.S_TileTexture.Instance.IsMouseInRect()) { var cellPosition = Utils.GetMouseCellPosition(_panel.S_TileTexture.Instance); var index = cellPosition.X + cellPosition.Y * _panel.MaskGrid.GetColumns(); var tempCell = (MaskCell)_panel.MaskGrid.GetCell(index); - if (tempCell.ConnectTerrainCell != null) + if (tempCell != null && tempCell.ConnectTerrainCell != null) { cell = tempCell; } @@ -73,7 +73,7 @@ var cellPosition = Utils.GetMouseCellPosition(_panel.S_TileTexture.Instance); var index = cellPosition.X + cellPosition.Y * _panel.MaskGrid.GetColumns(); var cell = (MaskCell)_panel.MaskGrid.GetCell(index); - if (cell.ConnectTerrainCell == null) //必须要没有使用的Cell + if (cell != null && cell.ConnectTerrainCell == null) //必须要没有使用的Cell { _panel.DraggingCell = cell; _panel.MaskGrid.SelectIndex = index; diff --git a/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/up/TileEditTerrain.cs b/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/up/TileEditTerrain.cs index 70cfab0..4f79c37 100644 --- a/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/up/TileEditTerrain.cs +++ b/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/up/TileEditTerrain.cs @@ -6,7 +6,7 @@ { private bool _dragMoveFlag = false; private TerrainCell _hoverCell = null; - private int _currentTerrainType = 0; + private int _currentTerrainType = -1; public override void SetUiNode(IUiNode uiNode) {