Add option to always open mod importer at default path.

This commit is contained in:
Ottermandias 2022-06-05 13:16:16 +02:00
parent 0a81e39690
commit 2746f7ea4f
3 changed files with 7 additions and 3 deletions

View file

@ -51,6 +51,7 @@ public partial class Configuration : IPluginConfiguration
public bool EnableHttpApi { get; set; } public bool EnableHttpApi { get; set; }
public string DefaultModImportPath { get; set; } = string.Empty; public string DefaultModImportPath { get; set; } = string.Empty;
public bool AlwaysOpenDefaultImport { get; set; } = false;
public string DefaultModAuthor { get; set; } = DefaultTexToolsData.Author; public string DefaultModAuthor { get; set; } = DefaultTexToolsData.Author;
public Dictionary< ColorId, uint > Colors { get; set; } public Dictionary< ColorId, uint > Colors { get; set; }

View file

@ -174,9 +174,9 @@ public sealed partial class ModFileSystemSelector : FileSystemSelector< Mod, Mod
return; return;
} }
var modPath = _hasSetFolder ? null var modPath = _hasSetFolder && !Penumbra.Config.AlwaysOpenDefaultImport ? null
: Penumbra.Config.DefaultModImportPath.Length > 0 ? Penumbra.Config.DefaultModImportPath : Penumbra.Config.DefaultModImportPath.Length > 0 ? Penumbra.Config.DefaultModImportPath
: Penumbra.Config.ModDirectory.Length > 0 ? Penumbra.Config.ModDirectory : null; : Penumbra.Config.ModDirectory.Length > 0 ? Penumbra.Config.ModDirectory : null;
_hasSetFolder = true; _hasSetFolder = true;
_fileManager.OpenFileDialog( "Import Mod Pack", "TexTools Mod Packs{.ttmp,.ttmp2}", ( s, f ) => _fileManager.OpenFileDialog( "Import Mod Pack", "TexTools Mod Packs{.ttmp,.ttmp2}", ( s, f ) =>
{ {

View file

@ -86,6 +86,9 @@ public partial class ConfigWindow
_window._selector.SetFilterDirty(); _window._selector.SetFilterDirty();
} ); } );
ImGui.Dummy( _window._defaultSpace ); ImGui.Dummy( _window._defaultSpace );
Checkbox( "Always Open Import at Default Directory",
"Open the import window at the location specified here every time, forgetting your previous path.",
Penumbra.Config.AlwaysOpenDefaultImport, v => Penumbra.Config.AlwaysOpenDefaultImport = v );
DrawDefaultModImportPath(); DrawDefaultModImportPath();
DrawDefaultModAuthor(); DrawDefaultModAuthor();