mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-13 12:14:17 +01:00
Make setting for crash handler.
This commit is contained in:
parent
a31bdb66c8
commit
b04cb343dd
3 changed files with 59 additions and 42 deletions
|
|
@ -33,7 +33,7 @@ public class Configuration : IPluginConfiguration, ISavable
|
||||||
public string ModDirectory { get; set; } = string.Empty;
|
public string ModDirectory { get; set; } = string.Empty;
|
||||||
public string ExportDirectory { get; set; } = string.Empty;
|
public string ExportDirectory { get; set; } = string.Empty;
|
||||||
|
|
||||||
public bool UseCrashHandler { get; set; } = true;
|
public bool? UseCrashHandler { get; set; } = null;
|
||||||
public bool OpenWindowAtStart { get; set; } = false;
|
public bool OpenWindowAtStart { get; set; } = false;
|
||||||
public bool HideUiInGPose { get; set; } = false;
|
public bool HideUiInGPose { get; set; } = false;
|
||||||
public bool HideUiInCutscenes { get; set; } = true;
|
public bool HideUiInCutscenes { get; set; } = true;
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ public sealed class CrashHandlerService : IDisposable, IService
|
||||||
_config = config;
|
_config = config;
|
||||||
_validityChecker = validityChecker;
|
_validityChecker = validityChecker;
|
||||||
|
|
||||||
if (!_config.UseCrashHandler)
|
if (_config.UseCrashHandler ?? false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
OpenEventWriter();
|
OpenEventWriter();
|
||||||
|
|
@ -84,7 +84,7 @@ public sealed class CrashHandlerService : IDisposable, IService
|
||||||
|
|
||||||
public void Enable()
|
public void Enable()
|
||||||
{
|
{
|
||||||
if (_config.UseCrashHandler)
|
if (_config.UseCrashHandler ?? false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_config.UseCrashHandler = true;
|
_config.UseCrashHandler = true;
|
||||||
|
|
@ -97,7 +97,7 @@ public sealed class CrashHandlerService : IDisposable, IService
|
||||||
|
|
||||||
public void Disable()
|
public void Disable()
|
||||||
{
|
{
|
||||||
if (!_config.UseCrashHandler)
|
if (!(_config.UseCrashHandler ?? false))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_config.UseCrashHandler = false;
|
_config.UseCrashHandler = false;
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,7 @@ public class SettingsTab : ITab
|
||||||
private readonly DalamudPluginInterface _pluginInterface;
|
private readonly DalamudPluginInterface _pluginInterface;
|
||||||
private readonly IDataManager _gameData;
|
private readonly IDataManager _gameData;
|
||||||
private readonly PredefinedTagManager _predefinedTagManager;
|
private readonly PredefinedTagManager _predefinedTagManager;
|
||||||
|
private readonly CrashHandlerService _crashService;
|
||||||
|
|
||||||
private int _minimumX = int.MaxValue;
|
private int _minimumX = int.MaxValue;
|
||||||
private int _minimumY = int.MaxValue;
|
private int _minimumY = int.MaxValue;
|
||||||
|
|
@ -53,7 +54,7 @@ public class SettingsTab : ITab
|
||||||
Penumbra penumbra, FileDialogService fileDialog, ModManager modManager, ModFileSystemSelector selector,
|
Penumbra penumbra, FileDialogService fileDialog, ModManager modManager, ModFileSystemSelector selector,
|
||||||
CharacterUtility characterUtility, ResidentResourceManager residentResources, ModExportManager modExportManager, HttpApi httpApi,
|
CharacterUtility characterUtility, ResidentResourceManager residentResources, ModExportManager modExportManager, HttpApi httpApi,
|
||||||
DalamudSubstitutionProvider dalamudSubstitutionProvider, FileCompactor compactor, DalamudConfigService dalamudConfig,
|
DalamudSubstitutionProvider dalamudSubstitutionProvider, FileCompactor compactor, DalamudConfigService dalamudConfig,
|
||||||
IDataManager gameData, PredefinedTagManager predefinedTagConfig)
|
IDataManager gameData, PredefinedTagManager predefinedTagConfig, CrashHandlerService crashService)
|
||||||
{
|
{
|
||||||
_pluginInterface = pluginInterface;
|
_pluginInterface = pluginInterface;
|
||||||
_config = config;
|
_config = config;
|
||||||
|
|
@ -74,6 +75,7 @@ public class SettingsTab : ITab
|
||||||
if (_compactor.CanCompact)
|
if (_compactor.CanCompact)
|
||||||
_compactor.Enabled = _config.UseFileSystemCompression;
|
_compactor.Enabled = _config.UseFileSystemCompression;
|
||||||
_predefinedTagManager = predefinedTagConfig;
|
_predefinedTagManager = predefinedTagConfig;
|
||||||
|
_crashService = crashService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DrawHeader()
|
public void DrawHeader()
|
||||||
|
|
@ -704,6 +706,7 @@ public class SettingsTab : ITab
|
||||||
if (!header)
|
if (!header)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
DrawCrashHandler();
|
||||||
DrawMinimumDimensionConfig();
|
DrawMinimumDimensionConfig();
|
||||||
Checkbox("Auto Deduplicate on Import",
|
Checkbox("Auto Deduplicate on Import",
|
||||||
"Automatically deduplicate mod files on import. This will make mod file sizes smaller, but deletes (binary identical) files.",
|
"Automatically deduplicate mod files on import. This will make mod file sizes smaller, but deletes (binary identical) files.",
|
||||||
|
|
@ -721,6 +724,20 @@ public class SettingsTab : ITab
|
||||||
ImGui.NewLine();
|
ImGui.NewLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void DrawCrashHandler()
|
||||||
|
{
|
||||||
|
Checkbox("Enable Penumbra Crash Logging (Experimental)",
|
||||||
|
"Enables Penumbra to launch a secondary process that records some game activity which may or may not help diagnosing Penumbra-related game crashes.",
|
||||||
|
_config.UseCrashHandler ?? false,
|
||||||
|
v =>
|
||||||
|
{
|
||||||
|
if (v)
|
||||||
|
_crashService.Enable();
|
||||||
|
else
|
||||||
|
_crashService.Disable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private void DrawCompressionBox()
|
private void DrawCompressionBox()
|
||||||
{
|
{
|
||||||
if (!_compactor.CanCompact)
|
if (!_compactor.CanCompact)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue