Browse Source

fixed struct

master
jkpete 2 months ago
parent
commit
3e158ff96b
  1. 8
      Example/SaveSystem/Script/ViewSaveSystem.cs
  2. 3
      addons/EGFramework/Module/GenerateTools/Templete/Godot/Dialog/EGodotBasicDialog.cs
  3. 5
      addons/EGFramework/Module/GenerateTools/Templete/Godot/Dialog/EGodotFileDialog.cs
  4. 6
      addons/EGFramework/Module/GenerateTools/Templete/Godot/UI/EGodotEditParam.cs
  5. 2
      addons/EGFramework/Module/GenerateTools/Templete/Godot/UI/EGodotTable.cs
  6. 4
      addons/EGFramework/Module/GenerateTools/Templete/Variant/EGDataStruct.cs

8
Example/SaveSystem/Script/ViewSaveSystem.cs

@ -46,14 +46,18 @@ namespace EGFramework.Examples.Test {
} }
public struct DataStudent { public struct DataStudent
{
public string Name { get; set; } public string Name { get; set; }
public int Age; public int Age;
public int ID; public int ID;
public DataStudent(string name, int age) { public EGPathSelect Path { set; get; }
public DataStudent(string name, int age)
{
Name = name; Name = name;
Age = age; Age = age;
ID = 0; ID = 0;
Path = new EGPathSelect();
} }
} }

3
addons/EGFramework/Module/GenerateTools/Templete/Godot/Dialog/EGodotBasicDialog.cs

@ -26,6 +26,7 @@ namespace EGFramework.UI
EGodotFileDialog fileDialog = self.SingletoneNode<EGodotFileDialog>("FileDialog"); EGodotFileDialog fileDialog = self.SingletoneNode<EGodotFileDialog>("FileDialog");
fileDialog.Title = title; fileDialog.Title = title;
fileDialog.RootSubfolder = filePath; fileDialog.RootSubfolder = filePath;
fileDialog.PopupCentered();
fileDialog.InitFileSelect(selectPath); fileDialog.InitFileSelect(selectPath);
} }
@ -34,6 +35,7 @@ namespace EGFramework.UI
EGodotFileDialog fileDialog = self.SingletoneNode<EGodotFileDialog>("FileDialog"); EGodotFileDialog fileDialog = self.SingletoneNode<EGodotFileDialog>("FileDialog");
fileDialog.Title = title; fileDialog.Title = title;
fileDialog.RootSubfolder = filePath; fileDialog.RootSubfolder = filePath;
fileDialog.PopupCentered();
fileDialog.InitSaveFileSelect(selectPath); fileDialog.InitSaveFileSelect(selectPath);
} }
@ -42,6 +44,7 @@ namespace EGFramework.UI
EGodotFileDialog fileDialog = self.SingletoneNode<EGodotFileDialog>("FileDialog"); EGodotFileDialog fileDialog = self.SingletoneNode<EGodotFileDialog>("FileDialog");
fileDialog.Title = title; fileDialog.Title = title;
fileDialog.RootSubfolder = filePath; fileDialog.RootSubfolder = filePath;
fileDialog.PopupCentered();
fileDialog.InitDirSelect(selectPath); fileDialog.InitDirSelect(selectPath);
} }
} }

5
addons/EGFramework/Module/GenerateTools/Templete/Godot/Dialog/EGodotFileDialog.cs

@ -27,7 +27,6 @@ namespace EGFramework.UI
OnFileSelect.Register(callback); OnFileSelect.Register(callback);
Init(); Init();
this.FileMode = FileModeEnum.OpenFile; this.FileMode = FileModeEnum.OpenFile;
this.PopupCentered();
} }
public void InitDirSelect(Action<string> callback) public void InitDirSelect(Action<string> callback)
@ -35,7 +34,6 @@ namespace EGFramework.UI
OnDirSelect.Register(callback); OnDirSelect.Register(callback);
this.FileMode = FileModeEnum.OpenDir; this.FileMode = FileModeEnum.OpenDir;
Init(); Init();
this.PopupCentered();
} }
public void InitFilesSelect(Action<string[]> callback) public void InitFilesSelect(Action<string[]> callback)
@ -43,7 +41,6 @@ namespace EGFramework.UI
OnFilesSelect.Register(callback); OnFilesSelect.Register(callback);
this.FileMode = FileModeEnum.OpenFiles; this.FileMode = FileModeEnum.OpenFiles;
Init(); Init();
this.PopupCentered();
} }
public void InitAnySelect(Action<string> singleSelectCallback, Action<string[]> multiSelectCallback) public void InitAnySelect(Action<string> singleSelectCallback, Action<string[]> multiSelectCallback)
@ -53,7 +50,6 @@ namespace EGFramework.UI
OnFilesSelect.Register(multiSelectCallback); OnFilesSelect.Register(multiSelectCallback);
this.FileMode = FileModeEnum.OpenAny; this.FileMode = FileModeEnum.OpenAny;
Init(); Init();
this.PopupCentered();
} }
public void InitSaveFileSelect(Action<string> callback) public void InitSaveFileSelect(Action<string> callback)
@ -61,7 +57,6 @@ namespace EGFramework.UI
OnFileSelect.Register(callback); OnFileSelect.Register(callback);
this.FileMode = FileModeEnum.SaveFile; this.FileMode = FileModeEnum.SaveFile;
Init(); Init();
this.PopupCentered();
} }

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

@ -122,8 +122,12 @@ namespace EGFramework.UI
ParamReadOnly.Text = pathSelect.Path; ParamReadOnly.Text = pathSelect.Path;
this.AddChild(ParamReadOnly); this.AddChild(ParamReadOnly);
this.ParamOperate = new Button(); this.ParamOperate = new Button();
ParamOperate.Name = "Select file"; ParamOperate.Name = "SelectBtn";
ParamOperate.Text = "Select file";
ParamOperate.SizeFlagsHorizontal = SizeFlags.ExpandFill; ParamOperate.SizeFlagsHorizontal = SizeFlags.ExpandFill;
ParamOperate.Pressed += () => {
this.EGFileOpen("res://", str => { ParamReadOnly.Text = str; });
};
// ParamOperate.Pressed += // ParamOperate.Pressed +=
this.AddChild(ParamOperate); this.AddChild(ParamOperate);
} }

2
addons/EGFramework/Module/GenerateTools/Templete/Godot/UI/EGodotTable.cs

@ -31,7 +31,7 @@ namespace EGFramework.UI
protected Dictionary<string,object> EmptyData { set; get; } protected Dictionary<string,object> EmptyData { set; get; }
protected Dictionary<string,object> TitleData { set; get; } protected Dictionary<string, object> TitleData { set; get; } = new Dictionary<string, object>();
protected EasyEvent<Dictionary<string, object>> AddData { set; get; } = new EasyEvent<Dictionary<string, object>>(); protected EasyEvent<Dictionary<string, object>> AddData { set; get; } = new EasyEvent<Dictionary<string, object>>();

4
addons/EGFramework/Module/GenerateTools/Templete/Variant/EGDataStruct.cs

@ -32,6 +32,10 @@ namespace EGFramework
{ {
public string Path { set; get; } public string Path { set; get; }
public bool IsDir { set; get; } public bool IsDir { set; get; }
public override string ToString()
{
return Path;
}
} }
public interface IEGReadOnlyString public interface IEGReadOnlyString

Loading…
Cancel
Save