From 250bd53392f951dc0f6df7f82de5149fe30532a9 Mon Sep 17 00:00:00 2001 From: Cold-Mint Date: Fri, 17 May 2024 22:08:19 +0800 Subject: [PATCH] =?UTF-8?q?Support=20to=20delete=20the=20selected=20node,?= =?UTF-8?q?=20the=20room=20template=20edit=20box=20for=20anti-shake=20proc?= =?UTF-8?q?essing.=20=E6=94=AF=E6=8C=81=E5=88=A0=E9=99=A4=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E8=8A=82=E7=82=B9=E4=BA=86=EF=BC=8C=E5=AF=B9?= =?UTF-8?q?=E6=88=BF=E9=97=B4=E6=A8=A1=E6=9D=BF=E7=BC=96=E8=BE=91=E6=A1=86?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E9=98=B2=E6=8A=96=E5=A4=84=E7=90=86=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locals/UI.csv | 7 +- locals/UI.en.translation | Bin 1610 -> 1646 bytes locals/UI.jp.translation | Bin 1973 -> 2081 bytes locals/UI.zh.translation | Bin 1673 -> 1741 bytes project.godot | 1 - scenes/LevelGraphEditor.tscn | 5 +- scripts/Config.cs | 6 + scripts/levelGraphEditor/RoomNodeData.cs | 2 + .../loader/uiLoader/LevelGraphEditorLoader.cs | 195 ++++++++++++------ 9 files changed, 151 insertions(+), 65 deletions(-) diff --git a/locals/UI.csv b/locals/UI.csv index 8bee363..f955582 100644 --- a/locals/UI.csv +++ b/locals/UI.csv @@ -19,11 +19,12 @@ name,名称,Name,めいしょう describe,描述,Describe,ないよう creation,创建,Creation,創建 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}エラーに位置し、ファイルは存在しません。 +room_template_collection_prompt,房间模板集(传入路径为文件夹,将选择文件夹内的所有子文件),"Room template set (incoming path is folder, all subfiles in folder will be selected)",部屋テンプレートセット(着信経路をフォルダにして、フォルダ内のすべてのサブファイルを選択します。) +error_specifying_room_template_line,位于{0}错误,文件或文件夹不存在。,"Located at {0} error, file or folder does not exist.",{0}エラーに位置し、ファイルやフォルダが存在しません。 line_errors_must_start_with_res,位于{0}错误,必须以res://开头。,"Located at {0} error, must start with res://.",{0}エラーに位置し、res://で始めなければなりません。 open_the_export_directory,打开导出目录,Open the export directory,エクスポートディレクトリを開きます save,保存,Save,保留 filename,文件名,File name,ファイル名 cancel,取消,Cancel,キャンセル -load,加载,Load,ろーど \ No newline at end of file +load,加载,Load,ろーど +delete_selected_node,删除选中的节点,Delete selected node,選択されたノードを削除します \ No newline at end of file diff --git a/locals/UI.en.translation b/locals/UI.en.translation index aed4396b7092aa25b788a00310fed6131409434f..70adeb148b938a2e62caddf204cf6d018daff828 100644 GIT binary patch delta 431 zcmX@b^NweOG$U(vdTDv(WCcdMKm`T{hW|)F4T-MlwuZ!+tt#JAVn4_*i4^8wkSliQiJWle#s zP#^~B2H}IpqyO6i87e@w>E!cF>ls&0u4i@^OazK40>$)z`1_p)>lRJE&aBTkWimTU zH{+holUXDf9sgx4SBc%ShY+`Z+sg>KF^^buaXdTE|LBT=J0GimI Aa{vGU delta 377 zcmaFIbBbq!G$U(Xrm=C(WCcdMKp6%GhW|)F35l-(W$OWH6DZpXNIO8;ZcrLY`+uLw z>lwuZgMczIK%4}`89-bF#K@{Dp!_-@-2%j2Ks*5|22(c;$Y%v&1t6X?S)9quIc{-D}tPzmq1H>TJAbjw6^nWWL zLmtT1o_wEaJ>$a3{mkxykw7s;pcu%v-|swFH*4~9W_`w<$>J>CjLSAJW|3f2{LiT2 z`o62!(L%iRz}p3F2{EU*izo9j>DqLl67%(il)B+3;xk}DTG&ttN+Htl$c@-i)@ zX;WHW5-H`*KR~8_n{n&L<$TY2R?n$Vzwh_=cFxJxChV6@vUPrCdCAQk^0?O_Nm9vl zoF?CH=q^OJq5Bbs4LxQ=(|Bo;KgbQ+vZ!>-{e}>04DMpN=4uq}@PfCCoWC311?}RyimPP{N+6~MPcPG@ zUTpS2d-#WvQQA}Y_$j-b}EX>8!TaY=IYdPF7pXn>wNJrkbg`R zvyt!X3~6!FcSt)YJw!VbH1<&b;5R34k9w? delta 397 zcmZ1|u$6y`=U`|Gvy^pad6?55l+C+zVw0yaY0HKHSs)D3 z4Z;VHNB>U+G7N!i!^!uU)-%4D+{f%LI1MPK4HN_6?{^-odph|Uvp(aM$zm+sOq@)c z7qcicW<1%m;A!j97u(lA-PiJD$F677+Mn#+_H@b4_j`JtZfJYi(D|%;C0y`nTkG># zEzdd|p3Uiex^@CYT$AC+-rgs>`l=0TUrw3%V*PrcR*1~Aj%jeMlLgqaRG)S%csX+k d(9kD4)&dQB(be?4X(!NeV84TW5)>Td3;?*J)b{`Y delta 413 zcmX@h+sV5@nvumK+ca&mJfmNr3`=U`|Gvy#pad6?&oy}&leVlAkOjgZ)gXNEc=Z2ZAVU?% zR-OEgX+7h)$@7@q1uKAJ+CVW7{(k4dy5p0-G3zsKo2wzNA<}Q5JvH#`tEzedgd^UIg(>WWS&TV+y(4@)mWN+`2 qU47LCwJ)d4e6fE0`#n9+rnNuWy=}4`TNXdiCXl;9t_lhcas~iI1+0Yt diff --git a/project.godot b/project.godot index 93617b2..eecff5d 100644 --- a/project.godot +++ b/project.godot @@ -147,7 +147,6 @@ hotbar_previous={ [internationalization] locale/translations=PackedStringArray("res://locals/UI.en.translation", "res://locals/UI.zh.translation", "res://locals/Error.zh.translation", "res://locals/Error.en.translation", "res://locals/slogan.en.translation", "res://locals/slogan.zh.translation", "res://locals/Log.en.translation", "res://locals/Log.zh.translation", "res://locals/Weapon.en.translation", "res://locals/Weapon.zh.translation", "res://locals/InputMapping.en.translation", "res://locals/InputMapping.zh.translation", "res://locals/Error.jp.translation", "res://locals/InputMapping.jp.translation", "res://locals/Log.jp.translation", "res://locals/slogan.jp.translation", "res://locals/UI.jp.translation", "res://locals/Weapon.jp.translation") -locale/test="jp" [layer_names] diff --git a/scenes/LevelGraphEditor.tscn b/scenes/LevelGraphEditor.tscn index 764c724..ec13035 100644 --- a/scenes/LevelGraphEditor.tscn +++ b/scenes/LevelGraphEditor.tscn @@ -35,7 +35,6 @@ offset_bottom = 32.0 text = "level_graph_editor" [node name="CreateOrEditorPanel" type="Panel" parent="."] -visible = false layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -152,6 +151,10 @@ offset_right = -15.0 offset_bottom = 47.0 grow_horizontal = 0 +[node name="DeleteSelectedNodeButton" type="Button" parent="HBoxContainer"] +layout_mode = 2 +text = "delete_selected_node" + [node name="OpenExportFolderButton" type="Button" parent="HBoxContainer"] layout_mode = 2 text = "open_the_export_directory" diff --git a/scripts/Config.cs b/scripts/Config.cs index 81fac7f..70d77dc 100644 --- a/scripts/Config.cs +++ b/scripts/Config.cs @@ -80,6 +80,12 @@ public static class Config /// public const int MaxStackQuantity = 99; + /// + /// Text change buffering Time How long does it take to execute the actual event after an event with a text change listener is triggered? (Anti-shake processing time), unit: milliseconds + /// 当添加了文本改变监听器的事件被触发后,多长时间后执行实际事件?(防抖处理时长),单位:毫秒 + /// + public const long TextChangesBuffetingDuration = 300; + /// /// Operation prompts, function key text color /// 操作提示内,功能键文本颜色 diff --git a/scripts/levelGraphEditor/RoomNodeData.cs b/scripts/levelGraphEditor/RoomNodeData.cs index 0b92f0f..bc647f4 100644 --- a/scripts/levelGraphEditor/RoomNodeData.cs +++ b/scripts/levelGraphEditor/RoomNodeData.cs @@ -5,4 +5,6 @@ public class RoomNodeData public string? Id { get; set; } public string? Title { get; set; } public string? Description { get; set; } + + public string[]? RoomTemplateSet { get; set; } } \ No newline at end of file diff --git a/scripts/loader/uiLoader/LevelGraphEditorLoader.cs b/scripts/loader/uiLoader/LevelGraphEditorLoader.cs index 4dc8992..a333382 100644 --- a/scripts/loader/uiLoader/LevelGraphEditorLoader.cs +++ b/scripts/loader/uiLoader/LevelGraphEditorLoader.cs @@ -1,5 +1,7 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.IO; +using ColdMint.scripts.debug; using ColdMint.scripts.levelGraphEditor; using ColdMint.scripts.serialization; using ColdMint.scripts.utils; @@ -49,6 +51,14 @@ public partial class LevelGraphEditorLoader : UiLoaderTemplate private Label? _saveOrLoadPanelTitleLabel; private LineEdit? _fileNameLineEdit; private Button? _showLoadPanelButton; + private Button? _deleteSelectedNodeButton; + private readonly List _selectedNodes = new List(); + + /// + /// Displays the time to enter the suggestion + /// 显示输入建议的时刻 + /// + private DateTime? _displaysTheSuggestedInputTime; /// /// Offset to append when a new node is created. @@ -103,6 +113,7 @@ public partial class LevelGraphEditorLoader : UiLoaderTemplate _showSavePanelButton = GetNode