diff --git a/DungeonShooting_Godot/prefab/ui/EditorInfo.tscn b/DungeonShooting_Godot/prefab/ui/EditorInfo.tscn new file mode 100644 index 0000000..4da2af9 --- /dev/null +++ b/DungeonShooting_Godot/prefab/ui/EditorInfo.tscn @@ -0,0 +1,65 @@ +[gd_scene load_steps=2 format=3 uid="uid://45krchsjrluh"] + +[ext_resource type="Script" path="res://src/game/ui/editorInfo/EditorInfoPanel.cs" id="1_3800s"] + +[node name="EditorInfo" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_3800s") + +[node name="MarginContainer" type="MarginContainer" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_left = 20 +theme_override_constants/margin_top = 50 +theme_override_constants/margin_right = 20 +theme_override_constants/margin_bottom = 20 + +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"] +layout_mode = 2 +theme_override_constants/separation = 20 + +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer"] +layout_mode = 2 + +[node name="NameLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 20.0 +text = "名称:" +horizontal_alignment = 2 +vertical_alignment = 1 + +[node name="NameInput" type="LineEdit" parent="MarginContainer/VBoxContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 80.0 +placeholder_text = "请输入名称" + +[node name="HBoxContainer5" type="HBoxContainer" parent="MarginContainer/VBoxContainer"] +layout_mode = 2 + +[node name="RemarkNameLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer5"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 0 +size_flags_stretch_ratio = 20.0 +text = "备注:" +horizontal_alignment = 2 +vertical_alignment = 1 + +[node name="RemarkInput" type="TextEdit" parent="MarginContainer/VBoxContainer/HBoxContainer5"] +custom_minimum_size = Vector2(0, 150) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 80.0 +placeholder_text = "选填" +wrap_mode = 1 diff --git a/DungeonShooting_Godot/prefab/ui/MapEditorCreateGroup.tscn b/DungeonShooting_Godot/prefab/ui/MapEditorCreateGroup.tscn deleted file mode 100644 index 8788c6c..0000000 --- a/DungeonShooting_Godot/prefab/ui/MapEditorCreateGroup.tscn +++ /dev/null @@ -1,65 +0,0 @@ -[gd_scene load_steps=2 format=3 uid="uid://45krchsjrluh"] - -[ext_resource type="Script" path="res://src/game/ui/mapEditorCreateGroup/MapEditorCreateGroupPanel.cs" id="1_qoujx"] - -[node name="MapEditorCreateGroup" type="Control"] -layout_mode = 3 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -script = ExtResource("1_qoujx") - -[node name="MarginContainer" type="MarginContainer" parent="."] -layout_mode = 1 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -theme_override_constants/margin_left = 20 -theme_override_constants/margin_top = 50 -theme_override_constants/margin_right = 20 -theme_override_constants/margin_bottom = 20 - -[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"] -layout_mode = 2 -theme_override_constants/separation = 20 - -[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer"] -layout_mode = 2 - -[node name="GroupNameLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer"] -layout_mode = 2 -size_flags_horizontal = 3 -size_flags_stretch_ratio = 20.0 -text = "组名称:" -horizontal_alignment = 2 -vertical_alignment = 1 - -[node name="GroupNameInput" type="LineEdit" parent="MarginContainer/VBoxContainer/HBoxContainer"] -layout_mode = 2 -size_flags_horizontal = 3 -size_flags_stretch_ratio = 80.0 -placeholder_text = "请输入组名称" - -[node name="HBoxContainer5" type="HBoxContainer" parent="MarginContainer/VBoxContainer"] -layout_mode = 2 - -[node name="RemarkNameLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer5"] -layout_mode = 2 -size_flags_horizontal = 3 -size_flags_vertical = 0 -size_flags_stretch_ratio = 20.0 -text = "组备注:" -horizontal_alignment = 2 -vertical_alignment = 1 - -[node name="RemarkInput" type="TextEdit" parent="MarginContainer/VBoxContainer/HBoxContainer5"] -custom_minimum_size = Vector2(0, 150) -layout_mode = 2 -size_flags_horizontal = 3 -size_flags_stretch_ratio = 80.0 -placeholder_text = "选填" -wrap_mode = 1 diff --git a/DungeonShooting_Godot/prefab/ui/TileSetEditorProject.tscn b/DungeonShooting_Godot/prefab/ui/TileSetEditorProject.tscn index 1e4f076..56ed921 100644 --- a/DungeonShooting_Godot/prefab/ui/TileSetEditorProject.tscn +++ b/DungeonShooting_Godot/prefab/ui/TileSetEditorProject.tscn @@ -213,6 +213,10 @@ anchor_top = 1.0 anchor_right = 1.0 anchor_bottom = 1.0 +offset_left = 2.0 +offset_top = -412.0 +offset_right = -2.0 +offset_bottom = -2.0 grow_horizontal = 2 grow_vertical = 0 expand_mode = 2 diff --git a/DungeonShooting_Godot/resource/map/tileSet/TileSet1/Test1.png b/DungeonShooting_Godot/resource/map/tileSet/TileSet1/Test1.png new file mode 100644 index 0000000..cb64efb --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileSet/TileSet1/Test1.png Binary files differ diff --git a/DungeonShooting_Godot/resource/map/tileSet/TileSet1/Test1.png.import b/DungeonShooting_Godot/resource/map/tileSet/TileSet1/Test1.png.import new file mode 100644 index 0000000..efd960c --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileSet/TileSet1/Test1.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bdbqiceo0p121" +path="res://.godot/imported/Test1.png-116dc7985045e1cdc2a9599a74b4b18e.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/map/tileSet/TileSet1/Test1.png" +dest_files=["res://.godot/imported/Test1.png-116dc7985045e1cdc2a9599a74b4b18e.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/tileSet/TileSet1/TileSet.json b/DungeonShooting_Godot/resource/map/tileSet/TileSet1/TileSet.json new file mode 100644 index 0000000..4c3280f --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileSet/TileSet1/TileSet.json @@ -0,0 +1,178 @@ +{ + "Name": "TileSet1", + "Sources": [ + { + "Name": "Test1", + "SourcePath": "resource/map/tileSet/TileSet1/Test1.png", + "Terrain": { + "_f": [ + 0, + 64 + ], + "_vl": [ + 16, + 64 + ], + "_vc": [ + 32, + 64 + ], + "_vr": [ + 48, + 64 + ], + "_vs": [ + 64, + 64 + ], + "_000_010_010": [ + 0, + 0 + ], + "_010_010_010": [ + 0, + 16 + ], + "_010_010_000": null, + "_000_010_000": null, + "_000_011_010": null, + "_010_011_010": null, + "_010_011_000": null, + "_000_011_000": null, + "_000_111_010": null, + "_010_111_010": null, + "_010_111_000": null, + "_000_111_000": null, + "_000_110_010": null, + "_010_110_010": null, + "_010_110_000": null, + "_000_110_000": null, + "_110_111_010": null, + "_010_011_011": null, + "_011_011_010": null, + "_010_111_110": null, + "_000_111_011": null, + "_011_111_111": null, + "_111_111_011": null, + "_011_111_000": null, + "_000_111_110": null, + "_110_111_111": null, + "_111_111_110": null, + "_110_111_000": null, + "_011_111_010": null, + "_010_110_110": null, + "_110_110_010": null, + "_010_111_011": null, + "_000_011_011": null, + "_011_011_011": null, + "_011_111_011": null, + "_011_011_000": [ + 128, + 48 + ], + "_010_111_111": null, + "_110_111_011": null, + "_111_111_111": null, + "_111_111_000": null, + "_000_111_111": null, + "_011_111_110": null, + "_111_111_010": [ + 160, + 48 + ], + "_000_110_110": [ + 176, + 0 + ], + "_110_111_110": null, + "_110_110_110": null, + "_110_110_000": [ + 176, + 48 + ] + }, + "Combination": [ + { + "Id": "638402348017543119", + "Name": "\u5899\u58C1", + "Cells": [ + { + "X": 16, + "Y": 64 + }, + { + "X": 32, + "Y": 64 + }, + { + "X": 48, + "Y": 64 + }, + { + "X": 48, + "Y": 48 + }, + { + "X": 32, + "Y": 48 + }, + { + "X": 16, + "Y": 48 + } + ], + "Positions": [ + { + "X": 0, + "Y": 16 + }, + { + "X": 16, + "Y": 16 + }, + { + "X": 32, + "Y": 16 + }, + { + "X": 32, + "Y": 0 + }, + { + "X": 16, + "Y": 0 + }, + { + "X": 0, + "Y": 0 + } + ] + }, + { + "Id": "638402348110507844", + "Name": "\u5899\u58C12", + "Cells": [ + { + "X": 0, + "Y": 48 + }, + { + "X": 64, + "Y": 64 + } + ], + "Positions": [ + { + "X": 0, + "Y": 0 + }, + { + "X": 0, + "Y": 16 + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileSet/TileSetConfig.json b/DungeonShooting_Godot/resource/map/tileSet/TileSetConfig.json index 04a100a..052c022 100644 --- a/DungeonShooting_Godot/resource/map/tileSet/TileSetConfig.json +++ b/DungeonShooting_Godot/resource/map/tileSet/TileSetConfig.json @@ -1,6 +1,7 @@ { - "测试数据": { + "TileSet1": { "ErrorType": 0, - "Path": "resource/map/tileSet/测试数据" + "Path": "resource/map/tileSet/TileSet1", + "Remark": "" } } \ No newline at end of file diff --git "a/DungeonShooting_Godot/resource/map/tileSet/\346\265\213\350\257\225\346\225\260\346\215\256/Test.png" "b/DungeonShooting_Godot/resource/map/tileSet/\346\265\213\350\257\225\346\225\260\346\215\256/Test.png" deleted file mode 100644 index cb64efb..0000000 --- "a/DungeonShooting_Godot/resource/map/tileSet/\346\265\213\350\257\225\346\225\260\346\215\256/Test.png" +++ /dev/null Binary files differ diff --git "a/DungeonShooting_Godot/resource/map/tileSet/\346\265\213\350\257\225\346\225\260\346\215\256/Test.png.import" "b/DungeonShooting_Godot/resource/map/tileSet/\346\265\213\350\257\225\346\225\260\346\215\256/Test.png.import" deleted file mode 100644 index 23f5a74..0000000 --- "a/DungeonShooting_Godot/resource/map/tileSet/\346\265\213\350\257\225\346\225\260\346\215\256/Test.png.import" +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://dc08xp6er034l" -path="res://.godot/imported/Test.png-ad28b6f84a52b6d4955cef560a7a8c19.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://resource/map/tileSet/测试数据/Test.png" -dest_files=["res://.godot/imported/Test.png-ad28b6f84a52b6d4955cef560a7a8c19.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/tileSet/\346\265\213\350\257\225\346\225\260\346\215\256/Test2.png" "b/DungeonShooting_Godot/resource/map/tileSet/\346\265\213\350\257\225\346\225\260\346\215\256/Test2.png" deleted file mode 100644 index a045ee2..0000000 --- "a/DungeonShooting_Godot/resource/map/tileSet/\346\265\213\350\257\225\346\225\260\346\215\256/Test2.png" +++ /dev/null Binary files differ diff --git "a/DungeonShooting_Godot/resource/map/tileSet/\346\265\213\350\257\225\346\225\260\346\215\256/Test2.png.import" "b/DungeonShooting_Godot/resource/map/tileSet/\346\265\213\350\257\225\346\225\260\346\215\256/Test2.png.import" deleted file mode 100644 index 06fa9e3..0000000 --- "a/DungeonShooting_Godot/resource/map/tileSet/\346\265\213\350\257\225\346\225\260\346\215\256/Test2.png.import" +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://cjogonyo581on" -path="res://.godot/imported/Test2.png-4f1e41d474574169a7bc738f71691230.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://resource/map/tileSet/测试数据/Test2.png" -dest_files=["res://.godot/imported/Test2.png-4f1e41d474574169a7bc738f71691230.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/tileSet/\346\265\213\350\257\225\346\225\260\346\215\256/Test3.png" "b/DungeonShooting_Godot/resource/map/tileSet/\346\265\213\350\257\225\346\225\260\346\215\256/Test3.png" deleted file mode 100644 index d74eba2..0000000 --- "a/DungeonShooting_Godot/resource/map/tileSet/\346\265\213\350\257\225\346\225\260\346\215\256/Test3.png" +++ /dev/null Binary files differ diff --git "a/DungeonShooting_Godot/resource/map/tileSet/\346\265\213\350\257\225\346\225\260\346\215\256/Test3.png.import" "b/DungeonShooting_Godot/resource/map/tileSet/\346\265\213\350\257\225\346\225\260\346\215\256/Test3.png.import" deleted file mode 100644 index bf2ed3c..0000000 --- "a/DungeonShooting_Godot/resource/map/tileSet/\346\265\213\350\257\225\346\225\260\346\215\256/Test3.png.import" +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="CompressedTexture2D" -uid="uid://bcfp6gaqj0yl8" -path="res://.godot/imported/Test3.png-cf3c536c55fcfc7190831a6b6b80331f.ctex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://resource/map/tileSet/测试数据/Test3.png" -dest_files=["res://.godot/imported/Test3.png-cf3c536c55fcfc7190831a6b6b80331f.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/tileSet/\346\265\213\350\257\225\346\225\260\346\215\256/TileSet.json" "b/DungeonShooting_Godot/resource/map/tileSet/\346\265\213\350\257\225\346\225\260\346\215\256/TileSet.json" deleted file mode 100644 index 6e89016..0000000 --- "a/DungeonShooting_Godot/resource/map/tileSet/\346\265\213\350\257\225\346\225\260\346\215\256/TileSet.json" +++ /dev/null @@ -1,914 +0,0 @@ -{ - "Name": "\u6D4B\u8BD5\u6570\u636E", - "Sources": [ - { - "Name": "Test", - "SourcePath": "resource/map/tileSet/\u6D4B\u8BD5\u6570\u636E/Test.png", - "Terrain": { - "_f": null, - "_vl": null, - "_vc": null, - "_vr": null, - "_vs": null, - "_000_010_010": null, - "_010_010_010": null, - "_010_010_000": null, - "_000_010_000": null, - "_000_011_010": null, - "_010_011_010": null, - "_010_011_000": null, - "_000_011_000": null, - "_000_111_010": null, - "_010_111_010": null, - "_010_111_000": null, - "_000_111_000": null, - "_000_110_010": null, - "_010_110_010": null, - "_010_110_000": null, - "_000_110_000": null, - "_110_111_010": null, - "_010_011_011": null, - "_011_011_010": null, - "_010_111_110": null, - "_000_111_011": null, - "_011_111_111": null, - "_111_111_011": null, - "_011_111_000": null, - "_000_111_110": null, - "_110_111_111": null, - "_111_111_110": null, - "_110_111_000": null, - "_011_111_010": null, - "_010_110_110": null, - "_110_110_010": null, - "_010_111_011": null, - "_000_011_011": null, - "_011_011_011": null, - "_011_111_011": null, - "_011_011_000": null, - "_010_111_111": null, - "_110_111_011": null, - "_111_111_111": null, - "_111_111_000": null, - "_000_111_111": null, - "_011_111_110": null, - "_111_111_010": null, - "_000_110_110": null, - "_110_111_110": null, - "_110_110_110": null, - "_110_110_000": null - }, - "Combination": [ - { - "Id": "638401423614996953", - "Name": "\u7EC4\u5408", - "Cells": [ - { - "X": 0, - "Y": 48 - }, - { - "X": 16, - "Y": 48 - }, - { - "X": 32, - "Y": 48 - }, - { - "X": 48, - "Y": 48 - }, - { - "X": 0, - "Y": 48 - }, - { - "X": 16, - "Y": 48 - }, - { - "X": 32, - "Y": 48 - }, - { - "X": 48, - "Y": 48 - }, - { - "X": 0, - "Y": 48 - }, - { - "X": 16, - "Y": 48 - }, - { - "X": 32, - "Y": 48 - }, - { - "X": 48, - "Y": 48 - } - ], - "Positions": [ - { - "X": 0, - "Y": 0 - }, - { - "X": 16, - "Y": 0 - }, - { - "X": 32, - "Y": 0 - }, - { - "X": 48, - "Y": 0 - }, - { - "X": 0, - "Y": 32 - }, - { - "X": 16, - "Y": 32 - }, - { - "X": 32, - "Y": 32 - }, - { - "X": 48, - "Y": 32 - }, - { - "X": 32, - "Y": 16 - }, - { - "X": 48, - "Y": 16 - }, - { - "X": 64, - "Y": 16 - }, - { - "X": 80, - "Y": 16 - } - ] - }, - { - "Id": "638401423666689215", - "Name": "\u7EC4\u5408", - "Cells": [ - { - "X": 80, - "Y": 16 - }, - { - "X": 80, - "Y": 32 - }, - { - "X": 80, - "Y": 32 - }, - { - "X": 80, - "Y": 16 - }, - { - "X": 80, - "Y": 32 - }, - { - "X": 80, - "Y": 16 - }, - { - "X": 80, - "Y": 32 - }, - { - "X": 80, - "Y": 16 - }, - { - "X": 80, - "Y": 32 - }, - { - "X": 80, - "Y": 32 - }, - { - "X": 96, - "Y": 32 - }, - { - "X": 96, - "Y": 32 - }, - { - "X": 96, - "Y": 32 - }, - { - "X": 96, - "Y": 16 - }, - { - "X": 96, - "Y": 32 - }, - { - "X": 80, - "Y": 32 - }, - { - "X": 96, - "Y": 16 - }, - { - "X": 96, - "Y": 16 - }, - { - "X": 96, - "Y": 32 - }, - { - "X": 96, - "Y": 16 - }, - { - "X": 80, - "Y": 16 - }, - { - "X": 80, - "Y": 32 - } - ], - "Positions": [ - { - "X": 0, - "Y": 48 - }, - { - "X": 0, - "Y": 64 - }, - { - "X": 16, - "Y": 64 - }, - { - "X": 16, - "Y": 48 - }, - { - "X": 32, - "Y": 64 - }, - { - "X": 32, - "Y": 48 - }, - { - "X": 48, - "Y": 64 - }, - { - "X": 48, - "Y": 48 - }, - { - "X": 64, - "Y": 64 - }, - { - "X": 64, - "Y": 48 - }, - { - "X": 80, - "Y": 64 - }, - { - "X": 80, - "Y": 48 - }, - { - "X": 64, - "Y": 32 - }, - { - "X": 80, - "Y": 32 - }, - { - "X": 48, - "Y": 16 - }, - { - "X": 48, - "Y": 32 - }, - { - "X": 64, - "Y": 16 - }, - { - "X": 32, - "Y": 0 - }, - { - "X": 32, - "Y": 16 - }, - { - "X": 48, - "Y": 0 - }, - { - "X": 16, - "Y": 0 - }, - { - "X": 16, - "Y": 16 - } - ] - } - ] - }, - { - "Name": "Test2", - "SourcePath": "resource/map/tileSet/\u6D4B\u8BD5\u6570\u636E/Test2.png", - "Terrain": { - "_f": null, - "_vl": [ - 80, - 16 - ], - "_vc": [ - 96, - 16 - ], - "_vr": [ - 112, - 16 - ], - "_vs": null, - "_000_010_010": null, - "_010_010_010": null, - "_010_010_000": null, - "_000_010_000": null, - "_000_011_010": null, - "_010_011_010": null, - "_010_011_000": null, - "_000_011_000": null, - "_000_111_010": null, - "_010_111_010": null, - "_010_111_000": null, - "_000_111_000": null, - "_000_110_010": null, - "_010_110_010": null, - "_010_110_000": null, - "_000_110_000": null, - "_110_111_010": null, - "_010_011_011": null, - "_011_011_010": null, - "_010_111_110": null, - "_000_111_011": null, - "_011_111_111": [ - 176, - 64 - ], - "_111_111_011": null, - "_011_111_000": null, - "_000_111_110": null, - "_110_111_111": null, - "_111_111_110": null, - "_110_111_000": null, - "_011_111_010": null, - "_010_110_110": null, - "_110_110_010": null, - "_010_111_011": null, - "_000_011_011": null, - "_011_011_011": null, - "_011_111_011": null, - "_011_011_000": [ - 144, - 16 - ], - "_010_111_111": null, - "_110_111_011": null, - "_111_111_111": null, - "_111_111_000": null, - "_000_111_111": null, - "_011_111_110": null, - "_111_111_010": null, - "_000_110_110": null, - "_110_111_110": null, - "_110_110_110": null, - "_110_110_000": null - }, - "Combination": [ - { - "Id": "638401565284022672", - "Name": "\u7EC4\u5408", - "Cells": [ - { - "X": 160, - "Y": 144 - }, - { - "X": 144, - "Y": 144 - }, - { - "X": 128, - "Y": 144 - }, - { - "X": 112, - "Y": 144 - }, - { - "X": 96, - "Y": 144 - }, - { - "X": 80, - "Y": 144 - }, - { - "X": 64, - "Y": 144 - }, - { - "X": 48, - "Y": 144 - }, - { - "X": 32, - "Y": 144 - }, - { - "X": 32, - "Y": 128 - }, - { - "X": 48, - "Y": 128 - }, - { - "X": 64, - "Y": 128 - }, - { - "X": 80, - "Y": 128 - }, - { - "X": 96, - "Y": 128 - }, - { - "X": 112, - "Y": 128 - }, - { - "X": 128, - "Y": 128 - }, - { - "X": 144, - "Y": 128 - }, - { - "X": 160, - "Y": 128 - }, - { - "X": 160, - "Y": 112 - }, - { - "X": 144, - "Y": 112 - }, - { - "X": 128, - "Y": 112 - }, - { - "X": 112, - "Y": 112 - }, - { - "X": 96, - "Y": 112 - }, - { - "X": 80, - "Y": 112 - }, - { - "X": 64, - "Y": 112 - }, - { - "X": 48, - "Y": 112 - }, - { - "X": 32, - "Y": 112 - }, - { - "X": 32, - "Y": 96 - }, - { - "X": 48, - "Y": 96 - }, - { - "X": 64, - "Y": 96 - }, - { - "X": 80, - "Y": 96 - }, - { - "X": 96, - "Y": 96 - }, - { - "X": 112, - "Y": 96 - }, - { - "X": 128, - "Y": 96 - }, - { - "X": 144, - "Y": 96 - }, - { - "X": 144, - "Y": 80 - }, - { - "X": 160, - "Y": 80 - }, - { - "X": 160, - "Y": 96 - }, - { - "X": 128, - "Y": 80 - }, - { - "X": 112, - "Y": 80 - }, - { - "X": 96, - "Y": 80 - }, - { - "X": 80, - "Y": 80 - }, - { - "X": 64, - "Y": 80 - }, - { - "X": 48, - "Y": 80 - }, - { - "X": 32, - "Y": 80 - } - ], - "Positions": [ - { - "X": 128, - "Y": 64 - }, - { - "X": 112, - "Y": 64 - }, - { - "X": 96, - "Y": 64 - }, - { - "X": 80, - "Y": 64 - }, - { - "X": 64, - "Y": 64 - }, - { - "X": 48, - "Y": 64 - }, - { - "X": 32, - "Y": 64 - }, - { - "X": 16, - "Y": 64 - }, - { - "X": 0, - "Y": 64 - }, - { - "X": 0, - "Y": 48 - }, - { - "X": 16, - "Y": 48 - }, - { - "X": 32, - "Y": 48 - }, - { - "X": 48, - "Y": 48 - }, - { - "X": 64, - "Y": 48 - }, - { - "X": 80, - "Y": 48 - }, - { - "X": 96, - "Y": 48 - }, - { - "X": 112, - "Y": 48 - }, - { - "X": 128, - "Y": 48 - }, - { - "X": 128, - "Y": 32 - }, - { - "X": 112, - "Y": 32 - }, - { - "X": 96, - "Y": 32 - }, - { - "X": 80, - "Y": 32 - }, - { - "X": 64, - "Y": 32 - }, - { - "X": 48, - "Y": 32 - }, - { - "X": 32, - "Y": 32 - }, - { - "X": 16, - "Y": 32 - }, - { - "X": 0, - "Y": 32 - }, - { - "X": 0, - "Y": 16 - }, - { - "X": 16, - "Y": 16 - }, - { - "X": 32, - "Y": 16 - }, - { - "X": 48, - "Y": 16 - }, - { - "X": 64, - "Y": 16 - }, - { - "X": 80, - "Y": 16 - }, - { - "X": 96, - "Y": 16 - }, - { - "X": 112, - "Y": 16 - }, - { - "X": 112, - "Y": 0 - }, - { - "X": 128, - "Y": 0 - }, - { - "X": 128, - "Y": 16 - }, - { - "X": 96, - "Y": 0 - }, - { - "X": 80, - "Y": 0 - }, - { - "X": 64, - "Y": 0 - }, - { - "X": 48, - "Y": 0 - }, - { - "X": 32, - "Y": 0 - }, - { - "X": 16, - "Y": 0 - }, - { - "X": 0, - "Y": 0 - } - ] - } - ] - }, - { - "Name": "Test3", - "SourcePath": "resource/map/tileSet/\u6D4B\u8BD5\u6570\u636E/Test3.png", - "Terrain": { - "_f": null, - "_vl": null, - "_vc": null, - "_vr": null, - "_vs": null, - "_000_010_010": null, - "_010_010_010": null, - "_010_010_000": null, - "_000_010_000": null, - "_000_011_010": null, - "_010_011_010": null, - "_010_011_000": null, - "_000_011_000": null, - "_000_111_010": null, - "_010_111_010": null, - "_010_111_000": null, - "_000_111_000": null, - "_000_110_010": null, - "_010_110_010": null, - "_010_110_000": null, - "_000_110_000": null, - "_110_111_010": null, - "_010_011_011": null, - "_011_011_010": null, - "_010_111_110": null, - "_000_111_011": null, - "_011_111_111": null, - "_111_111_011": null, - "_011_111_000": null, - "_000_111_110": null, - "_110_111_111": null, - "_111_111_110": null, - "_110_111_000": null, - "_011_111_010": null, - "_010_110_110": null, - "_110_110_010": null, - "_010_111_011": null, - "_000_011_011": null, - "_011_011_011": null, - "_011_111_011": null, - "_011_011_000": null, - "_010_111_111": null, - "_110_111_011": null, - "_111_111_111": null, - "_111_111_000": null, - "_000_111_111": null, - "_011_111_110": null, - "_111_111_010": null, - "_000_110_110": null, - "_110_111_110": null, - "_110_110_110": null, - "_110_110_000": null - }, - "Combination": [] - }, - { - "Name": "Test4", - "SourcePath": null, - "Terrain": { - "_f": null, - "_vl": null, - "_vc": null, - "_vr": null, - "_vs": null, - "_000_010_010": null, - "_010_010_010": null, - "_010_010_000": null, - "_000_010_000": null, - "_000_011_010": null, - "_010_011_010": null, - "_010_011_000": null, - "_000_011_000": null, - "_000_111_010": null, - "_010_111_010": null, - "_010_111_000": null, - "_000_111_000": null, - "_000_110_010": null, - "_010_110_010": null, - "_010_110_000": null, - "_000_110_000": null, - "_110_111_010": null, - "_010_011_011": null, - "_011_011_010": null, - "_010_111_110": null, - "_000_111_011": null, - "_011_111_111": null, - "_111_111_011": null, - "_011_111_000": null, - "_000_111_110": null, - "_110_111_111": null, - "_111_111_110": null, - "_110_111_000": null, - "_011_111_010": null, - "_010_110_110": null, - "_110_110_010": null, - "_010_111_011": null, - "_000_011_011": null, - "_011_011_011": null, - "_011_111_011": null, - "_011_011_000": null, - "_010_111_111": null, - "_110_111_011": null, - "_111_111_111": null, - "_111_111_000": null, - "_000_111_111": null, - "_011_111_110": null, - "_111_111_010": null, - "_000_110_110": null, - "_110_111_110": null, - "_110_110_110": null, - "_110_110_000": null - }, - "Combination": [] - } - ] -} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/serialize/tileSet/TileSetSourceInfo.cs b/DungeonShooting_Godot/src/framework/map/serialize/tileSet/TileSetSourceInfo.cs index 88ece13..267d81b 100644 --- a/DungeonShooting_Godot/src/framework/map/serialize/tileSet/TileSetSourceInfo.cs +++ b/DungeonShooting_Godot/src/framework/map/serialize/tileSet/TileSetSourceInfo.cs @@ -34,8 +34,6 @@ [JsonIgnore] private Image _sourceImage; - [JsonIgnore] - private bool _overWriteImage; /// /// 初始化默认数据 @@ -45,14 +43,6 @@ Terrain = new TileSetTerrainInfo(); Combination = new List(); } - - /// - /// 是否重写过Image - /// - public bool IsOverWriteImage() - { - return _overWriteImage; - } /// /// 获取资源图像数据 @@ -71,7 +61,6 @@ /// public void SetSourceImage(Image image) { - _overWriteImage = true; if (_sourceImage != null) { _sourceImage.Dispose(); @@ -90,6 +79,11 @@ tileSetSourceInfo.Combination.Add(combination.Clone()); } tileSetSourceInfo.SourcePath = SourcePath; + if (_sourceImage != null) + { + tileSetSourceInfo._sourceImage = (Image)_sourceImage.Duplicate(); + } + return tileSetSourceInfo; } diff --git a/DungeonShooting_Godot/src/game/data/EditorInfoData.cs b/DungeonShooting_Godot/src/game/data/EditorInfoData.cs new file mode 100644 index 0000000..e1d0dc6 --- /dev/null +++ b/DungeonShooting_Godot/src/game/data/EditorInfoData.cs @@ -0,0 +1,18 @@ + +public class EditorInfoData +{ + /// + /// 名称 + /// + public string Name; + /// + /// 备注 + /// + public string Remark; + + public EditorInfoData(string name, string remark) + { + Name = name; + Remark = remark; + } +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/manager/EditorTileSetManager.cs b/DungeonShooting_Godot/src/game/manager/EditorTileSetManager.cs index 0d02792..f59fae2 100644 --- a/DungeonShooting_Godot/src/game/manager/EditorTileSetManager.cs +++ b/DungeonShooting_Godot/src/game/manager/EditorTileSetManager.cs @@ -9,7 +9,7 @@ /// /// 扫描路径 /// - public static string CustomMapPath { get; private set; } + public static string CustomTileSetPath { get; private set; } private static bool _init; @@ -22,7 +22,7 @@ _init = true; #if TOOLS - CustomMapPath = GameConfig.RoomTileSetDir; + CustomTileSetPath = GameConfig.RoomTileSetDir; #else CustomMapPath = GameConfig.RoomTileSetDir; #endif @@ -221,63 +221,72 @@ var jsonText = JsonSerializer.Serialize(GameApplication.Instance.TileSetConfig, options); File.WriteAllText(GameConfig.RoomTileSetDir + GameConfig.TileSetConfigFile, jsonText); } - + + /// + /// 保存TileSetInfo数据 + /// + public static void SaveTileSetInfo(TileSetInfo tileSetInfo) + { + var dir = CustomTileSetPath + tileSetInfo.Name; + if (Directory.Exists(dir)) + { + //删除多余文件 + if (tileSetInfo.Sources == null) + { + Directory.Delete(dir, true); + Directory.CreateDirectory(dir); + } + else + { + var directoryInfo = new DirectoryInfo(dir); + var fileInfos = directoryInfo.GetFiles(); + foreach (var fileInfo in fileInfos) + { + if (fileInfo.Name.EndsWith(".png")) + { + var name = fileInfo.Name.Substring(0, fileInfo.Name.Length - 4); + if (tileSetInfo.Sources.FindIndex(info => info.Name == name) < 0) + { + fileInfo.Delete(); + } + } + } + } + } + else + { + Directory.CreateDirectory(dir); + } + + var path = dir + "/TileSet.json"; + + //保存json + var options = new JsonSerializerOptions(); + options.WriteIndented = true; + var jsonText = JsonSerializer.Serialize(tileSetInfo, options); + File.WriteAllText(path, jsonText); + + //保存资源 + if (tileSetInfo.Sources != null) + { + foreach (var sourceInfo in tileSetInfo.Sources) + { + var image = sourceInfo.GetSourceImage(); + if (image != null) + { + image.SavePng(dir + "/" + sourceInfo.Name + ".png"); + } + } + } + } + //保存图块集 private static void OnTileSetSave(object o) { if (o is TileSetSplit tileSetSplit) { var tileSetInfo = tileSetSplit.TileSetInfo; - var dir = CustomMapPath + tileSetInfo.Name; - if (Directory.Exists(dir)) - { - //删除多余文件 - if (tileSetInfo.Sources == null) - { - Directory.Delete(dir, true); - } - else - { - var directoryInfo = new DirectoryInfo(dir); - var fileInfos = directoryInfo.GetFiles(); - foreach (var fileInfo in fileInfos) - { - if (fileInfo.Name.EndsWith(".png")) - { - var name = fileInfo.Name.Substring(0, fileInfo.Name.Length - 4); - if (tileSetInfo.Sources.FindIndex(info => info.Name == name) < 0) - { - fileInfo.Delete(); - } - } - } - } - } - Directory.CreateDirectory(dir); - - var path = dir + "/TileSet.json"; - - //保存json - var options = new JsonSerializerOptions(); - options.WriteIndented = true; - var jsonText = JsonSerializer.Serialize(tileSetInfo, options); - File.WriteAllText(path, jsonText); - - //保存资源 - if (tileSetInfo.Sources != null) - { - foreach (var sourceInfo in tileSetInfo.Sources) - { - if (sourceInfo.IsOverWriteImage()) - { - var image = sourceInfo.GetSourceImage(); - if (image != null) - { - image.SavePng(dir + "/" + sourceInfo.Name + ".png"); - } - } - } - } + SaveTileSetInfo(tileSetInfo); } } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/manager/EditorWindowManager.cs b/DungeonShooting_Godot/src/game/manager/EditorWindowManager.cs index aa6c018..0b9e948 100644 --- a/DungeonShooting_Godot/src/game/manager/EditorWindowManager.cs +++ b/DungeonShooting_Godot/src/game/manager/EditorWindowManager.cs @@ -1,14 +1,15 @@  using System; using System.Collections.Generic; +using System.IO; using Config; using Godot; using UI.EditorColorPicker; using UI.EditorImportCombination; +using UI.EditorInfo; using UI.EditorInput; using UI.EditorTips; using UI.EditorWindow; -using UI.MapEditorCreateGroup; using UI.MapEditorCreateMark; using UI.MapEditorCreatePreinstall; using UI.MapEditorCreateRoom; @@ -213,17 +214,36 @@ var window = CreateWindowInstance(parentUi); window.SetWindowTitle("创建地牢组"); window.SetWindowSize(new Vector2I(700, 500)); - var body = window.OpenBody(UiManager.UiNames.MapEditorCreateGroup); + var body = window.OpenBody(UiManager.UiNames.EditorInfo); window.SetButtonList( new EditorWindowPanel.ButtonData("确定", () => { //获取填写的数据, 并创建ui - var groupInfo = body.GetGroupInfo(); - if (groupInfo != null) + var infoData = body.GetInfoData(); + //组名 + var groupName = infoData.Name; + + //检查名称是否合规 + if (string.IsNullOrEmpty(groupName)) { - window.CloseWindow(); - onCreateGroup(groupInfo); + ShowTips("错误", "组名称不能为空!"); + return; } + + //验证是否有同名组 + var path = MapProjectManager.CustomMapPath + groupName; + var dir = new DirectoryInfo(path); + if (dir.Exists && dir.GetDirectories().Length > 0) + { + ShowTips("错误", $"已经有相同路径的房间了!"); + return; + } + + var group = new DungeonRoomGroup(); + group.GroupName = groupName; + group.Remark = infoData.Remark; + window.CloseWindow(); + onCreateGroup(group); }), new EditorWindowPanel.ButtonData("取消", () => { @@ -543,6 +563,84 @@ }) ); } + + /// + /// 显示创建TileSet的面板 + /// + /// 创建完成回调, 第一个参数为TileSet名称, 第二个参数数据数据 + /// 所属父级Ui + public static void ShowCreateTileSet(Action onCreateTileSet, UiBase parentUi = null) + { + var window = CreateWindowInstance(parentUi); + window.SetWindowTitle("创建TileSet"); + window.SetWindowSize(new Vector2I(700, 500)); + var body = window.OpenBody(UiManager.UiNames.EditorInfo); + window.SetButtonList( + new EditorWindowPanel.ButtonData("确定", () => + { + //获取填写的数据, 并创建ui + var infoData = body.GetInfoData(); + //名称 + var name = infoData.Name; + + //检查名称是否合规 + if (string.IsNullOrEmpty(name)) + { + ShowTips("错误", "名称不能为空!"); + return; + } + + //验证是否有同名组 + var path = EditorTileSetManager.CustomTileSetPath + name; + var dir = new DirectoryInfo(path); + if (dir.Exists && dir.GetFiles().Length > 0) + { + ShowTips("错误", $"已经有相同名称的TileSet了!"); + return; + } + + var tileSetSplit = new TileSetSplit(); + tileSetSplit.Remark = infoData.Remark; + tileSetSplit.Path = EditorTileSetManager.CustomTileSetPath + name; + window.CloseWindow(); + onCreateTileSet(infoData.Name, tileSetSplit); + }), + new EditorWindowPanel.ButtonData("取消", () => + { + window.CloseWindow(); + }) + ); + } + + /// + /// 显示编辑TileSet的面板 + /// + /// 原数据 + /// 创建完成回调, 第一个参数为TileSet名称, 第二个参数数据数据 + /// 所属父级Ui + public static void ShowEditTileSet(TileSetSplit tileSetSplit, Action onCreateTileSet, UiBase parentUi = null) + { + var window = CreateWindowInstance(parentUi); + window.SetWindowTitle("编辑TileSet"); + window.SetWindowSize(new Vector2I(700, 500)); + var body = window.OpenBody(UiManager.UiNames.EditorInfo); + body.InitData(new EditorInfoData(tileSetSplit.TileSetInfo.Name, tileSetSplit.Remark)); + body.SetNameInputEnable(false); + window.SetButtonList( + new EditorWindowPanel.ButtonData("确定", () => + { + //获取填写的数据, 并创建ui + var infoData = body.GetInfoData(); + tileSetSplit.Remark = infoData.Remark; + window.CloseWindow(); + onCreateTileSet(tileSetSplit); + }), + new EditorWindowPanel.ButtonData("取消", () => + { + window.CloseWindow(); + }) + ); + } private static EditorWindowPanel CreateWindowInstance(UiBase parentUi = null) { diff --git a/DungeonShooting_Godot/src/game/manager/UiManager_Methods.cs b/DungeonShooting_Godot/src/game/manager/UiManager_Methods.cs index db4c6e4..cd4187a 100644 --- a/DungeonShooting_Godot/src/game/manager/UiManager_Methods.cs +++ b/DungeonShooting_Godot/src/game/manager/UiManager_Methods.cs @@ -9,6 +9,7 @@ public const string Debugger = "Debugger"; public const string EditorColorPicker = "EditorColorPicker"; public const string EditorImportCombination = "EditorImportCombination"; + public const string EditorInfo = "EditorInfo"; public const string EditorInput = "EditorInput"; public const string EditorTips = "EditorTips"; public const string EditorTools = "EditorTools"; @@ -16,7 +17,6 @@ public const string Loading = "Loading"; public const string Main = "Main"; public const string MapEditor = "MapEditor"; - public const string MapEditorCreateGroup = "MapEditorCreateGroup"; public const string MapEditorCreateMark = "MapEditorCreateMark"; public const string MapEditorCreatePreinstall = "MapEditorCreatePreinstall"; public const string MapEditorCreateRoom = "MapEditorCreateRoom"; @@ -230,6 +230,54 @@ } /// + /// 创建 EditorInfo, 并返回UI实例, 该函数不会打开 Ui + /// + public static UI.EditorInfo.EditorInfoPanel Create_EditorInfo() + { + return CreateUi(UiNames.EditorInfo); + } + + /// + /// 打开 EditorInfo, 并返回UI实例 + /// + public static UI.EditorInfo.EditorInfoPanel Open_EditorInfo() + { + return OpenUi(UiNames.EditorInfo); + } + + /// + /// 隐藏 EditorInfo 的所有实例 + /// + public static void Hide_EditorInfo() + { + var uiInstance = Get_EditorInfo_Instance(); + foreach (var uiPanel in uiInstance) + { + uiPanel.HideUi(); + } + } + + /// + /// 销毁 EditorInfo 的所有实例 + /// + public static void Destroy_EditorInfo() + { + var uiInstance = Get_EditorInfo_Instance(); + foreach (var uiPanel in uiInstance) + { + uiPanel.Destroy(); + } + } + + /// + /// 获取所有 EditorInfo 的实例, 如果没有实例, 则返回一个空数组 + /// + public static UI.EditorInfo.EditorInfoPanel[] Get_EditorInfo_Instance() + { + return GetUiInstance(nameof(UI.EditorInfo.EditorInfo)); + } + + /// /// 创建 EditorInput, 并返回UI实例, 该函数不会打开 Ui /// public static UI.EditorInput.EditorInputPanel Create_EditorInput() @@ -566,54 +614,6 @@ } /// - /// 创建 MapEditorCreateGroup, 并返回UI实例, 该函数不会打开 Ui - /// - public static UI.MapEditorCreateGroup.MapEditorCreateGroupPanel Create_MapEditorCreateGroup() - { - return CreateUi(UiNames.MapEditorCreateGroup); - } - - /// - /// 打开 MapEditorCreateGroup, 并返回UI实例 - /// - public static UI.MapEditorCreateGroup.MapEditorCreateGroupPanel Open_MapEditorCreateGroup() - { - return OpenUi(UiNames.MapEditorCreateGroup); - } - - /// - /// 隐藏 MapEditorCreateGroup 的所有实例 - /// - public static void Hide_MapEditorCreateGroup() - { - var uiInstance = Get_MapEditorCreateGroup_Instance(); - foreach (var uiPanel in uiInstance) - { - uiPanel.HideUi(); - } - } - - /// - /// 销毁 MapEditorCreateGroup 的所有实例 - /// - public static void Destroy_MapEditorCreateGroup() - { - var uiInstance = Get_MapEditorCreateGroup_Instance(); - foreach (var uiPanel in uiInstance) - { - uiPanel.Destroy(); - } - } - - /// - /// 获取所有 MapEditorCreateGroup 的实例, 如果没有实例, 则返回一个空数组 - /// - public static UI.MapEditorCreateGroup.MapEditorCreateGroupPanel[] Get_MapEditorCreateGroup_Instance() - { - return GetUiInstance(nameof(UI.MapEditorCreateGroup.MapEditorCreateGroup)); - } - - /// /// 创建 MapEditorCreateMark, 并返回UI实例, 该函数不会打开 Ui /// public static UI.MapEditorCreateMark.MapEditorCreateMarkPanel Create_MapEditorCreateMark() diff --git a/DungeonShooting_Godot/src/game/ui/editorInfo/EditorInfo.cs b/DungeonShooting_Godot/src/game/ui/editorInfo/EditorInfo.cs new file mode 100644 index 0000000..be72937 --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/editorInfo/EditorInfo.cs @@ -0,0 +1,235 @@ +namespace UI.EditorInfo; + +/// +/// Ui代码, 该类是根据ui场景自动生成的, 请不要手动编辑该类, 以免造成代码丢失 +/// +public abstract partial class EditorInfo : UiBase +{ + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorInfo.MarginContainer + /// + public MarginContainer L_MarginContainer + { + get + { + if (_L_MarginContainer == null) _L_MarginContainer = new MarginContainer((EditorInfoPanel)this, GetNode("MarginContainer")); + return _L_MarginContainer; + } + } + private MarginContainer _L_MarginContainer; + + + public EditorInfo() : base(nameof(EditorInfo)) + { + } + + public sealed override void OnInitNestedUi() + { + + } + + /// + /// 类型: , 路径: EditorInfo.MarginContainer.VBoxContainer.HBoxContainer.NameLabel + /// + public class NameLabel : UiNode + { + public NameLabel(EditorInfoPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override NameLabel Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: EditorInfo.MarginContainer.VBoxContainer.HBoxContainer.NameInput + /// + public class NameInput : UiNode + { + public NameInput(EditorInfoPanel uiPanel, Godot.LineEdit node) : base(uiPanel, node) { } + public override NameInput Clone() => new (UiPanel, (Godot.LineEdit)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: EditorInfo.MarginContainer.VBoxContainer.HBoxContainer + /// + public class HBoxContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorInfo.MarginContainer.VBoxContainer.NameLabel + /// + public NameLabel L_NameLabel + { + get + { + if (_L_NameLabel == null) _L_NameLabel = new NameLabel(UiPanel, Instance.GetNode("NameLabel")); + return _L_NameLabel; + } + } + private NameLabel _L_NameLabel; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorInfo.MarginContainer.VBoxContainer.NameInput + /// + public NameInput L_NameInput + { + get + { + if (_L_NameInput == null) _L_NameInput = new NameInput(UiPanel, Instance.GetNode("NameInput")); + return _L_NameInput; + } + } + private NameInput _L_NameInput; + + public HBoxContainer(EditorInfoPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: EditorInfo.MarginContainer.VBoxContainer.HBoxContainer5.RemarkNameLabel + /// + public class RemarkNameLabel : UiNode + { + public RemarkNameLabel(EditorInfoPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override RemarkNameLabel Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: EditorInfo.MarginContainer.VBoxContainer.HBoxContainer5.RemarkInput + /// + public class RemarkInput : UiNode + { + public RemarkInput(EditorInfoPanel uiPanel, Godot.TextEdit node) : base(uiPanel, node) { } + public override RemarkInput Clone() => new (UiPanel, (Godot.TextEdit)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: EditorInfo.MarginContainer.VBoxContainer.HBoxContainer5 + /// + public class HBoxContainer5 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorInfo.MarginContainer.VBoxContainer.RemarkNameLabel + /// + public RemarkNameLabel L_RemarkNameLabel + { + get + { + if (_L_RemarkNameLabel == null) _L_RemarkNameLabel = new RemarkNameLabel(UiPanel, Instance.GetNode("RemarkNameLabel")); + return _L_RemarkNameLabel; + } + } + private RemarkNameLabel _L_RemarkNameLabel; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorInfo.MarginContainer.VBoxContainer.RemarkInput + /// + public RemarkInput L_RemarkInput + { + get + { + if (_L_RemarkInput == null) _L_RemarkInput = new RemarkInput(UiPanel, Instance.GetNode("RemarkInput")); + return _L_RemarkInput; + } + } + private RemarkInput _L_RemarkInput; + + public HBoxContainer5(EditorInfoPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer5 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: EditorInfo.MarginContainer.VBoxContainer + /// + public class VBoxContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorInfo.MarginContainer.HBoxContainer + /// + public HBoxContainer L_HBoxContainer + { + get + { + if (_L_HBoxContainer == null) _L_HBoxContainer = new HBoxContainer(UiPanel, Instance.GetNode("HBoxContainer")); + return _L_HBoxContainer; + } + } + private HBoxContainer _L_HBoxContainer; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorInfo.MarginContainer.HBoxContainer5 + /// + public HBoxContainer5 L_HBoxContainer5 + { + get + { + if (_L_HBoxContainer5 == null) _L_HBoxContainer5 = new HBoxContainer5(UiPanel, Instance.GetNode("HBoxContainer5")); + return _L_HBoxContainer5; + } + } + private HBoxContainer5 _L_HBoxContainer5; + + public VBoxContainer(EditorInfoPanel uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } + public override VBoxContainer Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: EditorInfo.MarginContainer + /// + public class MarginContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorInfo.VBoxContainer + /// + public VBoxContainer L_VBoxContainer + { + get + { + if (_L_VBoxContainer == null) _L_VBoxContainer = new VBoxContainer(UiPanel, Instance.GetNode("VBoxContainer")); + return _L_VBoxContainer; + } + } + private VBoxContainer _L_VBoxContainer; + + public MarginContainer(EditorInfoPanel uiPanel, Godot.MarginContainer node) : base(uiPanel, node) { } + public override MarginContainer Clone() => new (UiPanel, (Godot.MarginContainer)Instance.Duplicate()); + } + + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorInfo.MarginContainer.VBoxContainer.HBoxContainer.NameLabel + /// + public NameLabel S_NameLabel => L_MarginContainer.L_VBoxContainer.L_HBoxContainer.L_NameLabel; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorInfo.MarginContainer.VBoxContainer.HBoxContainer.NameInput + /// + public NameInput S_NameInput => L_MarginContainer.L_VBoxContainer.L_HBoxContainer.L_NameInput; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorInfo.MarginContainer.VBoxContainer.HBoxContainer + /// + public HBoxContainer S_HBoxContainer => L_MarginContainer.L_VBoxContainer.L_HBoxContainer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorInfo.MarginContainer.VBoxContainer.HBoxContainer5.RemarkNameLabel + /// + public RemarkNameLabel S_RemarkNameLabel => L_MarginContainer.L_VBoxContainer.L_HBoxContainer5.L_RemarkNameLabel; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorInfo.MarginContainer.VBoxContainer.HBoxContainer5.RemarkInput + /// + public RemarkInput S_RemarkInput => L_MarginContainer.L_VBoxContainer.L_HBoxContainer5.L_RemarkInput; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorInfo.MarginContainer.VBoxContainer.HBoxContainer5 + /// + public HBoxContainer5 S_HBoxContainer5 => L_MarginContainer.L_VBoxContainer.L_HBoxContainer5; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorInfo.MarginContainer.VBoxContainer + /// + public VBoxContainer S_VBoxContainer => L_MarginContainer.L_VBoxContainer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: EditorInfo.MarginContainer + /// + public MarginContainer S_MarginContainer => L_MarginContainer; + +} diff --git a/DungeonShooting_Godot/src/game/ui/editorInfo/EditorInfoPanel.cs b/DungeonShooting_Godot/src/game/ui/editorInfo/EditorInfoPanel.cs new file mode 100644 index 0000000..e31d364 --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/editorInfo/EditorInfoPanel.cs @@ -0,0 +1,31 @@ +using System.IO; + +namespace UI.EditorInfo; + +public partial class EditorInfoPanel : EditorInfo +{ + /// + /// 初始化数据 + /// + public void InitData(EditorInfoData infoData) + { + S_NameInput.Instance.Text = infoData.Name; + S_RemarkInput.Instance.Text = infoData.Remark; + } + + /// + /// 获取填写的数据 + /// + public EditorInfoData GetInfoData() + { + return new EditorInfoData(S_NameInput.Instance.Text, S_RemarkInput.Instance.Text); + } + + /// + /// 是否可以编辑名称输入框 + /// + public void SetNameInputEnable(bool v) + { + S_NameInput.Instance.Editable = v; + } +} diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorCreateGroup/MapEditorCreateGroup.cs b/DungeonShooting_Godot/src/game/ui/mapEditorCreateGroup/MapEditorCreateGroup.cs deleted file mode 100644 index 18be6a5..0000000 --- a/DungeonShooting_Godot/src/game/ui/mapEditorCreateGroup/MapEditorCreateGroup.cs +++ /dev/null @@ -1,234 +0,0 @@ -namespace UI.MapEditorCreateGroup; - -/// -/// Ui代码, 该类是根据ui场景自动生成的, 请不要手动编辑该类, 以免造成代码丢失 -/// -public abstract partial class MapEditorCreateGroup : UiBase -{ - /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateGroup.MarginContainer - /// - public MarginContainer L_MarginContainer - { - get - { - if (_L_MarginContainer == null) _L_MarginContainer = new MarginContainer(this, GetNodeOrNull("MarginContainer")); - return _L_MarginContainer; - } - } - private MarginContainer _L_MarginContainer; - - - public MapEditorCreateGroup() : base(nameof(MapEditorCreateGroup)) - { - } - - public sealed override void OnInitNestedUi() - { - } - - /// - /// 类型: , 路径: MapEditorCreateGroup.MarginContainer.VBoxContainer.HBoxContainer.GroupNameLabel - /// - public class GroupNameLabel : UiNode - { - public GroupNameLabel(MapEditorCreateGroup uiPanel, Godot.Label node) : base(uiPanel, node) { } - public override GroupNameLabel Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); - } - - /// - /// 类型: , 路径: MapEditorCreateGroup.MarginContainer.VBoxContainer.HBoxContainer.GroupNameInput - /// - public class GroupNameInput : UiNode - { - public GroupNameInput(MapEditorCreateGroup uiPanel, Godot.LineEdit node) : base(uiPanel, node) { } - public override GroupNameInput Clone() => new (UiPanel, (Godot.LineEdit)Instance.Duplicate()); - } - - /// - /// 类型: , 路径: MapEditorCreateGroup.MarginContainer.VBoxContainer.HBoxContainer - /// - public class HBoxContainer : UiNode - { - /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateGroup.MarginContainer.VBoxContainer.GroupNameLabel - /// - public GroupNameLabel L_GroupNameLabel - { - get - { - if (_L_GroupNameLabel == null) _L_GroupNameLabel = new GroupNameLabel(UiPanel, Instance.GetNodeOrNull("GroupNameLabel")); - return _L_GroupNameLabel; - } - } - private GroupNameLabel _L_GroupNameLabel; - - /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateGroup.MarginContainer.VBoxContainer.GroupNameInput - /// - public GroupNameInput L_GroupNameInput - { - get - { - if (_L_GroupNameInput == null) _L_GroupNameInput = new GroupNameInput(UiPanel, Instance.GetNodeOrNull("GroupNameInput")); - return _L_GroupNameInput; - } - } - private GroupNameInput _L_GroupNameInput; - - public HBoxContainer(MapEditorCreateGroup uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } - public override HBoxContainer Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); - } - - /// - /// 类型: , 路径: MapEditorCreateGroup.MarginContainer.VBoxContainer.HBoxContainer5.RemarkNameLabel - /// - public class RemarkNameLabel : UiNode - { - public RemarkNameLabel(MapEditorCreateGroup uiPanel, Godot.Label node) : base(uiPanel, node) { } - public override RemarkNameLabel Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); - } - - /// - /// 类型: , 路径: MapEditorCreateGroup.MarginContainer.VBoxContainer.HBoxContainer5.RemarkInput - /// - public class RemarkInput : UiNode - { - public RemarkInput(MapEditorCreateGroup uiPanel, Godot.TextEdit node) : base(uiPanel, node) { } - public override RemarkInput Clone() => new (UiPanel, (Godot.TextEdit)Instance.Duplicate()); - } - - /// - /// 类型: , 路径: MapEditorCreateGroup.MarginContainer.VBoxContainer.HBoxContainer5 - /// - public class HBoxContainer5 : UiNode - { - /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateGroup.MarginContainer.VBoxContainer.RemarkNameLabel - /// - public RemarkNameLabel L_RemarkNameLabel - { - get - { - if (_L_RemarkNameLabel == null) _L_RemarkNameLabel = new RemarkNameLabel(UiPanel, Instance.GetNodeOrNull("RemarkNameLabel")); - return _L_RemarkNameLabel; - } - } - private RemarkNameLabel _L_RemarkNameLabel; - - /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateGroup.MarginContainer.VBoxContainer.RemarkInput - /// - public RemarkInput L_RemarkInput - { - get - { - if (_L_RemarkInput == null) _L_RemarkInput = new RemarkInput(UiPanel, Instance.GetNodeOrNull("RemarkInput")); - return _L_RemarkInput; - } - } - private RemarkInput _L_RemarkInput; - - public HBoxContainer5(MapEditorCreateGroup uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } - public override HBoxContainer5 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); - } - - /// - /// 类型: , 路径: MapEditorCreateGroup.MarginContainer.VBoxContainer - /// - public class VBoxContainer : UiNode - { - /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateGroup.MarginContainer.HBoxContainer - /// - public HBoxContainer L_HBoxContainer - { - get - { - if (_L_HBoxContainer == null) _L_HBoxContainer = new HBoxContainer(UiPanel, Instance.GetNodeOrNull("HBoxContainer")); - return _L_HBoxContainer; - } - } - private HBoxContainer _L_HBoxContainer; - - /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateGroup.MarginContainer.HBoxContainer5 - /// - public HBoxContainer5 L_HBoxContainer5 - { - get - { - if (_L_HBoxContainer5 == null) _L_HBoxContainer5 = new HBoxContainer5(UiPanel, Instance.GetNodeOrNull("HBoxContainer5")); - return _L_HBoxContainer5; - } - } - private HBoxContainer5 _L_HBoxContainer5; - - public VBoxContainer(MapEditorCreateGroup uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } - public override VBoxContainer Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); - } - - /// - /// 类型: , 路径: MapEditorCreateGroup.MarginContainer - /// - public class MarginContainer : UiNode - { - /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorCreateGroup.VBoxContainer - /// - public VBoxContainer L_VBoxContainer - { - get - { - if (_L_VBoxContainer == null) _L_VBoxContainer = new VBoxContainer(UiPanel, Instance.GetNodeOrNull("VBoxContainer")); - return _L_VBoxContainer; - } - } - private VBoxContainer _L_VBoxContainer; - - public MarginContainer(MapEditorCreateGroup uiPanel, Godot.MarginContainer node) : base(uiPanel, node) { } - public override MarginContainer Clone() => new (UiPanel, (Godot.MarginContainer)Instance.Duplicate()); - } - - - /// - /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateGroup.MarginContainer.VBoxContainer.HBoxContainer.GroupNameLabel - /// - public GroupNameLabel S_GroupNameLabel => L_MarginContainer.L_VBoxContainer.L_HBoxContainer.L_GroupNameLabel; - - /// - /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateGroup.MarginContainer.VBoxContainer.HBoxContainer.GroupNameInput - /// - public GroupNameInput S_GroupNameInput => L_MarginContainer.L_VBoxContainer.L_HBoxContainer.L_GroupNameInput; - - /// - /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateGroup.MarginContainer.VBoxContainer.HBoxContainer - /// - public HBoxContainer S_HBoxContainer => L_MarginContainer.L_VBoxContainer.L_HBoxContainer; - - /// - /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateGroup.MarginContainer.VBoxContainer.HBoxContainer5.RemarkNameLabel - /// - public RemarkNameLabel S_RemarkNameLabel => L_MarginContainer.L_VBoxContainer.L_HBoxContainer5.L_RemarkNameLabel; - - /// - /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateGroup.MarginContainer.VBoxContainer.HBoxContainer5.RemarkInput - /// - public RemarkInput S_RemarkInput => L_MarginContainer.L_VBoxContainer.L_HBoxContainer5.L_RemarkInput; - - /// - /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateGroup.MarginContainer.VBoxContainer.HBoxContainer5 - /// - public HBoxContainer5 S_HBoxContainer5 => L_MarginContainer.L_VBoxContainer.L_HBoxContainer5; - - /// - /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateGroup.MarginContainer.VBoxContainer - /// - public VBoxContainer S_VBoxContainer => L_MarginContainer.L_VBoxContainer; - - /// - /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorCreateGroup.MarginContainer - /// - public MarginContainer S_MarginContainer => L_MarginContainer; - -} diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorCreateGroup/MapEditorCreateGroupPanel.cs b/DungeonShooting_Godot/src/game/ui/mapEditorCreateGroup/MapEditorCreateGroupPanel.cs deleted file mode 100644 index cbc213d..0000000 --- a/DungeonShooting_Godot/src/game/ui/mapEditorCreateGroup/MapEditorCreateGroupPanel.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.IO; -using System.Text.RegularExpressions; -using Godot; - -namespace UI.MapEditorCreateGroup; - -public partial class MapEditorCreateGroupPanel : MapEditorCreateGroup -{ - - /// - /// 填完数据后获取数据对象, 并进行验证, 如果验证失败, 则返回 null - /// - public DungeonRoomGroup GetGroupInfo() - { - //组名 - var groupName = S_GroupNameInput.Instance.Text; - - //检查名称是否合规 - if (string.IsNullOrEmpty(groupName)) - { - EditorWindowManager.ShowTips("错误", "组名称不能为空!"); - return null; - } - - //验证是否有同名组 - var path = MapProjectManager.CustomMapPath + groupName; - var dir = new DirectoryInfo(path); - if (dir.Exists && dir.GetDirectories().Length > 0) - { - EditorWindowManager.ShowTips("错误", $"已经有相同路径的房间了!"); - return null; - } - - var group = new DungeonRoomGroup(); - group.GroupName = groupName; - group.Remark = S_RemarkInput.Instance.Text; - return group; - } -} diff --git a/DungeonShooting_Godot/src/game/ui/tileSetEditorCombination/leftBottom/TileEditArea.cs b/DungeonShooting_Godot/src/game/ui/tileSetEditorCombination/leftBottom/TileEditArea.cs index 3691683..8c83f4f 100644 --- a/DungeonShooting_Godot/src/game/ui/tileSetEditorCombination/leftBottom/TileEditArea.cs +++ b/DungeonShooting_Godot/src/game/ui/tileSetEditorCombination/leftBottom/TileEditArea.cs @@ -134,7 +134,7 @@ UiNode.L_TileTexture.Instance.Size = UiNode.L_TileTexture.Instance.Texture.GetSize(); _maskGrid.RemoveAll(); _useMask.Clear(); - _maskGrid.SetColumns(width); + _maskGrid.SetColumns(Mathf.Max(1, width)); for (var i = 0; i < width; i++) { for (var j = 0; j < height; j++) diff --git a/DungeonShooting_Godot/src/game/ui/tileSetEditorProject/TileSetEditorProjectPanel.cs b/DungeonShooting_Godot/src/game/ui/tileSetEditorProject/TileSetEditorProjectPanel.cs index c447b3a..07a51c2 100644 --- a/DungeonShooting_Godot/src/game/ui/tileSetEditorProject/TileSetEditorProjectPanel.cs +++ b/DungeonShooting_Godot/src/game/ui/tileSetEditorProject/TileSetEditorProjectPanel.cs @@ -23,9 +23,15 @@ { OpenPrevUi(); }; - + //搜索按钮 S_TileSearchButton.Instance.Pressed += OnSearchClick; - + //创建按钮 + S_TileAddButton.Instance.Pressed += OnAddClick; + //删除按钮 + S_TileDeleteButton.Instance.Pressed += OnDeleteClick; + //编辑按钮 + S_TileEditButton.Instance.Pressed += OnEditClick; + Grid = CreateUiGrid(S_TileButton); Grid.SetColumns(1); Grid.SetCellOffset(new Vector2I(0, 5)); @@ -62,8 +68,74 @@ } } + //搜索 private void OnSearchClick() { SearchData(S_TileSearchInput.Instance.Text); } + + //创建 + private void OnAddClick() + { + EditorWindowManager.ShowCreateTileSet((name, split) => + { + //创建TileSetInfo + var tileSetInfo = new TileSetInfo(); + tileSetInfo.InitData(); + tileSetInfo.Name = name; + split.SetTileSetInfo(tileSetInfo); + GameApplication.Instance.TileSetConfig.Add(name, split); + //保存TileSetInfo + EditorTileSetManager.SaveTileSetInfo(tileSetInfo); + //保存TileSetSplit数据 + EditorTileSetManager.SaveTileSetConfig(); + //刷新 + OnSearchClick(); + }); + } + + //删除 + private void OnDeleteClick() + { + if (Grid.SelectIndex < 0) + { + EditorWindowManager.ShowTips("提示", "请选择要删除的TileSet!"); + return; + } + + var tileSetSplit = Grid.SelectData; + //这里要判断是否引用, 后面再做 + + //删除数据 + EditorWindowManager.ShowConfirm("提示", "确认删除该TileSet吗,删除后无法恢复!", (v) => + { + if (v) + { + Directory.Delete(EditorTileSetManager.CustomTileSetPath + tileSetSplit.TileSetInfo.Name, true); + GameApplication.Instance.TileSetConfig.Remove(tileSetSplit.TileSetInfo.Name); + EditorTileSetManager.SaveTileSetConfig(); + tileSetSplit.TileSetInfo.Dispose(); + //刷新 + OnSearchClick(); + } + }); + } + + //编辑按钮 + private void OnEditClick() + { + if (Grid.SelectIndex < 0) + { + EditorWindowManager.ShowTips("提示", "请选择要删除的TileSet!"); + return; + } + + var tileSetSplit = Grid.SelectData; + EditorWindowManager.ShowEditTileSet(tileSetSplit, (v) => + { + EditorTileSetManager.SaveTileSetConfig(); + //刷新 + OnSearchClick(); + }); + } }