mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-03 14:23:40 +01:00
feat: make exception popup a yesno, exit process after choosing
This commit is contained in:
parent
35aadbe575
commit
8d269926c2
1 changed files with 14 additions and 3 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
|
|
@ -11,6 +12,7 @@ using Dalamud.Logging.Internal;
|
|||
using Dalamud.Utility;
|
||||
using HarmonyLib;
|
||||
using Newtonsoft.Json;
|
||||
using PInvoke;
|
||||
using Serilog;
|
||||
using Serilog.Core;
|
||||
using Serilog.Events;
|
||||
|
|
@ -202,11 +204,20 @@ namespace Dalamud
|
|||
$"{ex.TargetSite.DeclaringType.Assembly.GetName().Name}, {ex.TargetSite.DeclaringType.FullName}::{ex.TargetSite.Name}";
|
||||
}
|
||||
|
||||
Util.Fatal(
|
||||
const MessageBoxType flags = NativeFunctions.MessageBoxType.YesNo | NativeFunctions.MessageBoxType.IconError | NativeFunctions.MessageBoxType.SystemModal;
|
||||
var result = MessageBoxW(
|
||||
Process.GetCurrentProcess().MainWindowHandle,
|
||||
$"An internal error in a Dalamud plugin occurred.\nThe game must close.\n\nType: {ex.GetType().Name}\n{info}\n\nMore information has been recorded separately, please contact us in our Discord or on GitHub.\n\nDo you want to disable all plugins the next time you start the game?",
|
||||
"Dalamud");
|
||||
"Dalamud",
|
||||
flags);
|
||||
|
||||
// TODO Plugin disabling
|
||||
if (result == (int)User32.MessageBoxResult.IDYES)
|
||||
{
|
||||
Log.Information("User chose to disable plugins on next launch...");
|
||||
// TODO When services are in
|
||||
}
|
||||
|
||||
Environment.Exit(-1);
|
||||
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue