mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +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;
|
||||||
using System.IO;
|
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 )
|
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;
|
_exportDirectory = dir;
|
||||||
Penumbra.Config.ExportDirectory = dir.FullName;
|
|
||||||
Penumbra.Config.Save();
|
if( change )
|
||||||
|
{
|
||||||
|
Penumbra.Config.ExportDirectory = dir.FullName;
|
||||||
|
Penumbra.Config.Save();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -39,6 +39,7 @@ public sealed partial class Mod
|
||||||
{
|
{
|
||||||
ModDirectoryChanged += OnModDirectoryChange;
|
ModDirectoryChanged += OnModDirectoryChange;
|
||||||
SetBaseDirectory( modDirectory, true );
|
SetBaseDirectory( modDirectory, true );
|
||||||
|
UpdateExportDirectory( Penumbra.Config.ExportDirectory, false );
|
||||||
ModOptionChanged += OnModOptionChange;
|
ModOptionChanged += OnModOptionChange;
|
||||||
ModPathChanged += OnModPathChange;
|
ModPathChanged += OnModPathChange;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -236,7 +236,7 @@ public partial class ConfigWindow
|
||||||
|
|
||||||
if( ImGui.IsItemDeactivatedAfterEdit() )
|
if( ImGui.IsItemDeactivatedAfterEdit() )
|
||||||
{
|
{
|
||||||
Penumbra.ModManager.UpdateExportDirectory( _tempExportDirectory );
|
Penumbra.ModManager.UpdateExportDirectory( _tempExportDirectory, true );
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
|
|
@ -258,7 +258,7 @@ public partial class ConfigWindow
|
||||||
|
|
||||||
_dialogManager.OpenFolderDialog( "Choose Default Export Directory", ( b, s ) =>
|
_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;
|
_dialogOpen = false;
|
||||||
}, startDir );
|
}, startDir );
|
||||||
_dialogOpen = true;
|
_dialogOpen = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue