Merge branch 'net5'

This commit is contained in:
goaaats 2022-06-24 14:17:17 +02:00
commit 369ecad03f
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B
9 changed files with 21 additions and 27 deletions

View file

@ -27,7 +27,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Lumina" Version="3.6.0" /> <PackageReference Include="Lumina" Version="3.7.0" />
<PackageReference Include="Lumina.Excel" Version="6.1.1" /> <PackageReference Include="Lumina.Excel" Version="6.1.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.333"> <PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.333">

View file

@ -143,7 +143,6 @@ namespace Dalamud.Injector
Console.WriteLine("Command line error: {0}", clex.Message); Console.WriteLine("Command line error: {0}", clex.Message);
Console.WriteLine(); Console.WriteLine();
ProcessHelpCommand(args); ProcessHelpCommand(args);
Environment.Exit(-1);
} }
else if (Log.Logger == null) else if (Log.Logger == null)
{ {
@ -151,27 +150,13 @@ namespace Dalamud.Injector
} }
else if (exObj is Exception ex) else if (exObj is Exception ex)
{ {
Log.Error(ex, "A fatal error has occurred."); Log.Error(ex, "A fatal error has occurred");
} }
else 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); Environment.Exit(-1);
}; };
} }

View file

@ -65,7 +65,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="CheapLoc" Version="1.1.6" /> <PackageReference Include="CheapLoc" Version="1.1.6" />
<PackageReference Include="JetBrains.Annotations" Version="2021.2.0" /> <PackageReference Include="JetBrains.Annotations" Version="2021.2.0" />
<PackageReference Include="Lumina" Version="3.6.0" /> <PackageReference Include="Lumina" Version="3.7.0" />
<PackageReference Include="Lumina.Excel" Version="6.1.1" /> <PackageReference Include="Lumina.Excel" Version="6.1.1" />
<PackageReference Include="MinSharp" Version="1.0.4" /> <PackageReference Include="MinSharp" Version="1.0.4" />
<PackageReference Include="MonoMod.RuntimeDetour" Version="21.10.10.01" /> <PackageReference Include="MonoMod.RuntimeDetour" Version="21.10.10.01" />

View file

@ -303,6 +303,7 @@ namespace Dalamud.Data
{ {
var luminaOptions = new LuminaOptions var luminaOptions = new LuminaOptions
{ {
LoadMultithreaded = true,
CacheFileResources = true, CacheFileResources = true,
#if DEBUG #if DEBUG
PanicOnSheetChecksumMismatch = true, PanicOnSheetChecksumMismatch = true,

View file

@ -128,9 +128,9 @@ namespace Dalamud.Game.Gui.Internal
private void ToggleWindow(bool visible) private void ToggleWindow(bool visible)
{ {
if (visible) if (visible)
Service<DalamudInterface>.Get().OpenIMEWindow(); Service<DalamudInterface>.Get().OpenImeWindow();
else else
Service<DalamudInterface>.Get().CloseIMEWindow(); Service<DalamudInterface>.Get().CloseImeWindow();
} }
private long WndProcDetour(IntPtr hWnd, uint msg, ulong wParam, long lParam) private long WndProcDetour(IntPtr hWnd, uint msg, ulong wParam, long lParam)

View file

@ -289,7 +289,7 @@ namespace Dalamud.Interface.Internal
private void OnDebugDrawIMEPanel(string command, string arguments) private void OnDebugDrawIMEPanel(string command, string arguments)
{ {
Service<DalamudInterface>.Get().OpenIMEWindow(); Service<DalamudInterface>.Get().OpenImeWindow();
} }
private void OnOpenLog(string command, string arguments) private void OnOpenLog(string command, string arguments)

View file

@ -232,7 +232,7 @@ namespace Dalamud.Interface.Internal
/// <summary> /// <summary>
/// Opens the <see cref="IMEWindow"/>. /// Opens the <see cref="IMEWindow"/>.
/// </summary> /// </summary>
public void OpenIMEWindow() => this.imeWindow.IsOpen = true; public void OpenImeWindow() => this.imeWindow.IsOpen = true;
/// <summary> /// <summary>
/// Opens the <see cref="ConsoleWindow"/>. /// Opens the <see cref="ConsoleWindow"/>.
@ -276,7 +276,12 @@ namespace Dalamud.Interface.Internal
/// <summary> /// <summary>
/// Closes the <see cref="IMEWindow"/>. /// Closes the <see cref="IMEWindow"/>.
/// </summary> /// </summary>
public void CloseIMEWindow() => this.imeWindow.IsOpen = false; public void CloseImeWindow() => this.imeWindow.IsOpen = false;
/// <summary>
/// Closes the <see cref="GamepadModeNotifierWindow"/>.
/// </summary>
public void CloseGamepadModeNotifierWindow() => this.gamepadModeNotifierWindow.IsOpen = false;
#endregion #endregion

View file

@ -29,7 +29,7 @@ namespace Dalamud.Interface.Internal.Windows
/// <inheritdoc/> /// <inheritdoc/>
public override void Draw() public override void Draw()
{ {
if (this.IsOpen && Service<KeyState>.Get()[VirtualKey.SHIFT]) Service<DalamudInterface>.Get().CloseIMEWindow(); if (this.IsOpen && Service<KeyState>.Get()[VirtualKey.SHIFT]) Service<DalamudInterface>.Get().CloseImeWindow();
var ime = Service<DalamudIME>.GetNullable(); var ime = Service<DalamudIME>.GetNullable();
if (ime == null || !ime.IsEnabled) if (ime == null || !ime.IsEnabled)
@ -42,7 +42,7 @@ namespace Dalamud.Interface.Internal.Windows
/// <inheritdoc/> /// <inheritdoc/>
public override void PostDraw() public override void PostDraw()
{ {
if (this.IsOpen && Service<KeyState>.Get()[VirtualKey.SHIFT]) Service<DalamudInterface>.Get().CloseIMEWindow(); if (this.IsOpen && Service<KeyState>.Get()[VirtualKey.SHIFT]) Service<DalamudInterface>.Get().CloseImeWindow();
var ime = Service<DalamudIME>.GetNullable(); var ime = Service<DalamudIME>.GetNullable();
if (ime == null || !ime.IsEnabled) if (ime == null || !ime.IsEnabled)

View file

@ -952,6 +952,9 @@ namespace Dalamud.Interface.Internal.Windows
{ {
ImGui.GetIO().BackendFlags &= ~ImGuiBackendFlags.HasGamepad; ImGui.GetIO().BackendFlags &= ~ImGuiBackendFlags.HasGamepad;
ImGui.GetIO().ConfigFlags &= ~ImGuiConfigFlags.NavEnableSetMousePos; ImGui.GetIO().ConfigFlags &= ~ImGuiConfigFlags.NavEnableSetMousePos;
var di = Service<DalamudInterface>.Get();
di.CloseGamepadModeNotifierWindow();
} }
else else
{ {