Browse Source

fix bugs: file select options saved after will to line edit,now saved to file select

master
jkpete 1 month ago
parent
commit
92ab4b4e58
  1. 6
      Example/SaveSystem/Script/ViewSaveSystem.cs
  2. 17
      addons/EGFramework/Module/GenerateTools/Templete/Godot/UI/EGodotEditParam.cs

6
Example/SaveSystem/Script/ViewSaveSystem.cs

@ -37,12 +37,6 @@ namespace EGFramework.Examples.Test {
// rowData2.Init(new Dictionary<string, object>() { { "Name", "Z" }, { "Age", 1 } }); // rowData2.Init(new Dictionary<string, object>() { { "Name", "Z" }, { "Age", 1 } });
// EGodotEditParam editParam = container.CreateNode<EGodotEditParam>("editParam"); // EGodotEditParam editParam = container.CreateNode<EGodotEditParam>("editParam");
// editParam.Init(new KeyValuePair<string, object>("数量",1)); // editParam.Init(new KeyValuePair<string, object>("数量",1));
this.ExecuteAfterSecond(() =>
{
this.EGConfirm("fixed?", isconfirm => { GD.Print(isconfirm); });
this.EGAlert("-----~!");
}, 1.0f);
} }
public override void _ExitTree() public override void _ExitTree()

17
addons/EGFramework/Module/GenerateTools/Templete/Godot/UI/EGodotEditParam.cs

@ -11,6 +11,7 @@ namespace EGFramework.UI
public CheckButton ParamCheck { get; set; } public CheckButton ParamCheck { get; set; }
public List<CheckBox> ParamCheckList { get; set; } public List<CheckBox> ParamCheckList { get; set; }
public Label ParamReadOnly { get; set; } public Label ParamReadOnly { get; set; }
public Label ParamPathSelect { get; set; }
public SpinBox ParamSpinBox { get; set; } public SpinBox ParamSpinBox { get; set; }
public HSlider ParamSlider { get; set; } public HSlider ParamSlider { get; set; }
public Button ParamOperate { get; set; } public Button ParamOperate { get; set; }
@ -116,11 +117,11 @@ namespace EGFramework.UI
else if (editValue.Value is EGPathSelect) else if (editValue.Value is EGPathSelect)
{ {
EGPathSelect pathSelect = (EGPathSelect)editValue.Value; EGPathSelect pathSelect = (EGPathSelect)editValue.Value;
this.ParamReadOnly = new Label(); this.ParamPathSelect = new Label();
ParamReadOnly.Name = "ParamReadOnly"; ParamPathSelect.Name = "ParamReadOnly";
ParamReadOnly.SizeFlagsHorizontal = SizeFlags.ExpandFill; ParamPathSelect.SizeFlagsHorizontal = SizeFlags.ExpandFill;
ParamReadOnly.Text = pathSelect.Path; ParamPathSelect.Text = pathSelect.Path;
this.AddChild(ParamReadOnly); this.AddChild(ParamPathSelect);
this.ParamOperate = new Button(); this.ParamOperate = new Button();
ParamOperate.Name = "SelectBtn"; ParamOperate.Name = "SelectBtn";
ParamOperate.Text = "Select file"; ParamOperate.Text = "Select file";
@ -129,7 +130,7 @@ namespace EGFramework.UI
{ {
this.EGFileOpen("res://", str => this.EGFileOpen("res://", str =>
{ {
ParamReadOnly.Text = str; ParamPathSelect.Text = str;
}); });
}; };
// ParamOperate.Pressed += // ParamOperate.Pressed +=
@ -176,6 +177,10 @@ namespace EGFramework.UI
{ {
return ParamSlider.Value; return ParamSlider.Value;
} }
else if (ParamPathSelect != null)
{
return new EGPathSelect(){Path = ParamPathSelect.Text};
}
return null; return null;
} }

Loading…
Cancel
Save