diff --git a/DungeonShooting_Godot/prefab/ui/TileSetEditorTerrain.tscn b/DungeonShooting_Godot/prefab/ui/TileSetEditorTerrain.tscn index 0ca53e3..449bd53 100644 --- a/DungeonShooting_Godot/prefab/ui/TileSetEditorTerrain.tscn +++ b/DungeonShooting_Godot/prefab/ui/TileSetEditorTerrain.tscn @@ -1,8 +1,11 @@ -[gd_scene load_steps=11 format=3 uid="uid://dfqb73y4br8yd"] +[gd_scene load_steps=14 format=3 uid="uid://dfqb73y4br8yd"] [ext_resource type="Script" path="res://src/game/ui/tileSetEditorTerrain/TileSetEditorTerrainPanel.cs" id="1_6jjk7"] +[ext_resource type="Texture2D" uid="uid://n4atvj5fkcpg" path="res://resource/sprite/ui/commonIcon/Add.png" id="2_ns54l"] [ext_resource type="Script" path="res://src/game/ui/tileSetEditorTerrain/down/TileEditArea.cs" id="2_ynf0r"] [ext_resource type="Script" path="res://src/game/common/ui/EditorMaskBrush.cs" id="3_gydh0"] +[ext_resource type="Texture2D" uid="uid://c5778ntk2rdon" path="res://resource/sprite/ui/commonIcon/Delete.png" id="3_jn1bd"] +[ext_resource type="Texture2D" uid="uid://bn47bmilcw4x0" path="res://resource/sprite/ui/commonIcon/Select2.png" id="4_ka47m"] [ext_resource type="Script" path="res://src/game/ui/tileSetEditorTerrain/up/TileEditTerrain.cs" id="5_0x7yx"] [ext_resource type="Texture2D" uid="uid://d2wslibovwv7w" path="res://resource/sprite/ui/commonIcon/CenterTool.png" id="5_08bc4"] [ext_resource type="Texture2D" uid="uid://bud6ah5xyey37" path="res://resource/sprite/map/TerrainMask2.png" id="5_xabgh"] @@ -34,19 +37,76 @@ size_flags_vertical = 3 size_flags_stretch_ratio = 50.0 -[node name="MarginContainer" type="MarginContainer" parent="VSplitContainer/PanelTop"] +[node name="HSplitContainer" type="HSplitContainer" parent="VSplitContainer/PanelTop"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = 2.0 +offset_top = 2.0 +offset_right = -2.0 +offset_bottom = -2.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="TopTab" type="Panel" parent="VSplitContainer/PanelTop/HSplitContainer"] +custom_minimum_size = Vector2(250, 0) +layout_mode = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="VSplitContainer/PanelTop/HSplitContainer/TopTab"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = 2.0 +offset_top = 2.0 +offset_right = -2.0 +offset_bottom = -2.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="VSplitContainer/PanelTop/HSplitContainer/TopTab/VBoxContainer"] +custom_minimum_size = Vector2(0, 50) +layout_mode = 2 + +[node name="Label" type="Label" parent="VSplitContainer/PanelTop/HSplitContainer/TopTab/VBoxContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +text = "地形:" + +[node name="AddButton" type="Button" parent="VSplitContainer/PanelTop/HSplitContainer/TopTab/VBoxContainer/HBoxContainer"] +layout_mode = 2 +icon = ExtResource("2_ns54l") + +[node name="DeleteButton" type="Button" parent="VSplitContainer/PanelTop/HSplitContainer/TopTab/VBoxContainer/HBoxContainer"] +layout_mode = 2 +icon = ExtResource("3_jn1bd") + +[node name="ScrollContainer" type="ScrollContainer" parent="VSplitContainer/PanelTop/HSplitContainer/TopTab/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="TerrainTab" type="Button" parent="VSplitContainer/PanelTop/HSplitContainer/TopTab/VBoxContainer/ScrollContainer"] +custom_minimum_size = Vector2(0, 50) +layout_mode = 2 +size_flags_horizontal = 3 +text = "name" +text_overrun_behavior = 3 + +[node name="SelectTexture" type="NinePatchRect" parent="VSplitContainer/PanelTop/HSplitContainer/TopTab/VBoxContainer/ScrollContainer/TerrainTab"] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -theme_override_constants/margin_left = 2 -theme_override_constants/margin_top = 2 -theme_override_constants/margin_right = 2 -theme_override_constants/margin_bottom = 2 +texture = ExtResource("4_ka47m") +patch_margin_left = 3 +patch_margin_top = 3 +patch_margin_right = 3 +patch_margin_bottom = 3 -[node name="TopBg" type="ColorRect" parent="VSplitContainer/PanelTop/MarginContainer"] +[node name="TopBg" type="ColorRect" parent="VSplitContainer/PanelTop/HSplitContainer"] clip_children = 2 z_index = 1 layout_mode = 2 @@ -54,7 +114,7 @@ color = Color(0.496094, 0.496094, 0.496094, 1) script = ExtResource("5_0x7yx") -[node name="TerrainRoot" type="Control" parent="VSplitContainer/PanelTop/MarginContainer/TopBg"] +[node name="TerrainRoot" type="Control" parent="VSplitContainer/PanelTop/HSplitContainer/TopBg"] layout_mode = 1 anchors_preset = 8 anchor_left = 0.5 @@ -70,25 +130,25 @@ scale = Vector2(3, 3) mouse_filter = 2 -[node name="CellRoot" type="Control" parent="VSplitContainer/PanelTop/MarginContainer/TopBg/TerrainRoot"] +[node name="CellRoot" type="Control" parent="VSplitContainer/PanelTop/HSplitContainer/TopBg/TerrainRoot"] layout_mode = 3 anchors_preset = 0 offset_right = 1.0 offset_bottom = 1.0 mouse_filter = 2 -[node name="RightCell" type="Control" parent="VSplitContainer/PanelTop/MarginContainer/TopBg/TerrainRoot/CellRoot"] +[node name="RightCell" type="Control" parent="VSplitContainer/PanelTop/HSplitContainer/TopBg/TerrainRoot/CellRoot"] z_index = 1 anchors_preset = 0 offset_right = 16.0 offset_bottom = 16.0 mouse_filter = 1 -[node name="CellTexture" type="Sprite2D" parent="VSplitContainer/PanelTop/MarginContainer/TopBg/TerrainRoot/CellRoot/RightCell"] +[node name="CellTexture" type="Sprite2D" parent="VSplitContainer/PanelTop/HSplitContainer/TopBg/TerrainRoot/CellRoot/RightCell"] z_index = -1 centered = false -[node name="TerrainTexture1" type="TextureRect" parent="VSplitContainer/PanelTop/MarginContainer/TopBg/TerrainRoot"] +[node name="TerrainTexture1" type="TextureRect" parent="VSplitContainer/PanelTop/HSplitContainer/TopBg/TerrainRoot"] self_modulate = Color(1, 1, 1, 0.27451) custom_minimum_size = Vector2(192, 64) layout_mode = 1 @@ -97,7 +157,7 @@ mouse_filter = 2 texture = ExtResource("7_g8dxk") -[node name="Label" type="Label" parent="VSplitContainer/PanelTop/MarginContainer/TopBg/TerrainRoot/TerrainTexture1"] +[node name="Label" type="Label" parent="VSplitContainer/PanelTop/HSplitContainer/TopBg/TerrainRoot/TerrainTexture1"] layout_mode = 0 offset_top = -10.0 offset_right = 136.0 @@ -105,7 +165,7 @@ scale = Vector2(0.25, 0.25) text = "顶部墙壁" -[node name="TerrainTexture2" type="TextureRect" parent="VSplitContainer/PanelTop/MarginContainer/TopBg/TerrainRoot"] +[node name="TerrainTexture2" type="TextureRect" parent="VSplitContainer/PanelTop/HSplitContainer/TopBg/TerrainRoot"] self_modulate = Color(1, 1, 1, 0.27451) custom_minimum_size = Vector2(64, 16) layout_mode = 1 @@ -115,7 +175,7 @@ mouse_filter = 2 texture = ExtResource("5_xabgh") -[node name="Label" type="Label" parent="VSplitContainer/PanelTop/MarginContainer/TopBg/TerrainRoot/TerrainTexture2"] +[node name="Label" type="Label" parent="VSplitContainer/PanelTop/HSplitContainer/TopBg/TerrainRoot/TerrainTexture2"] layout_mode = 0 offset_top = -10.0 offset_right = 136.0 @@ -123,7 +183,7 @@ scale = Vector2(0.25, 0.25) text = "侧方墙壁" -[node name="TerrainTexture3" type="TextureRect" parent="VSplitContainer/PanelTop/MarginContainer/TopBg/TerrainRoot"] +[node name="TerrainTexture3" type="TextureRect" parent="VSplitContainer/PanelTop/HSplitContainer/TopBg/TerrainRoot"] self_modulate = Color(1, 1, 1, 0.27451) custom_minimum_size = Vector2(16, 16) layout_mode = 1 @@ -134,7 +194,7 @@ mouse_filter = 2 texture = ExtResource("6_vmj5y") -[node name="Label" type="Label" parent="VSplitContainer/PanelTop/MarginContainer/TopBg/TerrainRoot/TerrainTexture3"] +[node name="Label" type="Label" parent="VSplitContainer/PanelTop/HSplitContainer/TopBg/TerrainRoot/TerrainTexture3"] layout_mode = 0 offset_top = -10.0 offset_right = 136.0 @@ -142,7 +202,7 @@ scale = Vector2(0.25, 0.25) text = "地板" -[node name="TerrainTexture4" type="TextureRect" parent="VSplitContainer/PanelTop/MarginContainer/TopBg/TerrainRoot"] +[node name="TerrainTexture4" type="TextureRect" parent="VSplitContainer/PanelTop/HSplitContainer/TopBg/TerrainRoot"] visible = false self_modulate = Color(1, 1, 1, 0.27451) custom_minimum_size = Vector2(80, 48) @@ -152,7 +212,7 @@ mouse_filter = 2 texture = ExtResource("6_vbhca") -[node name="Label" type="Label" parent="VSplitContainer/PanelTop/MarginContainer/TopBg/TerrainRoot/TerrainTexture4"] +[node name="Label" type="Label" parent="VSplitContainer/PanelTop/HSplitContainer/TopBg/TerrainRoot/TerrainTexture4"] layout_mode = 0 offset_top = -10.0 offset_right = 136.0 @@ -160,7 +220,7 @@ scale = Vector2(0.25, 0.25) text = "地形" -[node name="Brush" type="Control" parent="VSplitContainer/PanelTop/MarginContainer/TopBg/TerrainRoot"] +[node name="Brush" type="Control" parent="VSplitContainer/PanelTop/HSplitContainer/TopBg/TerrainRoot"] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -170,7 +230,7 @@ mouse_filter = 2 script = ExtResource("7_lmu64") -[node name="Grid" type="ColorRect" parent="VSplitContainer/PanelTop/MarginContainer/TopBg"] +[node name="Grid" type="ColorRect" parent="VSplitContainer/PanelTop/HSplitContainer/TopBg"] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -180,7 +240,7 @@ mouse_filter = 2 color = Color(1, 1, 1, 0) -[node name="FocusBtn" type="TextureButton" parent="VSplitContainer/PanelTop/MarginContainer/TopBg"] +[node name="FocusBtn" type="TextureButton" parent="VSplitContainer/PanelTop/HSplitContainer/TopBg"] layout_mode = 1 anchors_preset = 1 anchor_left = 1.0 @@ -195,49 +255,29 @@ ignore_texture_size = true stretch_mode = 5 -[node name="TerrainTypeButton" type="OptionButton" parent="VSplitContainer/PanelTop/MarginContainer/TopBg"] -layout_mode = 1 -anchors_preset = 1 -anchor_left = 1.0 -anchor_right = 1.0 -offset_left = -330.0 -offset_top = 14.0 -offset_right = -94.0 -offset_bottom = 69.0 -grow_horizontal = 0 -item_count = 2 -selected = 0 -popup/item_0/text = "3x3(47格)" -popup/item_0/id = 0 -popup/item_1/text = "2x2(13格)" -popup/item_1/id = 1 - [node name="PanelBottom" type="Panel" parent="VSplitContainer"] layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 size_flags_stretch_ratio = 50.0 -[node name="MarginContainer" type="MarginContainer" parent="VSplitContainer/PanelBottom"] +[node name="BottomBg" type="ColorRect" parent="VSplitContainer/PanelBottom"] +clip_children = 2 +z_index = 1 layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 +offset_left = 2.0 +offset_top = 2.0 +offset_right = -2.0 +offset_bottom = -2.0 grow_horizontal = 2 grow_vertical = 2 -theme_override_constants/margin_left = 2 -theme_override_constants/margin_top = 2 -theme_override_constants/margin_right = 2 -theme_override_constants/margin_bottom = 2 - -[node name="BottomBg" type="ColorRect" parent="VSplitContainer/PanelBottom/MarginContainer"] -clip_children = 2 -z_index = 1 -layout_mode = 2 color = Color(0.203922, 0.203922, 0.203922, 1) script = ExtResource("2_ynf0r") -[node name="TileTexture" type="TextureRect" parent="VSplitContainer/PanelBottom/MarginContainer/BottomBg"] +[node name="TileTexture" type="TextureRect" parent="VSplitContainer/PanelBottom/BottomBg"] layout_mode = 1 anchors_preset = 8 anchor_left = 0.5 @@ -249,19 +289,19 @@ scale = Vector2(2, 2) mouse_filter = 2 -[node name="CellRoot" type="Control" parent="VSplitContainer/PanelBottom/MarginContainer/BottomBg/TileTexture"] +[node name="CellRoot" type="Control" parent="VSplitContainer/PanelBottom/BottomBg/TileTexture"] anchors_preset = 0 offset_right = 1.0 offset_bottom = 1.0 mouse_filter = 2 -[node name="BottomCell" type="Control" parent="VSplitContainer/PanelBottom/MarginContainer/BottomBg/TileTexture/CellRoot"] +[node name="BottomCell" type="Control" parent="VSplitContainer/PanelBottom/BottomBg/TileTexture/CellRoot"] anchors_preset = 0 offset_right = 16.0 offset_bottom = 16.0 mouse_filter = 2 -[node name="MaskBrush" type="Control" parent="VSplitContainer/PanelBottom/MarginContainer/BottomBg/TileTexture"] +[node name="MaskBrush" type="Control" parent="VSplitContainer/PanelBottom/BottomBg/TileTexture"] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -271,7 +311,7 @@ mouse_filter = 2 script = ExtResource("3_gydh0") -[node name="Grid" type="ColorRect" parent="VSplitContainer/PanelBottom/MarginContainer/BottomBg"] +[node name="Grid" type="ColorRect" parent="VSplitContainer/PanelBottom/BottomBg"] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -281,7 +321,7 @@ mouse_filter = 2 color = Color(1, 1, 1, 0) -[node name="FocusBtn" type="TextureButton" parent="VSplitContainer/PanelBottom/MarginContainer/BottomBg"] +[node name="FocusBtn" type="TextureButton" parent="VSplitContainer/PanelBottom/BottomBg"] layout_mode = 1 anchors_preset = 1 anchor_left = 1.0 diff --git a/DungeonShooting_Godot/resource/map/tileSet/TileSet1/TileSet.json b/DungeonShooting_Godot/resource/map/tileSet/TileSet1/TileSet.json index 3d57d81..1e568c8 100644 --- a/DungeonShooting_Godot/resource/map/tileSet/TileSet1/TileSet.json +++ b/DungeonShooting_Godot/resource/map/tileSet/TileSet1/TileSet.json @@ -4,223 +4,226 @@ { "Name": "Main", "SourcePath": "resource/map/tileSet/TileSet1/Main.png", - "Terrain": { - "F": { - "0": [ - 0, - 64 - ] - }, - "M": { - "1": [ - 16, - 64 - ], - "2": [ - 32, - 64 - ], - "3": [ - 48, - 64 - ], - "0": [ - 64, - 64 - ] - }, - "T": { - "144": [ - 0, - 0 - ], - "216": [ - 176, - 0 - ], - "27": [ - 176, - 48 - ], - "146": [ - 0, - 16 - ], - "18": [ - 0, - 32 - ], - "16": [ - 0, - 48 - ], - "48": [ - 16, - 48 - ], - "56": [ - 32, - 48 - ], - "24": [ - 48, - 48 - ], - "250": [ - 64, - 48 - ], - "62": [ - 80, - 48 - ], - "59": [ - 96, - 48 - ], - "442": [ - 112, - 48 - ], - "54": [ - 128, - 48 - ], - "63": [ - 144, - 48 - ], - "191": [ - 160, - 48 - ], - "219": [ - 176, - 32 - ], - "251": [ - 176, - 16 - ], - "504": [ - 160, - 0 - ], - "506": [ - 144, - 0 - ], - "432": [ - 128, - 0 - ], - "438": [ - 128, - 16 - ], - "446": [ - 128, - 32 - ], - "443": [ - 144, - 16 - ], - "511": [ - 144, - 32 - ], - "254": [ - 160, - 32 - ], - "190": [ - 112, - 0 - ], - "218": [ - 112, - 16 - ], - "155": [ - 112, - 32 - ], - "255": [ - 96, - 32 - ], - "447": [ - 80, - 32 - ], - "510": [ - 80, - 16 - ], - "507": [ - 96, - 16 - ], - "248": [ - 96, - 0 - ], - "440": [ - 80, - 0 - ], - "187": [ - 64, - 0 - ], - "434": [ - 64, - 16 - ], - "182": [ - 64, - 32 - ], - "176": [ - 16, - 0 - ], - "178": [ - 16, - 16 - ], - "50": [ - 16, - 32 - ], - "58": [ - 32, - 32 - ], - "26": [ - 48, - 32 - ], - "184": [ - 32, - 0 - ], - "152": [ - 48, - 0 - ], - "154": [ - 48, - 16 - ], - "186": [ - 32, - 16 - ] - }, - "TerrainType": 0 - }, + "Terrain": [ + { + "Name": "Main", + "F": { + "0": [ + 0, + 64 + ] + }, + "M": { + "1": [ + 16, + 64 + ], + "2": [ + 32, + 64 + ], + "3": [ + 48, + 64 + ], + "0": [ + 64, + 64 + ] + }, + "T": { + "144": [ + 0, + 0 + ], + "216": [ + 176, + 0 + ], + "27": [ + 176, + 48 + ], + "146": [ + 0, + 16 + ], + "18": [ + 0, + 32 + ], + "16": [ + 0, + 48 + ], + "48": [ + 16, + 48 + ], + "56": [ + 32, + 48 + ], + "24": [ + 48, + 48 + ], + "250": [ + 64, + 48 + ], + "62": [ + 80, + 48 + ], + "59": [ + 96, + 48 + ], + "442": [ + 112, + 48 + ], + "54": [ + 128, + 48 + ], + "63": [ + 144, + 48 + ], + "191": [ + 160, + 48 + ], + "219": [ + 176, + 32 + ], + "251": [ + 176, + 16 + ], + "504": [ + 160, + 0 + ], + "506": [ + 144, + 0 + ], + "432": [ + 128, + 0 + ], + "438": [ + 128, + 16 + ], + "446": [ + 128, + 32 + ], + "443": [ + 144, + 16 + ], + "511": [ + 144, + 32 + ], + "254": [ + 160, + 32 + ], + "190": [ + 112, + 0 + ], + "218": [ + 112, + 16 + ], + "155": [ + 112, + 32 + ], + "255": [ + 96, + 32 + ], + "447": [ + 80, + 32 + ], + "510": [ + 80, + 16 + ], + "507": [ + 96, + 16 + ], + "248": [ + 96, + 0 + ], + "440": [ + 80, + 0 + ], + "187": [ + 64, + 0 + ], + "434": [ + 64, + 16 + ], + "182": [ + 64, + 32 + ], + "176": [ + 16, + 0 + ], + "178": [ + 16, + 16 + ], + "50": [ + 16, + 32 + ], + "58": [ + 32, + 32 + ], + "26": [ + 48, + 32 + ], + "184": [ + 32, + 0 + ], + "152": [ + 48, + 0 + ], + "154": [ + 48, + 16 + ], + "186": [ + 32, + 16 + ] + }, + "TerrainType": 0 + } + ], "Combination": [] } ] diff --git a/DungeonShooting_Godot/resource/map/tileSet/TileSet2/TileSet.json b/DungeonShooting_Godot/resource/map/tileSet/TileSet2/TileSet.json index 5072e0c..e4ac01c 100644 --- a/DungeonShooting_Godot/resource/map/tileSet/TileSet2/TileSet.json +++ b/DungeonShooting_Godot/resource/map/tileSet/TileSet2/TileSet.json @@ -4,99 +4,98 @@ { "Name": "Main", "SourcePath": "resource/map/tileSet/TileSet2/Main.png", - "Terrain": { - "F": { - "0": [ - 16, - 144 - ] - }, - "M": { - "3": [ - 160, - 112 - ], - "2": [ - 80, - 112 - ], - "1": [ - 64, - 112 - ], - "0": [ - 0, - 112 - ] - }, - "T": { - "144": [ - 0, - 32 - ], - "507": [ - 224, - 0 - ], - "146": [ - 0, - 48 - ], - "434": [ - 64, - 96 - ], - "18": [ - 0, - 96 - ], - "219": [ - 160, - 80 - ], - "438": [ - 64, - 80 - ], - "63": [ - 96, - 96 - ], - "504": [ - 112, - 0 - ], - "510": [ - 240, - 0 - ], - "506": [ - 192, - 32 - ], - "16": [ - 0, - 0 - ], - "48": [ - 16, - 0 - ], - "56": [ - 32, - 0 - ], - "24": [ - 48, - 0 - ], - "272": [ - 0, - 0 - ] - }, - "TerrainType": 1 - }, + "Terrain": [ + { + "Name": "Main", + "F": { + "0": [ + 16, + 144 + ] + }, + "M": { + "3": [ + 160, + 112 + ], + "2": [ + 80, + 112 + ], + "1": [ + 64, + 112 + ], + "0": [ + 0, + 112 + ] + }, + "T": { + "144": [ + 0, + 32 + ], + "507": [ + 224, + 0 + ], + "146": [ + 0, + 48 + ], + "434": [ + 64, + 96 + ], + "18": [ + 0, + 96 + ], + "219": [ + 160, + 80 + ], + "438": [ + 64, + 80 + ], + "63": [ + 96, + 96 + ], + "504": [ + 112, + 0 + ], + "510": [ + 240, + 0 + ], + "506": [ + 192, + 32 + ], + "16": [ + 0, + 0 + ], + "48": [ + 16, + 0 + ], + "56": [ + 32, + 0 + ], + "24": [ + 48, + 0 + ] + }, + "TerrainType": 0 + } + ], "Combination": [ { "Id": "638404496948408912", @@ -303,65 +302,68 @@ { "Name": "Test2", "SourcePath": "resource/map/tileSet/TileSet2/Test2.png", - "Terrain": { - "F": {}, - "M": {}, - "T": { - "80": [ - 176, - 0 - ], - "272": [ - 128, - 0 - ], - "336": [ - 160, - 0 - ], - "21": [ - 144, - 48 - ], - "20": [ - 128, - 48 - ], - "17": [ - 176, - 48 - ], - "81": [ - 176, - 32 - ], - "276": [ - 128, - 16 - ], - "341": [ - 144, - 32 - ], - "337": [ - 96, - 16 - ], - "85": [ - 96, - 32 - ], - "277": [ - 80, - 32 - ], - "340": [ - 80, - 16 - ] - }, - "TerrainType": 1 - }, + "Terrain": [ + { + "Name": "TestTerrain2", + "F": {}, + "M": {}, + "T": { + "80": [ + 176, + 0 + ], + "272": [ + 128, + 0 + ], + "336": [ + 160, + 0 + ], + "21": [ + 144, + 48 + ], + "20": [ + 128, + 48 + ], + "17": [ + 176, + 48 + ], + "81": [ + 176, + 32 + ], + "276": [ + 128, + 16 + ], + "341": [ + 144, + 32 + ], + "337": [ + 96, + 16 + ], + "85": [ + 96, + 32 + ], + "277": [ + 80, + 32 + ], + "340": [ + 80, + 16 + ] + }, + "TerrainType": 1 + } + ], "Combination": [ { "Id": "638404866100310178", diff --git a/DungeonShooting_Godot/src/framework/map/serialize/tileSet/TileSetSourceInfo.cs b/DungeonShooting_Godot/src/framework/map/serialize/tileSet/TileSetSourceInfo.cs index 76f3917..c083d70 100644 --- a/DungeonShooting_Godot/src/framework/map/serialize/tileSet/TileSetSourceInfo.cs +++ b/DungeonShooting_Godot/src/framework/map/serialize/tileSet/TileSetSourceInfo.cs @@ -27,7 +27,7 @@ /// 地形配置数据 /// [JsonInclude] - public TileSetTerrainInfo Terrain; + public List Terrain; /// /// 组合数据 @@ -43,8 +43,7 @@ /// public void InitData() { - Terrain = new TileSetTerrainInfo(); - Terrain.InitData(); + Terrain = new List(); Combination = new List(); } @@ -76,7 +75,11 @@ { var tileSetSourceInfo = new TileSetSourceInfo(); tileSetSourceInfo.Name = Name; - tileSetSourceInfo.Terrain = Terrain.Clone(); + tileSetSourceInfo.Terrain = new List(); + foreach (var item in Terrain) + { + tileSetSourceInfo.Terrain.Add(item.Clone()); + } tileSetSourceInfo.Combination = new List(); foreach (var combination in Combination) { diff --git a/DungeonShooting_Godot/src/framework/map/serialize/tileSet/TileSetSplit.cs b/DungeonShooting_Godot/src/framework/map/serialize/tileSet/TileSetSplit.cs index 394b86c..4cbf1d7 100644 --- a/DungeonShooting_Godot/src/framework/map/serialize/tileSet/TileSetSplit.cs +++ b/DungeonShooting_Godot/src/framework/map/serialize/tileSet/TileSetSplit.cs @@ -114,41 +114,47 @@ for (var sourceIndex = 0; sourceIndex < _tileSetInfo.Sources.Count; sourceIndex++) { var tileSetSourceInfo = _tileSetInfo.Sources[sourceIndex]; - var terrainInfo = tileSetSourceInfo.Terrain; + var terrainList = tileSetSourceInfo.Terrain; //地形层 _tileSet.AddTerrainSet(); - _tileSet.AddTerrain(sourceIndex); - if (terrainInfo.TerrainType == 0) //3x3地形 - { - _tileSet.SetTerrainSetMode(sourceIndex, TileSet.TerrainMode.CornersAndSides); - } - else //2x2地形 - { - _tileSet.SetTerrainSetMode(sourceIndex, TileSet.TerrainMode.Corners); - } - - var tileSetAtlasSource = new TileSetAtlasSource(); - _tileSet.AddSource(tileSetAtlasSource); - //纹理 - var image = tileSetSourceInfo.GetSourceImage(); - tileSetAtlasSource.Texture = ImageTexture.CreateFromImage(image); - - var size = image.GetSize() / GameConfig.TileCellSize; - //创建cell - for (var i = 0; i < size.X; i++) - { - for (var j = 0; j < size.Y; j++) - { - tileSetAtlasSource.CreateTile(new Vector2I(i, j)); - } - } - //初始化地形 - tileSetAtlasSource.InitTerrain(terrainInfo, sourceIndex, 0); - if (sourceIndex == 0) + for (var terrainIndex = 0; terrainIndex < terrainList.Count; terrainIndex++) { - InitMainSourceData(terrainInfo, tileSetAtlasSource); + _tileSet.AddTerrain(sourceIndex); + + var terrainInfo = terrainList[terrainIndex]; + if (terrainInfo.TerrainType == 0) //3x3地形 + { + _tileSet.SetTerrainSetMode(sourceIndex, TileSet.TerrainMode.CornersAndSides); + } + else //2x2地形 + { + _tileSet.SetTerrainSetMode(sourceIndex, TileSet.TerrainMode.Corners); + } + + var tileSetAtlasSource = new TileSetAtlasSource(); + _tileSet.AddSource(tileSetAtlasSource); + //纹理 + var image = tileSetSourceInfo.GetSourceImage(); + tileSetAtlasSource.Texture = ImageTexture.CreateFromImage(image); + + var size = image.GetSize() / GameConfig.TileCellSize; + //创建cell + for (var i = 0; i < size.X; i++) + { + for (var j = 0; j < size.Y; j++) + { + tileSetAtlasSource.CreateTile(new Vector2I(i, j)); + } + } + + //初始化地形 + tileSetAtlasSource.InitTerrain(terrainInfo, sourceIndex, terrainIndex); + if (sourceIndex == 0) + { + InitMainSourceData(terrainInfo, tileSetAtlasSource); + } } } } diff --git a/DungeonShooting_Godot/src/framework/map/serialize/tileSet/TileSetTerrainInfo.cs b/DungeonShooting_Godot/src/framework/map/serialize/tileSet/TileSetTerrainInfo.cs index 96c8964..66adfac 100644 --- a/DungeonShooting_Godot/src/framework/map/serialize/tileSet/TileSetTerrainInfo.cs +++ b/DungeonShooting_Godot/src/framework/map/serialize/tileSet/TileSetTerrainInfo.cs @@ -13,6 +13,12 @@ public const byte MiddleLayerType = 2; public const byte FloorLayerType = 3; + /// + /// 地形名称 + /// + [JsonInclude] + public string Name; + //type = 3 /// /// 地板 (1块) type = 3 @@ -47,6 +53,7 @@ { var terrainInfo = new TileSetTerrainInfo(); terrainInfo.InitData(); + terrainInfo.Name = Name; foreach (var pair in T) { terrainInfo.T.Add(pair.Key, new []{ pair.Value[0], pair.Value[1] }); diff --git a/DungeonShooting_Godot/src/framework/ui/grid/UiGrid.cs b/DungeonShooting_Godot/src/framework/ui/grid/UiGrid.cs index db987d8..bb13117 100644 --- a/DungeonShooting_Godot/src/framework/ui/grid/UiGrid.cs +++ b/DungeonShooting_Godot/src/framework/ui/grid/UiGrid.cs @@ -11,6 +11,11 @@ /// 传给Cell的数据类型 public class UiGrid : IUiGrid where TUiCellNode : IUiCellNode { + /// + /// 选中Cell的时的回调, 参数为 Cell 索引 + /// + public event Action SelectEvent; + public bool IsDestroyed { get; private set; } public int SelectIndex @@ -47,6 +52,10 @@ { var uiCell = _cellList[newIndex]; uiCell.OnSelect(); + if (SelectEvent != null) + { + SelectEvent(newIndex); + } } } } diff --git a/DungeonShooting_Godot/src/game/room/DungeonManager.cs b/DungeonShooting_Godot/src/game/room/DungeonManager.cs index 3e50204..3f2de43 100644 --- a/DungeonShooting_Godot/src/game/room/DungeonManager.cs +++ b/DungeonShooting_Godot/src/game/room/DungeonManager.cs @@ -228,7 +228,7 @@ //填充地牢 var tileSetSplit = GameApplication.Instance.TileSetConfig.First().Value; - AutoTileConfig = new AutoTileConfig(0, tileSetSplit.TileSetInfo.Sources[0].Terrain); + AutoTileConfig = new AutoTileConfig(0, tileSetSplit.TileSetInfo.Sources[0].Terrain[0]); _dungeonTileMap = new DungeonTileMap(World.TileRoot); yield return _dungeonTileMap.AutoFillRoomTile(AutoTileConfig, _dungeonGenerator.StartRoomInfo, random); //yield return _dungeonTileMap.AddOutlineTile(AutoTileConfig.WALL_BLOCK); diff --git a/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs b/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs index c2ba6f7..be88d9e 100644 --- a/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs +++ b/DungeonShooting_Godot/src/game/ui/mapEditor/tileView/EditorTileMap.cs @@ -162,7 +162,7 @@ // 创建AutoTileConfig对象 // 使用第一个图块集源作为参数 - _autoTileConfig = new AutoTileConfig(0, tileSetSplit.TileSetInfo.Sources[0].Terrain); + _autoTileConfig = new AutoTileConfig(0, tileSetSplit.TileSetInfo.Sources[0].Terrain[0]); } public void SetUiNode(IUiNode uiNode) diff --git a/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/TerrainTabCell.cs b/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/TerrainTabCell.cs new file mode 100644 index 0000000..6e05c89 --- /dev/null +++ b/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/TerrainTabCell.cs @@ -0,0 +1,24 @@ +namespace UI.TileSetEditorTerrain; + +public class TerrainTabCell : UiCell +{ + public override void OnInit() + { + CellNode.L_SelectTexture.Instance.Visible = false; + } + + public override void OnSetData(TileSetTerrainInfo data) + { + CellNode.Instance.Text = data.Name; + } + + 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/tileSetEditorTerrain/TileSetEditorTerrain.cs b/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/TileSetEditorTerrain.cs index c210c6e..66467f8 100644 --- a/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/TileSetEditorTerrain.cs +++ b/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/TileSetEditorTerrain.cs @@ -38,14 +38,199 @@ public sealed override void OnInitNestedUi() { - _ = L_VSplitContainer.L_PanelTop.L_MarginContainer.L_TopBg; - _ = L_VSplitContainer.L_PanelTop.L_MarginContainer.L_TopBg.L_TerrainRoot.L_Brush; - _ = L_VSplitContainer.L_PanelBottom.L_MarginContainer.L_BottomBg; + _ = L_VSplitContainer.L_PanelTop.L_HSplitContainer.L_TopBg; + _ = L_VSplitContainer.L_PanelTop.L_HSplitContainer.L_TopBg.L_TerrainRoot.L_Brush; + _ = L_VSplitContainer.L_PanelBottom.L_BottomBg; } /// - /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.TerrainRoot.CellRoot.RightCell.CellTexture + /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopTab.VBoxContainer.HBoxContainer.Label + /// + public class Label : UiNode + { + public Label(TileSetEditorTerrainPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override Label Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopTab.VBoxContainer.HBoxContainer.AddButton + /// + public class AddButton : UiNode + { + public AddButton(TileSetEditorTerrainPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override AddButton Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopTab.VBoxContainer.HBoxContainer.DeleteButton + /// + public class DeleteButton : UiNode + { + public DeleteButton(TileSetEditorTerrainPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override DeleteButton Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopTab.VBoxContainer.HBoxContainer + /// + public class HBoxContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopTab.VBoxContainer.Label + /// + public Label L_Label + { + get + { + if (_L_Label == null) _L_Label = new Label(UiPanel, Instance.GetNode("Label")); + return _L_Label; + } + } + private Label _L_Label; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopTab.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 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopTab.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(TileSetEditorTerrainPanel uiPanel, Godot.HBoxContainer node) : base(uiPanel, node) { } + public override HBoxContainer Clone() => new (UiPanel, (Godot.HBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopTab.VBoxContainer.ScrollContainer.TerrainTab.SelectTexture + /// + public class SelectTexture : UiNode + { + public SelectTexture(TileSetEditorTerrainPanel uiPanel, Godot.NinePatchRect node) : base(uiPanel, node) { } + public override SelectTexture Clone() => new (UiPanel, (Godot.NinePatchRect)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopTab.VBoxContainer.ScrollContainer.TerrainTab + /// + public class TerrainTab : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopTab.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; + + public TerrainTab(TileSetEditorTerrainPanel uiPanel, Godot.Button node) : base(uiPanel, node) { } + public override TerrainTab Clone() => new (UiPanel, (Godot.Button)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopTab.VBoxContainer.ScrollContainer + /// + public class ScrollContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopTab.VBoxContainer.TerrainTab + /// + public TerrainTab L_TerrainTab + { + get + { + if (_L_TerrainTab == null) _L_TerrainTab = new TerrainTab(UiPanel, Instance.GetNode("TerrainTab")); + return _L_TerrainTab; + } + } + private TerrainTab _L_TerrainTab; + + public ScrollContainer(TileSetEditorTerrainPanel uiPanel, Godot.ScrollContainer node) : base(uiPanel, node) { } + public override ScrollContainer Clone() => new (UiPanel, (Godot.ScrollContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopTab.VBoxContainer + /// + public class VBoxContainer : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopTab.HBoxContainer + /// + public HBoxContainer L_HBoxContainer + { + get + { + if (_L_HBoxContainer == null) _L_HBoxContainer = new HBoxContainer(UiPanel, Instance.GetNode("HBoxContainer")); + return _L_HBoxContainer; + } + } + private HBoxContainer _L_HBoxContainer; + + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopTab.ScrollContainer + /// + public ScrollContainer L_ScrollContainer + { + get + { + if (_L_ScrollContainer == null) _L_ScrollContainer = new ScrollContainer(UiPanel, Instance.GetNode("ScrollContainer")); + return _L_ScrollContainer; + } + } + private ScrollContainer _L_ScrollContainer; + + public VBoxContainer(TileSetEditorTerrainPanel uiPanel, Godot.VBoxContainer node) : base(uiPanel, node) { } + public override VBoxContainer Clone() => new (UiPanel, (Godot.VBoxContainer)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopTab + /// + public class TopTab : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.VBoxContainer + /// + public VBoxContainer L_VBoxContainer + { + get + { + if (_L_VBoxContainer == null) _L_VBoxContainer = new VBoxContainer(UiPanel, Instance.GetNode("VBoxContainer")); + return _L_VBoxContainer; + } + } + private VBoxContainer _L_VBoxContainer; + + public TopTab(TileSetEditorTerrainPanel uiPanel, Godot.Panel node) : base(uiPanel, node) { } + public override TopTab Clone() => new (UiPanel, (Godot.Panel)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.TerrainRoot.CellRoot.RightCell.CellTexture /// public class CellTexture : UiNode { @@ -54,12 +239,12 @@ } /// - /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.TerrainRoot.CellRoot.RightCell + /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.TerrainRoot.CellRoot.RightCell /// public class RightCell : UiNode { /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.TerrainRoot.CellRoot.CellTexture + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.TerrainRoot.CellRoot.CellTexture /// public CellTexture L_CellTexture { @@ -76,12 +261,12 @@ } /// - /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.TerrainRoot.CellRoot + /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.TerrainRoot.CellRoot /// public class CellRoot : UiNode { /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.TerrainRoot.RightCell + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.TerrainRoot.RightCell /// public RightCell L_RightCell { @@ -98,38 +283,7 @@ } /// - /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.TerrainRoot.TerrainTexture1.Label - /// - public class Label : UiNode - { - public Label(TileSetEditorTerrainPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } - public override Label Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); - } - - /// - /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.TerrainRoot.TerrainTexture1 - /// - public class TerrainTexture1 : UiNode - { - /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.TerrainRoot.Label - /// - public Label L_Label - { - get - { - if (_L_Label == null) _L_Label = new Label(UiPanel, Instance.GetNode("Label")); - return _L_Label; - } - } - private Label _L_Label; - - public TerrainTexture1(TileSetEditorTerrainPanel uiPanel, Godot.TextureRect node) : base(uiPanel, node) { } - public override TerrainTexture1 Clone() => new (UiPanel, (Godot.TextureRect)Instance.Duplicate()); - } - - /// - /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.TerrainRoot.TerrainTexture2.Label + /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.TerrainRoot.TerrainTexture1.Label /// public class Label_1 : UiNode { @@ -138,12 +292,12 @@ } /// - /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.TerrainRoot.TerrainTexture2 + /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.TerrainRoot.TerrainTexture1 /// - public class TerrainTexture2 : UiNode + public class TerrainTexture1 : UiNode { /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.TerrainRoot.Label + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.TerrainRoot.Label /// public Label_1 L_Label { @@ -155,12 +309,12 @@ } private Label_1 _L_Label; - public TerrainTexture2(TileSetEditorTerrainPanel uiPanel, Godot.TextureRect node) : base(uiPanel, node) { } - public override TerrainTexture2 Clone() => new (UiPanel, (Godot.TextureRect)Instance.Duplicate()); + public TerrainTexture1(TileSetEditorTerrainPanel uiPanel, Godot.TextureRect node) : base(uiPanel, node) { } + public override TerrainTexture1 Clone() => new (UiPanel, (Godot.TextureRect)Instance.Duplicate()); } /// - /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.TerrainRoot.TerrainTexture3.Label + /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.TerrainRoot.TerrainTexture2.Label /// public class Label_2 : UiNode { @@ -169,12 +323,12 @@ } /// - /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.TerrainRoot.TerrainTexture3 + /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.TerrainRoot.TerrainTexture2 /// - public class TerrainTexture3 : UiNode + public class TerrainTexture2 : UiNode { /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.TerrainRoot.Label + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.TerrainRoot.Label /// public Label_2 L_Label { @@ -186,12 +340,12 @@ } private Label_2 _L_Label; - public TerrainTexture3(TileSetEditorTerrainPanel uiPanel, Godot.TextureRect node) : base(uiPanel, node) { } - public override TerrainTexture3 Clone() => new (UiPanel, (Godot.TextureRect)Instance.Duplicate()); + public TerrainTexture2(TileSetEditorTerrainPanel uiPanel, Godot.TextureRect node) : base(uiPanel, node) { } + public override TerrainTexture2 Clone() => new (UiPanel, (Godot.TextureRect)Instance.Duplicate()); } /// - /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.TerrainRoot.TerrainTexture4.Label + /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.TerrainRoot.TerrainTexture3.Label /// public class Label_3 : UiNode { @@ -200,12 +354,12 @@ } /// - /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.TerrainRoot.TerrainTexture4 + /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.TerrainRoot.TerrainTexture3 /// - public class TerrainTexture4 : UiNode + public class TerrainTexture3 : UiNode { /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.TerrainRoot.Label + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.TerrainRoot.Label /// public Label_3 L_Label { @@ -217,12 +371,43 @@ } private Label_3 _L_Label; + public TerrainTexture3(TileSetEditorTerrainPanel uiPanel, Godot.TextureRect node) : base(uiPanel, node) { } + public override TerrainTexture3 Clone() => new (UiPanel, (Godot.TextureRect)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.TerrainRoot.TerrainTexture4.Label + /// + public class Label_4 : UiNode + { + public Label_4(TileSetEditorTerrainPanel uiPanel, Godot.Label node) : base(uiPanel, node) { } + public override Label_4 Clone() => new (UiPanel, (Godot.Label)Instance.Duplicate()); + } + + /// + /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.TerrainRoot.TerrainTexture4 + /// + public class TerrainTexture4 : UiNode + { + /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.TerrainRoot.Label + /// + public Label_4 L_Label + { + get + { + if (_L_Label == null) _L_Label = new Label_4(UiPanel, Instance.GetNode("Label")); + return _L_Label; + } + } + private Label_4 _L_Label; + public TerrainTexture4(TileSetEditorTerrainPanel uiPanel, Godot.TextureRect node) : base(uiPanel, node) { } public override TerrainTexture4 Clone() => new (UiPanel, (Godot.TextureRect)Instance.Duplicate()); } /// - /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.TerrainRoot.Brush + /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.TerrainRoot.Brush /// public class Brush : UiNode { @@ -231,12 +416,12 @@ } /// - /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.TerrainRoot + /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.TerrainRoot /// public class TerrainRoot : UiNode { /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.CellRoot + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.CellRoot /// public CellRoot L_CellRoot { @@ -249,7 +434,7 @@ private CellRoot _L_CellRoot; /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.TerrainTexture1 + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.TerrainTexture1 /// public TerrainTexture1 L_TerrainTexture1 { @@ -262,7 +447,7 @@ private TerrainTexture1 _L_TerrainTexture1; /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.TerrainTexture2 + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.TerrainTexture2 /// public TerrainTexture2 L_TerrainTexture2 { @@ -275,7 +460,7 @@ private TerrainTexture2 _L_TerrainTexture2; /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.TerrainTexture3 + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.TerrainTexture3 /// public TerrainTexture3 L_TerrainTexture3 { @@ -288,7 +473,7 @@ private TerrainTexture3 _L_TerrainTexture3; /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.TerrainTexture4 + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.TerrainTexture4 /// public TerrainTexture4 L_TerrainTexture4 { @@ -301,7 +486,7 @@ private TerrainTexture4 _L_TerrainTexture4; /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.Brush + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.Brush /// public Brush L_Brush { @@ -318,7 +503,7 @@ } /// - /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.Grid + /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.Grid /// public class Grid : UiNode { @@ -327,7 +512,7 @@ } /// - /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.FocusBtn + /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.FocusBtn /// public class FocusBtn : UiNode { @@ -336,21 +521,12 @@ } /// - /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.TerrainTypeButton - /// - public class TerrainTypeButton : UiNode - { - public TerrainTypeButton(TileSetEditorTerrainPanel uiPanel, Godot.OptionButton node) : base(uiPanel, node) { } - public override TerrainTypeButton Clone() => new (UiPanel, (Godot.OptionButton)Instance.Duplicate()); - } - - /// - /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg + /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg /// public class TopBg : UiNode { /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TerrainRoot + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TerrainRoot /// public TerrainRoot L_TerrainRoot { @@ -363,7 +539,7 @@ private TerrainRoot _L_TerrainRoot; /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.Grid + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.Grid /// public Grid L_Grid { @@ -376,7 +552,7 @@ private Grid _L_Grid; /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.FocusBtn + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.FocusBtn /// public FocusBtn L_FocusBtn { @@ -388,29 +564,29 @@ } private FocusBtn _L_FocusBtn; - /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TerrainTypeButton - /// - public TerrainTypeButton L_TerrainTypeButton - { - get - { - if (_L_TerrainTypeButton == null) _L_TerrainTypeButton = new TerrainTypeButton(UiPanel, Instance.GetNode("TerrainTypeButton")); - return _L_TerrainTypeButton; - } - } - private TerrainTypeButton _L_TerrainTypeButton; - public TopBg(TileSetEditorTerrainPanel uiPanel, UI.TileSetEditorTerrain.TileEditTerrain node) : base(uiPanel, node) { } public override TopBg Clone() => new (UiPanel, (UI.TileSetEditorTerrain.TileEditTerrain)Instance.Duplicate()); } /// - /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer + /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer /// - public class MarginContainer : UiNode + public class HSplitContainer : UiNode { /// + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.TopTab + /// + public TopTab L_TopTab + { + get + { + if (_L_TopTab == null) _L_TopTab = new TopTab(UiPanel, Instance.GetNode("TopTab")); + return _L_TopTab; + } + } + private TopTab _L_TopTab; + + /// /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.TopBg /// public TopBg L_TopBg @@ -423,8 +599,8 @@ } private TopBg _L_TopBg; - public MarginContainer(TileSetEditorTerrainPanel uiPanel, Godot.MarginContainer node) : base(uiPanel, node) { } - public override MarginContainer Clone() => new (UiPanel, (Godot.MarginContainer)Instance.Duplicate()); + public HSplitContainer(TileSetEditorTerrainPanel uiPanel, Godot.HSplitContainer node) : base(uiPanel, node) { } + public override HSplitContainer Clone() => new (UiPanel, (Godot.HSplitContainer)Instance.Duplicate()); } /// @@ -433,24 +609,24 @@ public class PanelTop : UiNode { /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.MarginContainer + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.HSplitContainer /// - public MarginContainer L_MarginContainer + public HSplitContainer L_HSplitContainer { get { - if (_L_MarginContainer == null) _L_MarginContainer = new MarginContainer(UiPanel, Instance.GetNode("MarginContainer")); - return _L_MarginContainer; + if (_L_HSplitContainer == null) _L_HSplitContainer = new HSplitContainer(UiPanel, Instance.GetNode("HSplitContainer")); + return _L_HSplitContainer; } } - private MarginContainer _L_MarginContainer; + private HSplitContainer _L_HSplitContainer; public PanelTop(TileSetEditorTerrainPanel uiPanel, Godot.Panel node) : base(uiPanel, node) { } public override PanelTop Clone() => new (UiPanel, (Godot.Panel)Instance.Duplicate()); } /// - /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.MarginContainer.BottomBg.TileTexture.CellRoot.BottomCell + /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.BottomBg.TileTexture.CellRoot.BottomCell /// public class BottomCell : UiNode { @@ -459,12 +635,12 @@ } /// - /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.MarginContainer.BottomBg.TileTexture.CellRoot + /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.BottomBg.TileTexture.CellRoot /// public class CellRoot_1 : UiNode { /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.MarginContainer.BottomBg.TileTexture.BottomCell + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.BottomBg.TileTexture.BottomCell /// public BottomCell L_BottomCell { @@ -481,7 +657,7 @@ } /// - /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.MarginContainer.BottomBg.TileTexture.MaskBrush + /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.BottomBg.TileTexture.MaskBrush /// public class MaskBrush : UiNode { @@ -490,12 +666,12 @@ } /// - /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.MarginContainer.BottomBg.TileTexture + /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.BottomBg.TileTexture /// public class TileTexture : UiNode { /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.MarginContainer.BottomBg.CellRoot + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.BottomBg.CellRoot /// public CellRoot_1 L_CellRoot { @@ -508,7 +684,7 @@ private CellRoot_1 _L_CellRoot; /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.MarginContainer.BottomBg.MaskBrush + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.BottomBg.MaskBrush /// public MaskBrush L_MaskBrush { @@ -525,7 +701,7 @@ } /// - /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.MarginContainer.BottomBg.Grid + /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.BottomBg.Grid /// public class Grid_1 : UiNode { @@ -534,7 +710,7 @@ } /// - /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.MarginContainer.BottomBg.FocusBtn + /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.BottomBg.FocusBtn /// public class FocusBtn_1 : UiNode { @@ -543,12 +719,12 @@ } /// - /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.MarginContainer.BottomBg + /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.BottomBg /// public class BottomBg : UiNode { /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.MarginContainer.TileTexture + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.TileTexture /// public TileTexture L_TileTexture { @@ -561,7 +737,7 @@ private TileTexture _L_TileTexture; /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.MarginContainer.Grid + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.Grid /// public Grid_1 L_Grid { @@ -574,7 +750,7 @@ private Grid_1 _L_Grid; /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.MarginContainer.FocusBtn + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.FocusBtn /// public FocusBtn_1 L_FocusBtn { @@ -591,12 +767,12 @@ } /// - /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.MarginContainer + /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelBottom /// - public class MarginContainer_1 : UiNode + public class PanelBottom : UiNode { /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.BottomBg + /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.BottomBg /// public BottomBg L_BottomBg { @@ -608,28 +784,6 @@ } private BottomBg _L_BottomBg; - public MarginContainer_1(TileSetEditorTerrainPanel uiPanel, Godot.MarginContainer node) : base(uiPanel, node) { } - public override MarginContainer_1 Clone() => new (UiPanel, (Godot.MarginContainer)Instance.Duplicate()); - } - - /// - /// 类型: , 路径: TileSetEditorTerrain.VSplitContainer.PanelBottom - /// - public class PanelBottom : UiNode - { - /// - /// 使用 Instance 属性获取当前节点实例对象, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.MarginContainer - /// - public MarginContainer_1 L_MarginContainer - { - get - { - if (_L_MarginContainer == null) _L_MarginContainer = new MarginContainer_1(UiPanel, Instance.GetNode("MarginContainer")); - return _L_MarginContainer; - } - } - private MarginContainer_1 _L_MarginContainer; - public PanelBottom(TileSetEditorTerrainPanel uiPanel, Godot.Panel node) : base(uiPanel, node) { } public override PanelBottom Clone() => new (UiPanel, (Godot.Panel)Instance.Duplicate()); } @@ -680,54 +834,94 @@ /// - /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.TerrainRoot.CellRoot.RightCell.CellTexture + /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopTab.VBoxContainer.HBoxContainer.AddButton /// - public CellTexture S_CellTexture => L_VSplitContainer.L_PanelTop.L_MarginContainer.L_TopBg.L_TerrainRoot.L_CellRoot.L_RightCell.L_CellTexture; + public AddButton S_AddButton => L_VSplitContainer.L_PanelTop.L_HSplitContainer.L_TopTab.L_VBoxContainer.L_HBoxContainer.L_AddButton; /// - /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.TerrainRoot.CellRoot.RightCell + /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopTab.VBoxContainer.HBoxContainer.DeleteButton /// - public RightCell S_RightCell => L_VSplitContainer.L_PanelTop.L_MarginContainer.L_TopBg.L_TerrainRoot.L_CellRoot.L_RightCell; + public DeleteButton S_DeleteButton => L_VSplitContainer.L_PanelTop.L_HSplitContainer.L_TopTab.L_VBoxContainer.L_HBoxContainer.L_DeleteButton; /// - /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.TerrainRoot.TerrainTexture1 + /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopTab.VBoxContainer.HBoxContainer /// - public TerrainTexture1 S_TerrainTexture1 => L_VSplitContainer.L_PanelTop.L_MarginContainer.L_TopBg.L_TerrainRoot.L_TerrainTexture1; + public HBoxContainer S_HBoxContainer => L_VSplitContainer.L_PanelTop.L_HSplitContainer.L_TopTab.L_VBoxContainer.L_HBoxContainer; /// - /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.TerrainRoot.TerrainTexture2 + /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopTab.VBoxContainer.ScrollContainer.TerrainTab.SelectTexture /// - public TerrainTexture2 S_TerrainTexture2 => L_VSplitContainer.L_PanelTop.L_MarginContainer.L_TopBg.L_TerrainRoot.L_TerrainTexture2; + public SelectTexture S_SelectTexture => L_VSplitContainer.L_PanelTop.L_HSplitContainer.L_TopTab.L_VBoxContainer.L_ScrollContainer.L_TerrainTab.L_SelectTexture; /// - /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.TerrainRoot.TerrainTexture3 + /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopTab.VBoxContainer.ScrollContainer.TerrainTab /// - public TerrainTexture3 S_TerrainTexture3 => L_VSplitContainer.L_PanelTop.L_MarginContainer.L_TopBg.L_TerrainRoot.L_TerrainTexture3; + public TerrainTab S_TerrainTab => L_VSplitContainer.L_PanelTop.L_HSplitContainer.L_TopTab.L_VBoxContainer.L_ScrollContainer.L_TerrainTab; /// - /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.TerrainRoot.TerrainTexture4 + /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopTab.VBoxContainer.ScrollContainer /// - public TerrainTexture4 S_TerrainTexture4 => L_VSplitContainer.L_PanelTop.L_MarginContainer.L_TopBg.L_TerrainRoot.L_TerrainTexture4; + public ScrollContainer S_ScrollContainer => L_VSplitContainer.L_PanelTop.L_HSplitContainer.L_TopTab.L_VBoxContainer.L_ScrollContainer; /// - /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.TerrainRoot.Brush + /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopTab.VBoxContainer /// - public Brush S_Brush => L_VSplitContainer.L_PanelTop.L_MarginContainer.L_TopBg.L_TerrainRoot.L_Brush; + public VBoxContainer S_VBoxContainer => L_VSplitContainer.L_PanelTop.L_HSplitContainer.L_TopTab.L_VBoxContainer; /// - /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.TerrainRoot + /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopTab /// - public TerrainRoot S_TerrainRoot => L_VSplitContainer.L_PanelTop.L_MarginContainer.L_TopBg.L_TerrainRoot; + public TopTab S_TopTab => L_VSplitContainer.L_PanelTop.L_HSplitContainer.L_TopTab; /// - /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg.TerrainTypeButton + /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.TerrainRoot.CellRoot.RightCell.CellTexture /// - public TerrainTypeButton S_TerrainTypeButton => L_VSplitContainer.L_PanelTop.L_MarginContainer.L_TopBg.L_TerrainTypeButton; + public CellTexture S_CellTexture => L_VSplitContainer.L_PanelTop.L_HSplitContainer.L_TopBg.L_TerrainRoot.L_CellRoot.L_RightCell.L_CellTexture; /// - /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.MarginContainer.TopBg + /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.TerrainRoot.CellRoot.RightCell /// - public TopBg S_TopBg => L_VSplitContainer.L_PanelTop.L_MarginContainer.L_TopBg; + public RightCell S_RightCell => L_VSplitContainer.L_PanelTop.L_HSplitContainer.L_TopBg.L_TerrainRoot.L_CellRoot.L_RightCell; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.TerrainRoot.TerrainTexture1 + /// + public TerrainTexture1 S_TerrainTexture1 => L_VSplitContainer.L_PanelTop.L_HSplitContainer.L_TopBg.L_TerrainRoot.L_TerrainTexture1; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.TerrainRoot.TerrainTexture2 + /// + public TerrainTexture2 S_TerrainTexture2 => L_VSplitContainer.L_PanelTop.L_HSplitContainer.L_TopBg.L_TerrainRoot.L_TerrainTexture2; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.TerrainRoot.TerrainTexture3 + /// + public TerrainTexture3 S_TerrainTexture3 => L_VSplitContainer.L_PanelTop.L_HSplitContainer.L_TopBg.L_TerrainRoot.L_TerrainTexture3; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.TerrainRoot.TerrainTexture4 + /// + public TerrainTexture4 S_TerrainTexture4 => L_VSplitContainer.L_PanelTop.L_HSplitContainer.L_TopBg.L_TerrainRoot.L_TerrainTexture4; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.TerrainRoot.Brush + /// + public Brush S_Brush => L_VSplitContainer.L_PanelTop.L_HSplitContainer.L_TopBg.L_TerrainRoot.L_Brush; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg.TerrainRoot + /// + public TerrainRoot S_TerrainRoot => L_VSplitContainer.L_PanelTop.L_HSplitContainer.L_TopBg.L_TerrainRoot; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer.TopBg + /// + public TopBg S_TopBg => L_VSplitContainer.L_PanelTop.L_HSplitContainer.L_TopBg; + + /// + /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop.HSplitContainer + /// + public HSplitContainer S_HSplitContainer => L_VSplitContainer.L_PanelTop.L_HSplitContainer; /// /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelTop @@ -735,24 +929,24 @@ public PanelTop S_PanelTop => L_VSplitContainer.L_PanelTop; /// - /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.MarginContainer.BottomBg.TileTexture.CellRoot.BottomCell + /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.BottomBg.TileTexture.CellRoot.BottomCell /// - public BottomCell S_BottomCell => L_VSplitContainer.L_PanelBottom.L_MarginContainer.L_BottomBg.L_TileTexture.L_CellRoot.L_BottomCell; + public BottomCell S_BottomCell => L_VSplitContainer.L_PanelBottom.L_BottomBg.L_TileTexture.L_CellRoot.L_BottomCell; /// - /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.MarginContainer.BottomBg.TileTexture.MaskBrush + /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.BottomBg.TileTexture.MaskBrush /// - public MaskBrush S_MaskBrush => L_VSplitContainer.L_PanelBottom.L_MarginContainer.L_BottomBg.L_TileTexture.L_MaskBrush; + public MaskBrush S_MaskBrush => L_VSplitContainer.L_PanelBottom.L_BottomBg.L_TileTexture.L_MaskBrush; /// - /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.MarginContainer.BottomBg.TileTexture + /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.BottomBg.TileTexture /// - public TileTexture S_TileTexture => L_VSplitContainer.L_PanelBottom.L_MarginContainer.L_BottomBg.L_TileTexture; + public TileTexture S_TileTexture => L_VSplitContainer.L_PanelBottom.L_BottomBg.L_TileTexture; /// - /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.MarginContainer.BottomBg + /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelBottom.BottomBg /// - public BottomBg S_BottomBg => L_VSplitContainer.L_PanelBottom.L_MarginContainer.L_BottomBg; + public BottomBg S_BottomBg => L_VSplitContainer.L_PanelBottom.L_BottomBg; /// /// 场景中唯一名称的节点, 节点类型: , 节点路径: TileSetEditorTerrain.VSplitContainer.PanelBottom diff --git a/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/TileSetEditorTerrainPanel.cs b/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/TileSetEditorTerrainPanel.cs index 00fea1b..bedcdd7 100644 --- a/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/TileSetEditorTerrainPanel.cs +++ b/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/TileSetEditorTerrainPanel.cs @@ -9,12 +9,34 @@ /// 父Ui /// public TileSetEditorPanel EditorPanel; + + /// + /// 当前选中的地形索引 + /// + public int CurrTerrainIndex { get; set; } = -1; + + /// + /// 当前选中的地形 + /// + public TileSetTerrainInfo CurrTerrain + { + get + { + var terrain = EditorPanel.TileSetSourceInfo.Terrain; + if (CurrTerrainIndex < 0 || CurrTerrainIndex >= terrain.Count) + { + return null; + } + return terrain[CurrTerrainIndex]; + } + } /// /// 正在拖拽的图块 /// public MaskCell DraggingCell { get; set; } + public UiGrid TerrainTabGrid; public UiGrid TerrainGrid3x3; public UiGrid TerrainGrid2x2; public UiGrid TerrainGridMiddle; @@ -34,7 +56,13 @@ AddEventListener(EventEnum.OnSetTileTexture, OnSetTileTexture); //背景颜色改变 AddEventListener(EventEnum.OnSetTileSetBgColor, OnChangeTileSetBgColor); - + + //地形页签 + TerrainTabGrid = CreateUiGrid(S_TerrainTab); + TerrainTabGrid.SetCellOffset(Vector2I.Zero); + TerrainTabGrid.SetColumns(1); + TerrainTabGrid.SetHorizontalExpand(true); + MaskGrid = CreateUiGrid(S_BottomCell); MaskGrid.SetCellOffset(Vector2I.Zero); MaskGrid.GridContainer.MouseFilter = MouseFilterEnum.Ignore; @@ -47,7 +75,8 @@ OnSetTileTexture(EditorPanel.Texture); OnChangeTileSetBgColor(EditorPanel.BgColor); - S_TopBg.Instance.ChangeTerrainType(0, false); + OnChangeTerrainType(-1); + TerrainTabGrid.SelectEvent += OnChangeTerrain; } public override void OnDestroyUi() @@ -63,16 +92,15 @@ { _refreshGridConnect = false; - var terrain = EditorPanel.TileSetSourceInfo.Terrain; - if (EditorPanel.TileSetSourceIndex == 0) //选中Main Source + var terrain = CurrTerrain; + if (terrain.TerrainType == 0) //选中47格Terrain { TerrainGrid3x3.ForEach(cell => RefreshConnectTerrainCell(terrain, cell)); - TerrainGridMiddle.ForEach(cell => RefreshConnectTerrainCell(terrain, cell)); - TerrainGridFloor.ForEach(cell => RefreshConnectTerrainCell(terrain, cell)); - } - else if (terrain.TerrainType == 0) //选中47格Terrain - { - TerrainGrid3x3.ForEach(cell => RefreshConnectTerrainCell(terrain, cell)); + if (EditorPanel.TileSetSourceIndex == 0 && CurrTerrainIndex == 0) //选中Main Source + { + TerrainGridMiddle.ForEach(cell => RefreshConnectTerrainCell(terrain, cell)); + TerrainGridFloor.ForEach(cell => RefreshConnectTerrainCell(terrain, cell)); + } } else //选中13格Terrain { @@ -103,56 +131,15 @@ //改变选中的TileSet资源 private void OnSelectTileSetSource(object obj) { - //清除所有绑定的Terrain - TerrainGrid3x3.ForEach(cell => ((TerrainCell)cell).ClearCell()); - TerrainGridMiddle.ForEach(cell => ((TerrainCell)cell).ClearCell()); - TerrainGridFloor.ForEach(cell => ((TerrainCell)cell).ClearCell()); - TerrainGrid2x2.ForEach(cell => ((TerrainCell)cell).ClearCell()); - S_TopBg.Instance.SetHoverCell(null); - S_BottomBg.Instance.SetHoverCell(null); - - var sourceIndex = EditorPanel.TileSetSourceIndex; - if (sourceIndex == 0) //选中Main Source时就只能使用 47 Terrain - { - S_TerrainTexture2.Instance.Visible = true; - S_TerrainTexture3.Instance.Visible = true; - TerrainGridMiddle.Visible = true; - TerrainGridFloor.Visible = true; - S_TerrainTexture1.L_Label.Instance.Text = "顶部墙壁"; - S_TerrainTypeButton.Instance.Visible = false; - S_TerrainTypeButton.Instance.Selected = 0; - S_TopBg.Instance.ChangeTerrainType(0, false); - } - else - { - S_TerrainTexture2.Instance.Visible = false; - S_TerrainTexture3.Instance.Visible = false; - TerrainGridMiddle.Visible = false; - TerrainGridFloor.Visible = false; - S_TerrainTexture1.L_Label.Instance.Text = "地形"; - S_TerrainTypeButton.Instance.Visible = true; - var selectIndex = EditorPanel.TileSetSourceInfo.Terrain.TerrainType; - S_TerrainTypeButton.Instance.Selected = selectIndex; - S_TopBg.Instance.ChangeTerrainType(selectIndex, false); - } - - //再加载Terrain + TerrainTabGrid.RemoveAll(); + //加载Terrain if (obj != null) { - var terrain = ((TileSetSourceInfo)obj).Terrain; - if (sourceIndex == 0) //选中Main Source + var terrainList = ((TileSetSourceInfo)obj).Terrain; + if (terrainList.Count > 0) { - TerrainGrid3x3.ForEach(cell => SetTerrainCellData(terrain, cell)); - TerrainGridMiddle.ForEach(cell => SetTerrainCellData(terrain, cell)); - TerrainGridFloor.ForEach(cell => SetTerrainCellData(terrain, cell)); - } - else if (S_TerrainTypeButton.Instance.Selected == 0) //选中47个Terrain - { - TerrainGrid3x3.ForEach(cell => SetTerrainCellData(terrain, cell)); - } - else //选中13格Terrain - { - TerrainGrid2x2.ForEach(cell => SetTerrainCellData(terrain, cell)); + TerrainTabGrid.SetDataList(terrainList.ToArray()); + TerrainTabGrid.SelectIndex = 0; } } } @@ -192,7 +179,7 @@ /// public void OnDropCell(MaskCell maskCell) { - if (EditorPanel.TileSetSourceIndex == 0) //选中Main Source + if (CurrTerrain.TerrainType == 0) //选中47个Terrain { var flag = true; TerrainGrid3x3.ForEach((cell) => @@ -200,29 +187,25 @@ flag = !((TerrainCell)cell).OnDropCell(maskCell); return flag; }); - if (flag) + if (EditorPanel.TileSetSourceIndex == 0 && CurrTerrainIndex == 0) //选中Main Source { - TerrainGridMiddle.ForEach((cell) => + if (flag) { - flag = !((TerrainCell)cell).OnDropCell(maskCell); - return flag; - }); - } - if (flag) - { - TerrainGridFloor.ForEach((cell) => + TerrainGridMiddle.ForEach((cell) => + { + flag = !((TerrainCell)cell).OnDropCell(maskCell); + return flag; + }); + } + if (flag) { - return ((TerrainCell)cell).OnDropCell(maskCell); - }); + TerrainGridFloor.ForEach((cell) => + { + return ((TerrainCell)cell).OnDropCell(maskCell); + }); + } } } - else if (S_TerrainTypeButton.Instance.Selected == 0) //选中47个Terrain - { - TerrainGrid3x3.ForEach((cell) => - { - return !((TerrainCell)cell).OnDropCell(maskCell); - }); - } else //选中13格Terrain { TerrainGrid2x2.ForEach((cell) => @@ -262,4 +245,90 @@ S_BottomBg.Instance.Color = EditorPanel.BgColor; S_TopBg.Instance.Color = EditorPanel.BgColor; } + + //切换选中的地形 + private void OnChangeTerrain(int index) + { + CurrTerrainIndex = index; + + //清除所有绑定的Terrain + if (index >= 0) + { + TerrainGrid3x3.ForEach(cell => ((TerrainCell)cell).ClearCell()); + TerrainGridMiddle.ForEach(cell => ((TerrainCell)cell).ClearCell()); + TerrainGridFloor.ForEach(cell => ((TerrainCell)cell).ClearCell()); + TerrainGrid2x2.ForEach(cell => ((TerrainCell)cell).ClearCell()); + } + S_TopBg.Instance.SetHoverCell(null); + S_BottomBg.Instance.SetHoverCell(null); + + var terrain = CurrTerrain; + if (terrain.TerrainType == 0) //选中47个Terrain + { + TerrainGrid3x3.ForEach(cell => SetTerrainCellData(terrain, cell)); + if (EditorPanel.TileSetSourceIndex == 0) //选中Main Source + { + TerrainGridMiddle.ForEach(cell => SetTerrainCellData(terrain, cell)); + TerrainGridFloor.ForEach(cell => SetTerrainCellData(terrain, cell)); + } + } + else //选中13格Terrain + { + TerrainGrid2x2.ForEach(cell => SetTerrainCellData(terrain, cell)); + } + + if (index >= 0) + { + OnChangeTerrainType(TerrainTabGrid.GetCell(index).Data.TerrainType); + } + else + { + OnChangeTerrainType(-1); + } + } + + /// + /// 切换Terrain类型 + /// + private void OnChangeTerrainType(long index) + { + if (EditorPanel.TileSetSourceIndex == 0) //选中 Main Source + { + S_TerrainTexture2.Instance.Visible = true; + S_TerrainTexture3.Instance.Visible = true; + TerrainGridMiddle.Visible = true; + TerrainGridFloor.Visible = true; + S_TerrainTexture1.L_Label.Instance.Text = "顶部墙壁"; + } + else + { + S_TerrainTexture2.Instance.Visible = false; + S_TerrainTexture3.Instance.Visible = false; + TerrainGridMiddle.Visible = false; + TerrainGridFloor.Visible = false; + S_TerrainTexture1.L_Label.Instance.Text = "地形"; + } + + if (index == 0) //47 格子 + { + S_TerrainRoot.L_TerrainTexture1.Instance.Visible = true; + TerrainGrid3x3.Visible = true; + S_TerrainRoot.L_TerrainTexture4.Instance.Visible = false; + TerrainGrid2x2.Visible = false; + } + else if (index == 1) //13 格子 + { + S_TerrainRoot.L_TerrainTexture1.Instance.Visible = false; + TerrainGrid3x3.Visible = false; + S_TerrainRoot.L_TerrainTexture4.Instance.Visible = true; + TerrainGrid2x2.Visible = true; + } + else + { + S_TerrainRoot.L_TerrainTexture1.Instance.Visible = false; + TerrainGrid3x3.Visible = false; + S_TerrainRoot.L_TerrainTexture4.Instance.Visible = false; + TerrainGrid2x2.Visible = false; + } + } } diff --git a/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/up/TerrainCell.cs b/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/up/TerrainCell.cs index 9ec2788..93a786d 100644 --- a/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/up/TerrainCell.cs +++ b/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/up/TerrainCell.cs @@ -121,11 +121,11 @@ { if (cellData == null) { - _panel.EditorPanel.TileSetSourceInfo.Terrain.RemoveTerrainCell(Index, Data); + _panel.CurrTerrain.RemoveTerrainCell(Index, Data); } else { - _panel.EditorPanel.TileSetSourceInfo.Terrain.SetTerrainCell(Index, Data, cellData); + _panel.CurrTerrain.SetTerrainCell(Index, Data, cellData); } EventManager.EmitEvent(EventEnum.OnTileSetDirty); diff --git a/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/up/TerrainTabData.cs b/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/up/TerrainTabData.cs deleted file mode 100644 index cc13656..0000000 --- a/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/up/TerrainTabData.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -namespace UI.TileSetEditorTerrain; - -public class TerrainTabData -{ - public string Text; - public TileSetEditorTerrain.TopBg TopBg; - - public TerrainTabData(string text, TileSetEditorTerrain.TopBg topBg) - { - Text = text; - TopBg = topBg; - } -} \ No newline at end of file diff --git a/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/up/TileEditTerrain.cs b/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/up/TileEditTerrain.cs index c84e4c8..8075876 100644 --- a/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/up/TileEditTerrain.cs +++ b/DungeonShooting_Godot/src/game/ui/tileSetEditorTerrain/up/TileEditTerrain.cs @@ -6,7 +6,6 @@ { private bool _dragMoveFlag = false; private TerrainCell _hoverCell = null; - private int _currentTerrainType = -1; public override void SetUiNode(IUiNode uiNode) { @@ -22,11 +21,6 @@ //聚焦按钮点击 UiNode.L_FocusBtn.Instance.Pressed += OnFocusClick; - //切换TerrainType按钮点击 - UiNode.L_TerrainTypeButton.Instance.ItemSelected += (index) => - { - ChangeTerrainType(index, true); - }; } /// @@ -44,21 +38,20 @@ var _panel = UiNode.UiPanel; if (_panel.S_TopBg.Instance.IsMouseInRect()) { - if (_panel.EditorPanel.TileSetSourceIndex == 0) //选中Main Source + if (_panel.CurrTerrain.TerrainType == 0) //选中47个Terrain { cell = CalcMouseHoverCell(_panel.S_TerrainTexture1.Instance, _panel.TerrainGrid3x3); - if (cell == null) + if (_panel.EditorPanel.TileSetSourceIndex == 0 && _panel.CurrTerrainIndex == 0) //选中Main Source { - cell = CalcMouseHoverCell(_panel.S_TerrainTexture2.Instance, _panel.TerrainGridMiddle); + if (cell == null) + { + cell = CalcMouseHoverCell(_panel.S_TerrainTexture2.Instance, _panel.TerrainGridMiddle); + } + if (cell == null) + { + cell = CalcMouseHoverCell(_panel.S_TerrainTexture3.Instance, _panel.TerrainGridFloor); + } } - if (cell == null) - { - cell = CalcMouseHoverCell(_panel.S_TerrainTexture3.Instance, _panel.TerrainGridFloor); - } - } - else if (_panel.S_TerrainTypeButton.Instance.Selected == 0) //选中47个Terrain - { - cell = CalcMouseHoverCell(_panel.S_TerrainTexture1.Instance, _panel.TerrainGrid3x3); } else //选中13格Terrain { @@ -115,105 +108,21 @@ private void OnFocusClick() { Vector2 rootSize; - if (UiNode.UiPanel.EditorPanel.TileSetSourceIndex == 0) + var panel = UiNode.UiPanel; + if (panel.EditorPanel.TileSetSourceIndex == 0 && panel.CurrTerrainIndex == 0) //选中 Main Source { rootSize = UiNode.L_TerrainRoot.Instance.Size; } - else if (UiNode.L_TerrainTypeButton.Instance.Selected == 0) + else if (panel.CurrTerrain.TerrainType == 0) //选中 47 格 Terrain { rootSize = UiNode.L_TerrainRoot.L_TerrainTexture1.Instance.Size; } - else + else //13 格 Terrain { rootSize = UiNode.L_TerrainRoot.L_TerrainTexture4.Instance.Size; } Utils.DoFocusNode(ContainerRoot, Size, rootSize); RefreshGridTrans(); } - - /// - /// 切换Terrain类型 - /// - public void ChangeTerrainType(long index, bool initiative) - { - if (_currentTerrainType == index) - { - return; - } - if (!initiative) - { - _currentTerrainType = (int)index; - DoChangeTerrainType(index); - return; - } - EditorWindowManager.ShowConfirm("提示", "确定要切换Terrain类型吗?\n该操作将清除所有已经配置好的地形数据!", (v) => - { - if (v) - { - _currentTerrainType = (int)index; - UiNode.UiPanel.EditorPanel.TileSetSourceInfo.Terrain.TerrainType = (byte)_currentTerrainType; - DoChangeTerrainType(index); - DoClearCell(); - } - else - { - UiNode.L_TerrainTypeButton.Instance.Selected = _currentTerrainType; - } - }); - } - - private void DoChangeTerrainType(long index) - { - UiNode.L_TerrainRoot.L_TerrainTexture1.Instance.Visible = index == 0; - UiNode.UiPanel.TerrainGrid3x3.Visible = index == 0; - UiNode.L_TerrainRoot.L_TerrainTexture4.Instance.Visible = index != 0; - UiNode.UiPanel.TerrainGrid2x2.Visible = index != 0; - } - - private void DoClearCell() - { - if (UiNode.UiPanel.EditorPanel.TileSetSourceIndex == 0) - { - UiNode.UiPanel.TerrainGrid3x3.ForEach(cell => - { - var terrainCell = (TerrainCell)cell; - terrainCell.ClearCell(); - }); - UiNode.UiPanel.TerrainGridMiddle.ForEach(cell => - { - var terrainCell = (TerrainCell)cell; - terrainCell.ClearCell(); - }); - UiNode.UiPanel.TerrainGridFloor.ForEach(cell => - { - var terrainCell = (TerrainCell)cell; - terrainCell.ClearCell(); - }); - } - else if (UiNode.L_TerrainTypeButton.Instance.Selected == 0) - { - UiNode.UiPanel.TerrainGrid3x3.ForEach(cell => - { - var terrainCell = (TerrainCell)cell; - terrainCell.ClearCell(); - }); - } - else - { - UiNode.UiPanel.TerrainGrid2x2.ForEach(cell => - { - var terrainCell = (TerrainCell)cell; - terrainCell.ClearCell(); - }); - } - - UiNode.UiPanel.MaskGrid.ForEach(cell => - { - ((MaskCell)cell).SetConnectTerrainCell(null); - }); - - //清除Terrain中的数据 - var terrainInfo = UiNode.UiPanel.EditorPanel.TileSetSourceInfo.Terrain; - terrainInfo.T.Clear(); - } + } \ No newline at end of file