diff --git a/locals/UI.csv b/locals/UI.csv index 0f22d2d..8bee363 100644 --- a/locals/UI.csv +++ b/locals/UI.csv @@ -9,7 +9,7 @@ jump,跳跃,Jump,飛 throw,抛出,Throw a ,ほうしゅつ use_item,使用,Use,しよう jump_down,跳下平台,Jump off platform,踊り場から飛び降ります -de,的,'s,の +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} level_graph_editor,关卡图编辑器,Level graph editor,ステージマップエディター @@ -25,4 +25,5 @@ line_errors_must_start_with_res,位于{0}错误,必须以res://开头。,"Loca open_the_export_directory,打开导出目录,Open the export directory,エクスポートディレクトリを開きます save,保存,Save,保留 filename,文件名,File name,ファイル名 -cancel,取消,Cancel,キャンセル \ No newline at end of file +cancel,取消,Cancel,キャンセル +load,加载,Load,ろーど \ No newline at end of file diff --git a/locals/UI.en.translation b/locals/UI.en.translation index 7add425..aed4396 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 b887b84..9b74fe8 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 b5dd9ce..9774ac0 100644 Binary files a/locals/UI.zh.translation and b/locals/UI.zh.translation differ diff --git a/project.godot b/project.godot index eecff5d..93617b2 100644 --- a/project.godot +++ b/project.godot @@ -147,6 +147,7 @@ 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 70a343e..764c724 100644 --- a/scenes/LevelGraphEditor.tscn +++ b/scenes/LevelGraphEditor.tscn @@ -156,10 +156,14 @@ grow_horizontal = 0 layout_mode = 2 text = "open_the_export_directory" -[node name="SaveButton" type="Button" parent="HBoxContainer"] +[node name="ShowSavePanelButton" type="Button" parent="HBoxContainer"] layout_mode = 2 text = "save" +[node name="ShowLoadPanelButton" type="Button" parent="HBoxContainer"] +layout_mode = 2 +text = "load" + [node name="ShowCreateRoomPanelButton" type="Button" parent="HBoxContainer"] layout_mode = 2 text = "create_room" @@ -168,7 +172,7 @@ text = "create_room" layout_mode = 2 text = "close" -[node name="SaveOrloadPanel" type="Panel" parent="."] +[node name="SaveOrLoadPanel" type="Panel" parent="."] visible = false layout_mode = 1 anchors_preset = 15 @@ -181,7 +185,7 @@ offset_bottom = -155.0 grow_horizontal = 2 grow_vertical = 2 -[node name="Label" type="Label" parent="SaveOrloadPanel"] +[node name="SaveOrLoadPanelTitleLabel" type="Label" parent="SaveOrLoadPanel"] layout_mode = 1 anchors_preset = 5 anchor_left = 0.5 @@ -193,7 +197,7 @@ offset_bottom = 40.0 grow_horizontal = 2 text = "save" -[node name="LineEdit" type="LineEdit" parent="SaveOrloadPanel"] +[node name="FileNameLineEdit" type="LineEdit" parent="SaveOrLoadPanel"] layout_mode = 1 anchors_preset = 14 anchor_top = 0.5 @@ -206,7 +210,7 @@ offset_bottom = 28.0 grow_horizontal = 2 grow_vertical = 2 -[node name="Label2" type="Label" parent="SaveOrloadPanel"] +[node name="Label" type="Label" parent="SaveOrLoadPanel"] layout_mode = 1 anchors_preset = 4 anchor_top = 0.5 @@ -218,7 +222,7 @@ offset_bottom = -13.0 grow_vertical = 2 text = "filename" -[node name="HBoxContainer" type="HBoxContainer" parent="SaveOrloadPanel"] +[node name="HBoxContainer" type="HBoxContainer" parent="SaveOrLoadPanel"] layout_mode = 1 anchors_preset = 3 anchor_left = 1.0 @@ -232,10 +236,10 @@ offset_bottom = -10.0 grow_horizontal = 0 grow_vertical = 0 -[node name="CancelButton" type="Button" parent="SaveOrloadPanel/HBoxContainer"] +[node name="CancelButton" type="Button" parent="SaveOrLoadPanel/HBoxContainer"] layout_mode = 2 text = "cancel" -[node name="ActionButton" type="Button" parent="SaveOrloadPanel/HBoxContainer"] +[node name="ActionButton" type="Button" parent="SaveOrLoadPanel/HBoxContainer"] layout_mode = 2 text = "save" diff --git a/scripts/levelGraphEditor/IRoomNodeData.cs b/scripts/levelGraphEditor/IRoomNodeData.cs deleted file mode 100644 index c919967..0000000 --- a/scripts/levelGraphEditor/IRoomNodeData.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace ColdMint.scripts.levelGraphEditor; - -public interface IRoomNodeData -{ - string? Id { get; set; } - - /// - /// Title - /// 标题 - /// - string? Title { get; set; } - - /// - /// 描述 - /// Description - /// - string? Description { get; set; } -} \ No newline at end of file diff --git a/scripts/levelGraphEditor/LevelGraphEditorSaveData.cs b/scripts/levelGraphEditor/LevelGraphEditorSaveData.cs index 566ae3c..240c43e 100644 --- a/scripts/levelGraphEditor/LevelGraphEditorSaveData.cs +++ b/scripts/levelGraphEditor/LevelGraphEditorSaveData.cs @@ -10,5 +10,5 @@ public class LevelGraphEditorSaveData { public List? ConnectionDataList { get; set; } - public List? RoomNodeDataList { get; set; } + public List? RoomNodeDataList { get; set; } } \ No newline at end of file diff --git a/scripts/levelGraphEditor/RoomNode.cs b/scripts/levelGraphEditor/RoomNode.cs index 4b99858..de40f56 100644 --- a/scripts/levelGraphEditor/RoomNode.cs +++ b/scripts/levelGraphEditor/RoomNode.cs @@ -5,9 +5,9 @@ namespace ColdMint.scripts.levelGraphEditor; public partial class RoomNode : GraphNode { private Label? _describeLabel; - private IRoomNodeData? _roomNodeData; + private RoomNodeData? _roomNodeData; - public IRoomNodeData? RoomNodeData + public RoomNodeData? RoomNodeData { get => _roomNodeData; set diff --git a/scripts/levelGraphEditor/RoomNodeData.cs b/scripts/levelGraphEditor/RoomNodeData.cs index 8bcb935..0b92f0f 100644 --- a/scripts/levelGraphEditor/RoomNodeData.cs +++ b/scripts/levelGraphEditor/RoomNodeData.cs @@ -1,6 +1,6 @@ namespace ColdMint.scripts.levelGraphEditor; -public class RoomNodeData : IRoomNodeData +public class RoomNodeData { public string? Id { get; set; } public string? Title { get; set; } diff --git a/scripts/loader/uiLoader/LevelGraphEditorLoader.cs b/scripts/loader/uiLoader/LevelGraphEditorLoader.cs index de299cb..4dc8992 100644 --- a/scripts/loader/uiLoader/LevelGraphEditorLoader.cs +++ b/scripts/loader/uiLoader/LevelGraphEditorLoader.cs @@ -31,12 +31,37 @@ public partial class LevelGraphEditorLoader : UiLoaderTemplate private Button? _createRoomButton; private Button? _returnButton; private string? _defaultRoomName; + + /// + /// Index of the room + /// 房间的索引 + /// private int _roomIndex = 1; + private TextEdit? _roomTemplateCollectionTextEdit; private Label? _roomTemplateTipsLabel; - private Button? _saveButton; + private Button? _showSavePanelButton; private Button? _openExportFolderButton; private HBoxContainer? _hBoxContainer; + private Panel? _saveOrLoadPanel; + private Button? _cancelButton; + private Button? _actionButton; + private Label? _saveOrLoadPanelTitleLabel; + private LineEdit? _fileNameLineEdit; + private Button? _showLoadPanelButton; + + /// + /// Offset to append when a new node is created. + /// 创建新节点时追加的偏移量。 + /// + private Vector2 _positionOffset = new Vector2(100, 100); + + /// + /// Is the press event of an active button saved? + /// 活动按钮的按下事件是否为保存? + /// + private bool _saveMode; + public override void InitializeData() { @@ -68,8 +93,14 @@ public partial class LevelGraphEditorLoader : UiLoaderTemplate _openExportFolderButton.Visible = ExplorerUtils.SupportOpenDirectory(); } + _showLoadPanelButton = GetNode