From 2a28702fc6fad425b3c7cc2fa1793819e348467a Mon Sep 17 00:00:00 2001 From: Cold-Mint Date: Sun, 12 May 2024 18:00:47 +0800 Subject: [PATCH] =?UTF-8?q?Make=20a=20level=20map=20editor.=20=E5=88=B6?= =?UTF-8?q?=E4=BD=9C=E5=85=B3=E5=8D=A1=E5=9B=BE=E7=BC=96=E8=BE=91=E5=99=A8?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locals/UI.csv | 8 +- locals/UI.en.translation | Bin 986 -> 1138 bytes locals/UI.jp.translation | Bin 1093 -> 1305 bytes locals/UI.zh.translation | Bin 997 -> 1161 bytes .../dungeon/horizontalCorridorWithSewer.tscn | 12 +- prefab/roomTemplates/dungeon/initialRoom.tscn | 2 +- prefab/ui/RoomNode.tscn | 8 + scenes/LevelGraphEditor.tscn | 111 +++++++++++++ scenes/mainMenu.tscn | 12 ++ scripts/levelGraphEditor/IRoomNodeData.cs | 16 ++ scripts/levelGraphEditor/RoomNode.cs | 8 + scripts/levelGraphEditor/RoomNodeData.cs | 7 + .../loader/uiLoader/LevelGraphEditorLoader.cs | 146 ++++++++++++++++++ scripts/loader/uiLoader/MainMenuLoader.cs | 14 ++ 14 files changed, 341 insertions(+), 3 deletions(-) create mode 100644 prefab/ui/RoomNode.tscn create mode 100644 scenes/LevelGraphEditor.tscn create mode 100644 scripts/levelGraphEditor/IRoomNodeData.cs create mode 100644 scripts/levelGraphEditor/RoomNode.cs create mode 100644 scripts/levelGraphEditor/RoomNodeData.cs create mode 100644 scripts/loader/uiLoader/LevelGraphEditorLoader.cs 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 9ea560e60b23e22e1a28bc224f9154686410e555..1b26b391e73160d27bb3e91d49b2fbc2c6549dc3 100644 GIT binary patch delta 397 zcmcb`{)uCQG$U(rMX^cZWCcdIdI1Io1~DL30pkBaparE(fV345I{>j85QF4Ezz2yP z1Z2kmaS{--0mXP!YNP`Rk zVVD8GN@W8+0{I+3%n8KIP`L%VNuT_IY!)c4cyBZ3Jdn)?#KJ)QRq>_fT_6q8!!!9m zqqHi_YIVKnbM8PJ2 T?wtHT26mtcAm0TA2RQ=(J6~Hm delta 267 zcmeywaf^L}G$U(zdU00LWCcdI`u{+{!@$5G1jHb=1eBHo(kei#1;hqWF_63&659sI zb^>A#AZ7((1t9hVVn!%FSvSeY9LVN|Vwkv!;*12K5Q88CgBJtHBACPi-K0j85QF4Ezz2yP z1Z2kmaS{--0vZh>ynr%oW73yLe=+sx4ds#68>LHMiUOHF?uA8hetJ|<~Z znAPff(dR0GDquDV2i@3~3bSFd9aA-2U>u}?n7WX(8j zGZ(WiW7XrPosXN_9yjlK+_d9y^SsB+&5xU>KW8p@=sC delta 272 zcmbQqb(CX+G$U(~X;y0fWCh01`u{+{!@$5G1jHb=1eBHo(kei#1;hqWF_63&659sI zb^>A#AZ7((1t9hVVn!%FSvSci9>^AhVwkv!;*12K5J=n$ED4iXpquom6DYw2#V~QR zzwyU*0>yZt7$&Z+7k#c0C?){HlczCNi^61Pd3qiKIS;I3vKg~Aqt@mkW?e=;1_pMZ LFi2TYaF8905% diff --git a/locals/UI.zh.translation b/locals/UI.zh.translation index 4c1a73f4a5b8a947aad20f2e441f4c45c7de53e5..d44c8f1ada1eb2ac7ca0c6b9adee0986189eed0b 100644 GIT binary patch delta 398 zcmaFL-pRQ^nvvBst=OnwvI1jhy#NCPgBTF20P%ky(1Ow?K-vn39e~&kh(U57;Df{t z0iERU9 zI{~o=5VHcY0ucKFF(VY8tefOx3S{#_F-%-VaYh1A2qf+VmV`+x&`tUj0F+>dVwkwu x-}qx0Sj5%!qR)9w?qh1^gQ=Y5>3K+zVX{866Vqvi$;HfPdBKK(q=SNkoB>AiH=F + /// 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