diff --git a/DungeonShooting_Godot/prefab/ui/MapEditor.tscn b/DungeonShooting_Godot/prefab/ui/MapEditor.tscn index a747bd1..0d36e86 100644 --- a/DungeonShooting_Godot/prefab/ui/MapEditor.tscn +++ b/DungeonShooting_Godot/prefab/ui/MapEditor.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=8 format=3 uid="uid://csbxfkdupsckv"] [ext_resource type="Script" path="res://src/game/ui/mapEditor/MapEditorPanel.cs" id="1_5s7a0"] -[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileSet/TileSet1.tres" id="2_vrg60"] +[ext_resource type="TileSet" uid="uid://b00g22o1cqhe8" path="res://resource/map/tileset/TileSet1.tres" id="2_vrg60"] [ext_resource type="Script" path="res://src/game/ui/mapEditor/TileView/EditorTileMap.cs" id="2_waq8f"] [ext_resource type="Texture2D" uid="uid://0878uloew5jo" path="res://resource/sprite/ui/mapEditor/ErrorCell.png" id="4_465u2"] diff --git a/DungeonShooting_Godot/prefab/ui/MapEditorProject.tscn b/DungeonShooting_Godot/prefab/ui/MapEditorProject.tscn index dfde846..7474df9 100644 --- a/DungeonShooting_Godot/prefab/ui/MapEditorProject.tscn +++ b/DungeonShooting_Godot/prefab/ui/MapEditorProject.tscn @@ -1,6 +1,8 @@ -[gd_scene load_steps=2 format=3 uid="uid://dh7y03tq6v0a2"] +[gd_scene load_steps=4 format=3 uid="uid://dh7y03tq6v0a2"] [ext_resource type="Script" path="res://src/game/ui/mapEditorProject/MapEditorProjectPanel.cs" id="1_5aioo"] +[ext_resource type="Texture2D" uid="uid://chd1r5artktp" path="res://resource/sprite/ui/mapEditorProject/CellBg.png" id="2_6xs3a"] +[ext_resource type="Texture2D" uid="uid://uhhfgdhpk7i4" path="res://icon.png" id="2_xh3iw"] [node name="MapEditorProject" type="Control"] layout_mode = 3 @@ -10,6 +12,7 @@ grow_horizontal = 2 grow_vertical = 2 script = ExtResource("1_5aioo") +metadata/_edit_horizontal_guides_ = [449.0] [node name="Bg" type="Panel" parent="."] layout_mode = 1 @@ -66,9 +69,9 @@ [node name="ScrollContainer" type="ScrollContainer" parent="Bg/VBoxContainer/HBoxContainer/Panel/MarginContainer"] layout_mode = 2 -vertical_scroll_mode = 2 [node name="GroupButton" type="Button" parent="Bg/VBoxContainer/HBoxContainer/Panel/MarginContainer/ScrollContainer"] +custom_minimum_size = Vector2(0, 100) layout_mode = 2 size_flags_horizontal = 3 text = "testGroup1" @@ -80,8 +83,66 @@ size_flags_horizontal = 3 size_flags_stretch_ratio = 7.0 -[node name="Button" type="Button" parent="Bg/VBoxContainer/HBoxContainer/Panel2"] -layout_mode = 0 -offset_right = 12.0 -offset_bottom = 8.0 -text = "1231445461" +[node name="MarginContainer" type="MarginContainer" parent="Bg/VBoxContainer/HBoxContainer/Panel2"] +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 = 12 +theme_override_constants/margin_top = 12 +theme_override_constants/margin_right = 12 +theme_override_constants/margin_bottom = 12 + +[node name="ScrollContainer" type="ScrollContainer" parent="Bg/VBoxContainer/HBoxContainer/Panel2/MarginContainer"] +layout_mode = 2 + +[node name="RoomButton" type="TextureButton" parent="Bg/VBoxContainer/HBoxContainer/Panel2/MarginContainer/ScrollContainer"] +custom_minimum_size = Vector2(200, 285) +layout_mode = 2 +texture_normal = ExtResource("2_6xs3a") +texture_pressed = ExtResource("2_6xs3a") +texture_hover = ExtResource("2_6xs3a") +stretch_mode = 0 + +[node name="PreviewImage" type="TextureRect" parent="Bg/VBoxContainer/HBoxContainer/Panel2/MarginContainer/ScrollContainer/RoomButton"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_bottom = -85.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 +texture = ExtResource("2_xh3iw") +stretch_mode = 5 + +[node name="RoomName" type="Label" parent="Bg/VBoxContainer/HBoxContainer/Panel2/MarginContainer/ScrollContainer/RoomButton"] +layout_mode = 1 +anchors_preset = 12 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_top = -86.0 +offset_bottom = -43.0 +grow_horizontal = 2 +grow_vertical = 0 +text = "Room1" +horizontal_alignment = 1 +clip_text = true +text_overrun_behavior = 3 + +[node name="RoomType" type="Label" parent="Bg/VBoxContainer/HBoxContainer/Panel2/MarginContainer/ScrollContainer/RoomButton"] +layout_mode = 1 +anchors_preset = 12 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_top = -43.0 +grow_horizontal = 2 +grow_vertical = 0 +text = "战斗" +horizontal_alignment = 1 +clip_text = true +text_overrun_behavior = 3 diff --git a/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001.png.import b/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001.png.import index c36be94..b20c9a6 100644 --- a/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001.png.import +++ b/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://chd2vtesap5cf" -path="res://.godot/imported/Enemy0001.png-148a38dfa95953b26d890356e8875de4.ctex" +path="res://.godot/imported/enemy0001.png-1247a3ddf8a1a163d812cad12c4340fd.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://resource/sprite/role/enemy0001/Enemy0001.png" -dest_files=["res://.godot/imported/Enemy0001.png-148a38dfa95953b26d890356e8875de4.ctex"] +source_file="res://resource/sprite/role/enemy0001/enemy0001.png" +dest_files=["res://.godot/imported/enemy0001.png-1247a3ddf8a1a163d812cad12c4340fd.ctex"] [params] diff --git a/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001_Debris.png.import b/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001_Debris.png.import index d563acf..56388a2 100644 --- a/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001_Debris.png.import +++ b/DungeonShooting_Godot/resource/sprite/role/enemy0001/enemy0001_Debris.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://d2f55lu60x64i" -path="res://.godot/imported/Enemy0001_Debris.png-ac416dc79cd3c1217b27e1ef1fbe0d0b.ctex" +path="res://.godot/imported/enemy0001_Debris.png-297a2fb6680cb862a9a085cf58f8268c.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://resource/sprite/role/enemy0001/Enemy0001_Debris.png" -dest_files=["res://.godot/imported/Enemy0001_Debris.png-ac416dc79cd3c1217b27e1ef1fbe0d0b.ctex"] +source_file="res://resource/sprite/role/enemy0001/enemy0001_Debris.png" +dest_files=["res://.godot/imported/enemy0001_Debris.png-297a2fb6680cb862a9a085cf58f8268c.ctex"] [params] diff --git a/DungeonShooting_Godot/resource/sprite/ui/mapEditorProject/CellBg.png b/DungeonShooting_Godot/resource/sprite/ui/mapEditorProject/CellBg.png new file mode 100644 index 0000000..1445214 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/mapEditorProject/CellBg.png Binary files differ diff --git a/DungeonShooting_Godot/resource/sprite/ui/mapEditorProject/CellBg.png.import b/DungeonShooting_Godot/resource/sprite/ui/mapEditorProject/CellBg.png.import new file mode 100644 index 0000000..c97f183 --- /dev/null +++ b/DungeonShooting_Godot/resource/sprite/ui/mapEditorProject/CellBg.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://chd1r5artktp" +path="res://.godot/imported/CellBg.png-fd013af36fe871178b0c4d9d0b2ecb6f.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://resource/sprite/ui/mapEditorProject/CellBg.png" +dest_files=["res://.godot/imported/CellBg.png-fd013af36fe871178b0c4d9d0b2ecb6f.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/theme/mainTheme.tres b/DungeonShooting_Godot/resource/theme/mainTheme.tres index bd97f2b..4002e35 100644 --- a/DungeonShooting_Godot/resource/theme/mainTheme.tres +++ b/DungeonShooting_Godot/resource/theme/mainTheme.tres @@ -356,7 +356,7 @@ content_margin_right = 4.0 content_margin_bottom = 4.0 -[sub_resource type="Image" id="Image_qauv8"] +[sub_resource type="Image" id="Image_j3aok"] 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", @@ -366,7 +366,7 @@ } [sub_resource type="ImageTexture" id="56"] -image = SubResource("Image_qauv8") +image = SubResource("Image_j3aok") [sub_resource type="StyleBoxFlat" id="57"] content_margin_left = 6.0 diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorProject/MapEditorProject.cs b/DungeonShooting_Godot/src/game/ui/mapEditorProject/MapEditorProject.cs index d0782d7..1130ce2 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditorProject/MapEditorProject.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditorProject/MapEditorProject.cs @@ -130,12 +130,122 @@ } /// - /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.Button + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.ScrollContainer.RoomButton.PreviewImage /// - public class Button : UiNode + public class PreviewImage : UiNode { - public Button(MapEditorProject uiPanel, Godot.Button node) : base(uiPanel, node) { } - public override Button Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + public PreviewImage(MapEditorProject uiPanel, Godot.TextureRect node) : base(uiPanel, node) { } + public override PreviewImage Clone() => new (UiPanel, (Godot.TextureRect)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.ScrollContainer.RoomButton.RoomName + /// + public class RoomName : UiNode + { + public RoomName(MapEditorProject uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override RoomName Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.ScrollContainer.RoomButton.RoomType + /// + public class RoomType : UiNode + { + public RoomType(MapEditorProject uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override RoomType Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.ScrollContainer.RoomButton + /// + public class RoomButton : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.ScrollContainer.PreviewImage + /// + public PreviewImage L_PreviewImage + { + get + { + if (_L_PreviewImage == null) _L_PreviewImage = new PreviewImage(UiPanel, Instance.GetNodeOrNull("PreviewImage")); + return _L_PreviewImage; + } + } + private PreviewImage _L_PreviewImage; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.ScrollContainer.RoomName + /// + public RoomName L_RoomName + { + get + { + if (_L_RoomName == null) _L_RoomName = new RoomName(UiPanel, Instance.GetNodeOrNull("RoomName")); + return _L_RoomName; + } + } + private RoomName _L_RoomName; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.ScrollContainer.RoomType + /// + public RoomType L_RoomType + { + get + { + if (_L_RoomType == null) _L_RoomType = new RoomType(UiPanel, Instance.GetNodeOrNull("RoomType")); + return _L_RoomType; + } + } + private RoomType _L_RoomType; + + public RoomButton(MapEditorProject uiPanel, Godot.TextureButton node) : base(uiPanel, node) { } + public override RoomButton Clone() => new (UiPanel, (Godot.TextureButton)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.ScrollContainer + /// + public class ScrollContainer_1 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.RoomButton + /// + public RoomButton L_RoomButton + { + get + { + if (_L_RoomButton == null) _L_RoomButton = new RoomButton(UiPanel, Instance.GetNodeOrNull("RoomButton")); + return _L_RoomButton; + } + } + private RoomButton _L_RoomButton; + + public ScrollContainer_1(MapEditorProject uiPanel, Godot.ScrollContainer node) : base(uiPanel, node) { } + public override ScrollContainer_1 Clone() => new (UiPanel, (Godot.ScrollContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer + /// + public class MarginContainer_2 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.ScrollContainer + /// + public ScrollContainer_1 L_ScrollContainer + { + get + { + if (_L_ScrollContainer == null) _L_ScrollContainer = new ScrollContainer_1(UiPanel, Instance.GetNodeOrNull("ScrollContainer")); + return _L_ScrollContainer; + } + } + private ScrollContainer_1 _L_ScrollContainer; + + public MarginContainer_2(MapEditorProject uiPanel, Godot.MarginContainer node) : base(uiPanel, node) { } + public override MarginContainer_2 Clone() => new (UiPanel, (Godot.MarginContainer)Instance.Duplicate()); } /// @@ -144,17 +254,17 @@ public class Panel2 : UiNode { /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Button + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.MarginContainer /// - public Button L_Button + public MarginContainer_2 L_MarginContainer { get { - if (_L_Button == null) _L_Button = new Button(UiPanel, Instance.GetNodeOrNull("Button")); - return _L_Button; + if (_L_MarginContainer == null) _L_MarginContainer = new MarginContainer_2(UiPanel, Instance.GetNodeOrNull("MarginContainer")); + return _L_MarginContainer; } } - private Button _L_Button; + private MarginContainer_2 _L_MarginContainer; public Panel2(MapEditorProject uiPanel, Godot.Panel node) : base(uiPanel, node) { } public override Panel2 Clone() => new (UiPanel, (Godot.Panel)Instance.Duplicate()); @@ -259,14 +369,24 @@ public GroupButton S_GroupButton => L_Bg.L_VBoxContainer.L_HBoxContainer.L_Panel.L_MarginContainer.L_ScrollContainer.L_GroupButton; /// - /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel.MarginContainer.ScrollContainer + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.ScrollContainer.RoomButton.PreviewImage /// - public ScrollContainer S_ScrollContainer => L_Bg.L_VBoxContainer.L_HBoxContainer.L_Panel.L_MarginContainer.L_ScrollContainer; + public PreviewImage S_PreviewImage => L_Bg.L_VBoxContainer.L_HBoxContainer.L_Panel2.L_MarginContainer.L_ScrollContainer.L_RoomButton.L_PreviewImage; /// - /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.Button + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.ScrollContainer.RoomButton.RoomName /// - public Button S_Button => L_Bg.L_VBoxContainer.L_HBoxContainer.L_Panel2.L_Button; + public RoomName S_RoomName => L_Bg.L_VBoxContainer.L_HBoxContainer.L_Panel2.L_MarginContainer.L_ScrollContainer.L_RoomButton.L_RoomName; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.ScrollContainer.RoomButton.RoomType + /// + public RoomType S_RoomType => L_Bg.L_VBoxContainer.L_HBoxContainer.L_Panel2.L_MarginContainer.L_ScrollContainer.L_RoomButton.L_RoomType; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2.MarginContainer.ScrollContainer.RoomButton + /// + public RoomButton S_RoomButton => L_Bg.L_VBoxContainer.L_HBoxContainer.L_Panel2.L_MarginContainer.L_ScrollContainer.L_RoomButton; /// /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorProject.Bg.VBoxContainer.HBoxContainer.Panel2 diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorProject/MapEditorProjectPanel.cs b/DungeonShooting_Godot/src/game/ui/mapEditorProject/MapEditorProjectPanel.cs index 24afc04..42ac33e 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditorProject/MapEditorProjectPanel.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditorProject/MapEditorProjectPanel.cs @@ -6,12 +6,17 @@ { private UiGrid _groupGrid; + private UiGrid _roomGrid; public override void OnCreateUi() { - _groupGrid = new UiGrid(S_GroupButton, typeof(GroupButtonCell), 1, 0, 10); + _groupGrid = new UiGrid(S_GroupButton, typeof(GroupButtonCell), 1, 0, 2); _groupGrid.SetHorizontalExpand(true); _groupGrid.SetDataList(new []{ "1", "2", "3", "4", "5", "1", "2", "3", "4", "5", "1", "2", "3", "4", "5", "1", "2", "3", "4", "5", "1", "2", "3", "4", "5", "1", "2", "3", "4", "5" }); + + _roomGrid = new UiGrid(S_RoomButton, typeof(RoomButtonCell), 5, 5, 5); + _roomGrid.SetHorizontalExpand(true); + _roomGrid.SetDataList(new []{ "1", "2", "3", "4", "5", "1", "2", "3", "4", "5", "1", "2", "3", "4", "5", "1", "2", "3", "4", "5", "1", "2", "3", "4", "5", "1", "2", "3", "4", "5" }); } public override void OnShowUi() @@ -28,5 +33,8 @@ { _groupGrid.Destroy(); _groupGrid = null; + + _roomGrid.Destroy(); + _roomGrid = null; } } diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorProject/RoomButtonCell.cs b/DungeonShooting_Godot/src/game/ui/mapEditorProject/RoomButtonCell.cs new file mode 100644 index 0000000..1c974a2 --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/mapEditorProject/RoomButtonCell.cs @@ -0,0 +1,26 @@ +using Godot; + +namespace UI.MapEditorProject; + +public class RoomButtonCell : UiCell +{ + protected override void OnInit() + { + CellNode.Instance.Pressed += OnClick; + } + + protected override void OnSetData(string data) + { + CellNode.L_RoomName.Instance.Text = data; + } + + protected override void OnDestroy() + { + CellNode.Instance.Pressed -= OnClick; + } + + private void OnClick() + { + GD.Print("点击了按钮: " + Data); + } +} \ No newline at end of file