diff --git a/DungeonShooting_Godot/prefab/ui/MapEditor.tscn b/DungeonShooting_Godot/prefab/ui/MapEditor.tscn index 357a8dd..dad58f2 100644 --- a/DungeonShooting_Godot/prefab/ui/MapEditor.tscn +++ b/DungeonShooting_Godot/prefab/ui/MapEditor.tscn @@ -192,14 +192,22 @@ size_flags_vertical = 3 [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="ScrollContainer" type="ScrollContainer" parent="Bg/VBoxContainer/HSplitContainer/Right/MarginContainer/TabContainer/MapLayer"] +[node name="VBoxContainer" type="VBoxContainer" parent="Bg/VBoxContainer/HSplitContainer/Right/MarginContainer/TabContainer/MapLayer"] +layout_mode = 2 + +[node name="LayerLabel" type="Label" parent="Bg/VBoxContainer/HSplitContainer/Right/MarginContainer/TabContainer/MapLayer/VBoxContainer"] +layout_mode = 2 +text = "地图层级:" + +[node name="ScrollContainer" type="ScrollContainer" parent="Bg/VBoxContainer/HSplitContainer/Right/MarginContainer/TabContainer/MapLayer/VBoxContainer"] layout_mode = 2 size_flags_vertical = 3 -[node name="LayerButton" type="Button" parent="Bg/VBoxContainer/HSplitContainer/Right/MarginContainer/TabContainer/MapLayer/ScrollContainer"] +[node name="LayerButton" type="Button" parent="Bg/VBoxContainer/HSplitContainer/Right/MarginContainer/TabContainer/MapLayer/VBoxContainer/ScrollContainer"] custom_minimum_size = Vector2(0, 70) layout_mode = 2 size_flags_horizontal = 3 @@ -207,7 +215,7 @@ icon = ExtResource("7_lli1g") alignment = 0 -[node name="VisibleButton" type="TextureButton" parent="Bg/VBoxContainer/HSplitContainer/Right/MarginContainer/TabContainer/MapLayer/ScrollContainer/LayerButton"] +[node name="VisibleButton" type="TextureButton" parent="Bg/VBoxContainer/HSplitContainer/Right/MarginContainer/TabContainer/MapLayer/VBoxContainer/ScrollContainer/LayerButton"] layout_mode = 1 anchors_preset = 11 anchor_left = 1.0 @@ -218,3 +226,14 @@ grow_vertical = 2 texture_normal = ExtResource("8_gm7y5") stretch_mode = 3 + +[node name="MarkLayer" type="MarginContainer" parent="Bg/VBoxContainer/HSplitContainer/Right/MarginContainer/TabContainer"] +layout_mode = 2 +theme_override_constants/margin_top = 10 + +[node name="VBoxContainer" type="VBoxContainer" parent="Bg/VBoxContainer/HSplitContainer/Right/MarginContainer/TabContainer/MarkLayer"] +layout_mode = 2 + +[node name="MarkLabel" type="Label" parent="Bg/VBoxContainer/HSplitContainer/Right/MarginContainer/TabContainer/MarkLayer/VBoxContainer"] +layout_mode = 2 +text = "对象生成标记" diff --git a/DungeonShooting_Godot/src/game/ui/mapEditor/MapEditor.cs b/DungeonShooting_Godot/src/game/ui/mapEditor/MapEditor.cs index 100a7f3..aa08f97 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditor/MapEditor.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditor/MapEditor.cs @@ -278,7 +278,16 @@ } /// - /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapLayer.ScrollContainer.LayerButton.VisibleButton + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapLayer.VBoxContainer.LayerLabel + /// + public class LayerLabel : UiNode + { + public LayerLabel(MapEditor uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override LayerLabel Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapLayer.VBoxContainer.ScrollContainer.LayerButton.VisibleButton /// public class VisibleButton : UiNode { @@ -287,12 +296,12 @@ } /// - /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapLayer.ScrollContainer.LayerButton + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapLayer.VBoxContainer.ScrollContainer.LayerButton /// public class LayerButton : UiNode { /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapLayer.ScrollContainer.VisibleButton + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapLayer.VBoxContainer.ScrollContainer.VisibleButton /// public VisibleButton L_VisibleButton { @@ -309,12 +318,12 @@ } /// - /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapLayer.ScrollContainer + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapLayer.VBoxContainer.ScrollContainer /// public class ScrollContainer : UiNode { /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapLayer.LayerButton + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapLayer.VBoxContainer.LayerButton /// public LayerButton L_LayerButton { @@ -331,12 +340,25 @@ } /// - /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapLayer + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapLayer.VBoxContainer /// - public class MapLayer : UiNode + public class VBoxContainer_1 : UiNode { /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.ScrollContainer + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapLayer.LayerLabel + /// + public LayerLabel L_LayerLabel + { + get + { + if (_L_LayerLabel == null) _L_LayerLabel = new LayerLabel(UiPanel, Instance.GetNodeOrNull("LayerLabel")); + return _L_LayerLabel; + } + } + private LayerLabel _L_LayerLabel; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapLayer.ScrollContainer /// public ScrollContainer L_ScrollContainer { @@ -348,11 +370,86 @@ } private ScrollContainer _L_ScrollContainer; + public VBoxContainer_1(MapEditor uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } + public override VBoxContainer_1 Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapLayer + /// + public class MapLayer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.VBoxContainer + /// + public VBoxContainer_1 L_VBoxContainer + { + get + { + if (_L_VBoxContainer == null) _L_VBoxContainer = new VBoxContainer_1(UiPanel, Instance.GetNodeOrNull("VBoxContainer")); + return _L_VBoxContainer; + } + } + private VBoxContainer_1 _L_VBoxContainer; + public MapLayer(MapEditor uiPanel, Godot.MarginContainer node) : base(uiPanel, node) { } public override MapLayer Clone() => new (UiPanel, (Godot.MarginContainer)Instance.Duplicate()); } /// + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MarkLayer.VBoxContainer.MarkLabel + /// + public class MarkLabel : UiNode + { + public MarkLabel(MapEditor uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override MarkLabel Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MarkLayer.VBoxContainer + /// + public class VBoxContainer_2 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MarkLayer.MarkLabel + /// + public MarkLabel L_MarkLabel + { + get + { + if (_L_MarkLabel == null) _L_MarkLabel = new MarkLabel(UiPanel, Instance.GetNodeOrNull("MarkLabel")); + return _L_MarkLabel; + } + } + private MarkLabel _L_MarkLabel; + + public VBoxContainer_2(MapEditor uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } + public override VBoxContainer_2 Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MarkLayer + /// + public class MarkLayer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.VBoxContainer + /// + public VBoxContainer_2 L_VBoxContainer + { + get + { + if (_L_VBoxContainer == null) _L_VBoxContainer = new VBoxContainer_2(UiPanel, Instance.GetNodeOrNull("VBoxContainer")); + return _L_VBoxContainer; + } + } + private VBoxContainer_2 _L_VBoxContainer; + + public MarkLayer(MapEditor uiPanel, Godot.MarginContainer node) : base(uiPanel, node) { } + public override MarkLayer Clone() => new (UiPanel, (Godot.MarginContainer)Instance.Duplicate()); + } + + /// /// 类型: , 路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer /// public class TabContainer : UiNode @@ -370,6 +467,19 @@ } private MapLayer _L_MapLayer; + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.MarkLayer + /// + public MarkLayer L_MarkLayer + { + get + { + if (_L_MarkLayer == null) _L_MarkLayer = new MarkLayer(UiPanel, Instance.GetNodeOrNull("MarkLayer")); + return _L_MarkLayer; + } + } + private MarkLayer _L_MarkLayer; + public TabContainer(MapEditor uiPanel, Godot.TabContainer node) : base(uiPanel, node) { } public override TabContainer Clone() => new (UiPanel, (Godot.TabContainer)Instance.Duplicate()); } @@ -567,19 +677,24 @@ public Left S_Left => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Left; /// - /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapLayer.ScrollContainer.LayerButton.VisibleButton + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapLayer.VBoxContainer.LayerLabel /// - public VisibleButton S_VisibleButton => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Right.L_MarginContainer.L_TabContainer.L_MapLayer.L_ScrollContainer.L_LayerButton.L_VisibleButton; + public LayerLabel S_LayerLabel => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Right.L_MarginContainer.L_TabContainer.L_MapLayer.L_VBoxContainer.L_LayerLabel; /// - /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapLayer.ScrollContainer.LayerButton + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapLayer.VBoxContainer.ScrollContainer.LayerButton.VisibleButton /// - public LayerButton S_LayerButton => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Right.L_MarginContainer.L_TabContainer.L_MapLayer.L_ScrollContainer.L_LayerButton; + public VisibleButton S_VisibleButton => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Right.L_MarginContainer.L_TabContainer.L_MapLayer.L_VBoxContainer.L_ScrollContainer.L_LayerButton.L_VisibleButton; /// - /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapLayer.ScrollContainer + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapLayer.VBoxContainer.ScrollContainer.LayerButton /// - public ScrollContainer S_ScrollContainer => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Right.L_MarginContainer.L_TabContainer.L_MapLayer.L_ScrollContainer; + public LayerButton S_LayerButton => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Right.L_MarginContainer.L_TabContainer.L_MapLayer.L_VBoxContainer.L_ScrollContainer.L_LayerButton; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapLayer.VBoxContainer.ScrollContainer + /// + public ScrollContainer S_ScrollContainer => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Right.L_MarginContainer.L_TabContainer.L_MapLayer.L_VBoxContainer.L_ScrollContainer; /// /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MapLayer @@ -587,6 +702,16 @@ 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.MarkLayer.VBoxContainer.MarkLabel + /// + public MarkLabel S_MarkLabel => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Right.L_MarginContainer.L_TabContainer.L_MarkLayer.L_VBoxContainer.L_MarkLabel; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer.MarkLayer + /// + public MarkLayer S_MarkLayer => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Right.L_MarginContainer.L_TabContainer.L_MarkLayer; + + /// /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer.HSplitContainer.Right.MarginContainer.TabContainer /// public TabContainer S_TabContainer => L_Bg.L_VBoxContainer.L_HSplitContainer.L_Right.L_MarginContainer.L_TabContainer; @@ -602,11 +727,6 @@ public HSplitContainer S_HSplitContainer => L_Bg.L_VBoxContainer.L_HSplitContainer; /// - /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg.VBoxContainer - /// - public VBoxContainer S_VBoxContainer => L_Bg.L_VBoxContainer; - - /// /// 场景中唯一名称的节点, 节点类型: , 节点路径: MapEditor.Bg /// public Bg S_Bg => L_Bg; diff --git a/DungeonShooting_Godot/src/game/ui/mapEditor/MapEditorPanel.cs b/DungeonShooting_Godot/src/game/ui/mapEditor/MapEditorPanel.cs index c380fbd..0bfd885 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditor/MapEditorPanel.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditor/MapEditorPanel.cs @@ -11,6 +11,7 @@ public override void OnCreateUi() { S_TabContainer.Instance.SetTabTitle(0, "地图"); + S_TabContainer.Instance.SetTabTitle(1, "对象"); //S_MapLayer.Instance.Init(S_MapLayer); _editorTileMapBar = new EditorTileMapBar(this, S_TileMap); diff --git a/DungeonShooting_Godot/src/game/ui/mapEditor/TileView/EditorTileMap.cs b/DungeonShooting_Godot/src/game/ui/mapEditor/TileView/EditorTileMap.cs index ffda939..eea44cd 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditor/TileView/EditorTileMap.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditor/TileView/EditorTileMap.cs @@ -1,7 +1,5 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text.Json; using Godot; using Godot.Collections; diff --git a/DungeonShooting_Godot/src/game/ui/mapEditor/tabView/layerTab/EditorLayerBar.cs b/DungeonShooting_Godot/src/game/ui/mapEditor/tabView/layerTab/EditorLayerBar.cs index a04dd28..8a820ff 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditor/tabView/layerTab/EditorLayerBar.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditor/tabView/layerTab/EditorLayerBar.cs @@ -35,7 +35,7 @@ { _mapEditorPanel = mapEditorPanel; _mapLayer = mapLayer; - _grid = new UiGrid(mapLayer.L_ScrollContainer.L_LayerButton, typeof(LayerButtonCell)); + _grid = new UiGrid(mapLayer.L_VBoxContainer.L_ScrollContainer.L_LayerButton, typeof(LayerButtonCell)); _grid.SetCellOffset(new Vector2I(0, 2)); _grid.SetHorizontalExpand(true);