From 2fded229109822472aed9e9a122edb16d61eb9e3 Mon Sep 17 00:00:00 2001 From: Cold-Mint Date: Tue, 14 May 2024 22:26:33 +0800 Subject: [PATCH] =?UTF-8?q?Attempt=20to=20serialize=20node=20data.=20?= =?UTF-8?q?=E5=B0=9D=E8=AF=95=E5=BA=8F=E5=88=97=E5=8C=96=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ColdMint.Traveler.csproj | 24 +-- locals/UI.csv | 6 +- locals/UI.en.translation | Bin 1162 -> 1514 bytes locals/UI.jp.translation | Bin 1337 -> 1845 bytes locals/UI.zh.translation | Bin 1189 -> 1573 bytes scenes/LevelGraphEditor.tscn | 27 ++++ scripts/levelGraphEditor/ConnectionData.cs | 9 ++ .../LevelGraphEditorSaveData.cs | 12 ++ scripts/levelGraphEditor/RoomNode.cs | 4 +- .../loader/uiLoader/LevelGraphEditorLoader.cs | 146 +++++++++++++++++- scripts/serialization/JsonSerialization.cs | 11 ++ scripts/utils/StrUtils.cs | 17 ++ 12 files changed, 239 insertions(+), 17 deletions(-) create mode 100644 scripts/levelGraphEditor/ConnectionData.cs create mode 100644 scripts/levelGraphEditor/LevelGraphEditorSaveData.cs create mode 100644 scripts/utils/StrUtils.cs diff --git a/ColdMint.Traveler.csproj b/ColdMint.Traveler.csproj index 8fddecf..49b333a 100644 --- a/ColdMint.Traveler.csproj +++ b/ColdMint.Traveler.csproj @@ -1,13 +1,13 @@ - - - net6.0 - net7.0 - net8.0 - true - ColdMint - enable - - - - + + + net6.0 + net7.0 + net8.0 + true + ColdMint + enable + + + + \ No newline at end of file diff --git a/locals/UI.csv b/locals/UI.csv index 8aaf0d3..27e8618 100644 --- a/locals/UI.csv +++ b/locals/UI.csv @@ -18,4 +18,8 @@ close,关闭,Close,閉じます name,名称,Name,めいしょう describe,描述,Describe,ないよう creation,创建,Creation,創建 -default_room_name,房间{0},Room{0},部屋{0}です \ No newline at end of file +default_room_name,房间{0},Room{0},部屋{0}です +room_template_collection_prompt,房间模板集(每一行被认为是一条房间模板地址。),Room template set (Each row is considered to be one room template address.),お部屋テンプレートセット(各行がお部屋テンプレートアドレスとされています。) +error_specifying_room_template_line,位于{0}错误,文件不存在。,"Located at {0} error, file does not exist.",{0}エラーに位置し、ファイルは存在しません。 +line_errors_must_start_with_res,位于{0}错误,必须以res://开头。,"Located at {0} error, must start with res://.",{0}エラーに位置し、res://で始めなければなりません。 +display_current_page_data,显示当前页面数据,Displays the current page data,現在のページデータを表示します \ No newline at end of file diff --git a/locals/UI.en.translation b/locals/UI.en.translation index 91a4ec6952ebb51aca975098f960f96842f5a5a4..63f638f462ec0ee2e6b5405b08d5497491f4b292 100644 GIT binary patch delta 742 zcmeC;e8s&%nvvD4xF{`mvI3)Cy*>j3@Byj+Kp+C8L2M9^LgFhx*=j&q2g)`A(iTv* z9h8RXgpeLs#6U8BK=BX;hI)o5AR_^Y(|{ORBaEE`6fXke3LvgSQ_}+EvjVXK5O)DF zGY~TZ@hnfzLn=U;6N)$ee*RAv$mW9LYdy=Pe*)R;49O5hAWa~=KsV`=KaggDVwkv! z;*12K5Q88P%K*X?`n7zZ zNCF5?c4snHjoaSxzY3@h6zU+gFmq4VP4Y1Z^0`5HvN^NzRC zFx77)verieIf_6rJ(&39`ApKGze;5TJ_1EJfEW}QFdbhNUuxckit!+cSG>2Ga~{YC zr3PUnap9mF+nxdWY#=<@pIMo)Z*ws-H)H+3AhyYTOu9Cmu69hy{~0x0-**)|T8Nh( zc)Or2A?6f!F;rGkLPBv_-hW0-hJQY6GEe2&|1(t^)UM_!=26l4z%9X6*RuMTDs$dH zOljRE%D(=}VHdgnSsgtJQsAO$(;2*9SZ11HK&>dt&!y@t|A4Myhq^W>ILH|Q-`3(} delta 401 zcmaFG-Nm^K90K_>!%m~FN>n8b_1KHdR4D}#_fe9+1qBtV~$Yc-%VmTl_ zF)bnK4Uh&I0>Ur@ewE4wd<612fS41AnW1tEbdx^$1KBK4T=Cv!&Uql44~T_<_^aYe z&AUJvq=yHH85t)3VbU`d4!W`J8ITL|I|##^v+4Kqf4V?E7ZhtOz0Cu11ISvA$;X+L zC+}jCm|VmxG5HmffGAAYEKkovpil!@!a3QVNqTY=P=yhT1S7|0Zx(Jw9(JGv$R|O; GLCydHBv)|& diff --git a/locals/UI.jp.translation b/locals/UI.jp.translation index 4d09760515d7d83799096413d4adff7a4ba5e5fd..4582fc91f2c45fd745e98671cb9af44bfec4f006 100644 GIT binary patch delta 902 zcmaJxy?+g>5ClOF6||i@J6E z4{BOWI}8#5P5{M5#ZN+y0&PJ1A2V_EC4dh|0B*nq3O&~U*UH7}eQ4ANQF`0whQWANI4rI}9>Gl|_Gj`=jPII(GB{nWv$wewpp5;sZQlaF8{A7fKjb5j{&N$OxE zU`Y`lA~8a2)Oy%w4I(FL+iwv!knmSPkw4mUdRrhsY}gv^BF>22CwARF#F*qf@mo-? mXBzQ!#4;oXiOV*bA>O-?GIK-E)zkZz{<6@4(9U1r)^b_^ delta 369 zcmdnWx07pwG$U(%c}1$hWCcdsdT|B__zwkaKrV2eN_YD}gOxf=Z|;&PV_sj^5m0D5|bO5B_{u55)g&yn&s(v r$OfnaY}#Z$Ch5tUKoyQG5=_e&H%GIqVB}+9UK| diff --git a/locals/UI.zh.translation b/locals/UI.zh.translation index 4acfceee8b0b5b367035548e739bea9b9f33522a..e18f24e76a0613ee318696e36deaa2312737dc01 100644 GIT binary patch delta 777 zcmZ3=xs+#vG$X5NX;yy0WCcdsdVK~6-~&?sfj|UGgV-P-g~V5YvekgJ4wP*Kq%ELq zJ17m&2_ZeOh=FAMfZ`zx4D}3AKt=)(rvWjtMi@H>C|(4_6+m2vrltkRX9Z#fAnpQU zW*}w+;#r=ahZKP{I}~sF{rsN>kj)Fl*Ls#ogA}qeBtsN|G=cB}-K0+eKpLhICa$75 zBLOH3HvlFcdijF7Aduq(lmlUy_`&1R|AT=XRiK#aos zVNAxVaobz|F9xcU1d4z#O#jKcNj|1PKG?yN-I$dp|74QTJuxjI=@U>C-F0syves7s zwQ2+9Kp1SwlSI=A6*Lz5=MlfAu9cJ);o)V`cD^Tqo0@AvdPo7Vnh_qHcHdY`VH z@pR4#peihip6+jbxp23|lif>;Qj4wh^`Gu(c)DZ@NbR#3`<^e^^>pv#r=7ho7jAty VchR${8=m#90|y((LqWko&HxgBBH{o5 delta 404 zcmZ3=vy^j#G$U(Tl39}BWCcdsdT|B__zwkaKrVw8iJzF3 zkn{;ivqLe=fM2Du0Y8z%nSpGO+ydRCPaucD)K|Q>nR6P*7lz`miZ3lHsc_JZZLfh`m^PSmHvNA7PXkH0#?sq7>_B_CfMQ&euQ4f4KFK68xsh37@=qoK qQJAh-o}PykVWv&?W0Ibn2~^?8BEcxQIf_Muksm4ta&S;^kTU>Sj#lpg diff --git a/scenes/LevelGraphEditor.tscn b/scenes/LevelGraphEditor.tscn index 223f54b..544e7cb 100644 --- a/scenes/LevelGraphEditor.tscn +++ b/scenes/LevelGraphEditor.tscn @@ -63,6 +63,22 @@ offset_right = 72.0 offset_bottom = 131.0 text = "describe" +[node name="Label4" type="Label" parent="CreateOrEditorPanel"] +layout_mode = 1 +offset_left = 15.0 +offset_top = 152.0 +offset_right = 75.0 +offset_bottom = 177.0 +text = "room_template_collection_prompt" + +[node name="RoomTemplateTipsLabel" type="Label" parent="CreateOrEditorPanel"] +layout_mode = 1 +offset_left = 18.0 +offset_top = 319.0 +offset_right = 265.0 +offset_bottom = 344.0 +text = "errorTip" + [node name="RoomNameLineEdit" type="LineEdit" parent="CreateOrEditorPanel"] layout_mode = 1 anchors_preset = 10 @@ -118,6 +134,13 @@ grow_horizontal = 0 grow_vertical = 0 text = "creation" +[node name="RoomTemplateCollectionTextEdit" type="TextEdit" parent="CreateOrEditorPanel"] +layout_mode = 0 +offset_left = 16.0 +offset_top = 187.0 +offset_right = 1111.0 +offset_bottom = 303.0 + [node name="HBoxContainer" type="HBoxContainer" parent="."] layout_mode = 1 anchors_preset = 1 @@ -129,6 +152,10 @@ offset_right = -15.0 offset_bottom = 47.0 grow_horizontal = 0 +[node name="DisplayCurrentPageData" type="Button" parent="HBoxContainer"] +layout_mode = 2 +text = "display_current_page_data" + [node name="ShowCreateRoomPanelButton" type="Button" parent="HBoxContainer"] layout_mode = 2 text = "create_room" diff --git a/scripts/levelGraphEditor/ConnectionData.cs b/scripts/levelGraphEditor/ConnectionData.cs new file mode 100644 index 0000000..b256880 --- /dev/null +++ b/scripts/levelGraphEditor/ConnectionData.cs @@ -0,0 +1,9 @@ +namespace ColdMint.scripts.levelGraphEditor; + +public class ConnectionData +{ + public IRoomNodeData? From { get; set; } + public IRoomNodeData? To { get; set; } + public int FromPort { get; set; } + public int ToPort { get; set; } +} \ No newline at end of file diff --git a/scripts/levelGraphEditor/LevelGraphEditorSaveData.cs b/scripts/levelGraphEditor/LevelGraphEditorSaveData.cs new file mode 100644 index 0000000..74c98cc --- /dev/null +++ b/scripts/levelGraphEditor/LevelGraphEditorSaveData.cs @@ -0,0 +1,12 @@ +using System.Collections.Generic; + +namespace ColdMint.scripts.levelGraphEditor; + +/// +/// Level map editor saves data +/// 关卡图编辑器保存的数据 +/// +public class LevelGraphEditorSaveData +{ + public List? ConnectionData { get; set; } +} \ No newline at end of file diff --git a/scripts/levelGraphEditor/RoomNode.cs b/scripts/levelGraphEditor/RoomNode.cs index 8964274..a178872 100644 --- a/scripts/levelGraphEditor/RoomNode.cs +++ b/scripts/levelGraphEditor/RoomNode.cs @@ -16,11 +16,10 @@ public partial class RoomNode : GraphNode Title = value.Title; if (value.Description.Length == 0) { - _describeLabel.Visible = false; + _describeLabel.Text = string.Empty; } else { - _describeLabel.Visible = true; _describeLabel.Text = value.Description; } @@ -33,5 +32,4 @@ public partial class RoomNode : GraphNode base._Ready(); _describeLabel = GetNode