mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +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,12 +33,12 @@ public class Configuration : IPluginConfiguration, ISavable
|
|||
public string ModDirectory { get; set; } = string.Empty;
|
||||
public string ExportDirectory { get; set; } = string.Empty;
|
||||
|
||||
public bool UseCrashHandler { get; set; } = true;
|
||||
public bool OpenWindowAtStart { get; set; } = false;
|
||||
public bool HideUiInGPose { get; set; } = false;
|
||||
public bool HideUiInCutscenes { get; set; } = true;
|
||||
public bool HideUiWhenUiHidden { get; set; } = false;
|
||||
public bool UseDalamudUiTextureRedirection { get; set; } = true;
|
||||
public bool? UseCrashHandler { get; set; } = null;
|
||||
public bool OpenWindowAtStart { get; set; } = false;
|
||||
public bool HideUiInGPose { get; set; } = false;
|
||||
public bool HideUiInCutscenes { get; set; } = true;
|
||||
public bool HideUiWhenUiHidden { get; set; } = false;
|
||||
public bool UseDalamudUiTextureRedirection { get; set; } = true;
|
||||
|
||||
public bool UseCharacterCollectionInMainWindow { get; set; } = true;
|
||||
public bool UseCharacterCollectionsInCards { get; set; } = true;
|
||||
|
|
@ -48,9 +48,9 @@ public class Configuration : IPluginConfiguration, ISavable
|
|||
public bool UseNoModsInInspect { get; set; } = false;
|
||||
public bool HideChangedItemFilters { get; set; } = false;
|
||||
public bool ReplaceNonAsciiOnImport { get; set; } = false;
|
||||
public bool HidePrioritiesInSelector { get; set; } = false;
|
||||
public bool HideRedrawBar { get; set; } = false;
|
||||
public int OptionGroupCollapsibleMin { get; set; } = 5;
|
||||
public bool HidePrioritiesInSelector { get; set; } = false;
|
||||
public bool HideRedrawBar { get; set; } = false;
|
||||
public int OptionGroupCollapsibleMin { get; set; } = 5;
|
||||
|
||||
public Vector2 MinimumSize = new(Constants.MinimumSizeX, Constants.MinimumSizeY);
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public sealed class CrashHandlerService : IDisposable, IService
|
|||
_config = config;
|
||||
_validityChecker = validityChecker;
|
||||
|
||||
if (!_config.UseCrashHandler)
|
||||
if (_config.UseCrashHandler ?? false)
|
||||
return;
|
||||
|
||||
OpenEventWriter();
|
||||
|
|
@ -84,7 +84,7 @@ public sealed class CrashHandlerService : IDisposable, IService
|
|||
|
||||
public void Enable()
|
||||
{
|
||||
if (_config.UseCrashHandler)
|
||||
if (_config.UseCrashHandler ?? false)
|
||||
return;
|
||||
|
||||
_config.UseCrashHandler = true;
|
||||
|
|
@ -97,7 +97,7 @@ public sealed class CrashHandlerService : IDisposable, IService
|
|||
|
||||
public void Disable()
|
||||
{
|
||||
if (!_config.UseCrashHandler)
|
||||
if (!(_config.UseCrashHandler ?? false))
|
||||
return;
|
||||
|
||||
_config.UseCrashHandler = false;
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ public class SettingsTab : ITab
|
|||
private readonly DalamudPluginInterface _pluginInterface;
|
||||
private readonly IDataManager _gameData;
|
||||
private readonly PredefinedTagManager _predefinedTagManager;
|
||||
private readonly CrashHandlerService _crashService;
|
||||
|
||||
private int _minimumX = int.MaxValue;
|
||||
private int _minimumY = int.MaxValue;
|
||||
|
|
@ -53,7 +54,7 @@ public class SettingsTab : ITab
|
|||
Penumbra penumbra, FileDialogService fileDialog, ModManager modManager, ModFileSystemSelector selector,
|
||||
CharacterUtility characterUtility, ResidentResourceManager residentResources, ModExportManager modExportManager, HttpApi httpApi,
|
||||
DalamudSubstitutionProvider dalamudSubstitutionProvider, FileCompactor compactor, DalamudConfigService dalamudConfig,
|
||||
IDataManager gameData, PredefinedTagManager predefinedTagConfig)
|
||||
IDataManager gameData, PredefinedTagManager predefinedTagConfig, CrashHandlerService crashService)
|
||||
{
|
||||
_pluginInterface = pluginInterface;
|
||||
_config = config;
|
||||
|
|
@ -74,6 +75,7 @@ public class SettingsTab : ITab
|
|||
if (_compactor.CanCompact)
|
||||
_compactor.Enabled = _config.UseFileSystemCompression;
|
||||
_predefinedTagManager = predefinedTagConfig;
|
||||
_crashService = crashService;
|
||||
}
|
||||
|
||||
public void DrawHeader()
|
||||
|
|
@ -228,35 +230,35 @@ public class SettingsTab : ITab
|
|||
_newModDirectory = _config.ModDirectory;
|
||||
|
||||
bool save, selected;
|
||||
using (ImRaii.Group())
|
||||
{
|
||||
ImGui.SetNextItemWidth(UiHelpers.InputTextMinusButton3);
|
||||
using (ImRaii.PushStyle(ImGuiStyleVar.FrameBorderSize, ImGuiHelpers.GlobalScale, !_modManager.Valid))
|
||||
{
|
||||
using var color = ImRaii.PushColor(ImGuiCol.Border, Colors.RegexWarningBorder)
|
||||
.Push(ImGuiCol.TextDisabled, Colors.RegexWarningBorder, !_modManager.Valid);
|
||||
save = ImGui.InputTextWithHint("##rootDirectory", "Enter Root Directory here (MANDATORY)...", ref _newModDirectory,
|
||||
RootDirectoryMaxLength, ImGuiInputTextFlags.EnterReturnsTrue);
|
||||
}
|
||||
|
||||
selected = ImGui.IsItemActive();
|
||||
using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, new Vector2(UiHelpers.ScaleX3, 0));
|
||||
ImGui.SameLine();
|
||||
DrawDirectoryPickerButton();
|
||||
style.Pop();
|
||||
ImGui.SameLine();
|
||||
|
||||
const string tt = "This is where Penumbra will store your extracted mod files.\n"
|
||||
+ "TTMP files are not copied, just extracted.\n"
|
||||
+ "This directory needs to be accessible and you need write access here.\n"
|
||||
+ "It is recommended that this directory is placed on a fast hard drive, preferably an SSD.\n"
|
||||
+ "It should also be placed near the root of a logical drive - the shorter the total path to this folder, the better.\n"
|
||||
+ "Definitely do not place it in your Dalamud directory or any sub-directory thereof.";
|
||||
ImGuiComponents.HelpMarker(tt);
|
||||
_tutorial.OpenTutorial(BasicTutorialSteps.GeneralTooltips);
|
||||
ImGui.SameLine();
|
||||
ImGui.TextUnformatted("Root Directory");
|
||||
ImGuiUtil.HoverTooltip(tt);
|
||||
using (ImRaii.Group())
|
||||
{
|
||||
ImGui.SetNextItemWidth(UiHelpers.InputTextMinusButton3);
|
||||
using (ImRaii.PushStyle(ImGuiStyleVar.FrameBorderSize, ImGuiHelpers.GlobalScale, !_modManager.Valid))
|
||||
{
|
||||
using var color = ImRaii.PushColor(ImGuiCol.Border, Colors.RegexWarningBorder)
|
||||
.Push(ImGuiCol.TextDisabled, Colors.RegexWarningBorder, !_modManager.Valid);
|
||||
save = ImGui.InputTextWithHint("##rootDirectory", "Enter Root Directory here (MANDATORY)...", ref _newModDirectory,
|
||||
RootDirectoryMaxLength, ImGuiInputTextFlags.EnterReturnsTrue);
|
||||
}
|
||||
|
||||
selected = ImGui.IsItemActive();
|
||||
using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, new Vector2(UiHelpers.ScaleX3, 0));
|
||||
ImGui.SameLine();
|
||||
DrawDirectoryPickerButton();
|
||||
style.Pop();
|
||||
ImGui.SameLine();
|
||||
|
||||
const string tt = "This is where Penumbra will store your extracted mod files.\n"
|
||||
+ "TTMP files are not copied, just extracted.\n"
|
||||
+ "This directory needs to be accessible and you need write access here.\n"
|
||||
+ "It is recommended that this directory is placed on a fast hard drive, preferably an SSD.\n"
|
||||
+ "It should also be placed near the root of a logical drive - the shorter the total path to this folder, the better.\n"
|
||||
+ "Definitely do not place it in your Dalamud directory or any sub-directory thereof.";
|
||||
ImGuiComponents.HelpMarker(tt);
|
||||
_tutorial.OpenTutorial(BasicTutorialSteps.GeneralTooltips);
|
||||
ImGui.SameLine();
|
||||
ImGui.TextUnformatted("Root Directory");
|
||||
ImGuiUtil.HoverTooltip(tt);
|
||||
}
|
||||
|
||||
_tutorial.OpenTutorial(BasicTutorialSteps.ModDirectory);
|
||||
|
|
@ -704,6 +706,7 @@ public class SettingsTab : ITab
|
|||
if (!header)
|
||||
return;
|
||||
|
||||
DrawCrashHandler();
|
||||
DrawMinimumDimensionConfig();
|
||||
Checkbox("Auto Deduplicate on Import",
|
||||
"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();
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
if (!_compactor.CanCompact)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue