From bf72ad589d2186e30747cfd69e3e59fffacc15e2 Mon Sep 17 00:00:00 2001 From: goaaats Date: Thu, 23 Jun 2022 23:49:44 +0200 Subject: [PATCH 1/4] chore: remove error messagebox in Dalamud.Injector, the program that runs it should show an error instead --- Dalamud.Injector/EntryPoint.cs | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/Dalamud.Injector/EntryPoint.cs b/Dalamud.Injector/EntryPoint.cs index 8be568063..f0e42aade 100644 --- a/Dalamud.Injector/EntryPoint.cs +++ b/Dalamud.Injector/EntryPoint.cs @@ -143,7 +143,6 @@ namespace Dalamud.Injector Console.WriteLine("Command line error: {0}", clex.Message); Console.WriteLine(); ProcessHelpCommand(args); - Environment.Exit(-1); } else if (Log.Logger == null) { @@ -151,27 +150,13 @@ namespace Dalamud.Injector } else if (exObj is Exception ex) { - Log.Error(ex, "A fatal error has occurred."); + Log.Error(ex, "A fatal error has occurred"); } else { - Log.Error($"A fatal error has occurred: {eventArgs.ExceptionObject}"); + Log.Error("A fatal error has occurred: {Exception}", eventArgs.ExceptionObject.ToString()); } -#if DEBUG - var caption = "Debug Error"; - var message = - $"Couldn't inject.\nMake sure that Dalamud was not injected into your target process " + - $"as a release build before and that the target process can be accessed with VM_WRITE permissions.\n\n" + - $"{eventArgs.ExceptionObject}"; -#else - var caption = "XIVLauncher Error"; - var message = - "Failed to inject the XIVLauncher in-game addon.\nPlease try restarting your game and your PC.\n" + - "If this keeps happening, please report this error."; -#endif - _ = MessageBoxW(IntPtr.Zero, message, caption, MessageBoxType.IconError | MessageBoxType.Ok); - Environment.Exit(-1); }; } From b7cbaacac60fd9789a04ba34555aaad6133e7d0a Mon Sep 17 00:00:00 2001 From: goaaats Date: Fri, 24 Jun 2022 14:11:55 +0200 Subject: [PATCH 2/4] fix: close gamepad overlay when setting is disabled --- Dalamud/Game/Gui/Internal/DalamudIME.cs | 4 ++-- Dalamud/Interface/Internal/DalamudCommands.cs | 2 +- Dalamud/Interface/Internal/DalamudInterface.cs | 11 ++++++++--- Dalamud/Interface/Internal/Windows/IMEWindow.cs | 4 ++-- Dalamud/Interface/Internal/Windows/SettingsWindow.cs | 3 +++ 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Dalamud/Game/Gui/Internal/DalamudIME.cs b/Dalamud/Game/Gui/Internal/DalamudIME.cs index e955997fd..419b01de9 100644 --- a/Dalamud/Game/Gui/Internal/DalamudIME.cs +++ b/Dalamud/Game/Gui/Internal/DalamudIME.cs @@ -128,9 +128,9 @@ namespace Dalamud.Game.Gui.Internal private void ToggleWindow(bool visible) { if (visible) - Service.Get().OpenIMEWindow(); + Service.Get().OpenImeWindow(); else - Service.Get().CloseIMEWindow(); + Service.Get().CloseImeWindow(); } private long WndProcDetour(IntPtr hWnd, uint msg, ulong wParam, long lParam) diff --git a/Dalamud/Interface/Internal/DalamudCommands.cs b/Dalamud/Interface/Internal/DalamudCommands.cs index 56ec778d8..e81d9f5a4 100644 --- a/Dalamud/Interface/Internal/DalamudCommands.cs +++ b/Dalamud/Interface/Internal/DalamudCommands.cs @@ -289,7 +289,7 @@ namespace Dalamud.Interface.Internal private void OnDebugDrawIMEPanel(string command, string arguments) { - Service.Get().OpenIMEWindow(); + Service.Get().OpenImeWindow(); } private void OnOpenLog(string command, string arguments) diff --git a/Dalamud/Interface/Internal/DalamudInterface.cs b/Dalamud/Interface/Internal/DalamudInterface.cs index a25279e26..cd314a756 100644 --- a/Dalamud/Interface/Internal/DalamudInterface.cs +++ b/Dalamud/Interface/Internal/DalamudInterface.cs @@ -232,7 +232,7 @@ namespace Dalamud.Interface.Internal /// /// Opens the . /// - public void OpenIMEWindow() => this.imeWindow.IsOpen = true; + public void OpenImeWindow() => this.imeWindow.IsOpen = true; /// /// Opens the . @@ -263,7 +263,7 @@ namespace Dalamud.Interface.Internal /// Opens the . /// public void OpenStyleEditor() => this.styleEditorWindow.IsOpen = true; - + /// /// Opens the . /// @@ -276,7 +276,12 @@ namespace Dalamud.Interface.Internal /// /// Closes the . /// - public void CloseIMEWindow() => this.imeWindow.IsOpen = false; + public void CloseImeWindow() => this.imeWindow.IsOpen = false; + + /// + /// Closes the . + /// + public void CloseGamepadModeNotifierWindow() => this.gamepadModeNotifierWindow.IsOpen = false; #endregion diff --git a/Dalamud/Interface/Internal/Windows/IMEWindow.cs b/Dalamud/Interface/Internal/Windows/IMEWindow.cs index f07c56202..328f09c45 100644 --- a/Dalamud/Interface/Internal/Windows/IMEWindow.cs +++ b/Dalamud/Interface/Internal/Windows/IMEWindow.cs @@ -29,7 +29,7 @@ namespace Dalamud.Interface.Internal.Windows /// public override void Draw() { - if (this.IsOpen && Service.Get()[VirtualKey.SHIFT]) Service.Get().CloseIMEWindow(); + if (this.IsOpen && Service.Get()[VirtualKey.SHIFT]) Service.Get().CloseImeWindow(); var ime = Service.GetNullable(); if (ime == null || !ime.IsEnabled) @@ -42,7 +42,7 @@ namespace Dalamud.Interface.Internal.Windows /// public override void PostDraw() { - if (this.IsOpen && Service.Get()[VirtualKey.SHIFT]) Service.Get().CloseIMEWindow(); + if (this.IsOpen && Service.Get()[VirtualKey.SHIFT]) Service.Get().CloseImeWindow(); var ime = Service.GetNullable(); if (ime == null || !ime.IsEnabled) diff --git a/Dalamud/Interface/Internal/Windows/SettingsWindow.cs b/Dalamud/Interface/Internal/Windows/SettingsWindow.cs index 729390aa0..2dd5b2c57 100644 --- a/Dalamud/Interface/Internal/Windows/SettingsWindow.cs +++ b/Dalamud/Interface/Internal/Windows/SettingsWindow.cs @@ -952,6 +952,9 @@ namespace Dalamud.Interface.Internal.Windows { ImGui.GetIO().BackendFlags &= ~ImGuiBackendFlags.HasGamepad; ImGui.GetIO().ConfigFlags &= ~ImGuiConfigFlags.NavEnableSetMousePos; + + var di = Service.Get(); + di.CloseGamepadModeNotifierWindow(); } else { From 7f5507dae97dd0200eb36723d1bc3de4e4b19630 Mon Sep 17 00:00:00 2001 From: goaaats Date: Fri, 24 Jun 2022 14:16:20 +0200 Subject: [PATCH 3/4] deps: update Lumina to 3.7.0 --- Dalamud.CorePlugin/Dalamud.CorePlugin.csproj | 2 +- Dalamud/Dalamud.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dalamud.CorePlugin/Dalamud.CorePlugin.csproj b/Dalamud.CorePlugin/Dalamud.CorePlugin.csproj index ce3d3cf08..e64cea61e 100644 --- a/Dalamud.CorePlugin/Dalamud.CorePlugin.csproj +++ b/Dalamud.CorePlugin/Dalamud.CorePlugin.csproj @@ -27,7 +27,7 @@ - + diff --git a/Dalamud/Dalamud.csproj b/Dalamud/Dalamud.csproj index a838813eb..8344f95bb 100644 --- a/Dalamud/Dalamud.csproj +++ b/Dalamud/Dalamud.csproj @@ -65,7 +65,7 @@ - + From fba8c7163c06a94d4a7abcac58420236272aab35 Mon Sep 17 00:00:00 2001 From: goaaats Date: Fri, 24 Jun 2022 14:16:35 +0200 Subject: [PATCH 4/4] feat: set Lumina LoadMultithreaded --- Dalamud/Data/DataManager.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Dalamud/Data/DataManager.cs b/Dalamud/Data/DataManager.cs index 2e679ab23..8daa7cdf5 100644 --- a/Dalamud/Data/DataManager.cs +++ b/Dalamud/Data/DataManager.cs @@ -303,6 +303,7 @@ namespace Dalamud.Data { var luminaOptions = new LuminaOptions { + LoadMultithreaded = true, CacheFileResources = true, #if DEBUG PanicOnSheetChecksumMismatch = true,