image loader for imgui and optional nuget icons for plugins in browse tab
All checks were successful
Build / Compute Version (push) Successful in 6s
Build / Build Nuget package (CringeBootstrap.Abstractions) (push) Successful in 4m13s
Build / Build Nuget package (NuGet) (push) Successful in 4m12s
Build / Build Nuget package (CringePlugins) (push) Successful in 4m16s
Build / Build Nuget package (SharedCringe) (push) Successful in 4m11s
Build / Build Launcher (push) Successful in 5m13s
All checks were successful
Build / Compute Version (push) Successful in 6s
Build / Build Nuget package (CringeBootstrap.Abstractions) (push) Successful in 4m13s
Build / Build Nuget package (NuGet) (push) Successful in 4m12s
Build / Build Nuget package (CringePlugins) (push) Successful in 4m16s
Build / Build Nuget package (SharedCringe) (push) Successful in 4m11s
Build / Build Launcher (push) Successful in 5m13s
This commit is contained in:
@@ -7,7 +7,9 @@ using Windows.Win32.Foundation;
|
||||
using Windows.Win32.UI.WindowsAndMessaging;
|
||||
using CringePlugins.Abstractions;
|
||||
using CringePlugins.Render;
|
||||
using CringePlugins.Services;
|
||||
using ImGuiNET;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using SharpDX.Direct3D11;
|
||||
using static ImGuiNET.ImGui;
|
||||
using VRage;
|
||||
@@ -36,12 +38,14 @@ internal sealed class ImGuiHandler : IGuiHandler, IDisposable
|
||||
public static RenderTargetView? Rtv;
|
||||
|
||||
private readonly IRootRenderComponent _renderHandler;
|
||||
private readonly ImGuiImageService _imageService;
|
||||
private static bool _init;
|
||||
|
||||
public ImGuiHandler(DirectoryInfo configDir)
|
||||
{
|
||||
_configDir = configDir;
|
||||
_renderHandler = new RenderHandler(this);
|
||||
_imageService = (ImGuiImageService)GameServicesExtension.GameServices.GetRequiredService<IImGuiImageService>();
|
||||
}
|
||||
|
||||
public unsafe void Init(nint windowHandle, Device1 device, DeviceContext deviceContext)
|
||||
@@ -62,6 +66,8 @@ internal sealed class ImGuiHandler : IGuiHandler, IDisposable
|
||||
ImGui_ImplWin32_Init(windowHandle);
|
||||
ImGui_ImplDX11_Init(device.NativePointer, deviceContext.NativePointer);
|
||||
_init = true;
|
||||
|
||||
_imageService.Initialize();
|
||||
}
|
||||
|
||||
public static void HookWindow(HWND windowHandle)
|
||||
@@ -117,6 +123,8 @@ internal sealed class ImGuiHandler : IGuiHandler, IDisposable
|
||||
|
||||
UpdatePlatformWindows();
|
||||
RenderPlatformWindowsDefault();
|
||||
|
||||
_imageService.Update();
|
||||
}
|
||||
|
||||
[UnmanagedCallersOnly(CallConvs = [typeof(CallConvStdcall)])]
|
||||
|
@@ -1,4 +1,5 @@
|
||||
using System.Reflection;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Loader;
|
||||
@@ -161,15 +162,26 @@ public class Launcher : ICorePlugin
|
||||
{
|
||||
var services = new ServiceCollection();
|
||||
|
||||
var retryPolicy = HttpPolicyExtensions.HandleTransientHttpError()
|
||||
.WaitAndRetryAsync(5, _ => TimeSpan.FromSeconds(1));
|
||||
|
||||
services.AddHttpClient<PluginsLifetime>()
|
||||
.ConfigurePrimaryHttpMessageHandler(() => new HttpClientHandler
|
||||
{
|
||||
AutomaticDecompression = System.Net.DecompressionMethods.All
|
||||
AutomaticDecompression = DecompressionMethods.All
|
||||
})
|
||||
.AddPolicyHandler(HttpPolicyExtensions.HandleTransientHttpError().WaitAndRetryAsync(5, _ => TimeSpan.FromSeconds(1)));
|
||||
.AddPolicyHandler(retryPolicy);
|
||||
|
||||
services.AddHttpClient<ImGuiImageService>()
|
||||
.ConfigurePrimaryHttpMessageHandler(() => new HttpClientHandler
|
||||
{
|
||||
AutomaticDecompression = DecompressionMethods.All
|
||||
})
|
||||
.AddPolicyHandler(retryPolicy);
|
||||
|
||||
services.AddSingleton(_ => RenderHandler.Current)
|
||||
.AddSingleton<IPluginsLifetime>(s => s.GetRequiredService<PluginsLifetime>())
|
||||
.AddSingleton<IImGuiImageService>(s => s.GetRequiredService<ImGuiImageService>())
|
||||
.AddSingleton(_ => new ConfigHandler(_configDir));
|
||||
|
||||
return GameServicesExtension.GameServices = services.BuildServiceProvider();
|
||||
|
@@ -455,6 +455,7 @@
|
||||
"ImGui.NET.DirectX": "[1.91.0.1, )",
|
||||
"JsonSchema.Net.Generation": "[5.0.2, )",
|
||||
"Lib.Harmony.Thin": "[2.3.4-torch, )",
|
||||
"Microsoft.Extensions.DependencyInjection.Abstractions": "[9.0.5, )",
|
||||
"NLog": "[5.4.0, )",
|
||||
"NuGet": "[1.0.0, )",
|
||||
"SharedCringe": "[1.0.0, )",
|
||||
|
Reference in New Issue
Block a user