From c73bc185a54426c43779be50f3e432c9f7762704 Mon Sep 17 00:00:00 2001 From: Cold-Mint Date: Thu, 23 May 2024 21:58:49 +0800 Subject: [PATCH] =?UTF-8?q?Add=20the=20Generate=20map=20button=20used=20in?= =?UTF-8?q?=20the=20test=20to=20adjust=20the=20room=20selection=20algorith?= =?UTF-8?q?m.=20=E5=8A=A0=E5=85=A5=E6=B5=8B=E8=AF=95=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E7=9A=84=E7=94=9F=E6=88=90=E5=9C=B0=E5=9B=BE=E6=8C=89=E9=92=AE?= =?UTF-8?q?=EF=BC=8C=E8=B0=83=E6=95=B4=E6=88=BF=E9=97=B4=E7=9A=84=E9=80=89?= =?UTF-8?q?=E5=8F=96=E7=AE=97=E6=B3=95=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/levelGraphs/test.json | 75 ++++++++++++++++++ locals/UI.csv | 3 +- locals/UI.en.translation | Bin 1646 -> 1674 bytes locals/UI.jp.translation | Bin 2081 -> 2125 bytes locals/UI.zh.translation | Bin 1741 -> 1773 bytes scenes/game.tscn | 16 ++++ scripts/loader/sceneLoader/GameSceneLoader.cs | 37 ++++++++- scripts/map/MapGenerator.cs | 2 +- .../PatchworkRoomPlacementStrategy.cs | 35 +++++--- 9 files changed, 151 insertions(+), 17 deletions(-) diff --git a/data/levelGraphs/test.json b/data/levelGraphs/test.json index 4682698..607ecf0 100644 --- a/data/levelGraphs/test.json +++ b/data/levelGraphs/test.json @@ -5,6 +5,36 @@ "ToId": "4ae948ea-82b7-4b2d-bec2-19ed8a9d4c03", "FromPort": 0, "ToPort": 0 + }, + { + "FromId": "4ae948ea-82b7-4b2d-bec2-19ed8a9d4c03", + "ToId": "9d764cca-5057-470a-976d-ba472a21e2cc", + "FromPort": 0, + "ToPort": 0 + }, + { + "FromId": "9d764cca-5057-470a-976d-ba472a21e2cc", + "ToId": "08c9d2be-6174-4efe-91fc-e1b205c4dd53", + "FromPort": 0, + "ToPort": 0 + }, + { + "FromId": "08c9d2be-6174-4efe-91fc-e1b205c4dd53", + "ToId": "55d2ef86-49d0-4f8c-9f06-286673a5e1da", + "FromPort": 0, + "ToPort": 0 + }, + { + "FromId": "55d2ef86-49d0-4f8c-9f06-286673a5e1da", + "ToId": "07cc5f19-df5c-44aa-9997-81e48f4e2c4e", + "FromPort": 0, + "ToPort": 0 + }, + { + "FromId": "07cc5f19-df5c-44aa-9997-81e48f4e2c4e", + "ToId": "ea62a8ef-5575-4259-814a-b3454ff688f5", + "FromPort": 0, + "ToPort": 0 } ], "RoomNodeDataList": [ @@ -19,6 +49,51 @@ "StartingRoom" ] }, + { + "Id": "9d764cca-5057-470a-976d-ba472a21e2cc", + "Title": "房间3", + "Description": "", + "RoomTemplateSet": [ + "res://prefab/roomTemplates/dungeon" + ], + "Tags": null + }, + { + "Id": "08c9d2be-6174-4efe-91fc-e1b205c4dd53", + "Title": "房间4", + "Description": "", + "RoomTemplateSet": [ + "res://prefab/roomTemplates/dungeon" + ], + "Tags": null + }, + { + "Id": "55d2ef86-49d0-4f8c-9f06-286673a5e1da", + "Title": "房间5", + "Description": "", + "RoomTemplateSet": [ + "res://prefab/roomTemplates/dungeon" + ], + "Tags": null + }, + { + "Id": "ea62a8ef-5575-4259-814a-b3454ff688f5", + "Title": "房间7", + "Description": "", + "RoomTemplateSet": [ + "res://prefab/roomTemplates/dungeon" + ], + "Tags": null + }, + { + "Id": "07cc5f19-df5c-44aa-9997-81e48f4e2c4e", + "Title": "房间6", + "Description": "", + "RoomTemplateSet": [ + "res://prefab/roomTemplates/dungeon" + ], + "Tags": null + }, { "Id": "4ae948ea-82b7-4b2d-bec2-19ed8a9d4c03", "Title": "大厅", diff --git a/locals/UI.csv b/locals/UI.csv index f955582..226051c 100644 --- a/locals/UI.csv +++ b/locals/UI.csv @@ -27,4 +27,5 @@ save,保存,Save,保留 filename,文件名,File name,ファイル名 cancel,取消,Cancel,キャンセル load,加载,Load,ろーど -delete_selected_node,删除选中的节点,Delete selected node,選択されたノードを削除します \ No newline at end of file +delete_selected_node,删除选中的节点,Delete selected node,選択されたノードを削除します +re_create_map,重新创建地图,Re-create map,地図を再作成します \ No newline at end of file diff --git a/locals/UI.en.translation b/locals/UI.en.translation index 70adeb148b938a2e62caddf204cf6d018daff828..f3610dc85314ab467f0ed2baee26c6a09a8b01b7 100644 GIT binary patch delta 170 zcmaFI)5W_%nvu1vGOwU;vI65e&nyN8h5{h20^Idj1f)UItdsXMe`egXc{9s?Mjm#kf}r3aX8^_kF*g7J diff --git a/locals/UI.jp.translation b/locals/UI.jp.translation index 44b20fa803f82cc5571311c1dfd8765b39bec9af..7d3cd2f5308dfac9bcff14c740ed87a7fb92f86b 100644 GIT binary patch delta 188 zcmZ1|a8_W0G$U(yMpj1hWCg~(o>>eG3(jT zfmi{EmuyyJYGzbr0x}ta_^J|DUn!7gfnp`kh5B*K3=A?rzRcu(%%2&nHg94{WY&5* rXT#Ikn;$n#dfL|eWbd439TOfmPJi6E?{VWypi*`q1{oI=9OMiDuvJBq delta 144 zcmX>ruux!wG$U(rNl~uFWCg~(o@opW3^_nt2E_l7Kn;}N1f)BFxDSY@K*eCnW&!!E zK&$}73pT4UH8YAb0+}FuRf(&w6iBmx@Z@vMpBdveA7V*l=3`)BhbjpQ4sr$n1yC@c diff --git a/locals/UI.zh.translation b/locals/UI.zh.translation index 049cfd9181ef615dd5982025f918b4a4a0771f53..2f8339765b459f51b96ad2bbe4db31f4ddacd9ad 100644 GIT binary patch delta 177 zcmX@h`<8cuG$U(>eG3(jT zfmi{EmuyyJYGzbr0x}ta_^J|DpA(Q~hhinqh5DR8Nns#gc=A5x&x|sgH?iDG$U(fMM-JiWCg~(o@opW3^_nt2E_l7Kn;}N1f)BFxDSY@K*eCnW&!!E yK&$}73pT4UH8YAb0+}FuRf((52}rYp@Z@vMpBXtfA7bHQ;)jZX)C2_wIRgN0=`dLU diff --git a/scenes/game.tscn b/scenes/game.tscn index b4f4b30..9cc189b 100644 --- a/scenes/game.tscn +++ b/scenes/game.tscn @@ -67,6 +67,22 @@ grow_horizontal = 0 horizontal_alignment = 2 script = ExtResource("5_dis4v") +[node name="RecreateMapButton" type="Button" parent="CanvasLayer/Control"] +layout_mode = 0 +offset_right = 8.0 +offset_bottom = 8.0 +text = "re_create_map" + +[node name="SeedLabel" type="Label" parent="CanvasLayer/Control"] +layout_mode = 1 +anchors_preset = 5 +anchor_left = 0.5 +anchor_right = 0.5 +offset_left = -20.0 +offset_right = 20.0 +offset_bottom = 25.0 +grow_horizontal = 2 + [node name="ProjectileContainer" type="Node2D" parent="."] [node name="DamageNumberContainer" type="Node2D" parent="."] diff --git a/scripts/loader/sceneLoader/GameSceneLoader.cs b/scripts/loader/sceneLoader/GameSceneLoader.cs index 6179586..933ecf1 100644 --- a/scripts/loader/sceneLoader/GameSceneLoader.cs +++ b/scripts/loader/sceneLoader/GameSceneLoader.cs @@ -11,6 +11,8 @@ namespace ColdMint.scripts.loader.sceneLoader; public partial class GameSceneLoader : SceneLoaderTemplate { + private Label? _seedLabel; + public override Task InitializeData() { //加载血条场景 @@ -30,14 +32,41 @@ public partial class GameSceneLoader : SceneLoaderTemplate public override async Task LoadScene() { + var debugMode = Config.IsDebug(); + var recreateMapButton = GetNodeOrNull