diff --git a/DungeonShooting_Godot/prefab/ui/MapEditor.tscn b/DungeonShooting_Godot/prefab/ui/MapEditor.tscn index 21ca00a..8015e82 100644 --- a/DungeonShooting_Godot/prefab/ui/MapEditor.tscn +++ b/DungeonShooting_Godot/prefab/ui/MapEditor.tscn @@ -255,17 +255,22 @@ layout_mode = 2 size_flags_vertical = 3 -[node name="MapMark" type="MarginContainer" parent="Bg/VBoxContainer/HSplitContainer/Right/MarginContainer/TabContainer"] -layout_mode = 2 -theme_override_constants/margin_top = 10 - -[node name="MapEditorMapMark" parent="Bg/VBoxContainer/HSplitContainer/Right/MarginContainer/TabContainer/MapMark" instance=ExtResource("8_8tgeu")] -layout_mode = 2 - [node name="MapLayer" type="MarginContainer" parent="Bg/VBoxContainer/HSplitContainer/Right/MarginContainer/TabContainer"] -visible = false layout_mode = 2 theme_override_constants/margin_top = 10 [node name="MapEditorMapLayer" parent="Bg/VBoxContainer/HSplitContainer/Right/MarginContainer/TabContainer/MapLayer" instance=ExtResource("7_ychtn")] layout_mode = 2 + +[node name="MapTile" type="MarginContainer" parent="Bg/VBoxContainer/HSplitContainer/Right/MarginContainer/TabContainer"] +visible = false +layout_mode = 2 +theme_override_constants/margin_top = 10 + +[node name="MapMark" type="MarginContainer" parent="Bg/VBoxContainer/HSplitContainer/Right/MarginContainer/TabContainer"] +visible = false +layout_mode = 2 +theme_override_constants/margin_top = 10 + +[node name="MapEditorMapMark" parent="Bg/VBoxContainer/HSplitContainer/Right/MarginContainer/TabContainer/MapMark" instance=ExtResource("8_8tgeu")] +layout_mode = 2 diff --git a/DungeonShooting_Godot/prefab/ui/MapEditorMapLayer.tscn b/DungeonShooting_Godot/prefab/ui/MapEditorMapLayer.tscn index eabd3a6..739291c 100644 --- a/DungeonShooting_Godot/prefab/ui/MapEditorMapLayer.tscn +++ b/DungeonShooting_Godot/prefab/ui/MapEditorMapLayer.tscn @@ -1,8 +1,12 @@ -[gd_scene load_steps=4 format=3 uid="uid://bb2ekkpxifd7g"] +[gd_scene load_steps=8 format=3 uid="uid://bb2ekkpxifd7g"] [ext_resource type="Script" path="res://src/game/ui/mapEditorMapLayer/MapEditorMapLayerPanel.cs" id="1_3j05m"] +[ext_resource type="Texture2D" uid="uid://n4atvj5fkcpg" path="res://resource/sprite/ui/commonIcon/Add.png" id="2_f2gp6"] [ext_resource type="Texture2D" uid="uid://dmm8jw06bhffh" path="res://resource/sprite/ui/commonIcon/Lock.png" id="2_pfhyj"] +[ext_resource type="Texture2D" uid="uid://dggb6p4sdmfry" path="res://resource/sprite/ui/commonIcon/Edit.png" id="3_8g3vb"] +[ext_resource type="Texture2D" uid="uid://bn47bmilcw4x0" path="res://resource/sprite/ui/commonIcon/Select2.png" id="3_k8b5h"] [ext_resource type="Texture2D" uid="uid://dqvg18aacx6db" path="res://resource/sprite/ui/commonIcon/Visible.png" id="3_rqjh4"] +[ext_resource type="Texture2D" uid="uid://c5778ntk2rdon" path="res://resource/sprite/ui/commonIcon/Delete.png" id="4_h0gio"] [node name="MapEditorMapLayer" type="Control"] layout_mode = 3 @@ -21,10 +25,26 @@ grow_horizontal = 2 grow_vertical = 2 -[node name="LayerLabel" type="Label" parent="VBoxContainer"] +[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"] +layout_mode = 2 + +[node name="LayerLabel" type="Label" parent="VBoxContainer/HBoxContainer"] layout_mode = 2 text = "地图层级:" +[node name="AddButton" type="Button" parent="VBoxContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 10 +icon = ExtResource("2_f2gp6") + +[node name="EditButton" type="Button" parent="VBoxContainer/HBoxContainer"] +layout_mode = 2 +icon = ExtResource("3_8g3vb") + +[node name="DeleteButton" type="Button" parent="VBoxContainer/HBoxContainer"] +layout_mode = 2 +icon = ExtResource("4_h0gio") + [node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer"] layout_mode = 2 size_flags_vertical = 3 @@ -37,6 +57,19 @@ icon = ExtResource("2_pfhyj") alignment = 0 +[node name="SelectTexture" type="NinePatchRect" parent="VBoxContainer/ScrollContainer/LayerButton"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +texture = ExtResource("3_k8b5h") +patch_margin_left = 3 +patch_margin_top = 3 +patch_margin_right = 3 +patch_margin_bottom = 3 + [node name="VisibleButton" type="TextureButton" parent="VBoxContainer/ScrollContainer/LayerButton"] layout_mode = 1 anchors_preset = 11 diff --git a/DungeonShooting_Godot/prefab/ui/MapEditorTools.tscn b/DungeonShooting_Godot/prefab/ui/MapEditorTools.tscn index c8d6055..ba185f0 100644 --- a/DungeonShooting_Godot/prefab/ui/MapEditorTools.tscn +++ b/DungeonShooting_Godot/prefab/ui/MapEditorTools.tscn @@ -32,6 +32,7 @@ grow_vertical = 2 mouse_filter = 1 script = ExtResource("1_mqp1c") +metadata/_edit_vertical_guides_ = [1900.0] [node name="ToolRoot" type="Control" parent="."] anchors_preset = 0 @@ -201,3 +202,15 @@ patch_margin_top = 12 patch_margin_right = 12 patch_margin_bottom = 12 + +[node name="CurrLayer" type="Label" parent="."] +layout_mode = 1 +anchors_preset = 1 +anchor_left = 1.0 +anchor_right = 1.0 +offset_left = -220.0 +offset_top = 103.0 +offset_right = -20.0 +offset_bottom = 143.0 +grow_horizontal = 0 +text = "当前图层:地板" diff --git a/DungeonShooting_Godot/resource/map/tileMaps/Test1/outlet/End1/Preview.png b/DungeonShooting_Godot/resource/map/tileMaps/Test1/outlet/End1/Preview.png index e2c6849..3a075c0 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/Test1/outlet/End1/Preview.png +++ b/DungeonShooting_Godot/resource/map/tileMaps/Test1/outlet/End1/Preview.png Binary files differ diff --git a/DungeonShooting_Godot/resource/map/tileMaps/Test1/outlet/End1/TileInfo.json b/DungeonShooting_Godot/resource/map/tileMaps/Test1/outlet/End1/TileInfo.json index 3d8ad82..f4a21e1 100644 --- a/DungeonShooting_Godot/resource/map/tileMaps/Test1/outlet/End1/TileInfo.json +++ b/DungeonShooting_Godot/resource/map/tileMaps/Test1/outlet/End1/TileInfo.json @@ -1 +1 @@ -{"NavigationVertices":[{"X":42,"Y":34},{"X":-26,"Y":34},{"X":-26,"Y":-42},{"X":42,"Y":-42}],"NavigationPolygon":[[0,1,2,3]],"Floor":[-2,-1,0,3,-2,-2,0,3,-1,-2,0,3,0,-2,0,3,1,-2,0,3,1,-1,0,3,2,-1,0,3,0,-1,0,3,-1,-1,0,3,-2,0,0,3,-2,1,0,3,-1,1,0,3,0,1,0,3,1,1,0,3,2,1,0,3,2,0,0,3,1,0,0,3,0,0,0,3,-1,0,0,3,2,-2,0,3,2,-3,0,3,1,-3,0,3,0,-3,0,3,-1,-3,0,3,-2,-3,0,3],"Middle":[-2,-5,63,1,-2,-4,2,2,-1,-5,63,1,-1,-4,2,2,0,-5,63,1,0,-4,2,2,1,-5,63,1,1,-4,2,2,2,-5,63,1,2,-4,2,2],"Top":[-4,-6,511,1,-4,-5,511,1,-4,-4,511,1,-4,-3,511,1,-4,-2,511,1,-4,-1,511,1,-4,0,511,1,-4,1,511,1,-4,2,511,1,-4,3,511,1,-3,-6,511,1,-3,-5,255,1,-3,-4,219,1,-3,-3,219,1,-3,-2,219,1,-3,-1,219,1,-3,0,219,1,-3,1,219,1,-3,2,507,1,-3,3,511,1,-2,-6,511,1,-2,2,504,1,-2,3,511,1,-1,-6,511,1,-1,2,504,1,-1,3,511,1,0,-6,511,1,0,2,504,1,0,3,511,1,1,-6,511,1,1,2,504,1,1,3,511,1,2,-6,511,1,2,2,504,1,2,3,511,1,3,-6,511,1,3,-5,447,1,3,-4,438,1,3,-3,438,1,3,-2,438,1,3,-1,438,1,3,0,438,1,3,1,438,1,3,2,510,1,3,3,511,1,4,-6,511,1,4,-5,511,1,4,-4,511,1,4,-3,511,1,4,-2,511,1,4,-1,511,1,4,0,511,1,4,1,511,1,4,2,511,1,4,3,511,1]} \ No newline at end of file +{"NavigationVertices":[{"X":42,"Y":-42},{"X":42,"Y":34},{"X":22,"Y":6},{"X":22,"Y":-30},{"X":-26,"Y":-42},{"X":-6,"Y":-30},{"X":-26,"Y":34},{"X":-6,"Y":6}],"NavigationPolygon":[[0,1,2,3],[4,0,3,5],[2,1,6,7],[7,6,4,5]],"Floor":[-2,-1,0,3,-2,-2,0,3,-1,-2,0,3,1,-2,0,3,1,-1,0,3,2,-1,0,3,-1,-1,0,3,-2,0,0,3,-2,1,0,3,-1,1,0,3,0,1,0,3,1,1,0,3,2,1,0,3,2,0,0,3,1,0,0,3,0,0,0,3,-1,0,0,3,2,-2,0,3,2,-3,0,3,1,-3,0,3,0,-3,0,3,-1,-3,0,3,-2,-3,0,3],"Middle":[-2,-5,63,1,-2,-4,2,2,-1,-5,63,1,-1,-4,2,2,0,-5,63,1,0,-4,2,2,0,-2,16,1,0,-1,0,2,1,-5,63,1,1,-4,2,2,2,-5,63,1,2,-4,2,2],"Top":[-4,-6,511,1,-4,-5,511,1,-4,-4,511,1,-4,-3,511,1,-4,-2,511,1,-4,-1,511,1,-4,0,511,1,-4,1,511,1,-4,2,511,1,-4,3,511,1,-3,-6,511,1,-3,-5,255,1,-3,-4,219,1,-3,-3,219,1,-3,-2,219,1,-3,-1,219,1,-3,0,219,1,-3,1,219,1,-3,2,507,1,-3,3,511,1,-2,-6,511,1,-2,2,504,1,-2,3,511,1,-1,-6,511,1,-1,2,504,1,-1,3,511,1,0,-6,511,1,0,2,504,1,0,3,511,1,1,-6,511,1,1,2,504,1,1,3,511,1,2,-6,511,1,2,2,504,1,2,3,511,1,3,-6,511,1,3,-5,447,1,3,-4,438,1,3,-3,438,1,3,-2,438,1,3,-1,438,1,3,0,438,1,3,1,438,1,3,2,510,1,3,3,511,1,4,-6,511,1,4,-5,511,1,4,-4,511,1,4,-3,511,1,4,-2,511,1,4,-1,511,1,4,0,511,1,4,1,511,1,4,2,511,1,4,3,511,1]} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/framework/map/serialize/room/LayerData.cs b/DungeonShooting_Godot/src/framework/map/serialize/room/LayerData.cs new file mode 100644 index 0000000..65476ae --- /dev/null +++ b/DungeonShooting_Godot/src/framework/map/serialize/room/LayerData.cs @@ -0,0 +1,23 @@ + +using System.Text.Json.Serialization; + +/// +/// 层级数据 +/// +public class LayerData +{ + /// + /// 层级名称 + /// + [JsonInclude] public string Name; + + /// + /// 层级 + /// + [JsonInclude] public uint Layer; + + /// + /// 是否可见(仅在编辑器中) + /// + [JsonInclude] public bool Visible; +} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/event/EventEnum.cs b/DungeonShooting_Godot/src/game/event/EventEnum.cs index af3581a..5b325b5 100644 --- a/DungeonShooting_Godot/src/game/event/EventEnum.cs +++ b/DungeonShooting_Godot/src/game/event/EventEnum.cs @@ -147,6 +147,10 @@ /// 设置标记显示状态, 参数 /// OnSetMarkVisible, + /// + /// 选中TileMap编辑器中的层级, 参数为选择的层级索引, 参数 + /// + OnSelectTileLayer, /// /// 保存TileSet, 参数为 diff --git a/DungeonShooting_Godot/src/game/ui/mapEditor/MapEditor.cs b/DungeonShooting_Godot/src/game/ui/mapEditor/MapEditor.cs index a347165..993bedc 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditor/MapEditor.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditor/MapEditor.cs @@ -32,15 +32,15 @@ inst1.L_MapEditorTools.Instance.OnCreateUi(); inst1.L_MapEditorTools.Instance.OnInitNestedUi(); - var inst2 = L_Bg.L_VBoxContainer.L_HSplitContainer.L_Right.L_MarginContainer.L_TabContainer.L_MapMark; - RecordNestedUi(inst2.L_MapEditorMapMark.Instance, inst2, UiManager.RecordType.Open); - inst2.L_MapEditorMapMark.Instance.OnCreateUi(); - inst2.L_MapEditorMapMark.Instance.OnInitNestedUi(); + var inst2 = L_Bg.L_VBoxContainer.L_HSplitContainer.L_Right.L_MarginContainer.L_TabContainer.L_MapLayer; + RecordNestedUi(inst2.L_MapEditorMapLayer.Instance, inst2, UiManager.RecordType.Open); + inst2.L_MapEditorMapLayer.Instance.OnCreateUi(); + inst2.L_MapEditorMapLayer.Instance.OnInitNestedUi(); - var inst3 = L_Bg.L_VBoxContainer.L_HSplitContainer.L_Right.L_MarginContainer.L_TabContainer.L_MapLayer; - RecordNestedUi(inst3.L_MapEditorMapLayer.Instance, inst3, UiManager.RecordType.Open); - inst3.L_MapEditorMapLayer.Instance.OnCreateUi(); - inst3.L_MapEditorMapLayer.Instance.OnInitNestedUi(); + var inst3 = L_Bg.L_VBoxContainer.L_HSplitContainer.L_Right.L_MarginContainer.L_TabContainer.L_MapMark; + RecordNestedUi(inst3.L_MapEditorMapMark.Instance, inst3, UiManager.RecordType.Open); + inst3.L_MapEditorMapMark.Instance.OnCreateUi(); + inst3.L_MapEditorMapMark.Instance.OnInitNestedUi(); } @@ -422,44 +422,6 @@ } /// - /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapMark.MapEditorMapMark - /// - public class MapEditorMapMark : UiNode - { - public MapEditorMapMark(MapEditorPanel uiPanel, UI.MapEditorMapMark.MapEditorMapMarkPanel node) : base(uiPanel, node) { } - public override MapEditorMapMark Clone() - { - var uiNode = new MapEditorMapMark(UiPanel, (UI.MapEditorMapMark.MapEditorMapMarkPanel)Instance.Duplicate()); - UiPanel.RecordNestedUi(uiNode.Instance, this, UiManager.RecordType.Open); - uiNode.Instance.OnCreateUi(); - uiNode.Instance.OnInitNestedUi(); - return uiNode; - } - } - - /// - /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapMark - /// - public class MapMark : UiNode - { - /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapEditorMapMark - /// - public MapEditorMapMark L_MapEditorMapMark - { - get - { - if (_L_MapEditorMapMark == null) _L_MapEditorMapMark = new MapEditorMapMark(UiPanel, Instance.GetNode("MapEditorMapMark")); - return _L_MapEditorMapMark; - } - } - private MapEditorMapMark _L_MapEditorMapMark; - - public MapMark(MapEditorPanel uiPanel, Godot.MarginContainer node) : base(uiPanel, node) { } - public override MapMark Clone() => new (UiPanel, (Godot.MarginContainer)Instance.Duplicate()); - } - - /// /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapLayer.MapEditorMapLayer /// public class MapEditorMapLayer : UiNode @@ -498,24 +460,58 @@ } /// + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapTile + /// + public class MapTile : UiNode + { + public MapTile(MapEditorPanel uiPanel, Godot.MarginContainer node) : base(uiPanel, node) { } + public override MapTile Clone() => new (UiPanel, (Godot.MarginContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapMark.MapEditorMapMark + /// + public class MapEditorMapMark : UiNode + { + public MapEditorMapMark(MapEditorPanel uiPanel, UI.MapEditorMapMark.MapEditorMapMarkPanel node) : base(uiPanel, node) { } + public override MapEditorMapMark Clone() + { + var uiNode = new MapEditorMapMark(UiPanel, (UI.MapEditorMapMark.MapEditorMapMarkPanel)Instance.Duplicate()); + UiPanel.RecordNestedUi(uiNode.Instance, this, UiManager.RecordType.Open); + uiNode.Instance.OnCreateUi(); + uiNode.Instance.OnInitNestedUi(); + return uiNode; + } + } + + /// + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapMark + /// + public class MapMark : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapEditorMapMark + /// + public MapEditorMapMark L_MapEditorMapMark + { + get + { + if (_L_MapEditorMapMark == null) _L_MapEditorMapMark = new MapEditorMapMark(UiPanel, Instance.GetNode("MapEditorMapMark")); + return _L_MapEditorMapMark; + } + } + private MapEditorMapMark _L_MapEditorMapMark; + + public MapMark(MapEditorPanel uiPanel, Godot.MarginContainer node) : base(uiPanel, node) { } + public override MapMark Clone() => new (UiPanel, (Godot.MarginContainer)Instance.Duplicate()); + } + + /// /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer /// public class TabContainer : UiNode { /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.MapMark - /// - public MapMark L_MapMark - { - get - { - if (_L_MapMark == null) _L_MapMark = new MapMark(UiPanel, Instance.GetNode("MapMark")); - return _L_MapMark; - } - } - private MapMark _L_MapMark; - - /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.MapLayer /// public MapLayer L_MapLayer @@ -528,6 +524,32 @@ } private MapLayer _L_MapLayer; + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.MapTile + /// + public MapTile L_MapTile + { + get + { + if (_L_MapTile == null) _L_MapTile = new MapTile(UiPanel, Instance.GetNode("MapTile")); + return _L_MapTile; + } + } + private MapTile _L_MapTile; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.MapMark + /// + public MapMark L_MapMark + { + get + { + if (_L_MapMark == null) _L_MapMark = new MapMark(UiPanel, Instance.GetNode("MapMark")); + return _L_MapMark; + } + } + private MapMark _L_MapMark; + public TabContainer(MapEditorPanel uiPanel, Godot.TabContainer node) : base(uiPanel, node) { } public override TabContainer Clone() => new (UiPanel, (Godot.TabContainer)Instance.Duplicate()); } @@ -755,16 +777,6 @@ public Left S_Left => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Left; /// - /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapMark.MapEditorMapMark - /// - public MapEditorMapMark S_MapEditorMapMark => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Right.L_MarginContainer.L_TabContainer.L_MapMark.L_MapEditorMapMark; - - /// - /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapMark - /// - public MapMark S_MapMark => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Right.L_MarginContainer.L_TabContainer.L_MapMark; - - /// /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapLayer.MapEditorMapLayer /// public MapEditorMapLayer S_MapEditorMapLayer => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Right.L_MarginContainer.L_TabContainer.L_MapLayer.L_MapEditorMapLayer; @@ -775,6 +787,21 @@ public MapLayer S_MapLayer => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Right.L_MarginContainer.L_TabContainer.L_MapLayer; /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapTile + /// + public MapTile S_MapTile => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Right.L_MarginContainer.L_TabContainer.L_MapTile; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapMark.MapEditorMapMark + /// + public MapEditorMapMark S_MapEditorMapMark => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Right.L_MarginContainer.L_TabContainer.L_MapMark.L_MapEditorMapMark; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapMark + /// + public MapMark S_MapMark => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Right.L_MarginContainer.L_TabContainer.L_MapMark; + + /// /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer /// public TabContainer S_TabContainer => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Right.L_MarginContainer.L_TabContainer; diff --git a/DungeonShooting_Godot/src/game/ui/mapEditor/MapEditorPanel.cs b/DungeonShooting_Godot/src/game/ui/mapEditor/MapEditorPanel.cs index ecc78a1..6da38ff 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditor/MapEditorPanel.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditor/MapEditorPanel.cs @@ -31,8 +31,9 @@ var tileSetSplit = GameApplication.Instance.TileSetConfig.First().Value; S_TileMap.Instance.InitTileSet(tileSetSplit); - S_TabContainer.Instance.SetTabTitle(0, "对象"); - S_TabContainer.Instance.SetTabTitle(1, "图层"); + S_TabContainer.Instance.SetTabTitle(0, "图层"); + S_TabContainer.Instance.SetTabTitle(1, "图块"); + S_TabContainer.Instance.SetTabTitle(2, "对象"); //S_MapLayer.Instance.Init(S_MapLayer); S_Left.Instance.Resized += OnMapViewResized; S_Back.Instance.Pressed += OnBackClick; diff --git a/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs b/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs index 02ef800..c2ba6f7 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs @@ -38,30 +38,30 @@ /// 自动图块地板层 /// public const int AutoFloorLayer = 0; - /// - /// 自定义图块地板层 - /// - public const int CustomFloorLayer = 1; + // /// + // /// 自定义图块地板层 + // /// + // public const int CustomFloorLayer = 1; /// /// 自动图块中间层 /// - public const int AutoMiddleLayer = 2; - /// - /// 自定义图块中间层 - /// - public const int CustomMiddleLayer = 3; + public const int AutoMiddleLayer = 1; + // /// + // /// 自定义图块中间层 + // /// + // public const int CustomMiddleLayer = 3; /// /// 自动图块顶层 /// - public const int AutoTopLayer = 4; - /// - /// 自定义图块顶层 - /// - public const int CustomTopLayer = 5; + public const int AutoTopLayer = 2; + // /// + // /// 自定义图块顶层 + // /// + // public const int CustomTopLayer = 5; /// /// 标记数据层 /// - public const int MarkLayer = 10; + public const int MarkLayer = 999; /// /// 所属地图编辑器UI @@ -569,16 +569,16 @@ _initLayer = true; //初始化层级数据 - AddLayer(CustomFloorLayer); - SetLayerZIndex(CustomFloorLayer, CustomFloorLayer); + // AddLayer(CustomFloorLayer); + // SetLayerZIndex(CustomFloorLayer, CustomFloorLayer); AddLayer(AutoMiddleLayer); SetLayerZIndex(AutoMiddleLayer, AutoMiddleLayer); - AddLayer(CustomMiddleLayer); - SetLayerZIndex(CustomMiddleLayer, CustomMiddleLayer); + // AddLayer(CustomMiddleLayer); + // SetLayerZIndex(CustomMiddleLayer, CustomMiddleLayer); AddLayer(AutoTopLayer); SetLayerZIndex(AutoTopLayer, AutoTopLayer); - AddLayer(CustomTopLayer); - SetLayerZIndex(CustomTopLayer, CustomTopLayer); + // AddLayer(CustomTopLayer); + // SetLayerZIndex(CustomTopLayer, CustomTopLayer); } //缩小 @@ -1252,18 +1252,18 @@ MapEditorToolsPanel.Visible = false; //显示所有层级 _tempAutoFloorLayer = IsLayerEnabled(AutoFloorLayer); - _tempCustomFloorLayer = IsLayerEnabled(CustomFloorLayer); + //_tempCustomFloorLayer = IsLayerEnabled(CustomFloorLayer); _tempAutoMiddleLayer = IsLayerEnabled(AutoMiddleLayer); - _tempCustomMiddleLayer = IsLayerEnabled(CustomMiddleLayer); + //_tempCustomMiddleLayer = IsLayerEnabled(CustomMiddleLayer); _tempAutoTopLayer = IsLayerEnabled(AutoTopLayer); - _tempCustomTopLayer = IsLayerEnabled(CustomTopLayer); + //_tempCustomTopLayer = IsLayerEnabled(CustomTopLayer); SetLayerEnabled(AutoFloorLayer, true); - SetLayerEnabled(CustomFloorLayer, true); + //SetLayerEnabled(CustomFloorLayer, true); SetLayerEnabled(AutoMiddleLayer, true); - SetLayerEnabled(CustomMiddleLayer, true); + //SetLayerEnabled(CustomMiddleLayer, true); SetLayerEnabled(AutoTopLayer, true); - SetLayerEnabled(CustomTopLayer, true); + //SetLayerEnabled(CustomTopLayer, true); } private void OnFramePostDraw() @@ -1283,11 +1283,11 @@ MapEditorToolsPanel.Visible = true; //还原层级显示 SetLayerEnabled(AutoFloorLayer, _tempAutoFloorLayer); - SetLayerEnabled(CustomFloorLayer, _tempCustomFloorLayer); + //SetLayerEnabled(CustomFloorLayer, _tempCustomFloorLayer); SetLayerEnabled(AutoMiddleLayer, _tempAutoMiddleLayer); - SetLayerEnabled(CustomMiddleLayer, _tempCustomMiddleLayer); + //SetLayerEnabled(CustomMiddleLayer, _tempCustomMiddleLayer); SetLayerEnabled(AutoTopLayer, _tempAutoTopLayer); - SetLayerEnabled(CustomTopLayer, _tempCustomTopLayer); + //SetLayerEnabled(CustomTopLayer, _tempCustomTopLayer); //保存预览图 var subViewport = MapEditorPanel.S_SubViewport.Instance; diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorMapLayer/LayerButtonCell.cs b/DungeonShooting_Godot/src/game/ui/mapEditorMapLayer/LayerButtonCell.cs index 6f3a4f3..41b351d 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditorMapLayer/LayerButtonCell.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditorMapLayer/LayerButtonCell.cs @@ -9,6 +9,7 @@ public override void OnInit() { CellNode.L_VisibleButton.Instance.Pressed += OnVisibleButtonClick; + CellNode.L_SelectTexture.Instance.Visible = false; } public override void OnSetData(MapEditorMapLayerPanel.LayerButtonData data) @@ -67,4 +68,14 @@ CellNode.L_VisibleButton.Instance.TextureNormal = ResourceManager.LoadTexture2D(ResourcePath.resource_sprite_ui_commonIcon_Hide_png); } } + + public override void OnSelect() + { + CellNode.L_SelectTexture.Instance.Visible = true; + } + + public override void OnUnSelect() + { + CellNode.L_SelectTexture.Instance.Visible = false; + } } \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorMapLayer/MapEditorMapLayer.cs b/DungeonShooting_Godot/src/game/ui/mapEditorMapLayer/MapEditorMapLayer.cs index b21b499..fb0eda4 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditorMapLayer/MapEditorMapLayer.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditorMapLayer/MapEditorMapLayer.cs @@ -12,7 +12,7 @@ { get { - if (_L_VBoxContainer == null) _L_VBoxContainer = new VBoxContainer(this, GetNodeOrNull("VBoxContainer")); + if (_L_VBoxContainer == null) _L_VBoxContainer = new VBoxContainer((MapEditorMapLayerPanel)this, GetNode("VBoxContainer")); return _L_VBoxContainer; } } @@ -25,52 +25,163 @@ public sealed override void OnInitNestedUi() { + } /// - /// 类型: , 路径: MapEditorMapLayer.VBoxContainer.LayerLabel + /// 类型: , 路径: MapEditorMapLayer.VBoxContainer.HBoxContainer.LayerLabel /// - public class LayerLabel : UiNode + public class LayerLabel : UiNode { - public LayerLabel(MapEditorMapLayer uiPanel, Godot.Label node) : base(uiPanel, node) { } + public LayerLabel(MapEditorMapLayerPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } public override LayerLabel Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); } /// + /// 类型: , 路径: MapEditorMapLayer.VBoxContainer.HBoxContainer.AddButton + /// + public class AddButton : UiNode + { + public AddButton(MapEditorMapLayerPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override AddButton Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorMapLayer.VBoxContainer.HBoxContainer.EditButton + /// + public class EditButton : UiNode + { + public EditButton(MapEditorMapLayerPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override EditButton Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorMapLayer.VBoxContainer.HBoxContainer.DeleteButton + /// + public class DeleteButton : UiNode + { + public DeleteButton(MapEditorMapLayerPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override DeleteButton Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorMapLayer.VBoxContainer.HBoxContainer + /// + public class HBoxContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapLayer.VBoxContainer.LayerLabel + /// + public LayerLabel L_LayerLabel + { + get + { + if (_L_LayerLabel == null) _L_LayerLabel = new LayerLabel(UiPanel, Instance.GetNode("LayerLabel")); + return _L_LayerLabel; + } + } + private LayerLabel _L_LayerLabel; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapLayer.VBoxContainer.AddButton + /// + public AddButton L_AddButton + { + get + { + if (_L_AddButton == null) _L_AddButton = new AddButton(UiPanel, Instance.GetNode("AddButton")); + return _L_AddButton; + } + } + private AddButton _L_AddButton; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapLayer.VBoxContainer.EditButton + /// + public EditButton L_EditButton + { + get + { + if (_L_EditButton == null) _L_EditButton = new EditButton(UiPanel, Instance.GetNode("EditButton")); + return _L_EditButton; + } + } + private EditButton _L_EditButton; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapLayer.VBoxContainer.DeleteButton + /// + public DeleteButton L_DeleteButton + { + get + { + if (_L_DeleteButton == null) _L_DeleteButton = new DeleteButton(UiPanel, Instance.GetNode("DeleteButton")); + return _L_DeleteButton; + } + } + private DeleteButton _L_DeleteButton; + + public HBoxContainer(MapEditorMapLayerPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditorMapLayer.VBoxContainer.ScrollContainer.LayerButton.SelectTexture + /// + public class SelectTexture : UiNode + { + public SelectTexture(MapEditorMapLayerPanel uiPanel, Godot.NinePatchRect node) : base(uiPanel, node) { } + public override SelectTexture Clone() => new (UiPanel, (Godot.NinePatchRect)Instance.Duplicate()); + } + + /// /// 类型: , 路径: MapEditorMapLayer.VBoxContainer.ScrollContainer.LayerButton.VisibleButton /// - public class VisibleButton : UiNode + public class VisibleButton : UiNode { - public VisibleButton(MapEditorMapLayer uiPanel, Godot.TextureButton node) : base(uiPanel, node) { } + public VisibleButton(MapEditorMapLayerPanel uiPanel, Godot.TextureButton node) : base(uiPanel, node) { } public override VisibleButton Clone() => new (UiPanel, (Godot.TextureButton)Instance.Duplicate()); } /// /// 类型: , 路径: MapEditorMapLayer.VBoxContainer.ScrollContainer.LayerButton /// - public class LayerButton : UiNode + public class LayerButton : UiNode { /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapLayer.VBoxContainer.ScrollContainer.SelectTexture + /// + public SelectTexture L_SelectTexture + { + get + { + if (_L_SelectTexture == null) _L_SelectTexture = new SelectTexture(UiPanel, Instance.GetNode("SelectTexture")); + return _L_SelectTexture; + } + } + private SelectTexture _L_SelectTexture; + + /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapLayer.VBoxContainer.ScrollContainer.VisibleButton /// public VisibleButton L_VisibleButton { get { - if (_L_VisibleButton == null) _L_VisibleButton = new VisibleButton(UiPanel, Instance.GetNodeOrNull("VisibleButton")); + if (_L_VisibleButton == null) _L_VisibleButton = new VisibleButton(UiPanel, Instance.GetNode("VisibleButton")); return _L_VisibleButton; } } private VisibleButton _L_VisibleButton; - public LayerButton(MapEditorMapLayer uiPanel, Godot.Button node) : base(uiPanel, node) { } + public LayerButton(MapEditorMapLayerPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } public override LayerButton Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); } /// /// 类型: , 路径: MapEditorMapLayer.VBoxContainer.ScrollContainer /// - public class ScrollContainer : UiNode + public class ScrollContainer : UiNode { /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapLayer.VBoxContainer.LayerButton @@ -79,33 +190,33 @@ { get { - if (_L_LayerButton == null) _L_LayerButton = new LayerButton(UiPanel, Instance.GetNodeOrNull("LayerButton")); + if (_L_LayerButton == null) _L_LayerButton = new LayerButton(UiPanel, Instance.GetNode("LayerButton")); return _L_LayerButton; } } private LayerButton _L_LayerButton; - public ScrollContainer(MapEditorMapLayer uiPanel, Godot.ScrollContainer node) : base(uiPanel, node) { } + public ScrollContainer(MapEditorMapLayerPanel uiPanel, Godot.ScrollContainer node) : base(uiPanel, node) { } public override ScrollContainer Clone() => new (UiPanel, (Godot.ScrollContainer)Instance.Duplicate()); } /// /// 类型: , 路径: MapEditorMapLayer.VBoxContainer /// - public class VBoxContainer : UiNode + public class VBoxContainer : UiNode { /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapLayer.LayerLabel + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapLayer.HBoxContainer /// - public LayerLabel L_LayerLabel + public HBoxContainer L_HBoxContainer { get { - if (_L_LayerLabel == null) _L_LayerLabel = new LayerLabel(UiPanel, Instance.GetNodeOrNull("LayerLabel")); - return _L_LayerLabel; + if (_L_HBoxContainer == null) _L_HBoxContainer = new HBoxContainer(UiPanel, Instance.GetNode("HBoxContainer")); + return _L_HBoxContainer; } } - private LayerLabel _L_LayerLabel; + private HBoxContainer _L_HBoxContainer; /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorMapLayer.ScrollContainer @@ -114,21 +225,46 @@ { get { - if (_L_ScrollContainer == null) _L_ScrollContainer = new ScrollContainer(UiPanel, Instance.GetNodeOrNull("ScrollContainer")); + if (_L_ScrollContainer == null) _L_ScrollContainer = new ScrollContainer(UiPanel, Instance.GetNode("ScrollContainer")); return _L_ScrollContainer; } } private ScrollContainer _L_ScrollContainer; - public VBoxContainer(MapEditorMapLayer uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } + public VBoxContainer(MapEditorMapLayerPanel uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } public override VBoxContainer Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); } /// - /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapLayer.VBoxContainer.LayerLabel + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapLayer.VBoxContainer.HBoxContainer.LayerLabel /// - public LayerLabel S_LayerLabel => L_VBoxContainer.L_LayerLabel; + public LayerLabel S_LayerLabel => L_VBoxContainer.L_HBoxContainer.L_LayerLabel; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapLayer.VBoxContainer.HBoxContainer.AddButton + /// + public AddButton S_AddButton => L_VBoxContainer.L_HBoxContainer.L_AddButton; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapLayer.VBoxContainer.HBoxContainer.EditButton + /// + public EditButton S_EditButton => L_VBoxContainer.L_HBoxContainer.L_EditButton; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapLayer.VBoxContainer.HBoxContainer.DeleteButton + /// + public DeleteButton S_DeleteButton => L_VBoxContainer.L_HBoxContainer.L_DeleteButton; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapLayer.VBoxContainer.HBoxContainer + /// + public HBoxContainer S_HBoxContainer => L_VBoxContainer.L_HBoxContainer; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapLayer.VBoxContainer.ScrollContainer.LayerButton.SelectTexture + /// + public SelectTexture S_SelectTexture => L_VBoxContainer.L_ScrollContainer.L_LayerButton.L_SelectTexture; /// /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorMapLayer.VBoxContainer.ScrollContainer.LayerButton.VisibleButton diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorMapLayer/MapEditorMapLayerPanel.cs b/DungeonShooting_Godot/src/game/ui/mapEditorMapLayer/MapEditorMapLayerPanel.cs index ff3448e..2645af5 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditorMapLayer/MapEditorMapLayerPanel.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditorMapLayer/MapEditorMapLayerPanel.cs @@ -36,13 +36,11 @@ _grid.SetCellOffset(new Vector2I(0, 2)); _grid.SetHorizontalExpand(true); - _grid.Add(new LayerButtonData("地面", false, EditorTileMap.AutoFloorLayer)); - _grid.Add(new LayerButtonData("自定义底层", false, EditorTileMap.CustomFloorLayer)); - _grid.Add(new LayerButtonData("中层自动图块", true, EditorTileMap.AutoMiddleLayer)); - _grid.Add(new LayerButtonData("自定义中层", false, EditorTileMap.CustomMiddleLayer)); - _grid.Add(new LayerButtonData("高层自动图块", true, EditorTileMap.AutoTopLayer)); - _grid.Add(new LayerButtonData("自定义高层", false, EditorTileMap.CustomTopLayer)); + _grid.Add(new LayerButtonData("地板", false, EditorTileMap.AutoFloorLayer)); + _grid.Add(new LayerButtonData("侧方墙壁", true, EditorTileMap.AutoMiddleLayer)); + _grid.Add(new LayerButtonData("顶部墙壁", true, EditorTileMap.AutoTopLayer)); _grid.Add(new LayerButtonData("标记数据层", false, EditorTileMap.MarkLayer)); + _grid.SelectIndex = 0; } public override void OnDestroyUi() diff --git a/DungeonShooting_Godot/src/game/ui/mapEditorTools/MapEditorTools.cs b/DungeonShooting_Godot/src/game/ui/mapEditorTools/MapEditorTools.cs index 77fc4eb..e0f9d8b 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditorTools/MapEditorTools.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditorTools/MapEditorTools.cs @@ -12,7 +12,7 @@ { get { - if (_L_ToolRoot == null) _L_ToolRoot = new ToolRoot((MapEditorToolsPanel)this, GetNodeOrNull("ToolRoot")); + if (_L_ToolRoot == null) _L_ToolRoot = new ToolRoot((MapEditorToolsPanel)this, GetNode("ToolRoot")); return _L_ToolRoot; } } @@ -25,12 +25,25 @@ { get { - if (_L_HBoxContainer == null) _L_HBoxContainer = new HBoxContainer((MapEditorToolsPanel)this, GetNodeOrNull("HBoxContainer")); + if (_L_HBoxContainer == null) _L_HBoxContainer = new HBoxContainer((MapEditorToolsPanel)this, GetNode("HBoxContainer")); return _L_HBoxContainer; } } private HBoxContainer _L_HBoxContainer; + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditorTools.CurrLayer + /// + public CurrLayer L_CurrLayer + { + get + { + if (_L_CurrLayer == null) _L_CurrLayer = new CurrLayer((MapEditorToolsPanel)this, GetNode("CurrLayer")); + return _L_CurrLayer; + } + } + private CurrLayer _L_CurrLayer; + public MapEditorTools() : base(nameof(MapEditorTools)) { @@ -63,7 +76,7 @@ { get { - if (_L_N_HoverArea == null) _L_N_HoverArea = new N_HoverArea(UiPanel, Instance.GetNodeOrNull("N_HoverArea")); + if (_L_N_HoverArea == null) _L_N_HoverArea = new N_HoverArea(UiPanel, Instance.GetNode("N_HoverArea")); return _L_N_HoverArea; } } @@ -94,7 +107,7 @@ { get { - if (_L_E_HoverArea == null) _L_E_HoverArea = new E_HoverArea(UiPanel, Instance.GetNodeOrNull("E_HoverArea")); + if (_L_E_HoverArea == null) _L_E_HoverArea = new E_HoverArea(UiPanel, Instance.GetNode("E_HoverArea")); return _L_E_HoverArea; } } @@ -125,7 +138,7 @@ { get { - if (_L_S_HoverArea == null) _L_S_HoverArea = new S_HoverArea(UiPanel, Instance.GetNodeOrNull("S_HoverArea")); + if (_L_S_HoverArea == null) _L_S_HoverArea = new S_HoverArea(UiPanel, Instance.GetNode("S_HoverArea")); return _L_S_HoverArea; } } @@ -156,7 +169,7 @@ { get { - if (_L_W_HoverArea == null) _L_W_HoverArea = new W_HoverArea(UiPanel, Instance.GetNodeOrNull("W_HoverArea")); + if (_L_W_HoverArea == null) _L_W_HoverArea = new W_HoverArea(UiPanel, Instance.GetNode("W_HoverArea")); return _L_W_HoverArea; } } @@ -187,7 +200,7 @@ { get { - if (_L_HoverPreview == null) _L_HoverPreview = new HoverPreview(UiPanel, Instance.GetNodeOrNull("HoverPreview")); + if (_L_HoverPreview == null) _L_HoverPreview = new HoverPreview(UiPanel, Instance.GetNode("HoverPreview")); return _L_HoverPreview; } } @@ -236,7 +249,7 @@ { get { - if (_L_DoorArea == null) _L_DoorArea = new DoorArea(UiPanel, Instance.GetNodeOrNull("DoorArea")); + if (_L_DoorArea == null) _L_DoorArea = new DoorArea(UiPanel, Instance.GetNode("DoorArea")); return _L_DoorArea; } } @@ -249,7 +262,7 @@ { get { - if (_L_StartBtn == null) _L_StartBtn = new StartBtn(UiPanel, Instance.GetNodeOrNull("StartBtn")); + if (_L_StartBtn == null) _L_StartBtn = new StartBtn(UiPanel, Instance.GetNode("StartBtn")); return _L_StartBtn; } } @@ -262,7 +275,7 @@ { get { - if (_L_EndBtn == null) _L_EndBtn = new EndBtn(UiPanel, Instance.GetNodeOrNull("EndBtn")); + if (_L_EndBtn == null) _L_EndBtn = new EndBtn(UiPanel, Instance.GetNode("EndBtn")); return _L_EndBtn; } } @@ -293,7 +306,7 @@ { get { - if (_L_N_HoverRoot == null) _L_N_HoverRoot = new N_HoverRoot(UiPanel, Instance.GetNodeOrNull("N_HoverRoot")); + if (_L_N_HoverRoot == null) _L_N_HoverRoot = new N_HoverRoot(UiPanel, Instance.GetNode("N_HoverRoot")); return _L_N_HoverRoot; } } @@ -306,7 +319,7 @@ { get { - if (_L_E_HoverRoot == null) _L_E_HoverRoot = new E_HoverRoot(UiPanel, Instance.GetNodeOrNull("E_HoverRoot")); + if (_L_E_HoverRoot == null) _L_E_HoverRoot = new E_HoverRoot(UiPanel, Instance.GetNode("E_HoverRoot")); return _L_E_HoverRoot; } } @@ -319,7 +332,7 @@ { get { - if (_L_S_HoverRoot == null) _L_S_HoverRoot = new S_HoverRoot(UiPanel, Instance.GetNodeOrNull("S_HoverRoot")); + if (_L_S_HoverRoot == null) _L_S_HoverRoot = new S_HoverRoot(UiPanel, Instance.GetNode("S_HoverRoot")); return _L_S_HoverRoot; } } @@ -332,7 +345,7 @@ { get { - if (_L_W_HoverRoot == null) _L_W_HoverRoot = new W_HoverRoot(UiPanel, Instance.GetNodeOrNull("W_HoverRoot")); + if (_L_W_HoverRoot == null) _L_W_HoverRoot = new W_HoverRoot(UiPanel, Instance.GetNode("W_HoverRoot")); return _L_W_HoverRoot; } } @@ -345,7 +358,7 @@ { get { - if (_L_HoverPreviewRoot == null) _L_HoverPreviewRoot = new HoverPreviewRoot(UiPanel, Instance.GetNodeOrNull("HoverPreviewRoot")); + if (_L_HoverPreviewRoot == null) _L_HoverPreviewRoot = new HoverPreviewRoot(UiPanel, Instance.GetNode("HoverPreviewRoot")); return _L_HoverPreviewRoot; } } @@ -358,7 +371,7 @@ { get { - if (_L_DoorToolTemplate == null) _L_DoorToolTemplate = new DoorToolTemplate(UiPanel, Instance.GetNodeOrNull("DoorToolTemplate")); + if (_L_DoorToolTemplate == null) _L_DoorToolTemplate = new DoorToolTemplate(UiPanel, Instance.GetNode("DoorToolTemplate")); return _L_DoorToolTemplate; } } @@ -371,7 +384,7 @@ { get { - if (_L_MarkTemplate == null) _L_MarkTemplate = new MarkTemplate(UiPanel, Instance.GetNodeOrNull("MarkTemplate")); + if (_L_MarkTemplate == null) _L_MarkTemplate = new MarkTemplate(UiPanel, Instance.GetNode("MarkTemplate")); return _L_MarkTemplate; } } @@ -402,7 +415,7 @@ { get { - if (_L_Select == null) _L_Select = new Select(UiPanel, Instance.GetNodeOrNull("Select")); + if (_L_Select == null) _L_Select = new Select(UiPanel, Instance.GetNode("Select")); return _L_Select; } } @@ -424,7 +437,7 @@ { get { - if (_L_ToolButton == null) _L_ToolButton = new ToolButton(UiPanel, Instance.GetNodeOrNull("ToolButton")); + if (_L_ToolButton == null) _L_ToolButton = new ToolButton(UiPanel, Instance.GetNode("ToolButton")); return _L_ToolButton; } } @@ -434,6 +447,15 @@ public override HBoxContainer Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); } + /// + /// 类型: , 路径: MapEditorTools.CurrLayer + /// + public class CurrLayer : UiNode + { + public CurrLayer(MapEditorToolsPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override CurrLayer Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + /// /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorTools.ToolRoot.N_HoverRoot.N_HoverArea @@ -530,4 +552,9 @@ /// public HBoxContainer S_HBoxContainer => L_HBoxContainer; + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditorTools.CurrLayer + /// + public CurrLayer S_CurrLayer => L_CurrLayer; + }