mirror of
https://github.com/xivdev/Penumbra.git
synced 2026-02-23 00:07:53 +01:00
A bunch of filesystem fixes.
This commit is contained in:
parent
0b9a48a485
commit
f0af9f1274
4 changed files with 16 additions and 7 deletions
|
|
@ -68,7 +68,7 @@ public sealed class ModFileSystem : FileSystem< Mod >, IDisposable
|
|||
if( type.HasFlag( MetaChangeType.Name ) && oldName != null )
|
||||
{
|
||||
var old = oldName.FixName();
|
||||
if( Find( old, out var child ) )
|
||||
if( Find( old, out var child ) && child is not Folder)
|
||||
{
|
||||
Rename( child, mod.Name.Text );
|
||||
}
|
||||
|
|
@ -117,7 +117,7 @@ public sealed class ModFileSystem : FileSystem< Mod >, IDisposable
|
|||
|
||||
private static (string, bool) SaveMod( Mod mod, string fullPath )
|
||||
{
|
||||
var regex = new Regex( $@"^{Regex.Escape( ModToName( mod ) )}( \(\d+\))?" );
|
||||
var regex = new Regex( $@"^{Regex.Escape( ModToName( mod ) )}( \(\d+\))?$" );
|
||||
// Only save pairs with non-default paths.
|
||||
if( regex.IsMatch( fullPath ) )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ using System.IO;
|
|||
using System.Numerics;
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.Components;
|
||||
using Dalamud.Logging;
|
||||
using Dalamud.Memory;
|
||||
using ImGuiNET;
|
||||
using OtterGui;
|
||||
|
|
@ -45,7 +46,14 @@ public partial class ConfigWindow
|
|||
if( Input.Text( "Mod Path", Input.Path, Input.None, _leaf.FullName(), out var newPath, 256,
|
||||
_window._inputTextWidth.X ) )
|
||||
{
|
||||
_window._penumbra.ModFileSystem.RenameAndMove( _leaf, newPath );
|
||||
try
|
||||
{
|
||||
_window._penumbra.ModFileSystem.RenameAndMove( _leaf, newPath );
|
||||
}
|
||||
catch( Exception e )
|
||||
{
|
||||
PluginLog.Warning( e.Message );
|
||||
}
|
||||
}
|
||||
|
||||
ImGui.Dummy( _window._defaultSpace );
|
||||
|
|
@ -138,6 +146,7 @@ public partial class ConfigWindow
|
|||
_window.ModEditPopup.ChangeOption( -1, 0 );
|
||||
_window.ModEditPopup.IsOpen = true;
|
||||
}
|
||||
|
||||
ImGui.SameLine();
|
||||
fileExists = File.Exists( _mod.DefaultFile );
|
||||
tt = fileExists
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue