mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Only search through non-hidden files in a few places.
This commit is contained in:
parent
a88332d3bc
commit
2bf80dfa6b
4 changed files with 8 additions and 6 deletions
2
OtterGui
2
OtterGui
|
|
@ -1 +1 @@
|
|||
Subproject commit 39e24baebcb450ccd1e7103fd428ee3020c28702
|
||||
Subproject commit 377890671cba2e9edb8e792be3bf8f0a84a8b741
|
||||
|
|
@ -4,6 +4,7 @@ using System.IO;
|
|||
using System.Linq;
|
||||
using System.Threading;
|
||||
using Microsoft.Win32;
|
||||
using OtterGui;
|
||||
using Penumbra.String.Classes;
|
||||
|
||||
namespace Penumbra.Mods;
|
||||
|
|
@ -113,7 +114,7 @@ public class ModFileCollection : IDisposable
|
|||
tok.ThrowIfCancellationRequested();
|
||||
ClearFiles();
|
||||
|
||||
foreach (var file in mod.ModPath.EnumerateDirectories().SelectMany(d => d.EnumerateFiles("*.*", SearchOption.AllDirectories)))
|
||||
foreach (var file in mod.ModPath.EnumerateDirectories().Where(d => !d.IsHidden()).SelectMany(FileExtensions.EnumerateNonHiddenFiles))
|
||||
{
|
||||
tok.ThrowIfCancellationRequested();
|
||||
if (!FileRegistry.FromFile(mod.ModPath, file, out var registry))
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ using System.Text;
|
|||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OtterGui;
|
||||
using OtterGui.Filesystem;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Import.Structs;
|
||||
|
|
@ -98,7 +99,7 @@ internal static partial class ModCreator
|
|||
/// <summary> Create the data for a given sub mod from its data and the folder it is based on. </summary>
|
||||
public static ISubMod CreateSubMod( DirectoryInfo baseFolder, DirectoryInfo optionFolder, OptionList option )
|
||||
{
|
||||
var list = optionFolder.EnumerateFiles( "*.*", SearchOption.AllDirectories )
|
||||
var list = optionFolder.EnumerateNonHiddenFiles()
|
||||
.Select( f => ( Utf8GamePath.FromFile( f, optionFolder, out var gamePath, true ), gamePath, new FullPath( f ) ) )
|
||||
.Where( t => t.Item1 );
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OtterGui;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Meta.Manipulations;
|
||||
using Penumbra.String.Classes;
|
||||
|
|
@ -40,9 +41,8 @@ public partial class Mod
|
|||
{
|
||||
var modFiles = AllFiles.ToHashSet();
|
||||
return ModPath.EnumerateDirectories()
|
||||
.Where(d => !d.Attributes.HasFlag( FileAttributes.Hidden ) )
|
||||
.SelectMany(f => f.EnumerateFiles("*", SearchOption.AllDirectories))
|
||||
.Where( f => !f.Attributes.HasFlag( FileAttributes.Hidden ) )
|
||||
.Where(d => !d.IsHidden())
|
||||
.SelectMany(FileExtensions.EnumerateNonHiddenFiles)
|
||||
.Select(f => new FullPath(f))
|
||||
.Where(f => !modFiles.Contains(f))
|
||||
.ToList();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue