move imgui config to config/ directory
All checks were successful
Build / Compute Version (push) Successful in 6s
Build / Build Nuget package (NuGet) (push) Successful in 3m59s
Build / Build Nuget package (SharedCringe) (push) Successful in 3m57s
Build / Build Nuget package (CringeBootstrap.Abstractions) (push) Successful in 4m3s
Build / Build Launcher (push) Successful in 5m0s
Build / Build Nuget package (CringePlugins) (push) Successful in 8m13s
All checks were successful
Build / Compute Version (push) Successful in 6s
Build / Build Nuget package (NuGet) (push) Successful in 3m59s
Build / Build Nuget package (SharedCringe) (push) Successful in 3m57s
Build / Build Nuget package (CringeBootstrap.Abstractions) (push) Successful in 4m3s
Build / Build Launcher (push) Successful in 5m0s
Build / Build Nuget package (CringePlugins) (push) Successful in 8m13s
This commit is contained in:
@@ -17,6 +17,7 @@ namespace CringeLauncher;
|
|||||||
|
|
||||||
internal sealed class ImGuiHandler : IGuiHandler, IDisposable
|
internal sealed class ImGuiHandler : IGuiHandler, IDisposable
|
||||||
{
|
{
|
||||||
|
private readonly DirectoryInfo _configDir;
|
||||||
private DeviceContext? _deviceContext;
|
private DeviceContext? _deviceContext;
|
||||||
private int _blockKeysCounter;
|
private int _blockKeysCounter;
|
||||||
private static nint _wndproc;
|
private static nint _wndproc;
|
||||||
@@ -37,8 +38,9 @@ internal sealed class ImGuiHandler : IGuiHandler, IDisposable
|
|||||||
private readonly IRootRenderComponent _renderHandler;
|
private readonly IRootRenderComponent _renderHandler;
|
||||||
private static bool _init;
|
private static bool _init;
|
||||||
|
|
||||||
public ImGuiHandler()
|
public ImGuiHandler(DirectoryInfo configDir)
|
||||||
{
|
{
|
||||||
|
_configDir = configDir;
|
||||||
_renderHandler = new RenderHandler(this);
|
_renderHandler = new RenderHandler(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,9 +52,9 @@ internal sealed class ImGuiHandler : IGuiHandler, IDisposable
|
|||||||
|
|
||||||
var io = GetIO();
|
var io = GetIO();
|
||||||
|
|
||||||
var path = Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "CringeLauncher", "imgui.ini");
|
var path = Path.Join(_configDir.FullName, "imgui.ini");
|
||||||
|
|
||||||
io.NativePtr->IniFilename = AnsiStringMarshaller.ConvertToUnmanaged(path);
|
io.NativePtr->IniFilename = Utf8StringMarshaller.ConvertToUnmanaged(path);
|
||||||
|
|
||||||
io.ConfigWindowsMoveFromTitleBarOnly = true;
|
io.ConfigWindowsMoveFromTitleBarOnly = true;
|
||||||
io.ConfigFlags |= ImGuiConfigFlags.DockingEnable | ImGuiConfigFlags.ViewportsEnable;
|
io.ConfigFlags |= ImGuiConfigFlags.DockingEnable | ImGuiConfigFlags.ViewportsEnable;
|
||||||
|
@@ -50,6 +50,9 @@ public class Launcher : ICorePlugin
|
|||||||
|
|
||||||
private MyGameRenderComponent? _renderComponent;
|
private MyGameRenderComponent? _renderComponent;
|
||||||
|
|
||||||
|
private readonly DirectoryInfo _configDir = Directory.CreateDirectory(
|
||||||
|
Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "CringeLauncher", "config"));
|
||||||
|
|
||||||
public void Initialize(string[] args)
|
public void Initialize(string[] args)
|
||||||
{
|
{
|
||||||
if (Type.GetType("GameAnalyticsSDK.Net.Logging.GALogger, GameAnalytics.Mono") is { } gaLoggerType)
|
if (Type.GetType("GameAnalyticsSDK.Net.Logging.GALogger, GameAnalytics.Mono") is { } gaLoggerType)
|
||||||
@@ -154,7 +157,7 @@ public class Launcher : ICorePlugin
|
|||||||
public void Run() => _game?.Run();
|
public void Run() => _game?.Run();
|
||||||
|
|
||||||
|
|
||||||
private static IServiceProvider SetupServices()
|
private IServiceProvider SetupServices()
|
||||||
{
|
{
|
||||||
var services = new ServiceCollection();
|
var services = new ServiceCollection();
|
||||||
|
|
||||||
@@ -167,7 +170,7 @@ public class Launcher : ICorePlugin
|
|||||||
|
|
||||||
services.AddSingleton(_ => RenderHandler.Current)
|
services.AddSingleton(_ => RenderHandler.Current)
|
||||||
.AddSingleton<IPluginsLifetime>(s => s.GetRequiredService<PluginsLifetime>())
|
.AddSingleton<IPluginsLifetime>(s => s.GetRequiredService<PluginsLifetime>())
|
||||||
.AddSingleton(_ => new ConfigHandler(Directory.CreateDirectory(Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "CringeLauncher", "config"))));
|
.AddSingleton(_ => new ConfigHandler(_configDir));
|
||||||
|
|
||||||
return GameServicesExtension.GameServices = services.BuildServiceProvider();
|
return GameServicesExtension.GameServices = services.BuildServiceProvider();
|
||||||
}
|
}
|
||||||
@@ -192,7 +195,7 @@ public class Launcher : ICorePlugin
|
|||||||
|
|
||||||
private IVRageWindow InitEarlyWindow(Splash splash)
|
private IVRageWindow InitEarlyWindow(Splash splash)
|
||||||
{
|
{
|
||||||
ImGuiHandler.Instance = new();
|
ImGuiHandler.Instance = new(_configDir);
|
||||||
|
|
||||||
RenderHandler.Current.RegisterComponent(splash);
|
RenderHandler.Current.RegisterComponent(splash);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user