diff --git a/locals/UI.csv b/locals/UI.csv index 6b9a0cb..68564bb 100644 --- a/locals/UI.csv +++ b/locals/UI.csv @@ -11,4 +11,10 @@ use_item,使用,Use,しよう jump_down,跳下平台,Jump off platform,踊り場から飛び降ります de,的,'s,の default_player_name,白纸,blankPaper,しらかみ -item_prompt_debug,ID:{0}\n名称:{1}\n数量:{2}\n最大叠加数量:{3}\n数据类型:{4}\n描述:{5},ID: {0}\nName: {1}\nQuantity: {2}\nMaximum stacking quantity: {3}\nData type: {4}\nDescription:{5},id:{0}\n名称:{1}\nの数は最大{2}\nシナジー数:{3}\nデータタイプ:{4}\n述べ表わす:{5} \ No newline at end of file +item_prompt_debug,ID:{0}\n名称:{1}\n数量:{2}\n最大叠加数量:{3}\n数据类型:{4}\n描述:{5},ID: {0}\nName: {1}\nQuantity: {2}\nMaximum stacking quantity: {3}\nData type: {4}\nDescription:{5},id:{0}\n名称:{1}\nの数は最大{2}\nシナジー数:{3}\nデータタイプ:{4}\n述べ表わす:{5} +level_graph_editor,关卡图编辑器,Level graph editor,ステージマップエディター +create_room,创建房间,Create room,部屋を作ります +close,关闭,Close,閉じます +name,名称,Name,めいしょう +describe,描述,Describe,ないよう +creation,创建,Creation,創建 \ No newline at end of file diff --git a/locals/UI.en.translation b/locals/UI.en.translation index 9ea560e..1b26b39 100644 Binary files a/locals/UI.en.translation and b/locals/UI.en.translation differ diff --git a/locals/UI.jp.translation b/locals/UI.jp.translation index 2bff39c..b8e9d14 100644 Binary files a/locals/UI.jp.translation and b/locals/UI.jp.translation differ diff --git a/locals/UI.zh.translation b/locals/UI.zh.translation index 4c1a73f..d44c8f1 100644 Binary files a/locals/UI.zh.translation and b/locals/UI.zh.translation differ diff --git a/prefab/roomTemplates/dungeon/horizontalCorridorWithSewer.tscn b/prefab/roomTemplates/dungeon/horizontalCorridorWithSewer.tscn index dcc0c6b..124e176 100644 --- a/prefab/roomTemplates/dungeon/horizontalCorridorWithSewer.tscn +++ b/prefab/roomTemplates/dungeon/horizontalCorridorWithSewer.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=5 format=3 uid="uid://dslr5tdbp4noq"] +[gd_scene load_steps=6 format=3 uid="uid://dslr5tdbp4noq"] [ext_resource type="TileSet" uid="uid://c4wpp12rr44hi" path="res://tileSets/dungeon.tres" id="1_rn2om"] @@ -11,6 +11,9 @@ size = Vector2(20, 48) [sub_resource type="RectangleShape2D" id="RectangleShape2D_x4kt2"] size = Vector2(46, 20) +[sub_resource type="RectangleShape2D" id="RectangleShape2D_131jn"] +size = Vector2(20, 54) + [node name="InitialRoom" type="Node2D"] [node name="TileMap" type="TileMap" parent="."] @@ -44,3 +47,10 @@ shape = SubResource("RectangleShape2D_o85u0") [node name="CollisionShape2D" type="CollisionShape2D" parent="RoomSlotList/Area2D3"] position = Vector2(224, 178) shape = SubResource("RectangleShape2D_x4kt2") + +[node name="Area2D2" type="Area2D" parent="RoomSlotList"] +position = Vector2(498, 109) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="RoomSlotList/Area2D2"] +position = Vector2(0, 17) +shape = SubResource("RectangleShape2D_131jn") diff --git a/prefab/roomTemplates/dungeon/initialRoom.tscn b/prefab/roomTemplates/dungeon/initialRoom.tscn index db6f9ea..8c0540a 100644 --- a/prefab/roomTemplates/dungeon/initialRoom.tscn +++ b/prefab/roomTemplates/dungeon/initialRoom.tscn @@ -19,7 +19,7 @@ layer_0/tile_data = PackedInt32Array(393230, 393217, 5, 393229, 393217, 5, 39322 layer_1/name = "BackgroundDecoration" layer_1/tile_data = PackedInt32Array(393218, 458753, 5, 65550, 458753, 4) layer_2/name = "Ground" -layer_2/tile_data = PackedInt32Array(0, 1, 3, 65536, 131073, 1, 131072, 131073, 1, 196608, 131073, 1, 262144, 131073, 1, 458752, 1, 5, 1, 65537, 2, 458753, 65537, 0, 2, 65537, 2, 458754, 65537, 0, 3, 65537, 2, 458755, 65537, 0, 4, 65537, 2, 458756, 65537, 0, 5, 65537, 2, 458757, 65537, 0, 6, 65537, 2, 458758, 65537, 0, 7, 65537, 2, 458759, 65537, 0, 8, 65537, 2, 9, 65537, 2, 458761, 65537, 0, 10, 65537, 2, 458762, 65537, 0, 11, 65537, 2, 458763, 65537, 0, 12, 65537, 2, 458764, 65537, 0, 13, 65537, 2, 458765, 65537, 0, 14, 65537, 3, 458766, 65537, 0, 15, 131073, 3, 65551, 131073, 4, 131087, 131073, 4, 196623, 131073, 4, 262159, 131073, 4, 458767, 131073, 5, 458760, 65537, 0, 327680, 131073, 1, 393216, 131073, 1) +layer_2/tile_data = PackedInt32Array(0, 1, 3, 65536, 131073, 1, 131072, 131073, 1, 196608, 131073, 1, 262144, 131073, 1, 458752, 1, 5, 15, 131073, 3, 65551, 131073, 4, 131087, 131073, 4, 196623, 131073, 4, 262159, 131073, 4, 458767, 131073, 5, 327680, 131073, 1, 393216, 131073, 1, 1, 65537, 2, 2, 65537, 2, 3, 65537, 2, 4, 65537, 2, 5, 65537, 2, 6, 65537, 2, 7, 65537, 2, 8, 65537, 2, 9, 65537, 2, 10, 65537, 2, 11, 65537, 2, 12, 65537, 2, 13, 65537, 2, 14, 65537, 3, 458753, 65537, 0, 458754, 65537, 0, 458755, 65537, 0, 458756, 65537, 0, 458757, 65537, 0, 458758, 65537, 0, 458759, 65537, 0, 458760, 65537, 0, 458761, 65537, 0, 458762, 65537, 0, 458763, 65537, 0, 458764, 65537, 0, 458765, 65537, 0, 458766, 65537, 0) [node name="RoomArea" type="Area2D" parent="."] diff --git a/prefab/ui/RoomNode.tscn b/prefab/ui/RoomNode.tscn new file mode 100644 index 0000000..f95ef32 --- /dev/null +++ b/prefab/ui/RoomNode.tscn @@ -0,0 +1,8 @@ +[gd_scene load_steps=2 format=3 uid="uid://y6rg5jc4viwn"] + +[ext_resource type="Script" path="res://scripts/levelGraphEditor/RoomNode.cs" id="1_jiu7r"] + +[node name="RoomNode" type="GraphNode"] +offset_right = 571.0 +offset_bottom = 253.0 +script = ExtResource("1_jiu7r") diff --git a/scenes/LevelGraphEditor.tscn b/scenes/LevelGraphEditor.tscn new file mode 100644 index 0000000..59147c1 --- /dev/null +++ b/scenes/LevelGraphEditor.tscn @@ -0,0 +1,111 @@ +[gd_scene load_steps=2 format=3 uid="uid://ckl23uwxrjat4"] + +[ext_resource type="Script" path="res://scripts/loader/uiLoader/LevelGraphEditorLoader.cs" id="1_7nyq6"] + +[node name="LevelGraphEditor" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_7nyq6") + +[node name="GraphEdit" type="GraphEdit" parent="."] +visible = false +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_top = 39.0 +grow_horizontal = 2 +grow_vertical = 2 +show_grid = false +minimap_enabled = false +show_minimap_button = false + +[node name="Label" type="Label" parent="."] +layout_mode = 0 +offset_left = 11.0 +offset_top = 7.0 +offset_right = 143.0 +offset_bottom = 32.0 +text = "level_graph_editor" + +[node name="CreateOrEditorPanel" type="Panel" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = 45.0 +offset_top = 42.0 +offset_right = -39.0 +offset_bottom = -45.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="Label" type="Label" parent="CreateOrEditorPanel"] +layout_mode = 0 +offset_left = 15.0 +offset_top = 11.0 +offset_right = 102.0 +offset_bottom = 36.0 +text = "create_room" + +[node name="Label3" type="Label" parent="CreateOrEditorPanel"] +layout_mode = 0 +offset_left = 7.0 +offset_top = 109.0 +offset_right = 94.0 +offset_bottom = 134.0 +text = "describe" + +[node name="RoomNameLineEdit" type="LineEdit" parent="CreateOrEditorPanel"] +layout_mode = 0 +offset_left = 75.0 +offset_top = 54.0 +offset_right = 1053.0 +offset_bottom = 87.0 + +[node name="RoomDescriptionLineEdit" type="LineEdit" parent="CreateOrEditorPanel"] +layout_mode = 0 +offset_left = 82.0 +offset_top = 108.0 +offset_right = 1060.0 +offset_bottom = 141.0 + +[node name="HideCreateRoomPanelButton" type="Button" parent="CreateOrEditorPanel"] +layout_mode = 1 +anchors_preset = 1 +anchor_left = 1.0 +anchor_right = 1.0 +offset_left = -46.0 +offset_bottom = 33.0 +grow_horizontal = 0 +text = "close" + +[node name="Label2" type="Label" parent="CreateOrEditorPanel"] +layout_mode = 0 +offset_left = 22.0 +offset_top = 56.0 +offset_right = 62.0 +offset_bottom = 81.0 +text = "name" + +[node name="CreateRoomButton" type="Button" parent="CreateOrEditorPanel"] +layout_mode = 0 +offset_left = 972.0 +offset_top = 507.0 +offset_right = 1039.0 +offset_bottom = 540.0 +text = "creation" + +[node name="ShowCreateRoomPanelButton" type="Button" parent="."] +layout_mode = 1 +anchors_preset = 1 +anchor_left = 1.0 +anchor_right = 1.0 +offset_left = -95.0 +offset_bottom = 33.0 +grow_horizontal = 0 +text = "create_room" diff --git a/scenes/mainMenu.tscn b/scenes/mainMenu.tscn index 04fe4bb..6986741 100644 --- a/scenes/mainMenu.tscn +++ b/scenes/mainMenu.tscn @@ -37,6 +37,18 @@ offset_bottom = 248.0 grow_horizontal = 2 text = "settings" +[node name="levelGraphEditorButton" type="Button" parent="."] +layout_mode = 1 +anchors_preset = 5 +anchor_left = 0.5 +anchor_right = 0.5 +offset_left = -44.5 +offset_top = 269.0 +offset_right = 50.5 +offset_bottom = 302.0 +grow_horizontal = 2 +text = "level_graph_editor" + [node name="VBoxContainer" type="VBoxContainer" parent="."] layout_mode = 1 anchors_preset = 2 diff --git a/scripts/levelGraphEditor/IRoomNodeData.cs b/scripts/levelGraphEditor/IRoomNodeData.cs new file mode 100644 index 0000000..e20acff --- /dev/null +++ b/scripts/levelGraphEditor/IRoomNodeData.cs @@ -0,0 +1,16 @@ +namespace ColdMint.scripts.levelGraphEditor; + +public interface IRoomNodeData +{ + /// + /// Title + /// 标题 + /// + string Title { get; set; } + + /// + /// 描述 + /// Description + /// + string Description { get; set; } +} \ No newline at end of file diff --git a/scripts/levelGraphEditor/RoomNode.cs b/scripts/levelGraphEditor/RoomNode.cs new file mode 100644 index 0000000..89a5054 --- /dev/null +++ b/scripts/levelGraphEditor/RoomNode.cs @@ -0,0 +1,8 @@ +using Godot; + +namespace ColdMint.scripts.levelGraphEditor; + +public partial class RoomNode : GraphNode +{ + +} \ No newline at end of file diff --git a/scripts/levelGraphEditor/RoomNodeData.cs b/scripts/levelGraphEditor/RoomNodeData.cs new file mode 100644 index 0000000..80ff294 --- /dev/null +++ b/scripts/levelGraphEditor/RoomNodeData.cs @@ -0,0 +1,7 @@ +namespace ColdMint.scripts.levelGraphEditor; + +public class RoomNodeData : IRoomNodeData +{ + public string Title { get; set; } + public string Description { get; set; } +} \ No newline at end of file diff --git a/scripts/loader/uiLoader/LevelGraphEditorLoader.cs b/scripts/loader/uiLoader/LevelGraphEditorLoader.cs new file mode 100644 index 0000000..a72a0a2 --- /dev/null +++ b/scripts/loader/uiLoader/LevelGraphEditorLoader.cs @@ -0,0 +1,146 @@ +using ColdMint.scripts.levelGraphEditor; +using Godot; + +namespace ColdMint.scripts.loader.uiLoader; + +/// +/// Level graph editor +/// 关卡图编辑器 +/// +public partial class LevelGraphEditorLoader : UiLoaderTemplate +{ + private GraphEdit? _graphEdit; + + /// + /// Button to display the room creation panel. + /// 用于展示房间创建面板的按钮。 + /// + private Button? _showCreateRoomPanelButton; + + private PackedScene? _roomNodeScene; + private Panel? _createOrEditorPanel; + private Button? _hideCreateRoomPanelButton; + private LineEdit? _roomNameLineEdit; + private LineEdit? _roomDescriptionLineEdit; + private Button? _createRoomButton; + + public override void InitializeData() + { + base.InitializeData(); + _roomNodeScene = (PackedScene)GD.Load("res://prefab/ui/RoomNode.tscn"); + } + + + public override void InitializeUi() + { + base.InitializeUi(); + _graphEdit = GetNode("GraphEdit"); + _showCreateRoomPanelButton = GetNode