set imgui config path to appdata
All checks were successful
Build / Compute Version (push) Successful in 5s
Build / Build Nuget package (CringeBootstrap.Abstractions) (push) Successful in 1m41s
Build / Build Nuget package (NuGet) (push) Successful in 2m12s
Build / Build Nuget package (CringePlugins) (push) Successful in 2m39s
Build / Build Nuget package (SharedCringe) (push) Successful in 2m2s
Build / Build Launcher (push) Successful in 2m55s

This commit is contained in:
zznty
2024-11-03 03:16:52 +07:00
parent b8af0ed2a7
commit 6840ee4950

View File

@@ -1,5 +1,6 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Runtime.InteropServices.Marshalling;
using System.Runtime.Versioning; using System.Runtime.Versioning;
using Windows.Win32; using Windows.Win32;
using Windows.Win32.Foundation; using Windows.Win32.Foundation;
@@ -22,14 +23,18 @@ internal class ImGuiHandler : IDisposable
public static RenderTargetView? Rtv; public static RenderTargetView? Rtv;
private readonly IRootRenderComponent _renderHandler = new RenderHandler(); private readonly IRootRenderComponent _renderHandler = new RenderHandler();
public void Init(nint windowHandle, Device1 device, DeviceContext deviceContext) public unsafe void Init(nint windowHandle, Device1 device, DeviceContext deviceContext)
{ {
_deviceContext = deviceContext; _deviceContext = deviceContext;
CreateContext(); CreateContext();
var io = GetIO(); var io = GetIO();
var path = Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "CringeLauncher", "imgui.ini");
io.NativePtr->IniFilename = AnsiStringMarshaller.ConvertToUnmanaged(path);
io.ConfigWindowsMoveFromTitleBarOnly = true; io.ConfigWindowsMoveFromTitleBarOnly = true;
io.ConfigFlags |= ImGuiConfigFlags.DockingEnable | ImGuiConfigFlags.ViewportsEnable; io.ConfigFlags |= ImGuiConfigFlags.DockingEnable | ImGuiConfigFlags.ViewportsEnable;