mirror of
https://github.com/xivdev/Penumbra.git
synced 2026-02-21 07:17:53 +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
|
|
@ -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