diff --git a/DungeonShooting_Godot/prefab/ui/EditorTools.tscn b/DungeonShooting_Godot/prefab/ui/EditorTools.tscn index 8dd3024..292c2c9 100644 --- a/DungeonShooting_Godot/prefab/ui/EditorTools.tscn +++ b/DungeonShooting_Godot/prefab/ui/EditorTools.tscn @@ -96,11 +96,25 @@ layout_mode = 2 text = "创建地牢房间" -[node name="LineEdit" type="LineEdit" parent="ScrollContainer/MarginContainer/VBoxContainer/HBoxContainer6"] +[node name="RoomNameInput" type="LineEdit" parent="ScrollContainer/MarginContainer/VBoxContainer/HBoxContainer6"] custom_minimum_size = Vector2(400, 0) layout_mode = 2 placeholder_text = "请输入房间名称" +[node name="Label2" type="Label" parent="ScrollContainer/MarginContainer/VBoxContainer/HBoxContainer6"] +layout_mode = 2 +text = "房间所属分组" + +[node name="RoomGroupSelect" type="OptionButton" parent="ScrollContainer/MarginContainer/VBoxContainer/HBoxContainer6"] +layout_mode = 2 + +[node name="Label3" type="Label" parent="ScrollContainer/MarginContainer/VBoxContainer/HBoxContainer6"] +layout_mode = 2 +text = "房间类型" + +[node name="RoomTypeSelect" type="OptionButton" parent="ScrollContainer/MarginContainer/VBoxContainer/HBoxContainer6"] +layout_mode = 2 + [node name="Button" type="Button" parent="ScrollContainer/MarginContainer/VBoxContainer/HBoxContainer6"] layout_mode = 2 text = "创建 diff --git a/DungeonShooting_Godot/prefab/ui/MyUi.tscn b/DungeonShooting_Godot/prefab/ui/MyUi.tscn deleted file mode 100644 index 560b4ae..0000000 --- a/DungeonShooting_Godot/prefab/ui/MyUi.tscn +++ /dev/null @@ -1,27 +0,0 @@ -[gd_scene load_steps=2 format=3 uid="uid://buxit3x615xu3"] - -[ext_resource type="Script" path="res://src/game/ui/myUi/MyUiPanel.cs" id="1_bhjxh"] - -[node name="MyUi" 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_bhjxh") - -[node name="Button" type="Button" parent="."] -layout_mode = 0 -offset_right = 12.0 -offset_bottom = 8.0 - -[node name="Control" type="Control" parent="."] -anchors_preset = 0 -offset_right = 40.0 -offset_bottom = 40.0 - -[node name="Label" type="Label" parent="Control"] -layout_mode = 0 -offset_right = 9.0 -offset_bottom = 49.0 diff --git a/DungeonShooting_Godot/resource/map/RoomConfig.json b/DungeonShooting_Godot/resource/map/RoomConfig.json index 12c1bde..dac7d62 100644 --- a/DungeonShooting_Godot/resource/map/RoomConfig.json +++ b/DungeonShooting_Godot/resource/map/RoomConfig.json @@ -27,7 +27,12 @@ "ConfigPath": "res://resource/map/tiledata/testGroup/battle/Room6.json" } ], - "InletList": [], + "InletList": [ + { + "ScenePath": "res://resource/map/tileMaps/testGroup/inlet/Room1.tscn", + "ConfigPath": "res://resource/map/tiledata/testGroup/inlet/Room1.json" + } + ], "OutletList": [], "BossList": [], "RewardList": [], diff --git a/DungeonShooting_Godot/resource/map/tileMaps/testGroup/inlet/Room1.tscn b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/inlet/Room1.tscn new file mode 100644 index 0000000..87a5beb --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tileMaps/testGroup/inlet/Room1.tscn @@ -0,0 +1,15 @@ +[gd_scene load_steps=4 format=3 uid="uid://dmeb88jotqro6"] + +[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileset/TileSet1.tres" id="1_gh7sf"] +[ext_resource type="Script" path="res://src/framework/map/mark/PlayerBirthMark.cs" id="3_3iyr5"] +[ext_resource type="Script" path="res://src/framework/map/DungeonRoomTemplate.cs" id="dungeonRoomTemplate"] + +[node name="Room1" type="TileMap"] +tile_set = ExtResource("1_gh7sf") +format = 2 +layer_0/tile_data = PackedInt32Array(327689, 0, 8, 262153, 0, 8, 196617, 0, 8, 131081, 0, 8, 65545, 0, 8, 9, 0, 8, 327688, 0, 8, 262152, 0, 8, 196616, 0, 8, 131080, 0, 8, 65544, 0, 8, 8, 0, 8, 327687, 0, 8, 262151, 0, 8, 196615, 0, 8, 131079, 0, 8, 65543, 0, 8, 7, 0, 8, 327686, 0, 8, 262150, 0, 8, 196614, 0, 8, 131078, 0, 8, 65542, 0, 8, 6, 0, 8, 327685, 0, 8, 262149, 0, 8, 196613, 0, 8, 131077, 0, 8, 65541, 0, 8, 5, 0, 8, 327684, 0, 8, 262148, 0, 8, 196612, 0, 8, 131076, 0, 8, 65540, 0, 8, 4, 0, 8, 327683, 0, 8, 262147, 0, 8, 196611, 0, 8, 131075, 0, 8, 65539, 0, 8, 3, 0, 8, 327682, 0, 8, 262146, 0, 8, 196610, 0, 8, 131074, 0, 8, 65538, 0, 8, 2, 0, 8, 327681, 0, 8, 262145, 0, 8, 196609, 0, 8, 131073, 0, 8, 65537, 0, 8, 1, 0, 8, 327680, 0, 8, 262144, 0, 8, 196608, 0, 8, 131072, 0, 8, 65536, 0, 8, 0, 0, 8, 131071, 196608, 3, 65535, 196608, 3, -1, 196608, 4, -65536, 131072, 7, -65535, 131072, 7, 196607, 196608, 3, 262143, 196608, 3, 327679, 196608, 3, 393215, 196608, 3, 393217, 131072, 2, 393216, 131072, 2, 458751, 720896, 2, -65534, 131072, 7, 393218, 131072, 2, -65533, 131072, 7, 393219, 131072, 2, -65532, 131072, 7, 393220, 131072, 2, -65531, 131072, 7, 393221, 131072, 2, -65530, 131072, 7, 393222, 131072, 2, -65529, 131072, 7, 393223, 131072, 2, -65528, 131072, 7, 393224, 131072, 2, -65527, 131072, 7, 393225, 131072, 2, 10, 65536, 3, 65546, 65536, 3, -65526, 65536, 4, 131082, 65536, 3, 196618, 65536, 3, 262154, 65536, 3, 327690, 65536, 3, 393226, 851968, 2) +script = ExtResource("dungeonRoomTemplate") + +[node name="PlayerBirthMark" type="Node2D" parent="."] +position = Vector2(80, 48) +script = ExtResource("3_3iyr5") diff --git a/DungeonShooting_Godot/resource/map/tiledata/testGroup/inlet/Room1.json b/DungeonShooting_Godot/resource/map/tiledata/testGroup/inlet/Room1.json new file mode 100644 index 0000000..1a65117 --- /dev/null +++ b/DungeonShooting_Godot/resource/map/tiledata/testGroup/inlet/Room1.json @@ -0,0 +1,37 @@ +{ + "Position": { + "X": -1, + "Y": -1 + }, + "Size": { + "X": 12, + "Y": 8 + }, + "DoorAreaInfos": [], + "NavigationList": [ + { + "Type": 0, + "Points": [ + { + "X": 8, + "Y": 8 + }, + { + "X": 152, + "Y": 8 + }, + { + "X": 152, + "Y": 88 + }, + { + "X": 8, + "Y": 88 + } + ] + } + ], + "GroupName": "testGroup", + "RoomType": 1, + "FileName": "Room1" +} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/theme/mainTheme.tres b/DungeonShooting_Godot/resource/theme/mainTheme.tres index d359406..c36431c 100644 --- a/DungeonShooting_Godot/resource/theme/mainTheme.tres +++ b/DungeonShooting_Godot/resource/theme/mainTheme.tres @@ -352,7 +352,7 @@ [sub_resource type="ImageTexture" id="58"] -[sub_resource type="Image" id="Image_ff0la"] +[sub_resource type="Image" id="Image_56vuh"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 1, 255, 255, 255, 39, 255, 255, 255, 67, 255, 255, 255, 67, 255, 255, 255, 39, 255, 255, 255, 1, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 39, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 39, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 66, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 66, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 66, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 66, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 39, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 75, 255, 255, 255, 39, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 1, 255, 255, 255, 39, 255, 255, 255, 67, 255, 255, 255, 67, 255, 255, 255, 39, 255, 255, 255, 1, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -362,7 +362,7 @@ } [sub_resource type="ImageTexture" id="60"] -image = SubResource("Image_ff0la") +image = SubResource("Image_56vuh") [sub_resource type="StyleBoxTexture" id="61"] content_margin_left = 2.0 @@ -372,7 +372,7 @@ texture = SubResource("60") region_rect = Rect2(0, 0, 12, 12) -[sub_resource type="Image" id="Image_r73sc"] +[sub_resource type="Image" id="Image_owql0"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 247, 247, 247, 0, 248, 248, 248, 0, 248, 248, 248, 0, 247, 247, 247, 0, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 191, 191, 191, 4, 247, 247, 247, 98, 248, 248, 248, 167, 248, 248, 248, 167, 247, 247, 247, 98, 191, 191, 191, 4, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 247, 247, 247, 0, 247, 247, 247, 97, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 247, 247, 247, 97, 247, 247, 247, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 248, 248, 248, 0, 248, 248, 248, 164, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 164, 248, 248, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 248, 248, 248, 0, 248, 248, 248, 164, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 164, 248, 248, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 247, 247, 247, 0, 247, 247, 247, 97, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 248, 248, 248, 186, 247, 247, 247, 97, 247, 247, 247, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 191, 191, 191, 4, 247, 247, 247, 98, 248, 248, 248, 167, 248, 248, 248, 167, 247, 247, 247, 98, 191, 191, 191, 4, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 191, 191, 0, 247, 247, 247, 0, 248, 248, 248, 0, 248, 248, 248, 0, 247, 247, 247, 0, 191, 191, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -382,7 +382,7 @@ } [sub_resource type="ImageTexture" id="63"] -image = SubResource("Image_r73sc") +image = SubResource("Image_owql0") [sub_resource type="StyleBoxTexture" id="64"] content_margin_left = 2.0 @@ -392,7 +392,7 @@ texture = SubResource("63") region_rect = Rect2(0, 0, 12, 12) -[sub_resource type="Image" id="Image_rfiw1"] +[sub_resource type="Image" id="Image_f3n08"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 127, 127, 127, 4, 173, 173, 173, 97, 173, 173, 173, 166, 173, 173, 173, 166, 173, 173, 173, 97, 127, 127, 127, 4, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 172, 172, 172, 0, 172, 172, 172, 96, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 172, 172, 172, 96, 172, 172, 172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 173, 173, 173, 0, 173, 173, 173, 163, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 163, 173, 173, 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 173, 173, 173, 0, 173, 173, 173, 163, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 163, 173, 173, 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 172, 172, 172, 0, 172, 172, 172, 96, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 173, 173, 173, 185, 172, 172, 172, 96, 172, 172, 172, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 127, 127, 127, 4, 173, 173, 173, 97, 173, 173, 173, 166, 173, 173, 173, 166, 173, 173, 173, 97, 127, 127, 127, 4, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 127, 127, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 173, 173, 173, 0, 127, 127, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -402,7 +402,7 @@ } [sub_resource type="ImageTexture" id="66"] -image = SubResource("Image_rfiw1") +image = SubResource("Image_f3n08") [sub_resource type="StyleBoxTexture" id="67"] content_margin_left = 2.0 @@ -412,7 +412,7 @@ texture = SubResource("66") region_rect = Rect2(0, 0, 12, 12) -[sub_resource type="Image" id="Image_t6bx1"] +[sub_resource type="Image" id="Image_am8gf"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 4, 255, 255, 255, 16, 255, 255, 255, 16, 255, 255, 255, 4, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 16, 255, 255, 255, 21, 255, 255, 255, 21, 255, 255, 255, 16, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 16, 255, 255, 255, 21, 255, 255, 255, 21, 255, 255, 255, 16, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 4, 255, 255, 255, 16, 255, 255, 255, 16, 255, 255, 255, 4, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -422,7 +422,7 @@ } [sub_resource type="ImageTexture" id="69"] -image = SubResource("Image_t6bx1") +image = SubResource("Image_am8gf") [sub_resource type="StyleBoxTexture" id="70"] content_margin_left = 0.0 @@ -446,7 +446,7 @@ content_margin_right = 4.0 content_margin_bottom = 4.0 -[sub_resource type="Image" id="Image_4snrh"] +[sub_resource type="Image" id="Image_p4t5b"] data = { "data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 76, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 76, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 76, 255, 255, 255, 228, 255, 255, 255, 188, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 188, 255, 255, 255, 228, 255, 255, 255, 76, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 18, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 187, 255, 255, 255, 17, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 187, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 18, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 185, 255, 255, 255, 17, 255, 255, 255, 17, 255, 255, 255, 186, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 190, 255, 255, 255, 229, 255, 255, 255, 185, 255, 255, 255, 185, 255, 255, 255, 229, 255, 255, 255, 189, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 191, 255, 255, 255, 229, 255, 255, 255, 229, 255, 255, 255, 190, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 187, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 187, 255, 255, 255, 229, 255, 255, 255, 188, 255, 255, 255, 18, 255, 255, 255, 19, 255, 255, 255, 188, 255, 255, 255, 229, 255, 255, 255, 186, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 17, 255, 255, 255, 185, 255, 255, 255, 229, 255, 255, 255, 189, 255, 255, 255, 19, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 189, 255, 255, 255, 229, 255, 255, 255, 185, 255, 255, 255, 17, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 76, 255, 255, 255, 229, 255, 255, 255, 190, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 190, 255, 255, 255, 229, 255, 255, 255, 76, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 77, 255, 255, 255, 19, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 19, 255, 255, 255, 77, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), "format": "RGBA8", @@ -456,7 +456,7 @@ } [sub_resource type="ImageTexture" id="56"] -image = SubResource("Image_4snrh") +image = SubResource("Image_p4t5b") [sub_resource type="StyleBoxFlat" id="57"] content_margin_left = 6.0 diff --git a/DungeonShooting_Godot/src/framework/generator/DungeonRoomGenerator.cs b/DungeonShooting_Godot/src/framework/generator/DungeonRoomGenerator.cs index ab35659..fb9ba47 100644 --- a/DungeonShooting_Godot/src/framework/generator/DungeonRoomGenerator.cs +++ b/DungeonShooting_Godot/src/framework/generator/DungeonRoomGenerator.cs @@ -16,12 +16,11 @@ /// /// 根据名称在编辑器中创建地牢的预制房间, open 表示创建完成后是否在编辑器中打开这个房间 /// - public static bool CreateDungeonRoom(string groupName, DungeonRoomType type, string roomName, bool open = false) + public static bool CreateDungeonRoom(string groupName, string roomType, string roomName, bool open = false) { try { - var path = GameConfig.RoomTileDir + "/" + groupName + "/" + - DungeonRoomTemplate.DungeonRoomTypeToString(type); + var path = GameConfig.RoomTileDir + groupName + "/" + roomType; if (!Directory.Exists(path)) { Directory.CreateDirectory(path); diff --git a/DungeonShooting_Godot/src/framework/map/DungeonGenerator.cs b/DungeonShooting_Godot/src/framework/map/DungeonGenerator.cs index 331815b..0967eca 100644 --- a/DungeonShooting_Godot/src/framework/map/DungeonGenerator.cs +++ b/DungeonShooting_Godot/src/framework/map/DungeonGenerator.cs @@ -113,14 +113,14 @@ if (StartRoom != null) return; //第一个房间 - GenerateRoom(null, 0, out var startRoom); + GenerateRoom(null, 0, DungeonRoomType.Inlet, out var startRoom); StartRoom = startRoom; //如果房间数量不够, 就一直生成 while (_count < _maxCount) { var room = Utils.RandomChoose(RoomInfos); - var errorCode = GenerateRoom(room, Utils.RandomRangeInt(0, 3), out var nextRoom); + var errorCode = GenerateRoom(room, Utils.RandomRangeInt(0, 3), DungeonRoomType.Battle, out var nextRoom); if (errorCode == GenerateRoomErrorCode.NoError) { _failCount = 0; @@ -146,7 +146,7 @@ } //生成房间 - private GenerateRoomErrorCode GenerateRoom(RoomInfo prevRoomInfo, int direction, out RoomInfo resultRoom) + private GenerateRoomErrorCode GenerateRoom(RoomInfo prevRoomInfo, int direction, DungeonRoomType roomType, out RoomInfo resultRoom) { if (_count >= _maxCount) { @@ -155,7 +155,7 @@ } //随机选择一个房间 - var roomSplit = Utils.RandomChoose(GameApplication.Instance.RoomConfig[_groupName].BattleList); + var roomSplit = Utils.RandomChoose(GameApplication.Instance.RoomConfig[_groupName].GetRoomList(roomType)); //var roomSplit = GameApplication.Instance.RoomConfig[1]; var room = new RoomInfo(_count, roomSplit); @@ -267,7 +267,7 @@ while (dirList.Count > 0) { var randDir = Utils.RandomChoose(dirList); - GenerateRoom(room, randDir, out var nextRoom); + GenerateRoom(room, randDir, DungeonRoomType.Battle, out var nextRoom); if (nextRoom == null) { break; diff --git a/DungeonShooting_Godot/src/framework/map/DungeonRoomTemplate.cs b/DungeonShooting_Godot/src/framework/map/DungeonRoomTemplate.cs index 983b32d..7f6025d 100644 --- a/DungeonShooting_Godot/src/framework/map/DungeonRoomTemplate.cs +++ b/DungeonShooting_Godot/src/framework/map/DungeonRoomTemplate.cs @@ -944,6 +944,26 @@ return "battle"; } + + + /// + /// 将房间类型枚举转为描述字符串 + /// + public static string DungeonRoomTypeToDescribeString(DungeonRoomType roomType) + { + switch (roomType) + { + case DungeonRoomType.Battle: return "战斗房间"; + case DungeonRoomType.Inlet: return "起始房间"; + case DungeonRoomType.Outlet: return "结束房间"; + case DungeonRoomType.Boss: return "boss战房间"; + case DungeonRoomType.Reward: return "奖励房间"; + case DungeonRoomType.Shop: return "商店房间"; + case DungeonRoomType.Event: return "事件房间"; + } + + return "战斗房间"; + } #endif /// diff --git a/DungeonShooting_Godot/src/framework/map/mark/PlayerBirthMark.cs b/DungeonShooting_Godot/src/framework/map/mark/PlayerBirthMark.cs index 53c38d4..fd51265 100644 --- a/DungeonShooting_Godot/src/framework/map/mark/PlayerBirthMark.cs +++ b/DungeonShooting_Godot/src/framework/map/mark/PlayerBirthMark.cs @@ -1,8 +1,18 @@  using Godot; +/// +/// 玩家生成标记 +/// [Tool] public partial class PlayerBirthMark : ActivityMark { - + public override void _Ready() + { + DrawColor = Colors.Green; + } + + public override void Doing(RoomInfo roomInfo) + { + } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/mark/WeaponMark.cs b/DungeonShooting_Godot/src/framework/map/mark/WeaponMark.cs index 190ac94..a4279a2 100644 --- a/DungeonShooting_Godot/src/framework/map/mark/WeaponMark.cs +++ b/DungeonShooting_Godot/src/framework/map/mark/WeaponMark.cs @@ -21,7 +21,7 @@ public override void _Ready() { - DrawColor = Colors.Green; + DrawColor = Colors.Blue; Type = ActivityIdPrefix.ActivityPrefixType.Weapon; Layer = RoomLayerEnum.NormalLayer; } diff --git a/DungeonShooting_Godot/src/game/manager/UiManager_Methods.cs b/DungeonShooting_Godot/src/game/manager/UiManager_Methods.cs index f6fa6c3..91aaa92 100644 --- a/DungeonShooting_Godot/src/game/manager/UiManager_Methods.cs +++ b/DungeonShooting_Godot/src/game/manager/UiManager_Methods.cs @@ -7,7 +7,6 @@ public static class UiName { public const string EditorTools = "EditorTools"; - public const string MyUi = "MyUi"; public const string RoomUI = "RoomUI"; } @@ -28,22 +27,6 @@ } /// - /// 打开 MyUi, 并返回UI实例 - /// - public static UI.MyUi.MyUiPanel Open_MyUi() - { - return OpenUi(UiName.MyUi); - } - - /// - /// 获取所有 MyUi 的实例, 如果没有实例, 则返回一个空数组 - /// - public static UI.MyUi.MyUiPanel[] Get_MyUi_Instance() - { - return GetUiInstance(nameof(UI.MyUi.MyUi)); - } - - /// /// 打开 RoomUI, 并返回UI实例 /// public static UI.RoomUI.RoomUIPanel Open_RoomUI() diff --git a/DungeonShooting_Godot/src/game/ui/editorTools/EditorTools.cs b/DungeonShooting_Godot/src/game/ui/editorTools/EditorTools.cs index ca9d027..a33e0f6 100644 --- a/DungeonShooting_Godot/src/game/ui/editorTools/EditorTools.cs +++ b/DungeonShooting_Godot/src/game/ui/editorTools/EditorTools.cs @@ -293,12 +293,48 @@ } /// - /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer6.LineEdit + /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer6.RoomNameInput /// - public class UiNode1_LineEdit : IUiNode + public class UiNode_RoomNameInput : IUiNode { - public UiNode1_LineEdit(Godot.LineEdit node) : base(node) { } - public override UiNode1_LineEdit Clone() => new ((Godot.LineEdit)Instance.Duplicate()); + public UiNode_RoomNameInput(Godot.LineEdit node) : base(node) { } + public override UiNode_RoomNameInput Clone() => new ((Godot.LineEdit)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer6.Label2 + /// + public class UiNode_Label2 : IUiNode + { + public UiNode_Label2(Godot.Label node) : base(node) { } + public override UiNode_Label2 Clone() => new ((Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer6.RoomGroupSelect + /// + public class UiNode_RoomGroupSelect : IUiNode + { + public UiNode_RoomGroupSelect(Godot.OptionButton node) : base(node) { } + public override UiNode_RoomGroupSelect Clone() => new ((Godot.OptionButton)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer6.Label3 + /// + public class UiNode_Label3 : IUiNode + { + public UiNode_Label3(Godot.Label node) : base(node) { } + public override UiNode_Label3 Clone() => new ((Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.HBoxContainer6.RoomTypeSelect + /// + public class UiNode_RoomTypeSelect : IUiNode + { + public UiNode_RoomTypeSelect(Godot.OptionButton node) : base(node) { } + public override UiNode_RoomTypeSelect Clone() => new ((Godot.OptionButton)Instance.Duplicate()); } /// @@ -329,17 +365,69 @@ private UiNode4_Label _L_Label; /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.LineEdit + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.RoomNameInput /// - public UiNode1_LineEdit L_LineEdit + public UiNode_RoomNameInput L_RoomNameInput { get { - if (_L_LineEdit == null) _L_LineEdit = new UiNode1_LineEdit(Instance.GetNodeOrNull("LineEdit")); - return _L_LineEdit; + if (_L_RoomNameInput == null) _L_RoomNameInput = new UiNode_RoomNameInput(Instance.GetNodeOrNull("RoomNameInput")); + return _L_RoomNameInput; } } - private UiNode1_LineEdit _L_LineEdit; + private UiNode_RoomNameInput _L_RoomNameInput; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.Label2 + /// + public UiNode_Label2 L_Label2 + { + get + { + if (_L_Label2 == null) _L_Label2 = new UiNode_Label2(Instance.GetNodeOrNull("Label2")); + return _L_Label2; + } + } + private UiNode_Label2 _L_Label2; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.RoomGroupSelect + /// + public UiNode_RoomGroupSelect L_RoomGroupSelect + { + get + { + if (_L_RoomGroupSelect == null) _L_RoomGroupSelect = new UiNode_RoomGroupSelect(Instance.GetNodeOrNull("RoomGroupSelect")); + return _L_RoomGroupSelect; + } + } + private UiNode_RoomGroupSelect _L_RoomGroupSelect; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.Label3 + /// + public UiNode_Label3 L_Label3 + { + get + { + if (_L_Label3 == null) _L_Label3 = new UiNode_Label3(Instance.GetNodeOrNull("Label3")); + return _L_Label3; + } + } + private UiNode_Label3 _L_Label3; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.RoomTypeSelect + /// + public UiNode_RoomTypeSelect L_RoomTypeSelect + { + get + { + if (_L_RoomTypeSelect == null) _L_RoomTypeSelect = new UiNode_RoomTypeSelect(Instance.GetNodeOrNull("RoomTypeSelect")); + return _L_RoomTypeSelect; + } + } + private UiNode_RoomTypeSelect _L_RoomTypeSelect; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: EditorTools.ScrollContainer.MarginContainer.VBoxContainer.Button diff --git a/DungeonShooting_Godot/src/game/ui/editorTools/EditorToolsPanel.cs b/DungeonShooting_Godot/src/game/ui/editorTools/EditorToolsPanel.cs index f33b7d7..c307cf0 100644 --- a/DungeonShooting_Godot/src/game/ui/editorTools/EditorToolsPanel.cs +++ b/DungeonShooting_Godot/src/game/ui/editorTools/EditorToolsPanel.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.IO; using System.Text.RegularExpressions; using Generator; @@ -14,7 +15,12 @@ //询问窗口关闭 private Action _onConfirmClose; - + + //存放创建房间中选择组的下拉框数据 + private Dictionary _createRoomGroupValueMap = new Dictionary(); + //存放创建房间中选择类型的下拉框数据 + private Dictionary _createRoomTypeValueMap = new Dictionary(); + public override void OnShowUi() { //tips @@ -31,8 +37,31 @@ L_Confirm.Instance.Canceled += OnCanceled; L_Confirm.Instance.CloseRequested += OnCanceled; L_Confirm.Instance.Confirmed += OnConfirm; - + var container = L_ScrollContainer.L_MarginContainer.L_VBoxContainer; + + //创建ui的下拉框数据 + { + var directoryInfo = new DirectoryInfo(GameConfig.RoomTileDir); + var directoryInfoArray = directoryInfo.GetDirectories(); + for (var i = 0; i < directoryInfoArray.Length; i++) + { + var text = directoryInfoArray[i].Name; + container.L_HBoxContainer6.L_RoomGroupSelect.Instance.AddItem(text, i); + _createRoomGroupValueMap.Add(i, text); + } + + var dungeonRoomTypes = Enum.GetValues(); + for (var i = 0; i < dungeonRoomTypes.Length; i++) + { + var typeName = DungeonRoomTemplate.DungeonRoomTypeToString(dungeonRoomTypes[i]); + var text = typeName + " (" + + DungeonRoomTemplate.DungeonRoomTypeToDescribeString(dungeonRoomTypes[i]) + ")"; + container.L_HBoxContainer6.L_RoomTypeSelect.Instance.AddItem(text, i); + _createRoomTypeValueMap.Add(i, typeName); + } + } + //重新生成 ResourcePath container.L_HBoxContainer.L_Button.Instance.Pressed += GenerateResourcePath; //重新打包房间配置 @@ -295,8 +324,14 @@ /// private void GenerateDungeonRoom() { - var roomName = L_ScrollContainer.L_MarginContainer.L_VBoxContainer.L_HBoxContainer6.L_LineEdit.Instance.Text; - ShowConfirm("提示", "是否创建房间:" + roomName, (result) => + var node = L_ScrollContainer.L_MarginContainer.L_VBoxContainer.L_HBoxContainer6; + var group = _createRoomGroupValueMap[node.L_RoomGroupSelect.Instance.Selected]; + var type = _createRoomTypeValueMap[node.L_RoomTypeSelect.Instance.Selected]; + var roomName = node.L_RoomNameInput.Instance.Text; + + var pathName = group + "/" + type + "/" + roomName; + + ShowConfirm("提示", "是否创建房间:" + pathName, (result) => { if (result) { @@ -308,15 +343,15 @@ } //检查是否有同名的Ui - var path = GameConfig.RoomTileDir + roomName + ".tscn"; + var path = GameConfig.RoomTileDir + pathName + ".tscn"; if (File.Exists(path)) { - ShowTips("错误", "已经存在相同名称'" + roomName + "'的房间了, 不能重复创建!"); + ShowTips("错误", "已经存在相同名称'" + pathName + "'的房间了, 不能重复创建!"); return; } //执行创建操作 - if (DungeonRoomGenerator.CreateDungeonRoom("testGroup", DungeonRoomType.Battle, roomName, true)) + if (DungeonRoomGenerator.CreateDungeonRoom(group, type, roomName, true)) { ShowTips("提示", "创建房间成功!"); } diff --git a/DungeonShooting_Godot/src/game/ui/myUi/MyUi.cs b/DungeonShooting_Godot/src/game/ui/myUi/MyUi.cs deleted file mode 100644 index 65f9437..0000000 --- a/DungeonShooting_Godot/src/game/ui/myUi/MyUi.cs +++ /dev/null @@ -1,79 +0,0 @@ -namespace UI.MyUi; - -/// -/// Ui代码, 该类是根据ui场景自动生成的, 请不要手动编辑该类, 以免造成代码丢失 -/// -public abstract partial class MyUi : UiBase -{ - /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MyUi.Button - /// - public UiNode_Button L_Button - { - get - { - if (_L_Button == null) _L_Button = new UiNode_Button(GetNodeOrNull("Button")); - return _L_Button; - } - } - private UiNode_Button _L_Button; - - /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MyUi.Control - /// - public UiNode_Control L_Control - { - get - { - if (_L_Control == null) _L_Control = new UiNode_Control(GetNodeOrNull("Control")); - return _L_Control; - } - } - private UiNode_Control _L_Control; - - - public MyUi() : base(nameof(MyUi)) - { - } - - /// - /// 类型: , 路径: MyUi.Button - /// - public class UiNode_Button : IUiNode - { - public UiNode_Button(Godot.Button node) : base(node) { } - public override UiNode_Button Clone() => new ((Godot.Button)Instance.Duplicate()); - } - - /// - /// 类型: , 路径: MyUi.Control.Label - /// - public class UiNode_Label : IUiNode - { - public UiNode_Label(Godot.Label node) : base(node) { } - public override UiNode_Label Clone() => new ((Godot.Label)Instance.Duplicate()); - } - - /// - /// 类型: , 路径: MyUi.Control - /// - public class UiNode_Control : IUiNode - { - /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MyUi.Label - /// - public UiNode_Label L_Label - { - get - { - if (_L_Label == null) _L_Label = new UiNode_Label(Instance.GetNodeOrNull("Label")); - return _L_Label; - } - } - private UiNode_Label _L_Label; - - public UiNode_Control(Godot.Control node) : base(node) { } - public override UiNode_Control Clone() => new ((Godot.Control)Instance.Duplicate()); - } - -} diff --git a/DungeonShooting_Godot/src/game/ui/myUi/MyUiPanel.cs b/DungeonShooting_Godot/src/game/ui/myUi/MyUiPanel.cs deleted file mode 100644 index f6d0a04..0000000 --- a/DungeonShooting_Godot/src/game/ui/myUi/MyUiPanel.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Godot; - -namespace UI.MyUi; - -public partial class MyUiPanel : MyUi -{ - - public override void OnShowUi() - { - L_Control.L_Label.Instance.Text = "文本"; - L_Button.Instance.Pressed += () => - { - - }; - } - - public override void OnHideUi() - { - - } - -}