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

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

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

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

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

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

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

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

@ -29,9 +29,9 @@ namespace EGFramework.UI @@ -29,9 +29,9 @@ namespace EGFramework.UI
protected List<Dictionary<string, object>> TableData { set; get; }
protected Dictionary<string,object> EmptyData { set; get; }
protected Dictionary<string,object> TitleData { set; get; }
protected Dictionary<string,object> EmptyData { 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>>();

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

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

Loading…
Cancel
Save