mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 10:17:22 +01:00
Small fixes for backup, respect export directory on load.
This commit is contained in:
parent
c800f3191f
commit
b65bef17b2
4 changed files with 17 additions and 10 deletions
2
OtterGui
2
OtterGui
|
|
@ -1 +1 @@
|
|||
Subproject commit 441d5f9b2943f8ab81501870314d9b1610cb3b51
|
||||
Subproject commit 1b61ce894209ebabe6cf2d8b7c120f5a6edbe86a
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
using ImGuizmoNET;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
|
|
@ -110,7 +109,7 @@ public sealed partial class Mod
|
|||
}
|
||||
}
|
||||
|
||||
public void UpdateExportDirectory( string newDirectory )
|
||||
public void UpdateExportDirectory( string newDirectory, bool change )
|
||||
{
|
||||
if( newDirectory.Length == 0 )
|
||||
{
|
||||
|
|
@ -144,14 +143,21 @@ public sealed partial class Mod
|
|||
}
|
||||
}
|
||||
|
||||
foreach( var mod in _mods )
|
||||
if( change )
|
||||
{
|
||||
new ModBackup( mod ).Move( dir.FullName );
|
||||
foreach( var mod in _mods )
|
||||
{
|
||||
new ModBackup( mod ).Move( dir.FullName );
|
||||
}
|
||||
}
|
||||
|
||||
_exportDirectory = dir;
|
||||
Penumbra.Config.ExportDirectory = dir.FullName;
|
||||
Penumbra.Config.Save();
|
||||
_exportDirectory = dir;
|
||||
|
||||
if( change )
|
||||
{
|
||||
Penumbra.Config.ExportDirectory = dir.FullName;
|
||||
Penumbra.Config.Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -39,6 +39,7 @@ public sealed partial class Mod
|
|||
{
|
||||
ModDirectoryChanged += OnModDirectoryChange;
|
||||
SetBaseDirectory( modDirectory, true );
|
||||
UpdateExportDirectory( Penumbra.Config.ExportDirectory, false );
|
||||
ModOptionChanged += OnModOptionChange;
|
||||
ModPathChanged += OnModPathChange;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -236,7 +236,7 @@ public partial class ConfigWindow
|
|||
|
||||
if( ImGui.IsItemDeactivatedAfterEdit() )
|
||||
{
|
||||
Penumbra.ModManager.UpdateExportDirectory( _tempExportDirectory );
|
||||
Penumbra.ModManager.UpdateExportDirectory( _tempExportDirectory, true );
|
||||
}
|
||||
|
||||
ImGui.SameLine();
|
||||
|
|
@ -258,7 +258,7 @@ public partial class ConfigWindow
|
|||
|
||||
_dialogManager.OpenFolderDialog( "Choose Default Export Directory", ( b, s ) =>
|
||||
{
|
||||
Penumbra.ModManager.UpdateExportDirectory( b ? s : Penumbra.Config.ExportDirectory );
|
||||
Penumbra.ModManager.UpdateExportDirectory( b ? s : Penumbra.Config.ExportDirectory, true );
|
||||
_dialogOpen = false;
|
||||
}, startDir );
|
||||
_dialogOpen = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue