diff --git a/DungeonShooting_Godot/prefab/ui/MapEditorCreateMark.tscn b/DungeonShooting_Godot/prefab/ui/MapEditorCreateMark.tscn index 16ed1ab..41a829f 100644 --- a/DungeonShooting_Godot/prefab/ui/MapEditorCreateMark.tscn +++ b/DungeonShooting_Godot/prefab/ui/MapEditorCreateMark.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=6 format=3 uid="uid://bt4xo2lb4h4rx"] +[gd_scene load_steps=7 format=3 uid="uid://bt4xo2lb4h4rx"] [ext_resource type="Script" path="res://src/game/ui/mapEditorCreateMark/MapEditorCreateMarkPanel.cs" id="1_cjivg"] +[ext_resource type="Texture2D" uid="uid://n4atvj5fkcpg" path="res://resource/sprite/ui/commonIcon/Add.png" id="2_pxemo"] [ext_resource type="Material" uid="uid://cces3bhds7jyi" path="res://resource/material/Blend.tres" id="2_xb40b"] [ext_resource type="Texture2D" uid="uid://c5778ntk2rdon" path="res://resource/sprite/ui/commonIcon/Delete.png" id="3_7xihk"] [ext_resource type="Texture2D" uid="uid://dligpyhp72sg7" path="res://resource/sprite/ui/commonIcon/Right.png" id="3_v5clf"] @@ -38,19 +39,96 @@ layout_mode = 2 size_flags_horizontal = 3 -[node name="WaveNameLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer2"] +[node name="PosLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer2"] layout_mode = 2 size_flags_horizontal = 3 +size_flags_vertical = 0 size_flags_stretch_ratio = 30.0 -text = "所属波数:" +text = "区域位置:" horizontal_alignment = 2 vertical_alignment = 1 -[node name="WaveOption" type="OptionButton" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer2"] +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer2"] layout_mode = 2 size_flags_horizontal = 3 size_flags_stretch_ratio = 70.0 +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer2/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer2/VBoxContainer/HBoxContainer"] +layout_mode = 2 +text = "X" + +[node name="PosX" type="SpinBox" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer2/VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(200, 0) +layout_mode = 2 +allow_greater = true +allow_lesser = true +custom_arrow_step = 1.0 + +[node name="HBoxContainer2" type="HBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer2/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer2/VBoxContainer/HBoxContainer2"] +layout_mode = 2 +text = "Y" + +[node name="PosY" type="SpinBox" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer2/VBoxContainer/HBoxContainer2"] +custom_minimum_size = Vector2(200, 0) +layout_mode = 2 +allow_greater = true +allow_lesser = true +custom_arrow_step = 1.0 + +[node name="HBoxContainer3" type="HBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer3"] +layout_mode = 2 +size_flags_horizontal = 3 + +[node name="SizeLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer3"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 0 +size_flags_stretch_ratio = 30.0 +text = "区域大小:" +horizontal_alignment = 2 +vertical_alignment = 1 + +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer3"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 70.0 + +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer3/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer3/VBoxContainer/HBoxContainer"] +layout_mode = 2 +text = "X" + +[node name="SizeX" type="SpinBox" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer3/VBoxContainer/HBoxContainer"] +custom_minimum_size = Vector2(200, 0) +layout_mode = 2 +max_value = 9999.0 +custom_arrow_step = 1.0 + +[node name="HBoxContainer2" type="HBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer3/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer3/VBoxContainer/HBoxContainer2"] +layout_mode = 2 +text = "Y" + +[node name="SizeY" type="SpinBox" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer3/VBoxContainer/HBoxContainer2"] +custom_minimum_size = Vector2(200, 0) +layout_mode = 2 +max_value = 9999.0 +custom_arrow_step = 1.0 + [node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer3"] layout_mode = 2 size_flags_horizontal = 3 @@ -58,14 +136,17 @@ [node name="DelayNameLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 +size_flags_vertical = 0 size_flags_stretch_ratio = 30.0 -text = "延时时间:" +text = "延时时间(秒):" horizontal_alignment = 2 vertical_alignment = 1 [node name="DelayInput" type="SpinBox" parent="MarginContainer/VBoxContainer/HBoxContainer3/HBoxContainer"] +custom_minimum_size = Vector2(0, 43) layout_mode = 2 size_flags_horizontal = 3 +size_flags_vertical = 0 size_flags_stretch_ratio = 70.0 max_value = 30.0 step = 0.01 @@ -73,8 +154,9 @@ [node name="AddMark" type="Button" parent="MarginContainer/VBoxContainer"] layout_mode = 2 -size_flags_horizontal = 4 +size_flags_horizontal = 0 text = "添加物体" +icon = ExtResource("2_pxemo") [node name="Panel" type="Panel" parent="MarginContainer/VBoxContainer"] layout_mode = 2 diff --git a/DungeonShooting_Godot/prefab/ui/MapEditorMapMark.tscn b/DungeonShooting_Godot/prefab/ui/MapEditorMapMark.tscn index 1a66cee..4d910c6 100644 --- a/DungeonShooting_Godot/prefab/ui/MapEditorMapMark.tscn +++ b/DungeonShooting_Godot/prefab/ui/MapEditorMapMark.tscn @@ -1,12 +1,13 @@ -[gd_scene load_steps=8 format=3 uid="uid://peo0n8bl15y5"] +[gd_scene load_steps=9 format=3 uid="uid://peo0n8bl15y5"] [ext_resource type="Script" path="res://src/game/ui/mapEditorMapMark/MapEditorMapMarkPanel.cs" id="1_dudey"] [ext_resource type="Texture2D" uid="uid://n4atvj5fkcpg" path="res://resource/sprite/ui/commonIcon/Add.png" id="2_osya0"] [ext_resource type="Texture2D" uid="uid://dggb6p4sdmfry" path="res://resource/sprite/ui/commonIcon/Edit.png" id="3_wwaki"] [ext_resource type="Texture2D" uid="uid://c5778ntk2rdon" path="res://resource/sprite/ui/commonIcon/Delete.png" id="4_urq7y"] -[ext_resource type="Texture2D" uid="uid://uhhfgdhpk7i4" path="res://icon.png" id="5_3tml0"] [ext_resource type="Texture2D" uid="uid://d4gduco55dqpk" path="res://resource/sprite/ui/commonIcon/Down.png" id="5_x5dpw"] +[ext_resource type="Texture2D" uid="uid://dxpdjj1abmejh" path="res://resource/sprite/ui/commonIcon/DoorTool.png" id="6_he4th"] [ext_resource type="Texture2D" uid="uid://bn47bmilcw4x0" path="res://resource/sprite/ui/commonIcon/Select2.png" id="6_jpt3y"] +[ext_resource type="Texture2D" uid="uid://d2wslibovwv7w" path="res://resource/sprite/ui/commonIcon/CenterTool.png" id="7_jnnw0"] [node name="MapEditorMapMark" type="Control"] layout_mode = 3 @@ -94,6 +95,7 @@ layout_mode = 2 size_flags_horizontal = 3 text = "第1波" +icon = ExtResource("6_he4th") alignment = 0 [node name="Select" type="NinePatchRect" parent="VBoxContainer/ScrollContainer/VBoxContainer/WaveItem/WaveContainer/WaveButton"] @@ -129,9 +131,10 @@ [node name="MarkButton" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer/WaveItem/MarkContainer/MarkItem"] layout_mode = 2 size_flags_horizontal = 3 -text = "敌人(1001)" -icon = ExtResource("5_3tml0") +text = "1001" +icon = ExtResource("7_jnnw0") alignment = 0 +text_overrun_behavior = 3 [node name="Select" type="NinePatchRect" parent="VBoxContainer/ScrollContainer/VBoxContainer/WaveItem/MarkContainer/MarkItem/MarkButton"] visible = false diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room1/Room1_preinstall.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room1/Room1_preinstall.json index 245342f..983df16 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room1/Room1_preinstall.json +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room1/Room1_preinstall.json @@ -1 +1,40 @@ -[{"Name":"test1","Weight":100,"Remark":"","WaveList":[[{"Position":{"X":0,"Y":0},"MarkList":[{"Id":"weapon0001","Weight":100,"Attr":{"CurrAmmon":"30","ResidueAmmo":"60"}},{"Id":"weapon0006","Weight":100,"Attr":{"CurrAmmon":"10","ResidueAmmo":"30"}}]}]]}] \ No newline at end of file +[ + { + "Name": "test1", + "Weight": 100, + "Remark": "", + "WaveList": [ + [ + { + "Position": { + "X": 0, + "Y": 0 + }, + "Size": { + "X": 0, + "Y": 0 + }, + "DelayTime": 0, + "MarkList": [ + { + "Id": "weapon0006", + "Weight": 100, + "Attr": { + "CurrAmmon": "0", + "ResidueAmmo": "0" + } + }, + { + "Id": "weapon0003", + "Weight": 100, + "Attr": { + "CurrAmmon": "0", + "ResidueAmmo": "0" + } + } + ] + } + ] + ] + } +] \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room1/Room1_roomInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room1/Room1_roomInfo.json index f276a7c..e093afa 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room1/Room1_roomInfo.json +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room1/Room1_roomInfo.json @@ -1 +1 @@ -{"Position":{"X":-6,"Y":-6},"Size":{"X":15,"Y":11},"DoorAreaInfos":[{"Direction":3,"Start":0,"End":128},{"Direction":0,"Start":0,"End":144},{"Direction":2,"Start":80,"End":208},{"Direction":1,"Start":0,"End":144}],"GroupName":"TestGroup1","RoomType":0,"RoomName":"Room1","Weight":100,"Remark":""} \ No newline at end of file +{"Position":{"X":-6,"Y":-6},"Size":{"X":15,"Y":15},"DoorAreaInfos":[{"Direction":3,"Start":0,"End":128},{"Direction":0,"Start":0,"End":144},{"Direction":2,"Start":96,"End":208},{"Direction":1,"Start":0,"End":144}],"GroupName":"TestGroup1","RoomType":0,"RoomName":"Room1","Weight":100,"Remark":""} \ No newline at end of file diff --git a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room1/Room1_tileInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room1/Room1_tileInfo.json index eaf38dd..e4e7b41 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room1/Room1_tileInfo.json +++ b/DungeonShooting_Godot/resource/map/tileMaps/TestGroup1/battle/Room1/Room1_tileInfo.json @@ -1 +1 @@ -{"NavigationList":[{"Type":0,"Points":[-72,-72,40,-72,40,-8,104,-8,104,-72,120,-72,120,64,8,64,8,0,-56,0,-56,64,-72,64]}],"Floor":[7,3,0,0,8,7,2,0,0,8,7,1,0,0,8,7,0,0,0,8,7,-1,0,0,8,7,-2,0,0,8,7,-3,0,0,8,7,-4,0,0,8,7,-5,0,0,8,6,3,0,0,8,6,2,0,0,8,6,1,0,0,8,6,0,0,0,8,6,-1,0,0,8,6,-2,0,0,8,6,-3,0,0,8,6,-4,0,0,8,6,-5,0,0,8,5,3,0,0,8,5,2,0,0,8,5,1,0,0,8,5,0,0,0,8,5,-1,0,0,8,4,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-2,0,3,3,-6,-1,0,3,3,-6,0,0,3,3,-6,1,0,3,3,-6,2,0,3,3,-6,3,0,3,3,-6,4,0,11,2,-5,4,0,2,2,-4,4,0,2,2,-3,0,0,1,2,-3,1,0,1,3,-3,2,0,1,3,-3,3,0,1,3,-3,4,0,13,2,-2,0,0,2,2,-1,0,0,3,2,-1,1,0,3,3,-1,2,0,3,3,-1,3,0,3,3,-1,4,0,11,2,0,4,0,2,2,0,5,0,3,4,0,6,0,3,3,0,7,0,3,3,0,8,0,11,2,1,4,0,2,2,1,8,0,2,2,2,4,0,3,2,2,8,0,2,2,3,-6,0,1,4,3,-5,0,1,3,3,-4,0,1,3,3,-3,0,1,3,3,8,0,2,2,4,8,0,2,2,5,-6,0,3,4,5,-5,0,3,3,5,-4,0,3,3,5,-3,0,3,3,5,4,0,1,2,5,8,0,2,2,6,4,0,2,2,6,8,0,2,2,7,4,0,2,2,7,8,0,2,2,8,-6,0,1,4,8,-5,0,1,3,8,-4,0,1,3,8,-3,0,1,3,8,-2,0,1,3,8,-1,0,1,3,8,0,0,1,3,8,1,0,1,3,8,2,0,1,3,8,3,0,1,3,8,4,0,13,2,8,5,0,1,4,8,6,0,1,3,8,7,0,1,3,8,8,0,13,2]} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/data/MarkInfo.cs b/DungeonShooting_Godot/src/framework/map/data/MarkInfo.cs index 70b71e9..8d1900f 100644 --- a/DungeonShooting_Godot/src/framework/map/data/MarkInfo.cs +++ b/DungeonShooting_Godot/src/framework/map/data/MarkInfo.cs @@ -14,6 +14,12 @@ public SerializeVector2 Position; /// <summary> + /// 区域大小 + /// </summary> + [JsonInclude] + public SerializeVector2 Size; + + /// <summary> /// 延时时间 /// </summary> [JsonInclude] diff --git a/DungeonShooting_Godot/src/framework/ui/IUiNode.cs b/DungeonShooting_Godot/src/framework/ui/IUiNode.cs index 34350c4..5597e3c 100644 --- a/DungeonShooting_Godot/src/framework/ui/IUiNode.cs +++ b/DungeonShooting_Godot/src/framework/ui/IUiNode.cs @@ -55,4 +55,19 @@ /// 销毁当前节点 /// </summary> void QueueFree(); + + /// <summary> + /// 更改父节点, 但是当前节点的父节点不能为空 + /// </summary> + void Reparent(IUiNode uiNode); + + /// <summary> + /// 更改父节点, 但是当前节点的父节点不能为空 + /// </summary> + void Reparent(Node node); + + /// <summary> + /// 获取父节点 + /// </summary> + Node GetParent(); } diff --git a/DungeonShooting_Godot/src/framework/ui/UiNode.cs b/DungeonShooting_Godot/src/framework/ui/UiNode.cs index 9f2e473..2e58eb0 100644 --- a/DungeonShooting_Godot/src/framework/ui/UiNode.cs +++ b/DungeonShooting_Godot/src/framework/ui/UiNode.cs @@ -109,4 +109,19 @@ { Instance.QueueFree(); } + + public void Reparent(IUiNode uiNode) + { + Instance.Reparent(uiNode.GetUiInstance()); + } + + public void Reparent(Node node) + { + Instance.Reparent(node); + } + + public Node GetParent() + { + return Instance.GetParent(); + } } \ 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 d14a97f..80860cd 100644 --- a/DungeonShooting_Godot/src/game/manager/EditorWindowManager.cs +++ b/DungeonShooting_Godot/src/game/manager/EditorWindowManager.cs @@ -165,16 +165,13 @@ /// <summary> /// 打开创建标记页面 /// </summary> - /// <param name="preinstall">房间预设信息</param> - /// <param name="waveIndex">当前波数据</param> /// <param name="onCreateMarkInfo">创建标记回调</param> - public static void ShowCreateMark(RoomPreinstall preinstall, int waveIndex, Action<MarkInfo> onCreateMarkInfo) + public static void ShowCreateMark(Action<MarkInfo> onCreateMarkInfo) { var window = UiManager.Open_EditorWindow(); window.SetWindowTitle("创建标记"); window.SetWindowSize(new Vector2I(1400, 900)); var body = window.OpenBody<MapEditorCreateMarkPanel>(UiManager.UiName.MapEditorCreateMark); - body.InitData(preinstall, waveIndex); window.SetButtonList( new EditorWindowPanel.ButtonData("确定", () => { diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/MapEditorCreateMark.cs b/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/MapEditorCreateMark.cs index 8c07f2c..30c52c0 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/MapEditorCreateMark.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/MapEditorCreateMark.cs @@ -54,21 +54,153 @@ } /// <summary> - /// 类型: <see cref="Godot.Label"/>, 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.WaveNameLabel + /// 类型: <see cref="Godot.Label"/>, 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.PosLabel /// </summary> - public class WaveNameLabel : UiNode<MapEditorCreateMarkPanel, Godot.Label, WaveNameLabel> + public class PosLabel : UiNode<MapEditorCreateMarkPanel, Godot.Label, PosLabel> { - public WaveNameLabel(MapEditorCreateMarkPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } - public override WaveNameLabel Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + public PosLabel(MapEditorCreateMarkPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override PosLabel Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); } /// <summary> - /// 类型: <see cref="Godot.OptionButton"/>, 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.WaveOption + /// 类型: <see cref="Godot.Label"/>, 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.VBoxContainer.HBoxContainer.Label /// </summary> - public class WaveOption : UiNode<MapEditorCreateMarkPanel, Godot.OptionButton, WaveOption> + public class Label : UiNode<MapEditorCreateMarkPanel, Godot.Label, Label> { - public WaveOption(MapEditorCreateMarkPanel uiPanel, Godot.OptionButton node) : base(uiPanel, node) { } - public override WaveOption Clone() => new (UiPanel, (Godot.OptionButton)Instance.Duplicate()); + public Label(MapEditorCreateMarkPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override Label Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// <summary> + /// 类型: <see cref="Godot.SpinBox"/>, 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.VBoxContainer.HBoxContainer.PosX + /// </summary> + public class PosX : UiNode<MapEditorCreateMarkPanel, Godot.SpinBox, PosX> + { + public PosX(MapEditorCreateMarkPanel uiPanel, Godot.SpinBox node) : base(uiPanel, node) { } + public override PosX Clone() => new (UiPanel, (Godot.SpinBox)Instance.Duplicate()); + } + + /// <summary> + /// 类型: <see cref="Godot.HBoxContainer"/>, 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.VBoxContainer.HBoxContainer + /// </summary> + public class HBoxContainer : UiNode<MapEditorCreateMarkPanel, Godot.HBoxContainer, HBoxContainer> + { + /// <summary> + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.Label"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.VBoxContainer.Label + /// </summary> + public Label L_Label + { + get + { + if (_L_Label == null) _L_Label = new Label(UiPanel, Instance.GetNodeOrNull<Godot.Label>("Label")); + return _L_Label; + } + } + private Label _L_Label; + + /// <summary> + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.SpinBox"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.VBoxContainer.PosX + /// </summary> + public PosX L_PosX + { + get + { + if (_L_PosX == null) _L_PosX = new PosX(UiPanel, Instance.GetNodeOrNull<Godot.SpinBox>("PosX")); + return _L_PosX; + } + } + private PosX _L_PosX; + + public HBoxContainer(MapEditorCreateMarkPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// <summary> + /// 类型: <see cref="Godot.Label"/>, 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.VBoxContainer.HBoxContainer2.Label + /// </summary> + public class Label_1 : UiNode<MapEditorCreateMarkPanel, Godot.Label, Label_1> + { + public Label_1(MapEditorCreateMarkPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override Label_1 Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// <summary> + /// 类型: <see cref="Godot.SpinBox"/>, 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.VBoxContainer.HBoxContainer2.PosY + /// </summary> + public class PosY : UiNode<MapEditorCreateMarkPanel, Godot.SpinBox, PosY> + { + public PosY(MapEditorCreateMarkPanel uiPanel, Godot.SpinBox node) : base(uiPanel, node) { } + public override PosY Clone() => new (UiPanel, (Godot.SpinBox)Instance.Duplicate()); + } + + /// <summary> + /// 类型: <see cref="Godot.HBoxContainer"/>, 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.VBoxContainer.HBoxContainer2 + /// </summary> + public class HBoxContainer2_1 : UiNode<MapEditorCreateMarkPanel, Godot.HBoxContainer, HBoxContainer2_1> + { + /// <summary> + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.Label"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.VBoxContainer.Label + /// </summary> + public Label_1 L_Label + { + get + { + if (_L_Label == null) _L_Label = new Label_1(UiPanel, Instance.GetNodeOrNull<Godot.Label>("Label")); + return _L_Label; + } + } + private Label_1 _L_Label; + + /// <summary> + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.SpinBox"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.VBoxContainer.PosY + /// </summary> + public PosY L_PosY + { + get + { + if (_L_PosY == null) _L_PosY = new PosY(UiPanel, Instance.GetNodeOrNull<Godot.SpinBox>("PosY")); + return _L_PosY; + } + } + private PosY _L_PosY; + + public HBoxContainer2_1(MapEditorCreateMarkPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer2_1 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// <summary> + /// 类型: <see cref="Godot.VBoxContainer"/>, 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.VBoxContainer + /// </summary> + public class VBoxContainer_1 : UiNode<MapEditorCreateMarkPanel, Godot.VBoxContainer, VBoxContainer_1> + { + /// <summary> + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.HBoxContainer"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.HBoxContainer + /// </summary> + public HBoxContainer L_HBoxContainer + { + get + { + if (_L_HBoxContainer == null) _L_HBoxContainer = new HBoxContainer(UiPanel, Instance.GetNodeOrNull<Godot.HBoxContainer>("HBoxContainer")); + return _L_HBoxContainer; + } + } + private HBoxContainer _L_HBoxContainer; + + /// <summary> + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.HBoxContainer"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.HBoxContainer2 + /// </summary> + public HBoxContainer2_1 L_HBoxContainer2 + { + get + { + if (_L_HBoxContainer2 == null) _L_HBoxContainer2 = new HBoxContainer2_1(UiPanel, Instance.GetNodeOrNull<Godot.HBoxContainer>("HBoxContainer2")); + return _L_HBoxContainer2; + } + } + private HBoxContainer2_1 _L_HBoxContainer2; + + public VBoxContainer_1(MapEditorCreateMarkPanel uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } + public override VBoxContainer_1 Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); } /// <summary> @@ -77,36 +209,221 @@ public class HBoxContainer2 : UiNode<MapEditorCreateMarkPanel, Godot.HBoxContainer, HBoxContainer2> { /// <summary> - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.Label"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.WaveNameLabel + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.Label"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.PosLabel /// </summary> - public WaveNameLabel L_WaveNameLabel + public PosLabel L_PosLabel { get { - if (_L_WaveNameLabel == null) _L_WaveNameLabel = new WaveNameLabel(UiPanel, Instance.GetNodeOrNull<Godot.Label>("WaveNameLabel")); - return _L_WaveNameLabel; + if (_L_PosLabel == null) _L_PosLabel = new PosLabel(UiPanel, Instance.GetNodeOrNull<Godot.Label>("PosLabel")); + return _L_PosLabel; } } - private WaveNameLabel _L_WaveNameLabel; + private PosLabel _L_PosLabel; /// <summary> - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.OptionButton"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.WaveOption + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.VBoxContainer"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.VBoxContainer /// </summary> - public WaveOption L_WaveOption + public VBoxContainer_1 L_VBoxContainer { get { - if (_L_WaveOption == null) _L_WaveOption = new WaveOption(UiPanel, Instance.GetNodeOrNull<Godot.OptionButton>("WaveOption")); - return _L_WaveOption; + if (_L_VBoxContainer == null) _L_VBoxContainer = new VBoxContainer_1(UiPanel, Instance.GetNodeOrNull<Godot.VBoxContainer>("VBoxContainer")); + return _L_VBoxContainer; } } - private WaveOption _L_WaveOption; + private VBoxContainer_1 _L_VBoxContainer; public HBoxContainer2(MapEditorCreateMarkPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } public override HBoxContainer2 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); } /// <summary> + /// 类型: <see cref="Godot.Label"/>, 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3.SizeLabel + /// </summary> + public class SizeLabel : UiNode<MapEditorCreateMarkPanel, Godot.Label, SizeLabel> + { + public SizeLabel(MapEditorCreateMarkPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override SizeLabel Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// <summary> + /// 类型: <see cref="Godot.Label"/>, 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3.VBoxContainer.HBoxContainer.Label + /// </summary> + public class Label_2 : UiNode<MapEditorCreateMarkPanel, Godot.Label, Label_2> + { + public Label_2(MapEditorCreateMarkPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override Label_2 Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// <summary> + /// 类型: <see cref="Godot.SpinBox"/>, 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3.VBoxContainer.HBoxContainer.SizeX + /// </summary> + public class SizeX : UiNode<MapEditorCreateMarkPanel, Godot.SpinBox, SizeX> + { + public SizeX(MapEditorCreateMarkPanel uiPanel, Godot.SpinBox node) : base(uiPanel, node) { } + public override SizeX Clone() => new (UiPanel, (Godot.SpinBox)Instance.Duplicate()); + } + + /// <summary> + /// 类型: <see cref="Godot.HBoxContainer"/>, 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3.VBoxContainer.HBoxContainer + /// </summary> + public class HBoxContainer_1 : UiNode<MapEditorCreateMarkPanel, Godot.HBoxContainer, HBoxContainer_1> + { + /// <summary> + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.Label"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3.VBoxContainer.Label + /// </summary> + public Label_2 L_Label + { + get + { + if (_L_Label == null) _L_Label = new Label_2(UiPanel, Instance.GetNodeOrNull<Godot.Label>("Label")); + return _L_Label; + } + } + private Label_2 _L_Label; + + /// <summary> + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.SpinBox"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3.VBoxContainer.SizeX + /// </summary> + public SizeX L_SizeX + { + get + { + if (_L_SizeX == null) _L_SizeX = new SizeX(UiPanel, Instance.GetNodeOrNull<Godot.SpinBox>("SizeX")); + return _L_SizeX; + } + } + private SizeX _L_SizeX; + + public HBoxContainer_1(MapEditorCreateMarkPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer_1 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// <summary> + /// 类型: <see cref="Godot.Label"/>, 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3.VBoxContainer.HBoxContainer2.Label + /// </summary> + public class Label_3 : UiNode<MapEditorCreateMarkPanel, Godot.Label, Label_3> + { + public Label_3(MapEditorCreateMarkPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override Label_3 Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// <summary> + /// 类型: <see cref="Godot.SpinBox"/>, 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3.VBoxContainer.HBoxContainer2.SizeY + /// </summary> + public class SizeY : UiNode<MapEditorCreateMarkPanel, Godot.SpinBox, SizeY> + { + public SizeY(MapEditorCreateMarkPanel uiPanel, Godot.SpinBox node) : base(uiPanel, node) { } + public override SizeY Clone() => new (UiPanel, (Godot.SpinBox)Instance.Duplicate()); + } + + /// <summary> + /// 类型: <see cref="Godot.HBoxContainer"/>, 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3.VBoxContainer.HBoxContainer2 + /// </summary> + public class HBoxContainer2_2 : UiNode<MapEditorCreateMarkPanel, Godot.HBoxContainer, HBoxContainer2_2> + { + /// <summary> + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.Label"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3.VBoxContainer.Label + /// </summary> + public Label_3 L_Label + { + get + { + if (_L_Label == null) _L_Label = new Label_3(UiPanel, Instance.GetNodeOrNull<Godot.Label>("Label")); + return _L_Label; + } + } + private Label_3 _L_Label; + + /// <summary> + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.SpinBox"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3.VBoxContainer.SizeY + /// </summary> + public SizeY L_SizeY + { + get + { + if (_L_SizeY == null) _L_SizeY = new SizeY(UiPanel, Instance.GetNodeOrNull<Godot.SpinBox>("SizeY")); + return _L_SizeY; + } + } + private SizeY _L_SizeY; + + public HBoxContainer2_2(MapEditorCreateMarkPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer2_2 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// <summary> + /// 类型: <see cref="Godot.VBoxContainer"/>, 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3.VBoxContainer + /// </summary> + public class VBoxContainer_2 : UiNode<MapEditorCreateMarkPanel, Godot.VBoxContainer, VBoxContainer_2> + { + /// <summary> + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.HBoxContainer"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3.HBoxContainer + /// </summary> + public HBoxContainer_1 L_HBoxContainer + { + get + { + if (_L_HBoxContainer == null) _L_HBoxContainer = new HBoxContainer_1(UiPanel, Instance.GetNodeOrNull<Godot.HBoxContainer>("HBoxContainer")); + return _L_HBoxContainer; + } + } + private HBoxContainer_1 _L_HBoxContainer; + + /// <summary> + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.HBoxContainer"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3.HBoxContainer2 + /// </summary> + public HBoxContainer2_2 L_HBoxContainer2 + { + get + { + if (_L_HBoxContainer2 == null) _L_HBoxContainer2 = new HBoxContainer2_2(UiPanel, Instance.GetNodeOrNull<Godot.HBoxContainer>("HBoxContainer2")); + return _L_HBoxContainer2; + } + } + private HBoxContainer2_2 _L_HBoxContainer2; + + public VBoxContainer_2(MapEditorCreateMarkPanel uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } + public override VBoxContainer_2 Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); + } + + /// <summary> + /// 类型: <see cref="Godot.HBoxContainer"/>, 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3 + /// </summary> + public class HBoxContainer3_1 : UiNode<MapEditorCreateMarkPanel, Godot.HBoxContainer, HBoxContainer3_1> + { + /// <summary> + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.Label"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.SizeLabel + /// </summary> + public SizeLabel L_SizeLabel + { + get + { + if (_L_SizeLabel == null) _L_SizeLabel = new SizeLabel(UiPanel, Instance.GetNodeOrNull<Godot.Label>("SizeLabel")); + return _L_SizeLabel; + } + } + private SizeLabel _L_SizeLabel; + + /// <summary> + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.VBoxContainer"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.VBoxContainer + /// </summary> + public VBoxContainer_2 L_VBoxContainer + { + get + { + if (_L_VBoxContainer == null) _L_VBoxContainer = new VBoxContainer_2(UiPanel, Instance.GetNodeOrNull<Godot.VBoxContainer>("VBoxContainer")); + return _L_VBoxContainer; + } + } + private VBoxContainer_2 _L_VBoxContainer; + + public HBoxContainer3_1(MapEditorCreateMarkPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer3_1 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// <summary> /// 类型: <see cref="Godot.Label"/>, 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer.DelayNameLabel /// </summary> public class DelayNameLabel : UiNode<MapEditorCreateMarkPanel, Godot.Label, DelayNameLabel> @@ -127,7 +444,7 @@ /// <summary> /// 类型: <see cref="Godot.HBoxContainer"/>, 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer /// </summary> - public class HBoxContainer : UiNode<MapEditorCreateMarkPanel, Godot.HBoxContainer, HBoxContainer> + public class HBoxContainer_2 : UiNode<MapEditorCreateMarkPanel, Godot.HBoxContainer, HBoxContainer_2> { /// <summary> /// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.Label"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.DelayNameLabel @@ -155,8 +472,8 @@ } private DelayInput _L_DelayInput; - public HBoxContainer(MapEditorCreateMarkPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } - public override HBoxContainer Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + public HBoxContainer_2(MapEditorCreateMarkPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer_2 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); } /// <summary> @@ -178,17 +495,30 @@ private HBoxContainer2 _L_HBoxContainer2; /// <summary> - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.HBoxContainer"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.HBoxContainer"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3 /// </summary> - public HBoxContainer L_HBoxContainer + public HBoxContainer3_1 L_HBoxContainer3 { get { - if (_L_HBoxContainer == null) _L_HBoxContainer = new HBoxContainer(UiPanel, Instance.GetNodeOrNull<Godot.HBoxContainer>("HBoxContainer")); + if (_L_HBoxContainer3 == null) _L_HBoxContainer3 = new HBoxContainer3_1(UiPanel, Instance.GetNodeOrNull<Godot.HBoxContainer>("HBoxContainer3")); + return _L_HBoxContainer3; + } + } + private HBoxContainer3_1 _L_HBoxContainer3; + + /// <summary> + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.HBoxContainer"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer + /// </summary> + public HBoxContainer_2 L_HBoxContainer + { + get + { + if (_L_HBoxContainer == null) _L_HBoxContainer = new HBoxContainer_2(UiPanel, Instance.GetNodeOrNull<Godot.HBoxContainer>("HBoxContainer")); return _L_HBoxContainer; } } - private HBoxContainer _L_HBoxContainer; + private HBoxContainer_2 _L_HBoxContainer; public HBoxContainer3(MapEditorCreateMarkPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } public override HBoxContainer3 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); @@ -269,7 +599,7 @@ /// <summary> /// 类型: <see cref="Godot.HBoxContainer"/>, 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.VBoxContainer.HBoxContainer /// </summary> - public class HBoxContainer_1 : UiNode<MapEditorCreateMarkPanel, Godot.HBoxContainer, HBoxContainer_1> + public class HBoxContainer_3 : UiNode<MapEditorCreateMarkPanel, Godot.HBoxContainer, HBoxContainer_3> { /// <summary> /// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.Control"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.VBoxContainer.Control @@ -362,8 +692,8 @@ } private ExtraTitle _L_ExtraTitle; - public HBoxContainer_1(MapEditorCreateMarkPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } - public override HBoxContainer_1 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + public HBoxContainer_3(MapEditorCreateMarkPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer_3 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); } /// <summary> @@ -454,7 +784,7 @@ /// <summary> /// 类型: <see cref="Godot.HBoxContainer"/>, 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.VBoxContainer.ScrollContainer.MarkObject.HBoxContainer /// </summary> - public class HBoxContainer_2 : UiNode<MapEditorCreateMarkPanel, Godot.HBoxContainer, HBoxContainer_2> + public class HBoxContainer_4 : UiNode<MapEditorCreateMarkPanel, Godot.HBoxContainer, HBoxContainer_4> { /// <summary> /// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.Button"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.VBoxContainer.ScrollContainer.MarkObject.ExpandButton @@ -547,8 +877,8 @@ } private CenterContainer _L_CenterContainer; - public HBoxContainer_2(MapEditorCreateMarkPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } - public override HBoxContainer_2 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + public HBoxContainer_4(MapEditorCreateMarkPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer_4 Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); } /// <summary> @@ -559,15 +889,15 @@ /// <summary> /// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.HBoxContainer"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.VBoxContainer.ScrollContainer.HBoxContainer /// </summary> - public HBoxContainer_2 L_HBoxContainer + public HBoxContainer_4 L_HBoxContainer { get { - if (_L_HBoxContainer == null) _L_HBoxContainer = new HBoxContainer_2(UiPanel, Instance.GetNodeOrNull<Godot.HBoxContainer>("HBoxContainer")); + if (_L_HBoxContainer == null) _L_HBoxContainer = new HBoxContainer_4(UiPanel, Instance.GetNodeOrNull<Godot.HBoxContainer>("HBoxContainer")); return _L_HBoxContainer; } } - private HBoxContainer_2 _L_HBoxContainer; + private HBoxContainer_4 _L_HBoxContainer; public MarkObject(MapEditorCreateMarkPanel uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } public override MarkObject Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); @@ -598,20 +928,20 @@ /// <summary> /// 类型: <see cref="Godot.VBoxContainer"/>, 路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.VBoxContainer /// </summary> - public class VBoxContainer_1 : UiNode<MapEditorCreateMarkPanel, Godot.VBoxContainer, VBoxContainer_1> + public class VBoxContainer_3 : UiNode<MapEditorCreateMarkPanel, Godot.VBoxContainer, VBoxContainer_3> { /// <summary> /// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.HBoxContainer"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.HBoxContainer /// </summary> - public HBoxContainer_1 L_HBoxContainer + public HBoxContainer_3 L_HBoxContainer { get { - if (_L_HBoxContainer == null) _L_HBoxContainer = new HBoxContainer_1(UiPanel, Instance.GetNodeOrNull<Godot.HBoxContainer>("HBoxContainer")); + if (_L_HBoxContainer == null) _L_HBoxContainer = new HBoxContainer_3(UiPanel, Instance.GetNodeOrNull<Godot.HBoxContainer>("HBoxContainer")); return _L_HBoxContainer; } } - private HBoxContainer_1 _L_HBoxContainer; + private HBoxContainer_3 _L_HBoxContainer; /// <summary> /// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.ScrollContainer"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.Panel.ScrollContainer @@ -626,8 +956,8 @@ } private ScrollContainer _L_ScrollContainer; - public VBoxContainer_1(MapEditorCreateMarkPanel uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } - public override VBoxContainer_1 Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); + public VBoxContainer_3(MapEditorCreateMarkPanel uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } + public override VBoxContainer_3 Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); } /// <summary> @@ -638,15 +968,15 @@ /// <summary> /// 使用 Instance 属性获取当前节点实例对象, 节点类型: <see cref="Godot.VBoxContainer"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.VBoxContainer /// </summary> - public VBoxContainer_1 L_VBoxContainer + public VBoxContainer_3 L_VBoxContainer { get { - if (_L_VBoxContainer == null) _L_VBoxContainer = new VBoxContainer_1(UiPanel, Instance.GetNodeOrNull<Godot.VBoxContainer>("VBoxContainer")); + if (_L_VBoxContainer == null) _L_VBoxContainer = new VBoxContainer_3(UiPanel, Instance.GetNodeOrNull<Godot.VBoxContainer>("VBoxContainer")); return _L_VBoxContainer; } } - private VBoxContainer_1 _L_VBoxContainer; + private VBoxContainer_3 _L_VBoxContainer; public Panel(MapEditorCreateMarkPanel uiPanel, Godot.Panel node) : base(uiPanel, node) { } public override Panel Clone() => new (UiPanel, (Godot.Panel)Instance.Duplicate()); @@ -808,19 +1138,34 @@ /// <summary> - /// 场景中唯一名称的节点, 节点类型: <see cref="Godot.Label"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.WaveNameLabel + /// 场景中唯一名称的节点, 节点类型: <see cref="Godot.Label"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.PosLabel /// </summary> - public WaveNameLabel S_WaveNameLabel => L_MarginContainer.L_VBoxContainer.L_HBoxContainer3.L_HBoxContainer2.L_WaveNameLabel; + public PosLabel S_PosLabel => L_MarginContainer.L_VBoxContainer.L_HBoxContainer3.L_HBoxContainer2.L_PosLabel; /// <summary> - /// 场景中唯一名称的节点, 节点类型: <see cref="Godot.OptionButton"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.WaveOption + /// 场景中唯一名称的节点, 节点类型: <see cref="Godot.SpinBox"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.VBoxContainer.HBoxContainer.PosX /// </summary> - public WaveOption S_WaveOption => L_MarginContainer.L_VBoxContainer.L_HBoxContainer3.L_HBoxContainer2.L_WaveOption; + public PosX S_PosX => L_MarginContainer.L_VBoxContainer.L_HBoxContainer3.L_HBoxContainer2.L_VBoxContainer.L_HBoxContainer.L_PosX; /// <summary> - /// 场景中唯一名称的节点, 节点类型: <see cref="Godot.HBoxContainer"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2 + /// 场景中唯一名称的节点, 节点类型: <see cref="Godot.SpinBox"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer2.VBoxContainer.HBoxContainer2.PosY /// </summary> - public HBoxContainer2 S_HBoxContainer2 => L_MarginContainer.L_VBoxContainer.L_HBoxContainer3.L_HBoxContainer2; + public PosY S_PosY => L_MarginContainer.L_VBoxContainer.L_HBoxContainer3.L_HBoxContainer2.L_VBoxContainer.L_HBoxContainer2.L_PosY; + + /// <summary> + /// 场景中唯一名称的节点, 节点类型: <see cref="Godot.Label"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3.SizeLabel + /// </summary> + public SizeLabel S_SizeLabel => L_MarginContainer.L_VBoxContainer.L_HBoxContainer3.L_HBoxContainer3.L_SizeLabel; + + /// <summary> + /// 场景中唯一名称的节点, 节点类型: <see cref="Godot.SpinBox"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3.VBoxContainer.HBoxContainer.SizeX + /// </summary> + public SizeX S_SizeX => L_MarginContainer.L_VBoxContainer.L_HBoxContainer3.L_HBoxContainer3.L_VBoxContainer.L_HBoxContainer.L_SizeX; + + /// <summary> + /// 场景中唯一名称的节点, 节点类型: <see cref="Godot.SpinBox"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer3.VBoxContainer.HBoxContainer2.SizeY + /// </summary> + public SizeY S_SizeY => L_MarginContainer.L_VBoxContainer.L_HBoxContainer3.L_HBoxContainer3.L_VBoxContainer.L_HBoxContainer2.L_SizeY; /// <summary> /// 场景中唯一名称的节点, 节点类型: <see cref="Godot.Label"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3.HBoxContainer.DelayNameLabel @@ -833,11 +1178,6 @@ public DelayInput S_DelayInput => L_MarginContainer.L_VBoxContainer.L_HBoxContainer3.L_HBoxContainer.L_DelayInput; /// <summary> - /// 场景中唯一名称的节点, 节点类型: <see cref="Godot.HBoxContainer"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.HBoxContainer3 - /// </summary> - public HBoxContainer3 S_HBoxContainer3 => L_MarginContainer.L_VBoxContainer.L_HBoxContainer3; - - /// <summary> /// 场景中唯一名称的节点, 节点类型: <see cref="Godot.Button"/>, 节点路径: MapEditorCreateMark.MarginContainer.VBoxContainer.AddMark /// </summary> public AddMark S_AddMark => L_MarginContainer.L_VBoxContainer.L_AddMark; diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/MapEditorCreateMarkPanel.cs b/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/MapEditorCreateMarkPanel.cs index 865ee2f..a958bc5 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/MapEditorCreateMarkPanel.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditorCreateMark/MapEditorCreateMarkPanel.cs @@ -28,20 +28,6 @@ { _grid.Destroy(); } - - /// <summary> - /// 初始化数据 - /// </summary> - public void InitData(RoomPreinstall preinstall, int waveIndex) - { - var optionButton = S_WaveOption.Instance; - for (var i = 0; i < preinstall.WaveList.Count; i++) - { - optionButton.AddItem($"第{i + 1}波"); - } - - optionButton.Selected = waveIndex; - } /// <summary> /// 获取填写的标记数据 @@ -52,6 +38,9 @@ data.Position = new SerializeVector2(); data.MarkList = new List<MarkInfoItem>(); data.DelayTime = (float)S_DelayInput.Instance.Value; + data.Position = new SerializeVector2((float)S_PosX.Instance.Value, (float)S_PosY.Instance.Value); + data.Size = new SerializeVector2((float)S_SizeX.Instance.Value, (float)S_SizeY.Instance.Value); + var gridCount = _grid.Count; for (var i = 0; i < gridCount; i++) { diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorMapMark/EditorMarkCell.cs b/DungeonShooting_Godot/src/game/ui/mapEditorMapMark/EditorMarkCell.cs index 688af7c..991817a 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditorMapMark/EditorMarkCell.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditorMapMark/EditorMarkCell.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using Config; namespace UI.MapEditorMapMark; @@ -9,6 +10,33 @@ CellNode.L_MarkButton.Instance.Pressed += OnClick; } + public override void OnSetData(MarkInfo data) + { + var text = ""; + if (data.MarkList != null) + { + var str = ""; + for (var i = 0; i < data.MarkList.Count; i++) + { + var markInfoItem = data.MarkList[i]; + if (i > 0) + { + str += ","; + } + + str += ExcelConfig.ActivityObject_Map[markInfoItem.Id].Name; + } + text += str; + } + else + { + text += "空"; + } + + text += "\n" + data.DelayTime + "秒"; + CellNode.L_MarkButton.Instance.Text = text; + } + public override void OnClick() { CellNode.UiPanel.SetSelectCell(this, CellNode.Instance, MapEditorMapMarkPanel.SelectToolType.Mark); diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorMapMark/EditorWaveCell.cs b/DungeonShooting_Godot/src/game/ui/mapEditorMapMark/EditorWaveCell.cs index 986060e..ed1967a 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditorMapMark/EditorWaveCell.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditorMapMark/EditorWaveCell.cs @@ -9,6 +9,7 @@ public override void OnInit() { + //这里不绑定 Click 函数, 而是绑定 OnClick, 因为 Select 交给 MapEditorMapMarkPanel 处理了 CellNode.L_WaveContainer.L_WaveButton.Instance.Pressed += OnClick; CellNode.L_WaveContainer.L_TextureButton.Instance.Pressed += OnExpandOrClose; CellNode.L_MarginContainer.L_AddMarkButton.Instance.Pressed += OnAddMark; @@ -38,11 +39,9 @@ //添加标记 private void OnAddMark() { - //当前选中的预设 - var preinstall = CellNode.UiPanel.GetSelectPreinstall(); //打开添加标记页面 - EditorWindowManager.ShowCreateMark(preinstall, Index, OnCreateMarkInfo); - } + EditorWindowManager.ShowCreateMark(OnCreateMarkInfo); + } //创建的标记完成 private void OnCreateMarkInfo(MarkInfo markInfo) @@ -72,6 +71,7 @@ public override void OnClick() { + CellNode.UiPanel.WaveSelectIndex = Index; CellNode.UiPanel.SetSelectCell(this, CellNode.L_WaveContainer.Instance, MapEditorMapMarkPanel.SelectToolType.Wave); } diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorMapMark/MapEditorMapMarkPanel.cs b/DungeonShooting_Godot/src/game/ui/mapEditorMapMark/MapEditorMapMarkPanel.cs index c08b525..6a0da84 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditorMapMark/MapEditorMapMarkPanel.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditorMapMark/MapEditorMapMarkPanel.cs @@ -28,15 +28,21 @@ /// </summary> public EditorTileMap EditorTileMap { get; private set; } + //波数网格组件 private UiGrid<WaveItem, List<MarkInfo>> _grid; + /// <summary> + /// 波数网格选中的索引 + /// </summary> + public int WaveSelectIndex { get; set; } = -1; + public override void OnCreateUi() { var editorPanel = (MapEditorPanel)ParentUi; EditorTileMap = editorPanel.S_TileMap.Instance; - S_DynamicTool.Instance.GetParent().RemoveChild(S_DynamicTool.Instance); - S_DynamicTool.Instance.Visible = true; + //S_DynamicTool.Instance.GetParent().RemoveChild(S_DynamicTool.Instance); + S_DynamicTool.Instance.Visible = false; _grid = new UiGrid<WaveItem, List<MarkInfo>>(S_WaveItem, typeof(EditorWaveCell)); _grid.SetCellOffset(new Vector2I(0, 10)); @@ -45,7 +51,9 @@ S_PreinstallOption.Instance.ItemSelected += OnItemSelected; S_AddPreinstall.Instance.Pressed += OnAddPreinstall; S_AddWaveButton.Instance.Pressed += OnAddWave; - + + S_EditButton.Instance.Pressed += OnToolEditClick; + S_DeleteButton.Instance.Pressed += OnToolDeleteClick; //S_Test.Instance. } @@ -137,6 +145,19 @@ return; } + if (toolType == SelectToolType.Wave) //不需要显示编辑波数按钮 + { + S_DynamicTool.L_EditButton.Instance.Visible = false; + } + else + { + S_DynamicTool.L_EditButton.Instance.Visible = true; + } + + //显示工具 + S_DynamicTool.Instance.Visible = true; + + //改变所在父节点 var parent = S_DynamicTool.Instance.GetParent(); if (parent != null) { @@ -162,7 +183,7 @@ { return; } - var parent = S_DynamicTool.Instance.GetParent(); + var parent = S_DynamicTool.GetParent(); if (parent != null) { parent.RemoveChild(S_DynamicTool.Instance); @@ -207,13 +228,27 @@ item.WaveList.Add(wave); _grid.Add(wave); } - - /// <summary> - /// 编辑波数据 - /// </summary> - public void OnEditWave() + + //工具节点编辑按钮点击 + private void OnToolEditClick() { - + if (ToolType == SelectToolType.Mark) + { + OnEditMark(); + } + } + + //工具节点删除按钮点击 + private void OnToolDeleteClick() + { + if (ToolType == SelectToolType.Wave) + { + OnDeleteWave(); + } + else if (ToolType == SelectToolType.Mark) + { + OnDeleteMark(); + } } @@ -222,7 +257,25 @@ /// </summary> public void OnDeleteWave() { + var index = WaveSelectIndex; + if (index < 0) + { + return; + } + var selectPreinstall = GetSelectPreinstall(); + if (selectPreinstall == null) + { + return; + } + + //隐藏工具 + S_DynamicTool.Reparent(this); + S_DynamicTool.Instance.Visible = false; + //移除数据 + selectPreinstall.WaveList.RemoveAt(index); + _grid.RemoveByIndex(index); + WaveSelectIndex = -1; } /// <summary>