diff --git a/DungeonShooting_Godot/prefab/ui/MapEditorMapTile.tscn b/DungeonShooting_Godot/prefab/ui/MapEditorMapTile.tscn index c8deb8e..bdb92de 100644 --- a/DungeonShooting_Godot/prefab/ui/MapEditorMapTile.tscn +++ b/DungeonShooting_Godot/prefab/ui/MapEditorMapTile.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=7 format=3 uid="uid://tjbfj67t5akm"] +[gd_scene load_steps=8 format=3 uid="uid://tjbfj67t5akm"] [ext_resource type="Script" path="res://src/game/ui/mapEditorMapTile/MapEditorMapTilePanel.cs" id="1_gtth6"] [ext_resource type="Script" path="res://src/game/ui/mapEditorMapTile/FreeTileTab.cs" id="2_5c2no"] @@ -6,6 +6,7 @@ [ext_resource type="Script" path="res://src/game/ui/mapEditorMapTile/TerrainTileTab.cs" id="4_jxcal"] [ext_resource type="Texture2D" uid="uid://bn47bmilcw4x0" path="res://resource/sprite/ui/commonIcon/Select2.png" id="5_f4thw"] [ext_resource type="Script" path="res://src/game/ui/mapEditorMapTile/CombinationTileTab.cs" id="5_ty17f"] +[ext_resource type="Texture2D" uid="uid://c4ltpf5a3egu1" path="res://resource/sprite/ui/commonIcon/Error_mini.png" id="6_u35dn"] [node name="MapEditorMapTile" type="Control"] layout_mode = 3 @@ -15,7 +16,6 @@ grow_horizontal = 2 grow_vertical = 2 script = ExtResource("1_gtth6") -Layer = null [node name="VBoxContainer" type="VBoxContainer" parent="."] layout_mode = 1 @@ -133,7 +133,6 @@ stretch_mode = 5 [node name="Tab2" type="Control" parent="VBoxContainer/Panel/MarginContainer"] -visible = false layout_mode = 2 script = ExtResource("4_jxcal") @@ -174,6 +173,19 @@ horizontal_alignment = 1 vertical_alignment = 1 +[node name="ErrorIcon" type="TextureRect" parent="VBoxContainer/Panel/MarginContainer/Tab2/ScrollContainer/TerrainItem"] +layout_mode = 1 +anchors_preset = 1 +anchor_left = 1.0 +anchor_right = 1.0 +offset_left = -43.0 +offset_top = 3.0 +offset_right = -3.0 +offset_bottom = 43.0 +grow_horizontal = 0 +mouse_filter = 2 +texture = ExtResource("6_u35dn") + [node name="TerrainPreview" type="TextureRect" parent="VBoxContainer/Panel/MarginContainer/Tab2/ScrollContainer/TerrainItem"] layout_mode = 1 anchors_preset = 12 @@ -190,6 +202,7 @@ stretch_mode = 5 [node name="Tab3" type="Control" parent="VBoxContainer/Panel/MarginContainer"] +visible = false layout_mode = 2 script = ExtResource("5_ty17f") diff --git a/DungeonShooting_Godot/resource/map/tileMaps/GroupConfig.json b/DungeonShooting_Godot/resource/map/tileMaps/GroupConfig.json index 41a2530..eb2e045 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/GroupConfig.json +++ b/DungeonShooting_Godot/resource/map/tileMaps/GroupConfig.json @@ -10,7 +10,7 @@ "InletList": [ { "ErrorType": 0, - "Path": "resource/map/tileMaps/Test1/inlet/Start1" + "Path": "resource/map/tileMaps/Test1/inlet/Start" } ], "OutletList": [ diff --git a/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start/Preinstall.json b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start/Preinstall.json new file mode 100644 index 0000000..9287cc7 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start/Preinstall.json @@ -0,0 +1 @@ +[{"Name":"Preinstall1","Weight":100,"Remark":"","WaveList":[[{"Position":{"X":39,"Y":8},"Size":{"X":0,"Y":0},"SpecialMarkType":1,"DelayTime":0,"MarkList":[]},{"Position":{"X":-16,"Y":-18},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0001","Weight":100,"Attr":{"CurrAmmon":"30","ResidueAmmo":"210"},"Altitude":8,"VerticalSpeed":0}]}]]}] \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start/Preview.png b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start/Preview.png new file mode 100644 index 0000000..c0162e2 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start/Preview.png Binary files differ diff --git a/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start/Preview.png.import b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start/Preview.png.import new file mode 100644 index 0000000..9b13b48 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start/Preview.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dp0ufqrgdfx7y" +path="res://.godot/imported/Preview.png-316f603611f843062bfe5bd940ed732b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/map/tileMaps/Test1/inlet/Start/Preview.png" +dest_files=["res://.godot/imported/Preview.png-316f603611f843062bfe5bd940ed732b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start/RoomInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start/RoomInfo.json new file mode 100644 index 0000000..5182eed --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start/RoomInfo.json @@ -0,0 +1 @@ +{"Position":{"X":-9,"Y":-7},"Size":{"X":20,"Y":17},"DoorAreaInfos":[{"Direction":3,"Start":64,"End":208},{"Direction":0,"Start":16,"End":144},{"Direction":2,"Start":48,"End":176},{"Direction":1,"Start":16,"End":160}],"GroupName":"Test1","RoomType":1,"RoomName":"Start","Weight":100,"Remark":""} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start/TileInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start/TileInfo.json new file mode 100644 index 0000000..06b7005 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start/TileInfo.json @@ -0,0 +1 @@ +{"NavigationVertices":[{"X":138,"Y":-42},{"X":138,"Y":82},{"X":134,"Y":22},{"X":134,"Y":-14},{"X":58,"Y":82},{"X":54,"Y":54},{"X":74,"Y":38},{"X":118,"Y":38},{"X":22,"Y":118},{"X":58,"Y":130},{"X":-58,"Y":130},{"X":-22,"Y":118},{"X":-26,"Y":22},{"X":-26,"Y":-14},{"X":-22,"Y":18},{"X":-22,"Y":54},{"X":54,"Y":18},{"X":74,"Y":2},{"X":22,"Y":82},{"X":-58,"Y":98},{"X":-22,"Y":82},{"X":90,"Y":-42},{"X":90,"Y":-14},{"X":90,"Y":2},{"X":-42,"Y":-42},{"X":118,"Y":22},{"X":-42,"Y":-58},{"X":90,"Y":-58},{"X":-86,"Y":-14},{"X":-106,"Y":-42},{"X":-106,"Y":98},{"X":-86,"Y":22}],"NavigationPolygon":[[0,1,2,3],[4,5,6,7,1],[8,9,10,11],[12,13,14,15],[6,5,16,17],[4,9,8,18,5],[11,10,19,20],[21,0,3,22],[22,23,17,24],[7,25,2,1],[15,5,18,20],[24,26,27,21],[24,21,22],[24,17,16,13],[16,14,13],[24,13,28,29],[30,29,28,31],[19,30,31,12,15,20]],"Floor":[-3,-4,0,3,-2,-4,0,3,-2,-3,0,3,-3,-3,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,-6,-3,0,3,-6,-2,0,3,-6,-1,0,3,-6,0,0,3,-6,1,0,3,-6,2,0,3,-6,3,0,3,-6,4,0,3,-6,5,0,3,-5,-3,0,3,-5,-2,0,3,-5,1,0,3,-5,2,0,3,-5,3,0,3,-5,4,0,3,-5,5,0,3,-4,-3,0,3,-4,-2,0,3,-4,1,0,3,-4,2,0,3,-4,3,0,3,-4,4,0,3,-4,5,0,3,-3,-2,0,3,-3,1,0,3,-3,2,0,3,-3,3,0,3,-3,4,0,3,-3,5,0,3,-2,-2,0,3,-2,-1,0,3,-2,0,0,3,-2,1,0,3,-2,2,0,3,-2,3,0,3,-2,4,0,3,-2,5,0,3,-4,6,0,3,-4,7,0,3,-3,6,0,3,-3,7,0,3,-2,6,0,3,-2,7,0,3,-1,3,0,3,-1,4,0,3,-1,7,0,3,0,3,0,3,0,4,0,3,0,7,0,3,1,3,0,3,1,4,0,3,1,5,0,3,1,6,0,3,1,7,0,3,2,3,0,3,2,4,0,3,2,5,0,3,2,6,0,3,2,7,0,3,3,3,0,3,3,4,0,3,3,5,0,3,3,6,0,3,3,7,0,3,-1,-4,0,3,-1,-3,0,3,-1,-2,0,3,-1,-1,0,3,-1,0,0,3,0,-4,0,3,0,-3,0,3,0,-2,0,3,0,-1,0,3,0,0,0,3,1,-4,0,3,1,-3,0,3,1,-2,0,3,1,-1,0,3,1,0,0,3,2,-4,0,3,2,-3,0,3,2,-2,0,3,2,-1,0,3,2,0,0,3,3,-4,0,3,3,-3,0,3,3,-2,0,3,3,-1,0,3,3,0,0,3,4,-4,0,3,4,-3,0,3,4,-2,0,3,4,-1,0,3,4,0,0,3,5,-4,0,3,5,-3,0,3,5,-2,0,3,5,-1,0,3,3,1,0,3,3,2,0,3,4,1,0,3,4,2,0,3,4,3,0,3,4,4,0,3,5,2,0,3,5,3,0,3,5,4,0,3,6,2,0,3,6,3,0,3,6,4,0,3,6,-3,0,3,6,-2,0,3,7,-3,0,3,7,-2,0,3,7,1,0,3,7,2,0,3,7,3,0,3,7,4,0,3,8,-3,0,3,8,-2,0,3,8,-1,0,3,8,0,0,3,8,1,0,3,8,2,0,3,8,3,0,3,8,4,0,3],"Middle":[-7,-5,63,1,-7,-4,2,2,-6,-5,63,1,-6,-4,2,2,-5,-5,63,1,-5,-4,2,2,-5,-1,48,1,-5,0,1,2,-4,-5,27,1,-4,-4,3,2,-4,-1,56,1,-4,0,2,2,-3,-6,63,1,-3,-5,2,2,-3,-1,24,1,-3,0,3,2,-2,-6,63,1,-2,-5,2,2,-1,-6,63,1,-1,-5,2,2,-1,1,48,1,-1,2,1,2,-1,5,48,1,-1,6,1,2,0,-6,63,1,0,-5,2,2,0,1,56,1,0,2,2,2,0,5,24,1,0,6,3,2,1,-6,63,1,1,-5,2,2,1,1,56,1,1,2,2,2,2,-6,63,1,2,-5,2,2,2,1,24,1,2,2,3,2,3,-6,63,1,3,-5,2,2,4,-6,63,1,4,-5,2,2,5,-6,63,1,5,-5,2,2,5,0,48,1,5,1,1,2,6,-5,54,1,6,-4,1,2,6,0,26,1,6,1,3,2,7,-5,63,1,7,-4,2,2,7,-1,24,1,7,0,3,2,8,-5,63,1,8,-4,2,2],"Top":[-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,-8,-6,511,1,-8,-5,255,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,507,1,-8,7,511,1,-7,-6,511,1,-7,6,504,1,-7,7,511,1,-6,-6,511,1,-6,6,504,1,-6,7,511,1,-6,8,511,1,-6,9,511,1,-5,-7,511,1,-5,-6,511,1,-5,6,216,1,-5,7,219,1,-5,8,507,1,-5,9,511,1,-4,-7,511,1,-4,-6,255,1,-4,8,504,1,-4,9,511,1,-3,-7,511,1,-3,8,504,1,-3,9,511,1,-2,-7,511,1,-2,8,504,1,-2,9,511,1,-1,-7,511,1,-1,8,504,1,-1,9,511,1,0,-7,511,1,0,8,504,1,0,9,511,1,1,-7,511,1,1,8,504,1,1,9,511,1,2,-7,511,1,2,8,504,1,2,9,511,1,3,-7,511,1,3,8,504,1,3,9,511,1,4,-7,511,1,4,5,432,1,4,6,438,1,4,7,438,1,4,8,510,1,4,9,511,1,5,-7,511,1,5,5,504,1,5,6,511,1,5,7,511,1,5,8,511,1,5,9,511,1,6,-7,511,1,6,-6,447,1,6,-1,176,1,6,5,504,1,6,6,511,1,7,-7,511,1,7,-6,511,1,7,5,504,1,7,6,511,1,8,-6,511,1,8,5,504,1,8,6,511,1,9,-6,511,1,9,-5,447,1,9,-4,438,1,9,-3,438,1,9,-2,438,1,9,-1,438,1,9,0,438,1,9,1,438,1,9,2,438,1,9,3,438,1,9,4,438,1,9,5,510,1,9,6,511,1,10,-6,511,1,10,-5,511,1,10,-4,511,1,10,-3,511,1,10,-2,511,1,10,-1,511,1,10,0,511,1,10,1,511,1,10,2,511,1,10,3,511,1,10,4,511,1,10,5,511,1,10,6,511,1],"CustomFloor1":[-2,-3,1,6,14,-1,-3,1,7,14,0,-3,1,8,14,0,-2,1,8,15,-1,-2,1,7,15,-2,-2,1,6,15,-5,2,1,6,14,-4,2,1,7,14,-3,2,1,8,14,-3,3,1,8,15,-4,3,1,7,15,-5,3,1,6,15,4,3,1,6,14,5,3,1,7,14,6,3,1,8,14,6,4,1,8,15,5,4,1,7,15,4,4,1,6,15],"CustomFloor2":[],"CustomFloor3":[],"CustomMiddle1":[3,-4,1,5,5,3,-3,1,5,6,2,-4,1,5,5,2,-3,1,5,6,3,-2,1,10,5,3,-1,1,10,6,-3,4,1,10,5,-3,5,1,10,6,2,4,1,10,5,2,5,1,10,6,0,-1,1,18,12,1,-1,1,19,12,1,-2,1,19,11,0,-2,1,18,11,-6,4,1,18,12,-5,4,1,19,12,-5,3,1,19,11,-6,3,1,18,11,4,2,1,12,13,4,3,1,12,14,-6,-3,1,12,13,-6,-2,1,12,14,6,-3,1,15,13,7,-3,1,16,13,7,-2,1,16,14,6,-2,1,15,14,-1,3,1,15,13,0,3,1,16,13,0,4,1,16,14,-1,4,1,15,14],"CustomMiddle2":[-2,-4,1,14,4,-2,-3,1,14,5,-1,-3,1,15,5,-1,-4,1,15,4,-4,1,1,14,4,-4,2,1,14,5,-3,2,1,15,5,-3,1,1,15,4,7,2,1,13,6,-6,1,1,14,6,-4,-3,1,8,11,-4,7,1,6,11,5,-4,1,6,0,5,-3,1,6,1,-2,-1,1,5,0,-2,0,1,5,1],"CustomTop":[]} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start1/Preinstall.json b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start1/Preinstall.json deleted file mode 100644 index 5bae412..0000000 --- a/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start1/Preinstall.json +++ /dev/null @@ -1 +0,0 @@ -[{"Name":"Preinstall1","Weight":100,"Remark":"","WaveList":[[{"Position":{"X":0,"Y":0},"Size":{"X":0,"Y":0},"SpecialMarkType":1,"DelayTime":0,"MarkList":[]},{"Position":{"X":16,"Y":-16},"Size":{"X":16,"Y":16},"SpecialMarkType":0,"DelayTime":0,"MarkList":[{"Id":"weapon0001","Weight":100,"Attr":{"CurrAmmon":"30","ResidueAmmo":"210"},"Altitude":8,"VerticalSpeed":0}]}]]}] \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start1/Preview.png b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start1/Preview.png deleted file mode 100644 index fc3efd3..0000000 --- a/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start1/Preview.png +++ /dev/null Binary files differ diff --git a/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start1/Preview.png.import b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start1/Preview.png.import deleted file mode 100644 index e748d06..0000000 --- a/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start1/Preview.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://7m4jc30x73j0" -path="res://.godot/imported/Preview.png-4974b74c6afb3b83df9e34acaa9196c7.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://resource/map/tileMaps/Test1/inlet/Start1/Preview.png" -dest_files=["res://.godot/imported/Preview.png-4974b74c6afb3b83df9e34acaa9196c7.ctex"] - -[params] - -compress/mode=0 -compress/high_quality=false -compress/lossy_quality=0.7 -compress/hdr_compression=1 -compress/normal_map=0 -compress/channel_pack=0 -mipmaps/generate=false -mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" -process/fix_alpha_border=true -process/premult_alpha=false -process/normal_map_invert_y=false -process/hdr_as_srgb=false -process/hdr_clamp_exposure=false -process/size_limit=0 -detect_3d/compress_to=1 diff --git a/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start1/RoomInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start1/RoomInfo.json deleted file mode 100644 index b31da81..0000000 --- a/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start1/RoomInfo.json +++ /dev/null @@ -1 +0,0 @@ -{"Position":{"X":-6,"Y":-7},"Size":{"X":21,"Y":13},"DoorAreaInfos":[],"GroupName":"Test1","RoomType":1,"RoomName":"Start1","Weight":100,"Remark":""} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start1/TileInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start1/TileInfo.json deleted file mode 100644 index 0f209e6..0000000 --- a/DungeonShooting_Godot/resource/map/tileMaps/Test1/inlet/Start1/TileInfo.json +++ /dev/null @@ -1 +0,0 @@ -{"NavigationVertices":[{"X":202,"Y":-58},{"X":202,"Y":66},{"X":198,"Y":38},{"X":198,"Y":-14},{"X":-58,"Y":66},{"X":170,"Y":38},{"X":38,"Y":-10},{"X":38,"Y":-46},{"X":170,"Y":-14},{"X":-22,"Y":-10},{"X":-58,"Y":-58},{"X":-22,"Y":-46}],"NavigationPolygon":[[0,1,2,3],[2,1,4,5],[6,7,8,5],[6,5,4,9],[9,4,10,11],[11,10,0,7],[8,7,0,3]],"Floor":[3,-2,0,3,2,-2,0,3,-2,-2,0,3,-2,-1,0,3,-1,-1,0,3,0,-1,0,3,1,-1,0,3,2,-1,0,3,3,-1,0,3,3,0,0,3,2,0,0,3,1,0,0,3,0,0,0,3,-1,0,0,3,-2,0,0,3,-2,1,0,3,-1,1,0,3,0,1,0,3,1,1,0,3,2,1,0,3,3,1,0,3,3,-3,0,3,2,-3,0,3,-2,-3,0,3,4,-3,0,3,5,-3,0,3,6,-3,0,3,7,-3,0,3,8,-2,0,3,9,-2,0,3,7,-2,0,3,6,-2,0,3,5,-2,0,3,4,-2,0,3,8,-3,0,3,9,-3,0,3,10,-3,0,3,9,-4,0,3,8,-4,0,3,7,-4,0,3,6,-4,0,3,5,-4,0,3,4,-4,0,3,3,-4,0,3,2,-4,0,3,1,-4,0,3,0,-4,0,3,-1,-4,0,3,-2,-4,0,3,-3,-4,0,3,-3,-3,0,3,-3,-2,0,3,-3,-1,0,3,-3,0,0,3,-3,1,0,3,-4,1,0,3,-4,2,0,3,-3,2,0,3,-2,2,0,3,-1,2,0,3,0,2,0,3,1,2,0,3,2,2,0,3,3,2,0,3,4,2,0,3,4,1,0,3,4,0,0,3,4,-1,0,3,5,-1,0,3,6,-1,0,3,7,-1,0,3,8,-1,0,3,9,-1,0,3,10,-1,0,3,10,-2,0,3,10,0,0,3,9,0,0,3,8,0,0,3,7,0,0,3,6,0,0,3,5,0,0,3,5,1,0,3,6,1,0,3,7,1,0,3,8,1,0,3,9,1,0,3,9,2,0,3,10,2,0,3,8,2,0,3,7,2,0,3,6,2,0,3,5,2,0,3,10,1,0,3,10,3,0,3,9,3,0,3,8,3,0,3,7,3,0,3,6,3,0,3,5,3,0,3,4,3,0,3,3,3,0,3,2,3,0,3,1,3,0,3,0,3,0,3,-1,3,0,3,-2,3,0,3,-3,3,0,3,-4,0,0,3,-4,-1,0,3,-4,-2,0,3,-4,-3,0,3,-4,-4,0,3,-4,3,0,3,10,-4,0,3,12,-4,0,3,12,-3,0,3,12,-2,0,3,11,-2,0,3,11,-3,0,3,11,-4,0,3,12,-1,0,3,12,0,0,3,12,1,0,3,12,2,0,3,12,3,0,3,11,3,0,3,11,2,0,3],"Middle":[-4,-6,63,1,-4,-5,2,2,-3,-6,63,1,-3,-5,2,2,-2,-6,63,1,-2,-5,2,2,-1,-6,63,1,-1,-5,2,2,-1,-3,48,1,-1,-2,1,2,0,-6,63,1,0,-5,2,2,0,-3,56,1,0,-2,2,2,1,-6,63,1,1,-5,2,2,1,-3,24,1,1,-2,3,2,2,-6,63,1,2,-5,2,2,3,-6,63,1,3,-5,2,2,4,-6,63,1,4,-5,2,2,5,-6,63,1,5,-5,2,2,6,-6,63,1,6,-5,2,2,7,-6,63,1,7,-5,2,2,8,-6,63,1,8,-5,2,2,9,-6,63,1,9,-5,2,2,10,-6,63,1,10,-5,2,2,11,-6,63,1,11,-5,2,2,11,0,18,1,11,1,0,2,12,-6,63,1,12,-5,2,2],"Top":[-6,-7,511,1,-6,-6,511,1,-6,-5,511,1,-6,-4,511,1,-6,-3,511,1,-6,-2,511,1,-6,-1,511,1,-6,0,511,1,-6,1,511,1,-6,2,511,1,-6,3,511,1,-6,4,511,1,-6,5,511,1,-5,-7,511,1,-5,-6,255,1,-5,-5,219,1,-5,-4,219,1,-5,-3,219,1,-5,-2,219,1,-5,-1,219,1,-5,0,219,1,-5,1,219,1,-5,2,219,1,-5,3,219,1,-5,4,507,1,-5,5,511,1,-4,-7,511,1,-4,4,504,1,-4,5,511,1,-3,-7,511,1,-3,4,504,1,-3,5,511,1,-2,-7,511,1,-2,4,504,1,-2,5,511,1,-1,-7,511,1,-1,4,504,1,-1,5,511,1,0,-7,511,1,0,4,504,1,0,5,511,1,1,-7,511,1,1,4,504,1,1,5,511,1,2,-7,511,1,2,4,504,1,2,5,511,1,3,-7,511,1,3,4,504,1,3,5,511,1,4,-7,511,1,4,4,504,1,4,5,511,1,5,-7,511,1,5,4,504,1,5,5,511,1,6,-7,511,1,6,4,504,1,6,5,511,1,7,-7,511,1,7,4,504,1,7,5,511,1,8,-7,511,1,8,4,504,1,8,5,511,1,9,-7,511,1,9,4,504,1,9,5,511,1,10,-7,511,1,10,4,504,1,10,5,511,1,11,-7,511,1,11,-1,144,1,11,4,504,1,11,5,511,1,12,-7,511,1,12,4,504,1,12,5,511,1,13,-7,511,1,13,-6,447,1,13,-5,438,1,13,-4,438,1,13,-3,438,1,13,-2,438,1,13,-1,438,1,13,0,438,1,13,1,438,1,13,2,438,1,13,3,438,1,13,4,510,1,13,5,511,1,14,-7,511,1,14,-6,511,1,14,-5,511,1,14,-4,511,1,14,-3,511,1,14,-2,511,1,14,-1,511,1,14,0,511,1,14,1,511,1,14,2,511,1,14,3,511,1,14,4,511,1,14,5,511,1],"CustomFloor1":[],"CustomFloor2":[],"CustomFloor3":[],"CustomMiddle1":[4,-1,1,12,10,4,-2,1,12,9,4,-3,1,12,8,5,-3,1,13,8,6,-3,1,14,8,6,-2,1,14,9,6,-1,1,14,10,7,-1,1,15,10,7,-2,1,15,9,7,-3,1,15,8,-1,2,1,12,10,-1,1,1,12,9,-1,0,1,12,8,0,0,1,13,8,1,0,1,14,8,1,1,1,14,9,1,2,1,14,10,2,2,1,15,10,2,1,1,15,9,2,0,1,15,8,5,2,1,12,10,5,1,1,12,9,5,0,1,12,8,6,0,1,13,8,7,0,1,14,8,7,1,1,14,9,7,2,1,14,10,8,2,1,15,10,8,1,1,15,9,8,0,1,15,8],"CustomMiddle2":[],"CustomTop":[]} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileSet/TileSet1/TileSet.json b/DungeonShooting_Godot/resource/map/tileSet/TileSet1/TileSet.json index 83eebd4..36650c3 100644 --- a/DungeonShooting_Godot/resource/map/tileSet/TileSet1/TileSet.json +++ b/DungeonShooting_Godot/resource/map/tileSet/TileSet1/TileSet.json @@ -246,100 +246,124 @@ "Terrain": [], "Combination": [ { - "Id": "638410898975140817", + "Id": "638411075459225723", "Name": "\u7EC4\u5408", "Cells": [ { - "X": 192, - "Y": 160 + "X": 80, + "Y": 80 }, { - "X": 192, - "Y": 144 - }, - { - "X": 192, - "Y": 128 - }, - { - "X": 208, - "Y": 128 - }, - { - "X": 224, - "Y": 128 - }, - { - "X": 224, - "Y": 144 - }, - { - "X": 224, - "Y": 160 - }, - { - "X": 240, - "Y": 128 - }, - { - "X": 240, - "Y": 144 - }, - { - "X": 240, - "Y": 160 - }, - { - "X": 192, - "Y": 160 - }, - { - "X": 192, - "Y": 144 - }, - { - "X": 192, - "Y": 128 - }, - { - "X": 208, - "Y": 128 - }, - { - "X": 224, - "Y": 128 - }, - { - "X": 224, - "Y": 144 - }, - { - "X": 224, - "Y": 160 - }, - { - "X": 240, - "Y": 128 - }, - { - "X": 240, - "Y": 144 - }, - { - "X": 240, - "Y": 160 + "X": 80, + "Y": 96 } ], "Positions": [ { "X": 0, - "Y": 32 + "Y": 0 }, { "X": 0, "Y": 16 + } + ] + }, + { + "Id": "638411075513293604", + "Name": "\u7EC4\u5408", + "Cells": [ + { + "X": 160, + "Y": 80 }, { + "X": 160, + "Y": 96 + } + ], + "Positions": [ + { + "X": 0, + "Y": 0 + }, + { + "X": 0, + "Y": 16 + } + ] + }, + { + "Id": "638411075593121170", + "Name": "\u7EC4\u5408", + "Cells": [ + { + "X": 288, + "Y": 192 + }, + { + "X": 304, + "Y": 192 + }, + { + "X": 304, + "Y": 176 + }, + { + "X": 288, + "Y": 176 + } + ], + "Positions": [ + { + "X": 0, + "Y": 16 + }, + { + "X": 16, + "Y": 16 + }, + { + "X": 16, + "Y": 0 + }, + { + "X": 0, + "Y": 0 + } + ] + }, + { + "Id": "638411075650242118", + "Name": "\u7EC4\u5408", + "Cells": [ + { + "X": 96, + "Y": 224 + }, + { + "X": 112, + "Y": 224 + }, + { + "X": 128, + "Y": 224 + }, + { + "X": 128, + "Y": 240 + }, + { + "X": 112, + "Y": 240 + }, + { + "X": 96, + "Y": 240 + } + ], + "Positions": [ + { "X": 0, "Y": 0 }, @@ -356,60 +380,76 @@ "Y": 16 }, { - "X": 32, - "Y": 32 - }, - { - "X": 48, - "Y": 0 - }, - { - "X": 48, + "X": 16, "Y": 16 }, { - "X": 48, - "Y": 32 + "X": 0, + "Y": 16 + } + ] + }, + { + "Id": "638411075701755677", + "Name": "\u7EC4\u5408", + "Cells": [ + { + "X": 192, + "Y": 208 }, { - "X": 64, - "Y": 32 + "X": 192, + "Y": 224 + } + ], + "Positions": [ + { + "X": 0, + "Y": 0 }, { - "X": 64, + "X": 0, + "Y": 16 + } + ] + }, + { + "Id": "638411075748707154", + "Name": "\u7EC4\u5408", + "Cells": [ + { + "X": 240, + "Y": 208 + }, + { + "X": 256, + "Y": 208 + }, + { + "X": 256, + "Y": 224 + }, + { + "X": 240, + "Y": 224 + } + ], + "Positions": [ + { + "X": 0, + "Y": 0 + }, + { + "X": 16, + "Y": 0 + }, + { + "X": 16, "Y": 16 }, { - "X": 64, - "Y": 0 - }, - { - "X": 80, - "Y": 0 - }, - { - "X": 96, - "Y": 0 - }, - { - "X": 96, + "X": 0, "Y": 16 - }, - { - "X": 96, - "Y": 32 - }, - { - "X": 112, - "Y": 0 - }, - { - "X": 112, - "Y": 16 - }, - { - "X": 112, - "Y": 32 } ] } diff --git a/DungeonShooting_Godot/src/framework/InfiniteGrid.cs b/DungeonShooting_Godot/src/framework/InfiniteGrid.cs index 8fb292b..32c73ba 100644 --- a/DungeonShooting_Godot/src/framework/InfiniteGrid.cs +++ b/DungeonShooting_Godot/src/framework/InfiniteGrid.cs @@ -12,6 +12,8 @@ /// public delegate bool EachGridCallback(int x, int y, T data); + private bool _isDirty = false; + private Rect2I _rect = new Rect2I(); private readonly Dictionary> _map = new Dictionary>(); /// @@ -49,6 +51,7 @@ value = new Dictionary(); value.Add(y, data); _map.Add(x, value); + _isDirty = true; } } @@ -91,6 +94,7 @@ { if (_map.TryGetValue(x, out var value)) { + _isDirty = true; return value.Remove(y); } @@ -120,6 +124,7 @@ value = new Dictionary(); value.Add(y + j, data); _map.Add(x + i, value); + _isDirty = true; } } } @@ -144,6 +149,7 @@ if (value.Count == 0) { _map.Remove(x + i); + _isDirty = true; } } } @@ -156,6 +162,7 @@ public void Clear() { _map.Clear(); + _isDirty = true; } /// @@ -212,6 +219,13 @@ /// public Rect2I GetRect() { + if (!_isDirty) + { + return _rect; + } + + _isDirty = false; + var flag = false; var minX = int.MaxValue; var minY = int.MaxValue; @@ -236,6 +250,7 @@ return new Rect2I(); } - return new Rect2I(minX, minY, maxX - minX + 1, maxY - minY + 1); + _rect = new Rect2I(minX, minY, maxX - minX + 1, maxY - minY + 1); + return _rect; } } diff --git a/DungeonShooting_Godot/src/game/ui/mapEditor/MapEditorPanel.cs b/DungeonShooting_Godot/src/game/ui/mapEditor/MapEditorPanel.cs index be16f6f..bc0a9a4 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditor/MapEditorPanel.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditor/MapEditorPanel.cs @@ -88,6 +88,10 @@ _title = "正在编辑:" + roomSplit.RoomInfo.RoomName; S_Title.Instance.Text = _title; + //初始化 TileMap 层 + S_TileMap.Instance.InitLayer(); + //加载层级 + S_MapEditorMapLayer.Instance.InitData(); //加载MapTile面板 S_MapEditorMapTile.Instance.InitData(tileSetSplit); diff --git a/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs b/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs index fdb0fed..41e520c 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs @@ -151,9 +151,9 @@ public TileMapDrawMode CurrBrushType { get; private set; } /// - /// 当前笔刷使用的 AtlasCoords, value: atlasCoords, 单位: 格 + /// 当前笔刷使用的 AtlasCoords,, key: position, value: atlasCoords, 单位: 格 /// - public List CurrBrush { get; } = new List(); + public System.Collections.Generic.Dictionary CurrBrush { get; } = new System.Collections.Generic.Dictionary(); /// /// 当前笔刷使用的纹理 @@ -188,6 +188,7 @@ //------------------------------- private MapEditor.TileMap _editorTileMap; private EventFactory _eventFactory; + private Vector2I _cacheToolSizeData; public void SetUiNode(IUiNode uiNode) { @@ -216,14 +217,13 @@ _eventFactory.RemoveAllEventListener(); RenderingServer.FramePostDraw -= OnFramePostDraw; } - - public override void _Ready() - { - InitLayer(); - } public override void _Process(double delta) { + if (!_initLayer) + { + return; + } //触发绘制辅助线 _editorTileMap.L_Brush.Instance.QueueRedraw(); @@ -366,7 +366,7 @@ } else //自定义层 { - if (CurrBrushType == TileMapDrawMode.Free) + if (CurrBrushType == TileMapDrawMode.Free || CurrBrushType == TileMapDrawMode.Combination) //自由绘制 或者 绘制组合 { if (_isRightPressed) //按下了左键擦除 { @@ -376,8 +376,8 @@ { foreach (var item in CurrBrush) { - var rect = new Rect2(_mousePosition + (item + _brushOffset) * GameConfig.TileCellSize, GameConfig.TileCellSize, GameConfig.TileCellSize); - var srcRect = new Rect2(item * GameConfig.TileCellSize, GameConfig.TileCellSize, GameConfig.TileCellSize); + var rect = new Rect2(_mousePosition + (item.Key + _brushOffset) * GameConfig.TileCellSize, GameConfig.TileCellSize, GameConfig.TileCellSize); + var srcRect = new Rect2(item.Value * GameConfig.TileCellSize, GameConfig.TileCellSize, GameConfig.TileCellSize); canvasItem.DrawTextureRectRegion(CurrBrushTexture, rect, srcRect, new Color(1, 1, 1, 0.3f)); } } @@ -489,19 +489,23 @@ CurrBrushType = mode; } - public void AddCurrBrushAtlasCoords(Vector2I atlasCoords) + /// + /// 添加笔刷绘制的资源坐标, 单位: 格 + /// + public void AddCurrBrushAtlasCoords(Vector2I pos, Vector2I atlasCoords) { - if (!CurrBrush.Contains(atlasCoords)) + if (!CurrBrush.ContainsKey(pos)) { - CurrBrush.Add(atlasCoords); + CurrBrush.Add(pos, atlasCoords); var xStart = int.MaxValue; var xEnd = int.MinValue; var yStart = int.MaxValue; var yEnd = int.MinValue; //计算起始点和终点 - foreach (var cell in CurrBrush) + foreach (var kv in CurrBrush) { + var cell = kv.Key; xStart = Mathf.Min(cell.X, xStart); yStart = Mathf.Min(cell.Y, yStart); xEnd = Mathf.Max(cell.X, xEnd); @@ -512,16 +516,25 @@ } } + /// + /// 清除笔刷 + /// public void ClearCurrBrushAtlasCoords() { CurrBrush.Clear(); } + /// + /// 设置笔刷使用的纹理 + /// public void SetCurrBrushTexture(Texture2D texture) { CurrBrushTexture = texture; } + /// + /// 设置选中某个图层时是否淡化其他图层 + /// public void SetDesaltOtherLayer(bool flag) { _desaltOtherLayer = flag; @@ -675,9 +688,6 @@ { CurrDoorConfigs.Add(doorAreaInfo.Clone()); } - - //初始化层级数据 - InitLayer(); //读取地块数据 SetAutoLayerDataFromList(MapLayer.AutoFloorLayer, tileInfo.Floor); @@ -720,8 +730,8 @@ MapEditorToolsPanel.CreateDoorTool(doorAreaInfo); } - //聚焦 - OnClickCenterTool(null); + //聚焦 (需要延时一帧调用) + this.CallDelayInNode(0, () => OnClickCenterTool(null)); return true; } @@ -739,7 +749,10 @@ _autoTileConfig = new AutoTileConfig(0, tileSetSplit.TileSetInfo.Sources[0].Terrain[0]); } - private void InitLayer() + /// + /// 初始化层数据 + /// + public void InitLayer() { if (_initLayer) { @@ -807,11 +820,11 @@ } else //自定义层 { - if (CurrBrushType == TileMapDrawMode.Free) //自由绘制 + if (CurrBrushType == TileMapDrawMode.Free || CurrBrushType == TileMapDrawMode.Combination) //自由绘制 或者 组合 { foreach (var item in CurrBrush) { - SetCell(CurrLayer.Layer, position + item + _brushOffset, CurrSourceIndex, item); + SetCell(CurrLayer.Layer, position + item.Key + _brushOffset, CurrSourceIndex, item.Value); //标记有修改数据 EventManager.EmitEvent(EventEnum.OnTileMapDirty); } @@ -1394,14 +1407,11 @@ //设置地图大小 private void SetMapSize(Vector2I size, bool refreshDoorTrans) { - if (CurrRoomSize != size) + CurrRoomSize = size; + if (refreshDoorTrans && _cacheToolSizeData != size) { - CurrRoomSize = size; - - if (refreshDoorTrans) - { - MapEditorToolsPanel.SetDoorHoverToolTransform(CurrRoomPosition, CurrRoomSize); - } + _cacheToolSizeData = size; + MapEditorToolsPanel.SetDoorHoverToolTransform(CurrRoomPosition, CurrRoomSize); } } @@ -1569,6 +1579,6 @@ return Colors.White; } - return layer == CurrLayer.Layer ? Colors.White : new Color(1, 1, 1, 0.3f); + return layer == CurrLayer.Layer ? Colors.White : new Color(1, 1, 1, 0.25f); } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorMapLayer/MapEditorMapLayerPanel.cs b/DungeonShooting_Godot/src/game/ui/mapEditorMapLayer/MapEditorMapLayerPanel.cs index 7fb981e..24599fd 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditorMapLayer/MapEditorMapLayerPanel.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditorMapLayer/MapEditorMapLayerPanel.cs @@ -21,7 +21,15 @@ _grid = CreateUiGrid(S_LayerButton); _grid.SetCellOffset(new Vector2I(0, 2)); _grid.SetHorizontalExpand(true); - + + S_CheckButton.Instance.Toggled += OnToggled; + } + + /// + /// 初始化层级数据 + /// + public void InitData() + { _grid.Add(new TileMapLayerData("地板", MapLayer.AutoFloorLayer, false)); _grid.Add(new TileMapLayerData("底层1", MapLayer.CustomFloorLayer1, false)); _grid.Add(new TileMapLayerData("底层2", MapLayer.CustomFloorLayer2, false)); @@ -33,8 +41,6 @@ _grid.Add(new TileMapLayerData("顶层", MapLayer.CustomTopLayer, false)); _grid.Add(new TileMapLayerData("标记数据层", MapLayer.MarkLayer, true)); _grid.SelectIndex = 0; - - S_CheckButton.Instance.Toggled += OnToggled; } private void OnToggled(bool toggledon) diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorMapTile/CombinationCell.cs b/DungeonShooting_Godot/src/game/ui/mapEditorMapTile/CombinationCell.cs index b8ca7bd..24ef31a 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditorMapTile/CombinationCell.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditorMapTile/CombinationCell.cs @@ -1,3 +1,5 @@ +using Godot; + namespace UI.MapEditorMapTile; public class CombinationCell : UiCell @@ -35,6 +37,18 @@ { CellNode.L_SelectTexture.Instance.Visible = true; + //选中组合, 将组合数据设置到笔刷上 + var editorTileMap = CellNode.UiPanel.EditorTileMap; + editorTileMap.ClearCurrBrushAtlasCoords(); + var positions = Data.CombinationInfo.Positions; + var cells = Data.CombinationInfo.Cells; + for (var i = 0; i < cells.Length; i++) + { + editorTileMap.AddCurrBrushAtlasCoords( + positions[i].AsVector2I() / GameConfig.TileCellSize, + cells[i].AsVector2I() / GameConfig.TileCellSize + ); + } } public override void OnUnSelect() diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorMapTile/FreeTileTab.cs b/DungeonShooting_Godot/src/game/ui/mapEditorMapTile/FreeTileTab.cs index 1d54ce1..4f23415 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditorMapTile/FreeTileTab.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditorMapTile/FreeTileTab.cs @@ -67,7 +67,7 @@ var atlasCoords = Utils.GetMouseCellPosition(UiNode.L_TabRoot.Instance); _prevPos = atlasCoords * GameConfig.TileCellSize; _selectCells.Add(_prevPos); - UiNode.UiPanel.EditorTileMap.AddCurrBrushAtlasCoords(atlasCoords); + UiNode.UiPanel.EditorTileMap.AddCurrBrushAtlasCoords(atlasCoords, atlasCoords); } } } @@ -82,7 +82,7 @@ if (!_selectCells.Contains(pos)) { _selectCells.Add(pos); - UiNode.UiPanel.EditorTileMap.AddCurrBrushAtlasCoords(atlasCoords); + UiNode.UiPanel.EditorTileMap.AddCurrBrushAtlasCoords(atlasCoords, atlasCoords); } } } diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorMapTile/MapEditorMapTile.cs b/DungeonShooting_Godot/src/game/ui/mapEditorMapTile/MapEditorMapTile.cs index e6a7657..bf07036 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditorMapTile/MapEditorMapTile.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditorMapTile/MapEditorMapTile.cs @@ -275,6 +275,15 @@ } /// + /// 类型: , 路径: MapEditorMapTile.VBoxContainer.Panel.MarginContainer.Tab2.ScrollContainer.TerrainItem.ErrorIcon + /// + public class ErrorIcon : UiNode + { + public ErrorIcon(MapEditorMapTilePanel uiPanel, Godot.TextureRect node) : base(uiPanel, node) { } + public override ErrorIcon Clone() => new (UiPanel, (Godot.TextureRect)Instance.Duplicate()); + } + + /// /// 类型: , 路径: MapEditorMapTile.VBoxContainer.Panel.MarginContainer.Tab2.ScrollContainer.TerrainItem.TerrainPreview /// public class TerrainPreview : UiNode @@ -315,6 +324,19 @@ private TerrainName _L_TerrainName; /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapTile.VBoxContainer.Panel.MarginContainer.Tab2.ScrollContainer.ErrorIcon + /// + public ErrorIcon L_ErrorIcon + { + get + { + if (_L_ErrorIcon == null) _L_ErrorIcon = new ErrorIcon(UiPanel, Instance.GetNode("ErrorIcon")); + return _L_ErrorIcon; + } + } + private ErrorIcon _L_ErrorIcon; + + /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapTile.VBoxContainer.Panel.MarginContainer.Tab2.ScrollContainer.TerrainPreview /// public TerrainPreview L_TerrainPreview @@ -674,6 +696,11 @@ public TerrainName S_TerrainName => L_VBoxContainer.L_Panel.L_MarginContainer.L_Tab2.L_ScrollContainer.L_TerrainItem.L_TerrainName; /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapTile.VBoxContainer.Panel.MarginContainer.Tab2.ScrollContainer.TerrainItem.ErrorIcon + /// + public ErrorIcon S_ErrorIcon => L_VBoxContainer.L_Panel.L_MarginContainer.L_Tab2.L_ScrollContainer.L_TerrainItem.L_ErrorIcon; + + /// /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapTile.VBoxContainer.Panel.MarginContainer.Tab2.ScrollContainer.TerrainItem.TerrainPreview /// public TerrainPreview S_TerrainPreview => L_VBoxContainer.L_Panel.L_MarginContainer.L_Tab2.L_ScrollContainer.L_TerrainItem.L_TerrainPreview; diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorMapTile/TerrainCell.cs b/DungeonShooting_Godot/src/game/ui/mapEditorMapTile/TerrainCell.cs index f5b7f6c..4158ebf 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditorMapTile/TerrainCell.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditorMapTile/TerrainCell.cs @@ -5,17 +5,32 @@ /// public class TerrainCell : UiCell { + /// + /// 选中的地形配置数据 + /// public TileSetTerrainInfo TileSetTerrainInfo; public override void OnInit() { CellNode.L_Select.Instance.Visible = false; + CellNode.L_ErrorIcon.Instance.Visible = false; } public override void OnSetData(int data) { TileSetTerrainInfo = CellNode.UiPanel.TileSetSourceInfo.Terrain[data]; CellNode.L_TerrainName.Instance.Text = TileSetTerrainInfo.Name; + + //是否可以使用 + if (TileSetTerrainInfo.Ready) + { + CellNode.L_ErrorIcon.Instance.Visible = false; + + } + else + { + CellNode.L_ErrorIcon.Instance.Visible = true; + } } public override void OnSelect() diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorProject/MapEditorProjectPanel.cs b/DungeonShooting_Godot/src/game/ui/mapEditorProject/MapEditorProjectPanel.cs index 26b8d5b..81705b9 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditorProject/MapEditorProjectPanel.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditorProject/MapEditorProjectPanel.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using Godot; +using UI.MapEditor; namespace UI.MapEditorProject; @@ -92,14 +93,10 @@ /// public void OpenSelectRoom(DungeonRoomSplit room, TileSetSplit tileSetSplit) { - HideUi(); //创建地牢Ui - var mapEditor = UiManager.Create_MapEditor(); - mapEditor.PrevUi = this; + var mapEditor = ParentUi.OpenNextUi(UiManager.UiNames.MapEditor); //加载地牢 mapEditor.LoadMap(room, tileSetSplit); - //打开Ui - mapEditor.ShowUi(); } //搜索组按钮点击 diff --git a/DungeonShooting_Godot/src/game/ui/tileSetEditor/TileSetEditorPanel.cs b/DungeonShooting_Godot/src/game/ui/tileSetEditor/TileSetEditorPanel.cs index d178561..7e9077d 100644 --- a/DungeonShooting_Godot/src/game/ui/tileSetEditor/TileSetEditorPanel.cs +++ b/DungeonShooting_Godot/src/game/ui/tileSetEditor/TileSetEditorPanel.cs @@ -290,6 +290,9 @@ optionButton.RemoveItem(selectIndex); optionButton.Selected = index; OnOptionChange(index); + + //标记数据脏了 + EventManager.EmitEvent(EventEnum.OnTileSetDirty); } }); } diff --git a/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/TileSetEditorTerrainPanel.cs b/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/TileSetEditorTerrainPanel.cs index baa95f3..d431700 100644 --- a/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/TileSetEditorTerrainPanel.cs +++ b/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/TileSetEditorTerrainPanel.cs @@ -453,7 +453,8 @@ { TerrainTabGrid.SelectIndex = index; } - EventManager.EmitEvent(EventEnum.OnTileMapDirty); + //标记数据脏了 + EventManager.EmitEvent(EventEnum.OnTileSetDirty); } }); } @@ -471,7 +472,8 @@ //执行添加操作 EditorPanel.TileSetSourceInfo.Terrain.Add(terrainInfo); TerrainTabGrid.Add(terrainInfo, true); - EventManager.EmitEvent(EventEnum.OnTileMapDirty); + //标记数据脏了 + EventManager.EmitEvent(EventEnum.OnTileSetDirty); }); } @@ -503,7 +505,8 @@ terrain.Name = v; //刷新页签 ((TerrainTabCell)TerrainTabGrid.GetCell(CurrTerrainIndex)).RefreshData(); - EventManager.EmitEvent(EventEnum.OnTileMapDirty); + //标记数据脏了 + EventManager.EmitEvent(EventEnum.OnTileSetDirty); return true; }); }