diff --git a/CringeLauncher/CringeLauncher.csproj b/CringeLauncher/CringeLauncher.csproj index be91a2b..a6f6044 100644 --- a/CringeLauncher/CringeLauncher.csproj +++ b/CringeLauncher/CringeLauncher.csproj @@ -53,6 +53,10 @@ + + + PreserveNewest + diff --git a/CringeLauncher/Launcher.cs b/CringeLauncher/Launcher.cs index 465be3b..b5a3465 100644 --- a/CringeLauncher/Launcher.cs +++ b/CringeLauncher/Launcher.cs @@ -96,9 +96,9 @@ public class Launcher : ICorePlugin MyFileSystem.ExePath = Path.GetDirectoryName(args.ElementAtOrDefault(0) ?? Assembly.GetExecutingAssembly().Location)!; MyFileSystem.RootPath = new DirectoryInfo(MyFileSystem.ExePath).Parent!.FullName; - var splash = new Splash(); - var serviceProvider = SetupServices(); + + var splash = new Splash(); splash.DefineStage(_lifetime = serviceProvider.GetRequiredService()); diff --git a/CringeLauncher/splash.png b/CringeLauncher/splash.png new file mode 100644 index 0000000..767ad2b Binary files /dev/null and b/CringeLauncher/splash.png differ diff --git a/CringePlugins/Loader/PluginsLifetime.cs b/CringePlugins/Loader/PluginsLifetime.cs index b910b9c..ccd1565 100644 --- a/CringePlugins/Loader/PluginsLifetime.cs +++ b/CringePlugins/Loader/PluginsLifetime.cs @@ -37,6 +37,10 @@ internal class PluginsLifetime(ConfigHandler configHandler, HttpClient client) : progress.Report("Discovering local plugins"); +#if DEBUG + await Task.Delay(10000); +#endif + DiscoverLocalPlugins(_dir.CreateSubdirectory("plugins")); progress.Report("Loading config"); diff --git a/CringePlugins/Splash/Splash.cs b/CringePlugins/Splash/Splash.cs index 6f70c3a..126ef4a 100644 --- a/CringePlugins/Splash/Splash.cs +++ b/CringePlugins/Splash/Splash.cs @@ -1,6 +1,8 @@ using System.Numerics; using CringePlugins.Abstractions; +using CringePlugins.Services; using ImGuiNET; +using Microsoft.Extensions.DependencyInjection; using NLog; using static ImGuiNET.ImGui; @@ -15,7 +17,11 @@ public class Splash : ISplashProgress, IRenderComponent private ProgressInfo? _lastInfo; private bool _done; + private readonly string _splashPath = Path.Join(AppContext.BaseDirectory, "splash.png"); + private readonly IImGuiImageService _imageService = + GameServicesExtension.GameServices.GetRequiredService(); + public void Report(ProgressInfo value) { _lastInfo = value; @@ -60,9 +66,13 @@ public class Splash : ISplashProgress, IRenderComponent if (_done) return; SetNextWindowPos(GetMainViewport().GetCenter(), ImGuiCond.Always, new(.5f, .5f)); - SetNextWindowSize(new(400, GetFrameHeightWithSpacing()), ImGuiCond.Always); + const int imageSize = 512; + SetNextWindowSize(new(512, GetFrameHeightWithSpacing() * 2 + imageSize), ImGuiCond.Always); Begin("Splash", ImGuiWindowFlags.NoDecoration | ImGuiWindowFlags.NoInputs); + var image = _imageService.GetFromPath(_splashPath); + Image(image, new(imageSize)); + var sizeArg = new Vector2(GetWindowWidth() - GetStyle().WindowPadding.X * 2, 0); if (_lastInfo is null) {