From a819c729131197c12b1dc57c132d5d394b8b0842 Mon Sep 17 00:00:00 2001 From: goaaats <16760685+goaaats@users.noreply.github.com> Date: Wed, 20 Oct 2021 22:39:13 +0200 Subject: [PATCH] feat: show error message if tier 3 load never happened --- Dalamud/Game/Framework.cs | 16 ++++++++++++++++ Dalamud/Interface/Style/StyleModel.cs | 3 +++ 2 files changed, 19 insertions(+) diff --git a/Dalamud/Game/Framework.cs b/Dalamud/Game/Framework.cs index 66c4a462a..8f8ede47e 100644 --- a/Dalamud/Game/Framework.cs +++ b/Dalamud/Game/Framework.cs @@ -13,6 +13,7 @@ using Dalamud.Hooking; using Dalamud.Interface.Internal; using Dalamud.IoC; using Dalamud.IoC.Internal; +using Dalamud.Utility; using Serilog; namespace Dalamud.Game @@ -27,6 +28,8 @@ namespace Dalamud.Game private static Stopwatch statsStopwatch = new(); private Stopwatch updateStopwatch = new(); + private DateTime timeSinceTier2; + private Hook updateHook; private Hook destroyHook; private Hook realDestroyHook; @@ -174,11 +177,23 @@ namespace Dalamud.Game // If this is the first time we are running this loop, we need to init Dalamud subsystems synchronously if (!dalamud.IsReady) + { dalamud.LoadTier2(); + this.timeSinceTier2 = DateTime.Now; + goto original; + } + + if (!dalamud.IsLoadedPluginSystem && (DateTime.Now - this.timeSinceTier2).TotalSeconds > 30) + { + Util.Fatal("The Dalamud plugin system could not initialize important subsystems.\nThis error may be caused by outdated ReShade or GShade installations.\n\nIf this error persists, please contact us.", "XIVLauncher Error"); + } // Plugins expect the interface to be available and ready, so we need to wait with plugins until we have init'd ImGui if (!dalamud.IsLoadedPluginSystem && Service.GetNullable()?.IsReady == true) + { dalamud.LoadTier3(); + goto original; + } try { @@ -254,6 +269,7 @@ namespace Dalamud.Game } } + original: return this.updateHook.Original(framework); } diff --git a/Dalamud/Interface/Style/StyleModel.cs b/Dalamud/Interface/Style/StyleModel.cs index b7082e05e..978ef78dc 100644 --- a/Dalamud/Interface/Style/StyleModel.cs +++ b/Dalamud/Interface/Style/StyleModel.cs @@ -6,6 +6,7 @@ using Dalamud.Configuration.Internal; using Dalamud.Interface.Colors; using Dalamud.Utility; using Newtonsoft.Json; +using Serilog; namespace Dalamud.Interface.Style { @@ -83,6 +84,8 @@ namespace Dalamud.Interface.Style configuration.SavedStyles = new List(); configuration.SavedStyles.AddRange(configuration.SavedStylesOld); + Log.Information("Transferred {0} styles", configuration.SavedStyles.Count); + configuration.SavedStylesOld = null; configuration.Save(); }