From 92ab4b4e581b8bb209d87228f8aa0aa9419f6548 Mon Sep 17 00:00:00 2001 From: jkpete <1031139173@qq.com> Date: Mon, 30 Jun 2025 16:13:19 +0800 Subject: [PATCH] fix bugs: file select options saved after will to line edit,now saved to file select --- Example/SaveSystem/Script/ViewSaveSystem.cs | 6 ------ .../Templete/Godot/UI/EGodotEditParam.cs | 19 ++++++++++++------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Example/SaveSystem/Script/ViewSaveSystem.cs b/Example/SaveSystem/Script/ViewSaveSystem.cs index 0aa88a1..714ef34 100644 --- a/Example/SaveSystem/Script/ViewSaveSystem.cs +++ b/Example/SaveSystem/Script/ViewSaveSystem.cs @@ -37,12 +37,6 @@ namespace EGFramework.Examples.Test { // rowData2.Init(new Dictionary() { { "Name", "Z" }, { "Age", 1 } }); // EGodotEditParam editParam = container.CreateNode("editParam"); // editParam.Init(new KeyValuePair("数量",1)); - this.ExecuteAfterSecond(() => - { - - this.EGConfirm("fixed?", isconfirm => { GD.Print(isconfirm); }); - this.EGAlert("-----~!"); - }, 1.0f); } public override void _ExitTree() diff --git a/addons/EGFramework/Module/GenerateTools/Templete/Godot/UI/EGodotEditParam.cs b/addons/EGFramework/Module/GenerateTools/Templete/Godot/UI/EGodotEditParam.cs index b13c481..0bc81e6 100644 --- a/addons/EGFramework/Module/GenerateTools/Templete/Godot/UI/EGodotEditParam.cs +++ b/addons/EGFramework/Module/GenerateTools/Templete/Godot/UI/EGodotEditParam.cs @@ -11,6 +11,7 @@ namespace EGFramework.UI public CheckButton ParamCheck { get; set; } public List ParamCheckList { get; set; } public Label ParamReadOnly { get; set; } + public Label ParamPathSelect { get; set; } public SpinBox ParamSpinBox { get; set; } public HSlider ParamSlider { get; set; } public Button ParamOperate { get; set; } @@ -116,11 +117,11 @@ namespace EGFramework.UI else if (editValue.Value is EGPathSelect) { EGPathSelect pathSelect = (EGPathSelect)editValue.Value; - this.ParamReadOnly = new Label(); - ParamReadOnly.Name = "ParamReadOnly"; - ParamReadOnly.SizeFlagsHorizontal = SizeFlags.ExpandFill; - ParamReadOnly.Text = pathSelect.Path; - this.AddChild(ParamReadOnly); + this.ParamPathSelect = new Label(); + ParamPathSelect.Name = "ParamReadOnly"; + ParamPathSelect.SizeFlagsHorizontal = SizeFlags.ExpandFill; + ParamPathSelect.Text = pathSelect.Path; + this.AddChild(ParamPathSelect); this.ParamOperate = new Button(); ParamOperate.Name = "SelectBtn"; ParamOperate.Text = "Select file"; @@ -129,7 +130,7 @@ namespace EGFramework.UI { this.EGFileOpen("res://", str => { - ParamReadOnly.Text = str; + ParamPathSelect.Text = str; }); }; // ParamOperate.Pressed += @@ -166,7 +167,7 @@ namespace EGFramework.UI { return (int)ParamSpinBox.Value; } - else if(ValueType == typeof(float)) + else if (ValueType == typeof(float)) { return (float)ParamSpinBox.Value; } @@ -176,6 +177,10 @@ namespace EGFramework.UI { return ParamSlider.Value; } + else if (ParamPathSelect != null) + { + return new EGPathSelect(){Path = ParamPathSelect.Text}; + } return null; }