Adding SzGui project
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -7,4 +7,6 @@
|
||||
SzCli/bin/
|
||||
SzCli/obj/
|
||||
SzCore/bin/
|
||||
SzCore/obj/
|
||||
SzCore/obj/
|
||||
SzGui/obj/
|
||||
SzGui/bin/
|
||||
|
||||
@@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SzCore", "SzCore\SzCore.csp
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SzCli", "SzCli\SzCli.csproj", "{F598E3F7-5CE7-4713-9AED-9BCFDC872974}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SzGui", "SzGui\SzGui.csproj", "{3347AFA3-823F-4F40-9B9A-7C277164622E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -24,5 +26,9 @@ Global
|
||||
{F598E3F7-5CE7-4713-9AED-9BCFDC872974}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F598E3F7-5CE7-4713-9AED-9BCFDC872974}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F598E3F7-5CE7-4713-9AED-9BCFDC872974}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{3347AFA3-823F-4F40-9B9A-7C277164622E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{3347AFA3-823F-4F40-9B9A-7C277164622E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3347AFA3-823F-4F40-9B9A-7C277164622E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{3347AFA3-823F-4F40-9B9A-7C277164622E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
@@ -22,6 +22,8 @@ public class SzDataHandler
|
||||
try
|
||||
{
|
||||
var json = SZ.Parser.SerializeDatasetToJson(dataset);
|
||||
var evalResult = await SZ.Evaluator.EvaluateDatasetAsync(dataset);
|
||||
if (!evalResult.IsSuccess) return SzResult<bool>.Failure($"Could not save dataset, evaluation failed: {evalResult.Error!}");
|
||||
var success = await SZ.LocalFileManager.SaveFileAsync(datasetPath, json, ct);
|
||||
return success ? SzResult<bool>.Success(true) : SzResult<bool>.Failure("Failed to write dataset file.");
|
||||
}
|
||||
@@ -246,4 +248,4 @@ public class SzDataHandler
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,4 +109,4 @@ public class SzEvaluator
|
||||
var errString = errors.ToString().Trim();
|
||||
return string.IsNullOrEmpty(errString) ? SzResult<bool>.Success(true) : SzResult<bool>.Failure(errString);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
6
SzGui/Program.cs
Normal file
6
SzGui/Program.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
// See https://aka.ms/new-console-template for more information
|
||||
|
||||
using SzGui;
|
||||
|
||||
var app = new SzApp();
|
||||
app.Init();
|
||||
46
SzGui/SzApp.cs
Normal file
46
SzGui/SzApp.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using System.Numerics;
|
||||
using ImGuiNET;
|
||||
using Raylib_cs;
|
||||
using rlImGui_cs;
|
||||
|
||||
namespace SzGui;
|
||||
|
||||
public class SzApp
|
||||
{
|
||||
public void Init()
|
||||
{
|
||||
Raylib.SetConfigFlags(ConfigFlags.Msaa4xHint | ConfigFlags.VSyncHint | ConfigFlags.ResizableWindow);
|
||||
Raylib.InitWindow(1280, 800, "SessionZero");
|
||||
|
||||
rlImGui.Setup(true, true);
|
||||
ImGui.GetIO().ConfigWindowsMoveFromTitleBarOnly = true;
|
||||
|
||||
while (!Raylib.WindowShouldClose())
|
||||
{
|
||||
Raylib.BeginDrawing();
|
||||
Raylib.ClearBackground(new Color(0, 20, 50));
|
||||
rlImGui.Begin();
|
||||
|
||||
ImGui.DockSpaceOverViewport(0);
|
||||
|
||||
// ImGui.ShowDemoWindow();
|
||||
ImGui.ShowStyleEditor();
|
||||
DrawImGui();
|
||||
|
||||
rlImGui.End();
|
||||
Raylib.EndDrawing();
|
||||
}
|
||||
|
||||
rlImGui.Shutdown();
|
||||
Raylib.CloseWindow();
|
||||
}
|
||||
|
||||
private void DrawImGui()
|
||||
{
|
||||
if(ImGui.Begin("SessionZero"))
|
||||
{
|
||||
ImGui.TextUnformatted("Test: " + IconFonts.FontAwesome6.House);
|
||||
}
|
||||
ImGui.End();
|
||||
}
|
||||
}
|
||||
20
SzGui/SzGui.csproj
Normal file
20
SzGui/SzGui.csproj
Normal file
@@ -0,0 +1,20 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ImGui.NET" Version="1.91.6.1" />
|
||||
<PackageReference Include="Raylib-cs" Version="7.0.2" />
|
||||
<PackageReference Include="rlImgui-cs" Version="3.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SzCore\SzCore.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
79
SzGui/imgui.ini
Normal file
79
SzGui/imgui.ini
Normal file
@@ -0,0 +1,79 @@
|
||||
[Window][Debug##Default]
|
||||
Pos=1006,402
|
||||
Size=762,814
|
||||
Collapsed=0
|
||||
|
||||
[Window][SessionZero]
|
||||
Pos=0,0
|
||||
Size=3792,2067
|
||||
Collapsed=0
|
||||
DockId=0x08BD597D,0
|
||||
|
||||
[Window][Dear ImGui Demo]
|
||||
Size=1894,2067
|
||||
Collapsed=0
|
||||
DockId=0x08BD597D,0
|
||||
|
||||
[Window][Dear ImGui Style Editor]
|
||||
Pos=96,60
|
||||
Size=692,1365
|
||||
Collapsed=0
|
||||
|
||||
[Window][Example: Assets Browser]
|
||||
Pos=60,60
|
||||
Size=800,480
|
||||
Collapsed=0
|
||||
|
||||
[Window][Dear ImGui Debug Log]
|
||||
Pos=60,60
|
||||
Size=343,428
|
||||
Collapsed=0
|
||||
|
||||
[Window][About Dear ImGui]
|
||||
Pos=1113,633
|
||||
Size=568,155
|
||||
Collapsed=0
|
||||
|
||||
[Window][Example: Auto-resizing window]
|
||||
Pos=1131,778
|
||||
Size=652,464
|
||||
Collapsed=0
|
||||
|
||||
[Window][DockSpace Demo]
|
||||
Pos=0,19
|
||||
Size=3840,2141
|
||||
Collapsed=0
|
||||
|
||||
[Window][Example: Console]
|
||||
Pos=798,38
|
||||
Size=2086,2122
|
||||
Collapsed=0
|
||||
DockId=0xC0DFADC4,0
|
||||
|
||||
[Window][Example: Property editor]
|
||||
Pos=60,60
|
||||
Size=430,450
|
||||
Collapsed=0
|
||||
|
||||
[Window][Example: Property editor/##tree_37EC733C]
|
||||
IsChild=1
|
||||
Size=300,409
|
||||
|
||||
[Window][WindowOverViewport_11111111]
|
||||
Pos=0,0
|
||||
Size=3792,2067
|
||||
Collapsed=0
|
||||
|
||||
[Table][0xB6880529,2]
|
||||
RefScale=13
|
||||
Column 0 Sort=0v
|
||||
|
||||
[Table][0x2048C668,2]
|
||||
RefScale=13
|
||||
Column 0 Width=4
|
||||
Column 1 Weight=2.0000
|
||||
|
||||
[Docking][Data]
|
||||
DockSpace ID=0x08BD597D Window=0x1BBC0F80 Pos=0,0 Size=3792,2067 CentralNode=1 Selected=0x3C0097EB
|
||||
DockSpace ID=0xC0DFADC4 Pos=0,38 Size=3840,2122 CentralNode=1
|
||||
|
||||
20
flake.nix
20
flake.nix
@@ -8,7 +8,6 @@
|
||||
outputs = { self, nixpkgs }:
|
||||
let
|
||||
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
||||
|
||||
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
});
|
||||
@@ -19,10 +18,29 @@
|
||||
nativeBuildInputs = with pkgs; [
|
||||
dotnet-sdk
|
||||
omnisharp-roslyn
|
||||
pkg-config
|
||||
];
|
||||
|
||||
buildInputs = with pkgs; [
|
||||
libGL
|
||||
# X11 dependencies for Raylib
|
||||
xorg.libX11
|
||||
xorg.libXcursor
|
||||
xorg.libXi
|
||||
xorg.libXinerama
|
||||
xorg.libXrandr
|
||||
];
|
||||
|
||||
shellHook = ''
|
||||
echo "// SESSION ZERO DEV SHELL //"
|
||||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${with pkgs; lib.makeLibraryPath [
|
||||
libGL
|
||||
xorg.libX11
|
||||
xorg.libXcursor
|
||||
xorg.libXi
|
||||
xorg.libXinerama
|
||||
xorg.libXrandr
|
||||
]}"
|
||||
'';
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user