mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-13 20:24:17 +01:00
Move Mod.Manager and ModCollection.Manager to outer scope and required changes.
This commit is contained in:
parent
ccdafcf85d
commit
1253079968
59 changed files with 2562 additions and 2615 deletions
|
|
@ -38,7 +38,7 @@ public class IpcTester : IDisposable
|
|||
private readonly ModSettings _modSettings;
|
||||
private readonly Temporary _temporary;
|
||||
|
||||
public IpcTester(DalamudPluginInterface pi, PenumbraIpcProviders ipcProviders, Mod.Manager modManager)
|
||||
public IpcTester(DalamudPluginInterface pi, PenumbraIpcProviders ipcProviders, ModManager modManager)
|
||||
{
|
||||
_ipcProviders = ipcProviders;
|
||||
_pluginState = new PluginState(pi);
|
||||
|
|
@ -1139,9 +1139,9 @@ public class IpcTester : IDisposable
|
|||
private class Temporary
|
||||
{
|
||||
private readonly DalamudPluginInterface _pi;
|
||||
private readonly Mod.Manager _modManager;
|
||||
private readonly ModManager _modManager;
|
||||
|
||||
public Temporary(DalamudPluginInterface pi, Mod.Manager modManager)
|
||||
public Temporary(DalamudPluginInterface pi, ModManager modManager)
|
||||
{
|
||||
_pi = pi;
|
||||
_modManager = modManager;
|
||||
|
|
|
|||
|
|
@ -93,10 +93,10 @@ public class PenumbraApi : IDisposable, IPenumbraApi
|
|||
private Penumbra _penumbra;
|
||||
private Lumina.GameData? _lumina;
|
||||
|
||||
private Mod.Manager _modManager;
|
||||
private ModManager _modManager;
|
||||
private ResourceLoader _resourceLoader;
|
||||
private Configuration _config;
|
||||
private ModCollection.Manager _collectionManager;
|
||||
private CollectionManager _collectionManager;
|
||||
private DalamudServices _dalamud;
|
||||
private TempCollectionManager _tempCollections;
|
||||
private TempModManager _tempMods;
|
||||
|
|
@ -104,8 +104,8 @@ public class PenumbraApi : IDisposable, IPenumbraApi
|
|||
private CollectionResolver _collectionResolver;
|
||||
private CutsceneService _cutsceneService;
|
||||
|
||||
public unsafe PenumbraApi(CommunicatorService communicator, Penumbra penumbra, Mod.Manager modManager, ResourceLoader resourceLoader,
|
||||
Configuration config, ModCollection.Manager collectionManager, DalamudServices dalamud, TempCollectionManager tempCollections,
|
||||
public unsafe PenumbraApi(CommunicatorService communicator, Penumbra penumbra, ModManager modManager, ResourceLoader resourceLoader,
|
||||
Configuration config, CollectionManager collectionManager, DalamudServices dalamud, TempCollectionManager tempCollections,
|
||||
TempModManager tempMods, ActorService actors, CollectionResolver collectionResolver, CutsceneService cutsceneService)
|
||||
{
|
||||
_communicator = communicator;
|
||||
|
|
@ -1021,7 +1021,7 @@ public class PenumbraApi : IDisposable, IPenumbraApi
|
|||
|
||||
// Resolve a path given by string for a specific collection.
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
|
||||
private string ResolvePath(string path, Mod.Manager _, ModCollection collection)
|
||||
private string ResolvePath(string path, ModManager _, ModCollection collection)
|
||||
{
|
||||
if (!_config.EnableMods)
|
||||
return path;
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ public class PenumbraIpcProviders : IDisposable
|
|||
internal readonly FuncProvider< string, int, PenumbraApiEc > RemoveTemporaryModAll;
|
||||
internal readonly FuncProvider< string, string, int, PenumbraApiEc > RemoveTemporaryMod;
|
||||
|
||||
public PenumbraIpcProviders( DalamudPluginInterface pi, IPenumbraApi api, Mod.Manager modManager )
|
||||
public PenumbraIpcProviders( DalamudPluginInterface pi, IPenumbraApi api, ModManager modManager )
|
||||
{
|
||||
Api = api;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,26 +15,24 @@ using Penumbra.Util;
|
|||
|
||||
namespace Penumbra.Collections;
|
||||
|
||||
public partial class ModCollection
|
||||
{
|
||||
public sealed partial class Manager : ISavable
|
||||
public sealed partial class CollectionManager : ISavable
|
||||
{
|
||||
public const int Version = 1;
|
||||
|
||||
// The collection currently selected for changing settings.
|
||||
public ModCollection Current { get; private set; } = Empty;
|
||||
public ModCollection Current { get; private set; } = ModCollection.Empty;
|
||||
|
||||
// The collection currently selected is in use either as an active collection or through inheritance.
|
||||
public bool CurrentCollectionInUse { get; private set; }
|
||||
|
||||
// The collection used for general file redirections and all characters not specifically named.
|
||||
public ModCollection Default { get; private set; } = Empty;
|
||||
public ModCollection Default { get; private set; } = ModCollection.Empty;
|
||||
|
||||
// The collection used for all files categorized as UI files.
|
||||
public ModCollection Interface { get; private set; } = Empty;
|
||||
public ModCollection Interface { get; private set; } = ModCollection.Empty;
|
||||
|
||||
// A single collection that can not be deleted as a fallback for the current collection.
|
||||
private ModCollection DefaultName { get; set; } = Empty;
|
||||
private ModCollection DefaultName { get; set; } = ModCollection.Empty;
|
||||
|
||||
// The list of character collections.
|
||||
public readonly IndividualCollections Individuals;
|
||||
|
|
@ -84,7 +82,7 @@ public partial class ModCollection
|
|||
return;
|
||||
|
||||
var newCollection = this[newIdx];
|
||||
if (newIdx > Empty.Index)
|
||||
if (newIdx > ModCollection.Empty.Index)
|
||||
newCollection.CreateCache(collectionType is CollectionType.Default);
|
||||
|
||||
switch (collectionType)
|
||||
|
|
@ -179,7 +177,7 @@ public partial class ModCollection
|
|||
|
||||
// Obtain the index of a collection by name.
|
||||
private int GetIndexForCollectionName(string name)
|
||||
=> name.Length == 0 ? Empty.Index : _collections.IndexOf(c => c.Name == name);
|
||||
=> name.Length == 0 ? ModCollection.Empty.Index : _collections.IndexOf(c => c.Name == name);
|
||||
|
||||
// Load default, current, special, and character collections from config.
|
||||
// Then create caches. If a collection does not exist anymore, reset it to an appropriate default.
|
||||
|
|
@ -188,14 +186,14 @@ public partial class ModCollection
|
|||
var configChanged = !ReadActiveCollections(files, out var jObject);
|
||||
|
||||
// Load the default collection.
|
||||
var defaultName = jObject[nameof(Default)]?.ToObject<string>() ?? (configChanged ? DefaultCollection : Empty.Name);
|
||||
var defaultName = jObject[nameof(Default)]?.ToObject<string>() ?? (configChanged ? ModCollection.DefaultCollection : ModCollection.Empty.Name);
|
||||
var defaultIdx = GetIndexForCollectionName(defaultName);
|
||||
if (defaultIdx < 0)
|
||||
{
|
||||
Penumbra.ChatService.NotificationMessage(
|
||||
$"Last choice of {TutorialService.DefaultCollection} {defaultName} is not available, reset to {Empty.Name}.", "Load Failure",
|
||||
$"Last choice of {TutorialService.DefaultCollection} {defaultName} is not available, reset to {ModCollection.Empty.Name}.", "Load Failure",
|
||||
NotificationType.Warning);
|
||||
Default = Empty;
|
||||
Default = ModCollection.Empty;
|
||||
configChanged = true;
|
||||
}
|
||||
else
|
||||
|
|
@ -209,9 +207,9 @@ public partial class ModCollection
|
|||
if (interfaceIdx < 0)
|
||||
{
|
||||
Penumbra.ChatService.NotificationMessage(
|
||||
$"Last choice of {TutorialService.InterfaceCollection} {interfaceName} is not available, reset to {Empty.Name}.",
|
||||
$"Last choice of {TutorialService.InterfaceCollection} {interfaceName} is not available, reset to {ModCollection.Empty.Name}.",
|
||||
"Load Failure", NotificationType.Warning);
|
||||
Interface = Empty;
|
||||
Interface = ModCollection.Empty;
|
||||
configChanged = true;
|
||||
}
|
||||
else
|
||||
|
|
@ -220,12 +218,12 @@ public partial class ModCollection
|
|||
}
|
||||
|
||||
// Load the current collection.
|
||||
var currentName = jObject[nameof(Current)]?.ToObject<string>() ?? DefaultCollection;
|
||||
var currentName = jObject[nameof(Current)]?.ToObject<string>() ?? ModCollection.DefaultCollection;
|
||||
var currentIdx = GetIndexForCollectionName(currentName);
|
||||
if (currentIdx < 0)
|
||||
{
|
||||
Penumbra.ChatService.NotificationMessage(
|
||||
$"Last choice of {TutorialService.SelectedCollection} {currentName} is not available, reset to {DefaultCollection}.",
|
||||
$"Last choice of {TutorialService.SelectedCollection} {currentName} is not available, reset to {ModCollection.DefaultCollection}.",
|
||||
"Load Failure", NotificationType.Warning);
|
||||
Current = DefaultName;
|
||||
configChanged = true;
|
||||
|
|
@ -305,9 +303,9 @@ public partial class ModCollection
|
|||
if (idx < 0)
|
||||
{
|
||||
Penumbra.ChatService.NotificationMessage(
|
||||
$"Last choice of <{player}>'s Collection {collectionName} is not available, reset to {Empty.Name}.", "Load Failure",
|
||||
$"Last choice of <{player}>'s Collection {collectionName} is not available, reset to {ModCollection.Empty.Name}.", "Load Failure",
|
||||
NotificationType.Warning);
|
||||
dict.Add(player, Empty);
|
||||
dict.Add(player, ModCollection.Empty);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -364,7 +362,7 @@ public partial class ModCollection
|
|||
|
||||
private void RemoveCache(int idx)
|
||||
{
|
||||
if (idx != Empty.Index
|
||||
if (idx != ModCollection.Empty.Index
|
||||
&& idx != Default.Index
|
||||
&& idx != Interface.Index
|
||||
&& idx != Current.Index
|
||||
|
|
@ -419,4 +417,3 @@ public partial class ModCollection
|
|||
jObj.WriteTo(j);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,11 +17,9 @@ using CharacterUtility = Penumbra.Interop.Services.CharacterUtility;
|
|||
|
||||
namespace Penumbra.Collections;
|
||||
|
||||
public partial class ModCollection
|
||||
public sealed partial class CollectionManager : IDisposable, IEnumerable<ModCollection>
|
||||
{
|
||||
public sealed partial class Manager : IDisposable, IEnumerable<ModCollection>
|
||||
{
|
||||
private readonly Mod.Manager _modManager;
|
||||
private readonly Mods.ModManager _modManager;
|
||||
private readonly CommunicatorService _communicator;
|
||||
private readonly CharacterUtility _characterUtility;
|
||||
private readonly ResidentResourceManager _residentResources;
|
||||
|
|
@ -32,7 +30,7 @@ public partial class ModCollection
|
|||
// It can not be deleted or moved.
|
||||
private readonly List<ModCollection> _collections = new()
|
||||
{
|
||||
Empty,
|
||||
ModCollection.Empty,
|
||||
};
|
||||
|
||||
public ModCollection this[Index idx]
|
||||
|
|
@ -58,15 +56,15 @@ public partial class ModCollection
|
|||
public IEnumerable<ModCollection> GetEnumeratorWithEmpty()
|
||||
=> _collections;
|
||||
|
||||
public Manager(StartTracker timer, CommunicatorService communicator, FilenameService files, CharacterUtility characterUtility,
|
||||
ResidentResourceManager residentResources, Configuration config, Mod.Manager manager, IndividualCollections individuals)
|
||||
public CollectionManager(StartTracker timer, CommunicatorService communicator, FilenameService files, CharacterUtility characterUtility,
|
||||
ResidentResourceManager residentResources, Configuration config, Mods.ModManager modManager, IndividualCollections individuals)
|
||||
{
|
||||
using var time = timer.Measure(StartTimeType.Collections);
|
||||
_communicator = communicator;
|
||||
_characterUtility = characterUtility;
|
||||
_residentResources = residentResources;
|
||||
_config = config;
|
||||
_modManager = manager;
|
||||
_modManager = modManager;
|
||||
Individuals = individuals;
|
||||
|
||||
// The collection manager reacts to changes in mods by itself.
|
||||
|
|
@ -99,7 +97,7 @@ public partial class ModCollection
|
|||
// and no existing collection results in the same filename as name.
|
||||
public bool CanAddCollection(string name, out string fixedName)
|
||||
{
|
||||
if (!IsValidName(name))
|
||||
if (!ModCollection.IsValidName(name))
|
||||
{
|
||||
fixedName = string.Empty;
|
||||
return false;
|
||||
|
|
@ -107,7 +105,7 @@ public partial class ModCollection
|
|||
|
||||
name = name.RemoveInvalidPathSymbols().ToLowerInvariant();
|
||||
if (name.Length == 0
|
||||
|| name == Empty.Name.ToLowerInvariant()
|
||||
|| name == ModCollection.Empty.Name.ToLowerInvariant()
|
||||
|| _collections.Any(c => c.Name.RemoveInvalidPathSymbols().ToLowerInvariant() == name))
|
||||
{
|
||||
fixedName = string.Empty;
|
||||
|
|
@ -131,7 +129,7 @@ public partial class ModCollection
|
|||
return false;
|
||||
}
|
||||
|
||||
var newCollection = duplicate?.Duplicate(name) ?? CreateNewEmpty(name);
|
||||
var newCollection = duplicate?.Duplicate(name) ?? ModCollection.CreateNewEmpty(name);
|
||||
newCollection.Index = _collections.Count;
|
||||
_collections.Add(newCollection);
|
||||
|
||||
|
|
@ -147,7 +145,7 @@ public partial class ModCollection
|
|||
// Also removes the collection from inheritances of all other collections.
|
||||
public bool RemoveCollection(int idx)
|
||||
{
|
||||
if (idx <= Empty.Index || idx >= _collections.Count)
|
||||
if (idx <= ModCollection.Empty.Index || idx >= _collections.Count)
|
||||
{
|
||||
Penumbra.Log.Error("Can not remove the empty collection.");
|
||||
return false;
|
||||
|
|
@ -163,18 +161,18 @@ public partial class ModCollection
|
|||
SetCollection(DefaultName.Index, CollectionType.Current);
|
||||
|
||||
if (idx == Default.Index)
|
||||
SetCollection(Empty.Index, CollectionType.Default);
|
||||
SetCollection(ModCollection.Empty.Index, CollectionType.Default);
|
||||
|
||||
for (var i = 0; i < _specialCollections.Length; ++i)
|
||||
{
|
||||
if (idx == _specialCollections[i]?.Index)
|
||||
SetCollection(Empty, (CollectionType)i);
|
||||
SetCollection(ModCollection.Empty, (CollectionType)i);
|
||||
}
|
||||
|
||||
for (var i = 0; i < Individuals.Count; ++i)
|
||||
{
|
||||
if (Individuals[i].Collection.Index == idx)
|
||||
SetCollection(Empty, CollectionType.Individual, i);
|
||||
SetCollection(ModCollection.Empty, CollectionType.Individual, i);
|
||||
}
|
||||
|
||||
var collection = _collections[idx];
|
||||
|
|
@ -304,14 +302,14 @@ public partial class ModCollection
|
|||
// This can also not be deleted, so there are always at least the empty and a collection with default name.
|
||||
private void AddDefaultCollection()
|
||||
{
|
||||
var idx = GetIndexForCollectionName(DefaultCollection);
|
||||
var idx = GetIndexForCollectionName(ModCollection.DefaultCollection);
|
||||
if (idx >= 0)
|
||||
{
|
||||
DefaultName = this[idx];
|
||||
return;
|
||||
}
|
||||
|
||||
var defaultCollection = CreateNewEmpty(DefaultCollection);
|
||||
var defaultCollection = ModCollection.CreateNewEmpty((string)ModCollection.DefaultCollection);
|
||||
Penumbra.SaveService.ImmediateSave(defaultCollection);
|
||||
defaultCollection.Index = _collections.Count;
|
||||
_collections.Add(defaultCollection);
|
||||
|
|
@ -351,7 +349,7 @@ public partial class ModCollection
|
|||
var inheritances = new List<IReadOnlyList<string>>();
|
||||
foreach (var file in files.CollectionFiles)
|
||||
{
|
||||
var collection = LoadFromFile(file, out var inheritance);
|
||||
var collection = ModCollection.LoadFromFile(file, out var inheritance);
|
||||
if (collection == null || collection.Name.Length == 0)
|
||||
continue;
|
||||
|
||||
|
|
@ -475,4 +473,3 @@ public partial class ModCollection
|
|||
return string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ public partial class IndividualCollections
|
|||
return ret;
|
||||
}
|
||||
|
||||
public bool ReadJObject( JArray? obj, ModCollection.Manager manager )
|
||||
public bool ReadJObject( JArray? obj, CollectionManager manager )
|
||||
{
|
||||
if( obj == null )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ using System.Diagnostics.CodeAnalysis;
|
|||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading;
|
||||
using Penumbra.Interop;
|
||||
using Penumbra.Interop.Structs;
|
||||
using Penumbra.Meta.Files;
|
||||
using Penumbra.Meta.Manipulations;
|
||||
|
|
@ -20,27 +19,27 @@ namespace Penumbra.Collections;
|
|||
public partial class ModCollection
|
||||
{
|
||||
// Only active collections need to have a cache.
|
||||
private Cache? _cache;
|
||||
internal ModCollectionCache? _cache;
|
||||
|
||||
public bool HasCache
|
||||
=> _cache != null;
|
||||
|
||||
// Count the number of changes of the effective file list.
|
||||
// This is used for material and imc changes.
|
||||
public int ChangeCounter { get; private set; }
|
||||
public int ChangeCounter { get; internal set; }
|
||||
|
||||
// Only create, do not update.
|
||||
private void CreateCache(bool isDefault)
|
||||
{
|
||||
if (_cache == null)
|
||||
internal void CreateCache(bool isDefault)
|
||||
{
|
||||
if (_cache != null)
|
||||
return;
|
||||
|
||||
CalculateEffectiveFileList(isDefault);
|
||||
Penumbra.Log.Verbose($"Created new cache for collection {Name}.");
|
||||
}
|
||||
}
|
||||
|
||||
// Force an update with metadata for this cache.
|
||||
private void ForceCacheUpdate()
|
||||
internal void ForceCacheUpdate()
|
||||
=> CalculateEffectiveFileList(this == Penumbra.CollectionManager.Default);
|
||||
|
||||
// Handle temporary mods for this collection.
|
||||
|
|
@ -83,7 +82,7 @@ public partial class ModCollection
|
|||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
private static bool CheckFullPath(Utf8GamePath path, FullPath fullPath)
|
||||
internal static bool CheckFullPath(Utf8GamePath path, FullPath fullPath)
|
||||
{
|
||||
if (fullPath.InternalName.Length < Utf8GamePath.MaxGamePathLength)
|
||||
return true;
|
||||
|
|
@ -127,14 +126,14 @@ public partial class ModCollection
|
|||
=> Penumbra.Framework.RegisterImportant(nameof(CalculateEffectiveFileList) + Name, () =>
|
||||
CalculateEffectiveFileListInternal(isDefault));
|
||||
|
||||
private void CalculateEffectiveFileListInternal(bool isDefault)
|
||||
internal void CalculateEffectiveFileListInternal(bool isDefault)
|
||||
{
|
||||
// Skip the empty collection.
|
||||
if (Index == 0)
|
||||
return;
|
||||
|
||||
Penumbra.Log.Debug($"[{Thread.CurrentThread.ManagedThreadId}] Recalculating effective file list for {AnonymizedName}");
|
||||
_cache ??= new Cache(this);
|
||||
_cache ??= new ModCollectionCache(this);
|
||||
_cache.FullRecalculation(isDefault);
|
||||
|
||||
Penumbra.Log.Debug($"[{Thread.CurrentThread.ManagedThreadId}] Recalculation of effective file list for {AnonymizedName} finished.");
|
||||
|
|
|
|||
|
|
@ -15,11 +15,11 @@ namespace Penumbra.Collections;
|
|||
public record struct ModPath( IMod Mod, FullPath Path );
|
||||
public record ModConflicts( IMod Mod2, List< object > Conflicts, bool HasPriority, bool Solved );
|
||||
|
||||
public partial class ModCollection
|
||||
{
|
||||
// The Cache contains all required temporary data to use a collection.
|
||||
// It will only be setup if a collection gets activated in any way.
|
||||
private class Cache : IDisposable
|
||||
/// <summary>
|
||||
/// The Cache contains all required temporary data to use a collection.
|
||||
/// It will only be setup if a collection gets activated in any way.
|
||||
/// </summary>
|
||||
internal class ModCollectionCache : IDisposable
|
||||
{
|
||||
private readonly ModCollection _collection;
|
||||
private readonly SortedList< string, (SingleArray< IMod >, object?) > _changedItems = new();
|
||||
|
|
@ -46,7 +46,7 @@ public partial class ModCollection
|
|||
}
|
||||
|
||||
// The cache reacts through events on its collection changing.
|
||||
public Cache( ModCollection collection )
|
||||
public ModCollectionCache( ModCollection collection )
|
||||
{
|
||||
_collection = collection;
|
||||
MetaManipulations = new MetaManager( _collection );
|
||||
|
|
@ -354,7 +354,7 @@ public partial class ModCollection
|
|||
// Inside the same mod, conflicts are not recorded.
|
||||
private void AddFile( Utf8GamePath path, FullPath file, IMod mod )
|
||||
{
|
||||
if( !CheckFullPath( path, file ) )
|
||||
if( !ModCollection.CheckFullPath( path, file ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -543,4 +543,3 @@ public partial class ModCollection
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -15,7 +15,7 @@ public partial class ModCollection : ISavable
|
|||
{
|
||||
// Since inheritances depend on other collections existing,
|
||||
// we return them as a list to be applied after reading all collections.
|
||||
private static ModCollection? LoadFromFile(FileInfo file, out IReadOnlyList<string> inheritance)
|
||||
internal static ModCollection? LoadFromFile(FileInfo file, out IReadOnlyList<string> inheritance)
|
||||
{
|
||||
inheritance = Array.Empty<string>();
|
||||
if (!file.Exists)
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ public partial class ModCollection
|
|||
// The bool signifies whether the change was in an already inherited collection.
|
||||
public event Action< bool > InheritanceChanged;
|
||||
|
||||
private readonly List< ModCollection > _inheritance = new();
|
||||
internal readonly List< ModCollection > _inheritance = new();
|
||||
|
||||
public IReadOnlyList< ModCollection > Inheritance
|
||||
=> _inheritance;
|
||||
|
|
@ -98,7 +98,7 @@ public partial class ModCollection
|
|||
Penumbra.Log.Debug( $"Removed {inheritance.AnonymizedName} from {AnonymizedName} inheritances." );
|
||||
}
|
||||
|
||||
private void ClearSubscriptions( ModCollection other )
|
||||
internal void ClearSubscriptions( ModCollection other )
|
||||
{
|
||||
other.ModSettingChanged -= OnInheritedModSettingChange;
|
||||
other.InheritanceChanged -= OnInheritedInheritanceChange;
|
||||
|
|
|
|||
|
|
@ -23,18 +23,18 @@ public partial class ModCollection
|
|||
|
||||
// The collection name can contain invalid path characters,
|
||||
// but after removing those and going to lower case it has to be unique.
|
||||
public string Name { get; private init; }
|
||||
public string Name { get; internal init; }
|
||||
|
||||
// Get the first two letters of a collection name and its Index (or None if it is the empty collection).
|
||||
public string AnonymizedName
|
||||
=> this == Empty ? Empty.Name : Name.Length > 2 ? $"{Name[..2]}... ({Index})" : $"{Name} ({Index})";
|
||||
|
||||
public int Version { get; private set; }
|
||||
public int Index { get; private set; } = -1;
|
||||
public int Version { get; internal set; }
|
||||
public int Index { get; internal set; } = -1;
|
||||
|
||||
// If a ModSetting is null, it can be inherited from other collections.
|
||||
// If no collection provides a setting for the mod, it is just disabled.
|
||||
private readonly List<ModSettings?> _settings;
|
||||
internal readonly List<ModSettings?> _settings;
|
||||
|
||||
public IReadOnlyList<ModSettings?> Settings
|
||||
=> _settings;
|
||||
|
|
@ -115,7 +115,7 @@ public partial class ModCollection
|
|||
}
|
||||
|
||||
// Add settings for a new appended mod, by checking if the mod had settings from a previous deletion.
|
||||
private bool AddMod(Mod mod)
|
||||
internal bool AddMod(Mod mod)
|
||||
{
|
||||
if (_unusedSettings.TryGetValue(mod.ModPath.Name, out var save))
|
||||
{
|
||||
|
|
@ -130,7 +130,7 @@ public partial class ModCollection
|
|||
}
|
||||
|
||||
// Move settings from the current mod list to the unused mod settings.
|
||||
private void RemoveMod(Mod mod, int idx)
|
||||
internal void RemoveMod(Mod mod, int idx)
|
||||
{
|
||||
var settings = _settings[idx];
|
||||
if (settings != null)
|
||||
|
|
@ -150,7 +150,7 @@ public partial class ModCollection
|
|||
}
|
||||
|
||||
// Move all settings to unused settings for rediscovery.
|
||||
private void PrepareModDiscovery()
|
||||
internal void PrepareModDiscovery()
|
||||
{
|
||||
foreach (var (mod, setting) in Penumbra.ModManager.Zip(_settings).Where(s => s.Second != null))
|
||||
_unusedSettings[mod.ModPath.Name] = new ModSettings.SavedSettings(setting!, mod);
|
||||
|
|
@ -160,7 +160,7 @@ public partial class ModCollection
|
|||
|
||||
// Apply all mod settings from unused settings to the current set of mods.
|
||||
// Also fixes invalid settings.
|
||||
private void ApplyModSettings()
|
||||
internal void ApplyModSettings()
|
||||
{
|
||||
_settings.Capacity = Math.Max(_settings.Capacity, Penumbra.ModManager.Count);
|
||||
if (Penumbra.ModManager.Aggregate(false, (current, mod) => current | AddMod(mod)))
|
||||
|
|
|
|||
|
|
@ -27,12 +27,12 @@ public class CommandHandler : IDisposable
|
|||
private readonly Configuration _config;
|
||||
private readonly ConfigWindow _configWindow;
|
||||
private readonly ActorManager _actors;
|
||||
private readonly Mod.Manager _modManager;
|
||||
private readonly ModCollection.Manager _collectionManager;
|
||||
private readonly ModManager _modManager;
|
||||
private readonly CollectionManager _collectionManager;
|
||||
private readonly Penumbra _penumbra;
|
||||
|
||||
public CommandHandler(Framework framework, CommandManager commandManager, ChatGui chat, RedrawService redrawService, Configuration config,
|
||||
ConfigWindow configWindow, Mod.Manager modManager, ModCollection.Manager collectionManager, ActorService actors, Penumbra penumbra)
|
||||
ConfigWindow configWindow, ModManager modManager, CollectionManager collectionManager, ActorService actors, Penumbra penumbra)
|
||||
{
|
||||
_commandManager = commandManager;
|
||||
_redrawService = redrawService;
|
||||
|
|
|
|||
|
|
@ -36,10 +36,10 @@ public partial class TexToolsImporter : IDisposable
|
|||
|
||||
private readonly Configuration _config;
|
||||
private readonly ModEditor _editor;
|
||||
private readonly Mod.Manager _modManager;
|
||||
private readonly ModManager _modManager;
|
||||
|
||||
public TexToolsImporter( DirectoryInfo baseDirectory, int count, IEnumerable< FileInfo > modPackFiles,
|
||||
Action< FileInfo, DirectoryInfo?, Exception? > handler, Configuration config, ModEditor editor, Mod.Manager modManager)
|
||||
Action< FileInfo, DirectoryInfo?, Exception? > handler, Configuration config, ModEditor editor, ModManager modManager)
|
||||
{
|
||||
_baseDirectory = baseDirectory;
|
||||
_tmpFile = Path.Combine( _baseDirectory.FullName, TempFileName );
|
||||
|
|
|
|||
|
|
@ -31,12 +31,12 @@ public unsafe class CollectionResolver
|
|||
private readonly CutsceneService _cutscenes;
|
||||
|
||||
private readonly Configuration _config;
|
||||
private readonly ModCollection.Manager _collectionManager;
|
||||
private readonly CollectionManager _collectionManager;
|
||||
private readonly TempCollectionManager _tempCollections;
|
||||
private readonly DrawObjectState _drawObjectState;
|
||||
|
||||
public CollectionResolver(PerformanceTracker performance, IdentifiedCollectionCache cache, ClientState clientState, GameGui gameGui,
|
||||
DataManager gameData, ActorService actors, CutsceneService cutscenes, Configuration config, ModCollection.Manager collectionManager,
|
||||
DataManager gameData, ActorService actors, CutsceneService cutscenes, Configuration config, CollectionManager collectionManager,
|
||||
TempCollectionManager tempCollections, DrawObjectState drawObjectState)
|
||||
{
|
||||
_performance = performance;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ public class PathResolver : IDisposable
|
|||
{
|
||||
private readonly PerformanceTracker _performance;
|
||||
private readonly Configuration _config;
|
||||
private readonly ModCollection.Manager _collectionManager;
|
||||
private readonly CollectionManager _collectionManager;
|
||||
private readonly TempCollectionManager _tempCollections;
|
||||
private readonly ResourceLoader _loader;
|
||||
|
||||
|
|
@ -25,7 +25,7 @@ public class PathResolver : IDisposable
|
|||
private readonly PathState _pathState;
|
||||
private readonly MetaState _metaState;
|
||||
|
||||
public unsafe PathResolver(PerformanceTracker performance, Configuration config, ModCollection.Manager collectionManager,
|
||||
public unsafe PathResolver(PerformanceTracker performance, Configuration config, CollectionManager collectionManager,
|
||||
TempCollectionManager tempCollections, ResourceLoader loader, AnimationHookService animationHookService, SubfileHelper subfileHelper,
|
||||
PathState pathState, MetaState metaState)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -11,12 +11,12 @@ namespace Penumbra.Mods;
|
|||
|
||||
public class DuplicateManager
|
||||
{
|
||||
private readonly Mod.Manager _modManager;
|
||||
private readonly ModManager _modManager;
|
||||
private readonly SHA256 _hasher = SHA256.Create();
|
||||
private readonly ModFileCollection _files;
|
||||
private readonly List<(FullPath[] Paths, long Size, byte[] Hash)> _duplicates = new();
|
||||
|
||||
public DuplicateManager(ModFileCollection files, Mod.Manager modManager)
|
||||
public DuplicateManager(ModFileCollection files, ModManager modManager)
|
||||
{
|
||||
_files = files;
|
||||
_modManager = modManager;
|
||||
|
|
@ -80,7 +80,7 @@ public class DuplicateManager
|
|||
}
|
||||
else
|
||||
{
|
||||
var sub = (Mod.SubMod)subMod;
|
||||
var sub = (SubMod)subMod;
|
||||
sub.FileData = dict;
|
||||
if (groupIdx == -1)
|
||||
mod.SaveDefaultMod();
|
||||
|
|
|
|||
|
|
@ -10,12 +10,12 @@ public class ModBackup
|
|||
{
|
||||
public static bool CreatingBackup { get; private set; }
|
||||
|
||||
private readonly Mod.Manager _modManager;
|
||||
private readonly ModManager _modManager;
|
||||
private readonly Mod _mod;
|
||||
public readonly string Name;
|
||||
public readonly bool Exists;
|
||||
|
||||
public ModBackup(Mod.Manager modManager, Mod mod)
|
||||
public ModBackup(ModManager modManager, Mod mod)
|
||||
{
|
||||
_modManager = modManager;
|
||||
_mod = mod;
|
||||
|
|
@ -24,9 +24,9 @@ public class ModBackup
|
|||
}
|
||||
|
||||
/// <summary> Migrate file extensions. </summary>
|
||||
public static void MigrateZipToPmp(Mod.Manager manager)
|
||||
public static void MigrateZipToPmp(ModManager modManager)
|
||||
{
|
||||
foreach (var mod in manager)
|
||||
foreach (var mod in modManager)
|
||||
{
|
||||
var pmpName = mod.ModPath + ".pmp";
|
||||
var zipName = mod.ModPath + ".zip";
|
||||
|
|
|
|||
|
|
@ -9,11 +9,11 @@ namespace Penumbra.Mods;
|
|||
public class ModFileEditor
|
||||
{
|
||||
private readonly ModFileCollection _files;
|
||||
private readonly Mod.Manager _modManager;
|
||||
private readonly ModManager _modManager;
|
||||
|
||||
public bool Changes { get; private set; }
|
||||
|
||||
public ModFileEditor(ModFileCollection files, Mod.Manager modManager)
|
||||
public ModFileEditor(ModFileCollection files, ModManager modManager)
|
||||
{
|
||||
_files = files;
|
||||
_modManager = modManager;
|
||||
|
|
@ -24,7 +24,7 @@ public class ModFileEditor
|
|||
Changes = false;
|
||||
}
|
||||
|
||||
public int Apply(Mod mod, Mod.SubMod option)
|
||||
public int Apply(Mod mod, SubMod option)
|
||||
{
|
||||
var dict = new Dictionary<Utf8GamePath, FullPath>();
|
||||
var num = 0;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ namespace Penumbra.Mods;
|
|||
|
||||
public class ModMetaEditor
|
||||
{
|
||||
private readonly Mod.Manager _modManager;
|
||||
private readonly ModManager _modManager;
|
||||
|
||||
private readonly HashSet<ImcManipulation> _imc = new();
|
||||
private readonly HashSet<EqpManipulation> _eqp = new();
|
||||
|
|
@ -15,7 +15,7 @@ public class ModMetaEditor
|
|||
private readonly HashSet<EstManipulation> _est = new();
|
||||
private readonly HashSet<RspManipulation> _rsp = new();
|
||||
|
||||
public ModMetaEditor(Mod.Manager modManager)
|
||||
public ModMetaEditor(ModManager modManager)
|
||||
=> _modManager = modManager;
|
||||
|
||||
public bool Changes { get; private set; } = false;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ namespace Penumbra.Mods;
|
|||
|
||||
public class ModNormalizer
|
||||
{
|
||||
private readonly Mod.Manager _modManager;
|
||||
private readonly ModManager _modManager;
|
||||
private readonly List<List<Dictionary<Utf8GamePath, FullPath>>> _redirections = new();
|
||||
|
||||
public Mod Mod { get; private set; } = null!;
|
||||
|
|
@ -24,7 +24,7 @@ public class ModNormalizer
|
|||
public bool Running
|
||||
=> Step < TotalSteps;
|
||||
|
||||
public ModNormalizer(Mod.Manager modManager)
|
||||
public ModNormalizer(ModManager modManager)
|
||||
=> _modManager = modManager;
|
||||
|
||||
public void Normalize(Mod mod)
|
||||
|
|
@ -177,7 +177,7 @@ public class ModNormalizer
|
|||
_redirections[groupIdx + 1].Add(new Dictionary<Utf8GamePath, FullPath>());
|
||||
|
||||
var groupDir = Mod.Creator.CreateModFolder(directory, group.Name);
|
||||
foreach (var option in group.OfType<Mod.SubMod>())
|
||||
foreach (var option in group.OfType<SubMod>())
|
||||
{
|
||||
var optionDir = Mod.Creator.CreateModFolder(groupDir, option.Name);
|
||||
|
||||
|
|
@ -279,7 +279,7 @@ public class ModNormalizer
|
|||
|
||||
private void ApplyRedirections()
|
||||
{
|
||||
foreach (var option in Mod.AllSubMods.OfType<Mod.SubMod>())
|
||||
foreach (var option in Mod.AllSubMods.OfType<SubMod>())
|
||||
{
|
||||
_modManager.OptionSetFiles(Mod, option.GroupIdx, option.OptionIdx, _redirections[option.GroupIdx + 1][option.OptionIdx]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,13 +5,13 @@ using Penumbra.Util;
|
|||
|
||||
public class ModSwapEditor
|
||||
{
|
||||
private readonly Mod.Manager _modManager;
|
||||
private readonly ModManager _modManager;
|
||||
private readonly Dictionary<Utf8GamePath, FullPath> _swaps = new();
|
||||
|
||||
public IReadOnlyDictionary<Utf8GamePath, FullPath> Swaps
|
||||
=> _swaps;
|
||||
|
||||
public ModSwapEditor(Mod.Manager modManager)
|
||||
public ModSwapEditor(ModManager modManager)
|
||||
=> _modManager = modManager;
|
||||
|
||||
public void Revert(ISubMod option)
|
||||
|
|
|
|||
|
|
@ -4,9 +4,7 @@ using System.Linq;
|
|||
|
||||
namespace Penumbra.Mods;
|
||||
|
||||
public partial class Mod
|
||||
{
|
||||
public partial class Manager
|
||||
public partial class ModManager
|
||||
{
|
||||
public delegate void ModPathChangeDelegate(ModPathChangeType type, Mod mod, DirectoryInfo? oldDirectory,
|
||||
DirectoryInfo? newDirectory);
|
||||
|
|
@ -132,8 +130,8 @@ public partial class Mod
|
|||
if (_mods.Any(m => m.ModPath.Name == modFolder.Name))
|
||||
return;
|
||||
|
||||
Creator.SplitMultiGroups(modFolder);
|
||||
var mod = LoadMod(this, modFolder, true);
|
||||
Mod.Creator.SplitMultiGroups(modFolder);
|
||||
var mod = Mod.LoadMod(this, modFolder, true);
|
||||
if (mod == null)
|
||||
return;
|
||||
|
||||
|
|
@ -164,7 +162,7 @@ public partial class Mod
|
|||
if (oldName == newName)
|
||||
return NewDirectoryState.Identical;
|
||||
|
||||
var fixedNewName = Creator.ReplaceBadXivSymbols(newName);
|
||||
var fixedNewName = Mod.Creator.ReplaceBadXivSymbols(newName);
|
||||
if (fixedNewName != newName)
|
||||
return NewDirectoryState.ContainsInvalidSymbols;
|
||||
|
||||
|
|
@ -202,4 +200,3 @@ public partial class Mod
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
|
||||
namespace Penumbra.Mods;
|
||||
|
||||
public sealed partial class Mod
|
||||
{
|
||||
public partial class Manager
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -11,9 +11,7 @@ using Penumbra.Util;
|
|||
|
||||
namespace Penumbra.Mods;
|
||||
|
||||
public sealed partial class Mod
|
||||
{
|
||||
public sealed partial class Manager
|
||||
public sealed partial class ModManager
|
||||
{
|
||||
public delegate void ModOptionChangeDelegate(ModOptionChangeType type, Mod mod, int groupIdx, int optionIdx, int movedToIdx);
|
||||
public event ModOptionChangeDelegate ModOptionChanged;
|
||||
|
|
@ -316,7 +314,6 @@ public sealed partial class Mod
|
|||
"Warning", NotificationType.Warning);
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
private static SubMod GetSubMod(Mod mod, int groupIdx, int optionIdx)
|
||||
|
|
@ -378,4 +375,3 @@ public sealed partial class Mod
|
|||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,9 +6,7 @@ using System.Threading.Tasks;
|
|||
|
||||
namespace Penumbra.Mods;
|
||||
|
||||
public sealed partial class Mod
|
||||
{
|
||||
public sealed partial class Manager
|
||||
public sealed partial class ModManager
|
||||
{
|
||||
public DirectoryInfo BasePath { get; private set; } = null!;
|
||||
private DirectoryInfo? _exportDirectory;
|
||||
|
|
@ -35,24 +33,19 @@ public sealed partial class Mod
|
|||
private void SetBaseDirectory(string newPath, bool firstTime)
|
||||
{
|
||||
if (!firstTime && string.Equals(newPath, Penumbra.Config.ModDirectory, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (newPath.Length == 0)
|
||||
{
|
||||
Valid = false;
|
||||
BasePath = new DirectoryInfo(".");
|
||||
if (Penumbra.Config.ModDirectory != BasePath.FullName)
|
||||
{
|
||||
ModDirectoryChanged.Invoke(string.Empty, false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var newDir = new DirectoryInfo(newPath);
|
||||
if (!newDir.Exists)
|
||||
{
|
||||
try
|
||||
{
|
||||
Directory.CreateDirectory(newDir.FullName);
|
||||
|
|
@ -62,16 +55,13 @@ public sealed partial class Mod
|
|||
{
|
||||
Penumbra.Log.Error($"Could not create specified mod directory {newDir.FullName}:\n{e}");
|
||||
}
|
||||
}
|
||||
|
||||
BasePath = newDir;
|
||||
Valid = Directory.Exists(newDir.FullName);
|
||||
if (Penumbra.Config.ModDirectory != BasePath.FullName)
|
||||
{
|
||||
ModDirectoryChanged.Invoke(BasePath.FullName, Valid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void OnModDirectoryChange(string newPath, bool _)
|
||||
{
|
||||
|
|
@ -97,11 +87,9 @@ public sealed partial class Mod
|
|||
var queue = new ConcurrentQueue<Mod>();
|
||||
Parallel.ForEach(BasePath.EnumerateDirectories(), options, dir =>
|
||||
{
|
||||
var mod = LoadMod( this, dir, false );
|
||||
var mod = Mod.LoadMod(this, dir, false);
|
||||
if (mod != null)
|
||||
{
|
||||
queue.Enqueue(mod);
|
||||
}
|
||||
});
|
||||
|
||||
foreach (var mod in queue)
|
||||
|
|
@ -115,19 +103,15 @@ public sealed partial class Mod
|
|||
Penumbra.Log.Information("Rediscovered mods.");
|
||||
|
||||
if (MigrateModBackups)
|
||||
{
|
||||
ModBackup.MigrateZipToPmp(this);
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateExportDirectory(string newDirectory, bool change)
|
||||
{
|
||||
if (newDirectory.Length == 0)
|
||||
{
|
||||
if (_exportDirectory == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_exportDirectory = null;
|
||||
_config.ExportDirectory = string.Empty;
|
||||
|
|
@ -137,12 +121,9 @@ public sealed partial class Mod
|
|||
|
||||
var dir = new DirectoryInfo(newDirectory);
|
||||
if (dir.FullName.Equals(_exportDirectory?.FullName, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!dir.Exists)
|
||||
{
|
||||
try
|
||||
{
|
||||
Directory.CreateDirectory(dir.FullName);
|
||||
|
|
@ -152,15 +133,10 @@ public sealed partial class Mod
|
|||
Penumbra.Log.Error($"Could not create Export Directory:\n{e}");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (change)
|
||||
{
|
||||
foreach (var mod in _mods)
|
||||
{
|
||||
new ModBackup(this, mod).Move(dir.FullName);
|
||||
}
|
||||
}
|
||||
|
||||
_exportDirectory = dir;
|
||||
|
||||
|
|
@ -171,4 +147,3 @@ public sealed partial class Mod
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -7,9 +7,7 @@ using Penumbra.Util;
|
|||
|
||||
namespace Penumbra.Mods;
|
||||
|
||||
public sealed partial class Mod
|
||||
{
|
||||
public sealed partial class Manager : IReadOnlyList<Mod>
|
||||
public sealed partial class ModManager : IReadOnlyList<Mod>
|
||||
{
|
||||
// Set when reading Config and migrating from v4 to v5.
|
||||
public static bool MigrateModBackups = false;
|
||||
|
|
@ -41,7 +39,7 @@ public sealed partial class Mod
|
|||
private readonly CommunicatorService _communicator;
|
||||
public readonly ModDataEditor DataEditor;
|
||||
|
||||
public Manager(StartTracker time, Configuration config, CommunicatorService communicator, ModDataEditor dataEditor)
|
||||
public ModManager(StartTracker time, Configuration config, CommunicatorService communicator, ModDataEditor dataEditor)
|
||||
{
|
||||
using var timer = time.Measure(StartTimeType.Mods);
|
||||
_config = config;
|
||||
|
|
@ -76,4 +74,3 @@ public sealed partial class Mod
|
|||
return mod != null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ using System;
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
using Dalamud.Utility;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OtterGui.Classes;
|
||||
using Penumbra.Services;
|
||||
|
|
|
|||
|
|
@ -15,10 +15,10 @@ public enum ModPathChangeType
|
|||
|
||||
public partial class Mod
|
||||
{
|
||||
public DirectoryInfo ModPath { get; private set; }
|
||||
public DirectoryInfo ModPath { get; internal set; }
|
||||
public string Identifier
|
||||
=> Index >= 0 ? ModPath.Name : Name;
|
||||
public int Index { get; private set; } = -1;
|
||||
public int Index { get; internal set; } = -1;
|
||||
|
||||
public bool IsTemporary
|
||||
=> Index < 0;
|
||||
|
|
@ -33,7 +33,7 @@ public partial class Mod
|
|||
_default = new SubMod( this );
|
||||
}
|
||||
|
||||
private static Mod? LoadMod( Manager modManager, DirectoryInfo modPath, bool incorporateMetaChanges )
|
||||
public static Mod? LoadMod( ModManager modManager, DirectoryInfo modPath, bool incorporateMetaChanges )
|
||||
{
|
||||
modPath.Refresh();
|
||||
if( !modPath.Exists )
|
||||
|
|
@ -52,7 +52,7 @@ public partial class Mod
|
|||
|
||||
}
|
||||
|
||||
internal bool Reload(Manager modManager, bool incorporateMetaChanges, out ModDataChangeType modDataChange )
|
||||
internal bool Reload(ModManager modManager, bool incorporateMetaChanges, out ModDataChangeType modDataChange )
|
||||
{
|
||||
modDataChange = ModDataChangeType.Deletion;
|
||||
ModPath.Refresh();
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ public sealed partial class Mod
|
|||
public SortedList< string, object? > ChangedItems { get; } = new();
|
||||
public string LowerChangedItemsString { get; private set; } = string.Empty;
|
||||
|
||||
private void ComputeChangedItems()
|
||||
internal void ComputeChangedItems()
|
||||
{
|
||||
ChangedItems.Clear();
|
||||
foreach( var gamePath in AllRedirects )
|
||||
|
|
|
|||
|
|
@ -18,15 +18,15 @@ public partial class Mod
|
|||
public IReadOnlyList< IModGroup > Groups
|
||||
=> _groups;
|
||||
|
||||
private readonly SubMod _default;
|
||||
private readonly List< IModGroup > _groups = new();
|
||||
internal readonly SubMod _default;
|
||||
internal readonly List< IModGroup > _groups = new();
|
||||
|
||||
public int TotalFileCount { get; private set; }
|
||||
public int TotalSwapCount { get; private set; }
|
||||
public int TotalManipulations { get; private set; }
|
||||
public bool HasOptions { get; private set; }
|
||||
public int TotalFileCount { get; internal set; }
|
||||
public int TotalSwapCount { get; internal set; }
|
||||
public int TotalManipulations { get; internal set; }
|
||||
public bool HasOptions { get; internal set; }
|
||||
|
||||
private bool SetCounts()
|
||||
internal bool SetCounts()
|
||||
{
|
||||
TotalFileCount = 0;
|
||||
TotalSwapCount = 0;
|
||||
|
|
@ -120,7 +120,7 @@ public partial class Mod
|
|||
|
||||
// Delete all existing group files and save them anew.
|
||||
// Used when indices change in complex ways.
|
||||
private void SaveAllGroups()
|
||||
internal void SaveAllGroups()
|
||||
{
|
||||
foreach( var file in GroupFiles )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -12,12 +12,12 @@ namespace Penumbra.Mods;
|
|||
|
||||
public sealed class ModFileSystem : FileSystem<Mod>, IDisposable, ISavable
|
||||
{
|
||||
private readonly Mod.Manager _modManager;
|
||||
private readonly ModManager _modManager;
|
||||
private readonly CommunicatorService _communicator;
|
||||
private readonly FilenameService _files;
|
||||
|
||||
// Create a new ModFileSystem from the currently loaded mods and the current sort order file.
|
||||
public ModFileSystem(Mod.Manager modManager, CommunicatorService communicator, FilenameService files)
|
||||
public ModFileSystem(ModManager modManager, CommunicatorService communicator, FilenameService files)
|
||||
{
|
||||
_modManager = modManager;
|
||||
_communicator = communicator;
|
||||
|
|
|
|||
|
|
@ -15,8 +15,11 @@ namespace Penumbra.Mods;
|
|||
|
||||
public partial class Mod
|
||||
{
|
||||
// Groups that allow all available options to be selected at once.
|
||||
private sealed class MultiModGroup : IModGroup
|
||||
|
||||
}
|
||||
|
||||
/// <summary> Groups that allow all available options to be selected at once. </summary>
|
||||
public sealed class MultiModGroup : IModGroup
|
||||
{
|
||||
public GroupType Type
|
||||
=> GroupType.Multi;
|
||||
|
|
@ -114,4 +117,3 @@ public partial class Mod
|
|||
o.SetPosition(o.GroupIdx, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,10 +10,8 @@ using Penumbra.Api.Enums;
|
|||
|
||||
namespace Penumbra.Mods;
|
||||
|
||||
public partial class Mod
|
||||
{
|
||||
// Groups that allow only one of their available options to be selected.
|
||||
private sealed class SingleModGroup : IModGroup
|
||||
/// <summary> Groups that allow only one of their available options to be selected. </summary>
|
||||
public sealed class SingleModGroup : IModGroup
|
||||
{
|
||||
public GroupType Type
|
||||
=> GroupType.Single;
|
||||
|
|
@ -128,4 +126,3 @@ public partial class Mod
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -36,7 +36,7 @@ public partial class Mod
|
|||
ISubMod.WriteSubMod( j, serializer, _default, ModPath, 0 );
|
||||
}
|
||||
|
||||
private void SaveDefaultModDelayed()
|
||||
internal void SaveDefaultModDelayed()
|
||||
=> Penumbra.Framework.RegisterDelayed( nameof( SaveDefaultMod ) + ModPath.Name, SaveDefaultMod );
|
||||
|
||||
private void LoadDefaultOption()
|
||||
|
|
@ -92,14 +92,19 @@ public partial class Mod
|
|||
}
|
||||
|
||||
|
||||
// A sub mod is a collection of
|
||||
// - file replacements
|
||||
// - file swaps
|
||||
// - meta manipulations
|
||||
// that can be used either as an option or as the default data for a mod.
|
||||
// It can be loaded and reloaded from Json.
|
||||
// Nothing is checked for existence or validity when loading.
|
||||
// Objects are also not checked for uniqueness, the first appearance of a game path or meta path decides.
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A sub mod is a collection of
|
||||
/// - file replacements
|
||||
/// - file swaps
|
||||
/// - meta manipulations
|
||||
/// that can be used either as an option or as the default data for a mod.
|
||||
/// It can be loaded and reloaded from Json.
|
||||
/// Nothing is checked for existence or validity when loading.
|
||||
/// Objects are also not checked for uniqueness, the first appearance of a game path or meta path decides.
|
||||
/// </summary>
|
||||
public sealed class SubMod : ISubMod
|
||||
{
|
||||
public string Name { get; set; } = "Default";
|
||||
|
|
@ -321,4 +326,3 @@ public partial class Mod
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -10,7 +10,7 @@ using Penumbra.String.Classes;
|
|||
|
||||
namespace Penumbra.Mods;
|
||||
|
||||
// Contains the settings for a given mod.
|
||||
/// <summary> Contains the settings for a given mod. </summary>
|
||||
public class ModSettings
|
||||
{
|
||||
public static readonly ModSettings Empty = new();
|
||||
|
|
|
|||
|
|
@ -27,10 +27,10 @@ public class TemporaryMod : IMod
|
|||
public IEnumerable< ISubMod > AllSubMods
|
||||
=> new[] { Default };
|
||||
|
||||
private readonly Mod.SubMod _default;
|
||||
private readonly SubMod _default;
|
||||
|
||||
public TemporaryMod()
|
||||
=> _default = new Mod.SubMod( this );
|
||||
=> _default = new SubMod( this );
|
||||
|
||||
public void SetFile( Utf8GamePath gamePath, FullPath fullPath )
|
||||
=> _default.FileData[ gamePath ] = fullPath;
|
||||
|
|
@ -44,7 +44,7 @@ public class TemporaryMod : IMod
|
|||
_default.ManipulationData = manips;
|
||||
}
|
||||
|
||||
public static void SaveTempCollection( Mod.Manager modManager, ModCollection collection, string? character = null )
|
||||
public static void SaveTempCollection( ModManager modManager, ModCollection collection, string? character = null )
|
||||
{
|
||||
DirectoryInfo? dir = null;
|
||||
try
|
||||
|
|
@ -54,7 +54,7 @@ public class TemporaryMod : IMod
|
|||
modManager.DataEditor.CreateMeta( dir, collection.Name, character ?? Penumbra.Config.DefaultModAuthor,
|
||||
$"Mod generated from temporary collection {collection.Name} for {character ?? "Unknown Character"}.", null, null );
|
||||
var mod = new Mod( dir );
|
||||
var defaultMod = (Mod.SubMod) mod.Default;
|
||||
var defaultMod = (SubMod) mod.Default;
|
||||
foreach( var (gamePath, fullPath) in collection.ResolvedFiles )
|
||||
{
|
||||
if( gamePath.Path.EndsWith( ".imc"u8 ) )
|
||||
|
|
|
|||
|
|
@ -47,8 +47,8 @@ public class Penumbra : IDalamudPlugin
|
|||
public static CharacterUtility CharacterUtility { get; private set; } = null!;
|
||||
public static GameEventManager GameEvents { get; private set; } = null!;
|
||||
public static MetaFileManager MetaFileManager { get; private set; } = null!;
|
||||
public static Mod.Manager ModManager { get; private set; } = null!;
|
||||
public static ModCollection.Manager CollectionManager { get; private set; } = null!;
|
||||
public static ModManager ModManager { get; private set; } = null!;
|
||||
public static CollectionManager CollectionManager { get; private set; } = null!;
|
||||
public static TempCollectionManager TempCollections { get; private set; } = null!;
|
||||
public static TempModManager TempMods { get; private set; } = null!;
|
||||
public static ResourceLoader ResourceLoader { get; private set; } = null!;
|
||||
|
|
@ -96,8 +96,8 @@ public class Penumbra : IDalamudPlugin
|
|||
TempMods = _tmp.Services.GetRequiredService<TempModManager>();
|
||||
ResidentResources = _tmp.Services.GetRequiredService<ResidentResourceManager>();
|
||||
_tmp.Services.GetRequiredService<ResourceManagerService>();
|
||||
ModManager = _tmp.Services.GetRequiredService<Mod.Manager>();
|
||||
CollectionManager = _tmp.Services.GetRequiredService<ModCollection.Manager>();
|
||||
ModManager = _tmp.Services.GetRequiredService<ModManager>();
|
||||
CollectionManager = _tmp.Services.GetRequiredService<CollectionManager>();
|
||||
TempCollections = _tmp.Services.GetRequiredService<TempCollectionManager>();
|
||||
ModFileSystem = _tmp.Services.GetRequiredService<ModFileSystem>();
|
||||
RedrawService = _tmp.Services.GetRequiredService<RedrawService>();
|
||||
|
|
|
|||
|
|
@ -88,12 +88,12 @@ public class PenumbraNew
|
|||
// Add Collection Services
|
||||
services.AddTransient<IndividualCollections>()
|
||||
.AddSingleton<TempCollectionManager>()
|
||||
.AddSingleton<ModCollection.Manager>();
|
||||
.AddSingleton<CollectionManager>();
|
||||
|
||||
// Add Mod Services
|
||||
services.AddSingleton<TempModManager>()
|
||||
.AddSingleton<ModDataEditor>()
|
||||
.AddSingleton<Mod.Manager>()
|
||||
.AddSingleton<ModManager>()
|
||||
.AddSingleton<ModFileSystem>();
|
||||
|
||||
// Add Resource services
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ public class ConfigMigrationService
|
|||
if (_config.Version != 6)
|
||||
return;
|
||||
|
||||
ModCollection.Manager.MigrateUngenderedCollections(_fileNames);
|
||||
CollectionManager.MigrateUngenderedCollections(_fileNames);
|
||||
_config.Version = 7;
|
||||
}
|
||||
|
||||
|
|
@ -113,7 +113,7 @@ public class ConfigMigrationService
|
|||
if (_config.Version != 4)
|
||||
return;
|
||||
|
||||
Mod.Manager.MigrateModBackups = true;
|
||||
ModManager.MigrateModBackups = true;
|
||||
_config.Version = 5;
|
||||
}
|
||||
|
||||
|
|
@ -257,11 +257,11 @@ public class ConfigMigrationService
|
|||
using var j = new JsonTextWriter(writer);
|
||||
j.Formatting = Formatting.Indented;
|
||||
j.WriteStartObject();
|
||||
j.WritePropertyName(nameof(ModCollection.Manager.Default));
|
||||
j.WritePropertyName(nameof(CollectionManager.Default));
|
||||
j.WriteValue(def);
|
||||
j.WritePropertyName(nameof(ModCollection.Manager.Interface));
|
||||
j.WritePropertyName(nameof(CollectionManager.Interface));
|
||||
j.WriteValue(ui);
|
||||
j.WritePropertyName(nameof(ModCollection.Manager.Current));
|
||||
j.WritePropertyName(nameof(CollectionManager.Current));
|
||||
j.WriteValue(current);
|
||||
foreach (var (type, collection) in special)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -25,12 +25,12 @@ public class ItemSwapTab : IDisposable, ITab
|
|||
{
|
||||
private readonly CommunicatorService _communicator;
|
||||
private readonly ItemService _itemService;
|
||||
private readonly ModCollection.Manager _collectionManager;
|
||||
private readonly Mod.Manager _modManager;
|
||||
private readonly CollectionManager _collectionManager;
|
||||
private readonly ModManager _modManager;
|
||||
private readonly Configuration _config;
|
||||
|
||||
public ItemSwapTab(CommunicatorService communicator, ItemService itemService, ModCollection.Manager collectionManager,
|
||||
Mod.Manager modManager, Configuration config)
|
||||
public ItemSwapTab(CommunicatorService communicator, ItemService itemService, CollectionManager collectionManager,
|
||||
ModManager modManager, Configuration config)
|
||||
{
|
||||
_communicator = communicator;
|
||||
_itemService = itemService;
|
||||
|
|
|
|||
|
|
@ -297,7 +297,7 @@ public partial class ModEditWindow
|
|||
var tt = changes ? "Apply the current file setup to the currently selected option." : "No changes made.";
|
||||
if (ImGuiUtil.DrawDisabledButton("Apply Changes", Vector2.Zero, tt, !changes))
|
||||
{
|
||||
var failedFiles = _editor.FileEditor.Apply(_editor.Mod!, (Mod.SubMod)_editor.Option!);
|
||||
var failedFiles = _editor.FileEditor.Apply(_editor.Mod!, (SubMod)_editor.Option!);
|
||||
if (failedFiles > 0)
|
||||
Penumbra.Log.Information($"Failed to apply {failedFiles} file redirections to {_editor.Option!.FullName}.");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ public partial class ModEditWindow
|
|||
_editor.FileEditor.Revert(_editor.Mod!, _editor.Option!);
|
||||
var fileRegistry = _editor.Files.Available.First(file => file.File.FullName == _targetPath);
|
||||
_editor.FileEditor.AddPathsToSelected(_editor.Option!, new []{ fileRegistry }, _subDirs);
|
||||
_editor.FileEditor.Apply(_editor.Mod!, (Mod.SubMod) _editor.Option!);
|
||||
_editor.FileEditor.Apply(_editor.Mod!, (SubMod) _editor.Option!);
|
||||
|
||||
return fileRegistry;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ namespace Penumbra.UI.CollectionTab;
|
|||
|
||||
public sealed class CollectionSelector : FilterComboCache<ModCollection>
|
||||
{
|
||||
private readonly ModCollection.Manager _collectionManager;
|
||||
private readonly CollectionManager _collectionManager;
|
||||
|
||||
public CollectionSelector(ModCollection.Manager manager, Func<IReadOnlyList<ModCollection>> items)
|
||||
public CollectionSelector(CollectionManager manager, Func<IReadOnlyList<ModCollection>> items)
|
||||
: base(items)
|
||||
=> _collectionManager = manager;
|
||||
|
||||
|
|
|
|||
|
|
@ -16,10 +16,10 @@ namespace Penumbra.UI.CollectionTab;
|
|||
public class IndividualCollectionUi
|
||||
{
|
||||
private readonly ActorService _actorService;
|
||||
private readonly ModCollection.Manager _collectionManager;
|
||||
private readonly CollectionManager _collectionManager;
|
||||
private readonly CollectionSelector _withEmpty;
|
||||
|
||||
public IndividualCollectionUi(ActorService actors, ModCollection.Manager collectionManager, CollectionSelector withEmpty)
|
||||
public IndividualCollectionUi(ActorService actors, CollectionManager collectionManager, CollectionSelector withEmpty)
|
||||
{
|
||||
_actorService = actors;
|
||||
_collectionManager = collectionManager;
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@ public class InheritanceUi
|
|||
private const int InheritedCollectionHeight = 9;
|
||||
private const string InheritanceDragDropLabel = "##InheritanceMove";
|
||||
|
||||
private readonly ModCollection.Manager _collectionManager;
|
||||
private readonly CollectionManager _collectionManager;
|
||||
|
||||
public InheritanceUi(ModCollection.Manager collectionManager)
|
||||
public InheritanceUi(CollectionManager collectionManager)
|
||||
=> _collectionManager = collectionManager;
|
||||
|
||||
/// <summary> Draw the whole inheritance block. </summary>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ namespace Penumbra.UI.CollectionTab;
|
|||
|
||||
public sealed class SpecialCombo : FilterComboBase<(CollectionType, string, string)>
|
||||
{
|
||||
private readonly ModCollection.Manager _collectionManager;
|
||||
private readonly CollectionManager _collectionManager;
|
||||
|
||||
public (CollectionType, string, string)? CurrentType
|
||||
=> CollectionTypeExtensions.Special[CurrentIdx];
|
||||
|
|
@ -16,7 +16,7 @@ public sealed class SpecialCombo : FilterComboBase<(CollectionType, string, stri
|
|||
private readonly float _unscaledWidth;
|
||||
private readonly string _label;
|
||||
|
||||
public SpecialCombo(ModCollection.Manager collectionManager, string label, float unscaledWidth)
|
||||
public SpecialCombo(CollectionManager collectionManager, string label, float unscaledWidth)
|
||||
: base(CollectionTypeExtensions.Special, false)
|
||||
{
|
||||
_collectionManager = collectionManager;
|
||||
|
|
|
|||
|
|
@ -14,12 +14,12 @@ namespace Penumbra.UI;
|
|||
|
||||
public class FileDialogService : IDisposable
|
||||
{
|
||||
private readonly Mod.Manager _mods;
|
||||
private readonly ModManager _mods;
|
||||
private readonly FileDialogManager _manager;
|
||||
private readonly ConcurrentDictionary<string, string> _startPaths = new();
|
||||
private bool _isOpen;
|
||||
|
||||
public FileDialogService(Mod.Manager mods, Configuration config)
|
||||
public FileDialogService(ModManager mods, Configuration config)
|
||||
{
|
||||
_mods = mods;
|
||||
_manager = SetupFileManager(config.ModDirectory);
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ public sealed partial class ModFileSystemSelector : FileSystemSelector<Mod, ModF
|
|||
private readonly ChatService _chat;
|
||||
private readonly Configuration _config;
|
||||
private readonly FileDialogService _fileDialog;
|
||||
private readonly Mod.Manager _modManager;
|
||||
private readonly ModCollection.Manager _collectionManager;
|
||||
private readonly ModManager _modManager;
|
||||
private readonly CollectionManager _collectionManager;
|
||||
private readonly TutorialService _tutorial;
|
||||
private readonly ModEditor _modEditor;
|
||||
|
||||
|
|
@ -38,8 +38,8 @@ public sealed partial class ModFileSystemSelector : FileSystemSelector<Mod, ModF
|
|||
public ModSettings SelectedSettings { get; private set; } = ModSettings.Empty;
|
||||
public ModCollection SelectedSettingCollection { get; private set; } = ModCollection.Empty;
|
||||
|
||||
public ModFileSystemSelector(CommunicatorService communicator, ModFileSystem fileSystem, Mod.Manager modManager,
|
||||
ModCollection.Manager collectionManager, Configuration config, TutorialService tutorial, FileDialogService fileDialog, ChatService chat,
|
||||
public ModFileSystemSelector(CommunicatorService communicator, ModFileSystem fileSystem, ModManager modManager,
|
||||
CollectionManager collectionManager, Configuration config, TutorialService tutorial, FileDialogService fileDialog, ChatService chat,
|
||||
ModEditor modEditor)
|
||||
: base(fileSystem, DalamudServices.KeyState, HandleException)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@ namespace Penumbra.UI.ModsTab;
|
|||
public class ModPanelConflictsTab : ITab
|
||||
{
|
||||
private readonly ModFileSystemSelector _selector;
|
||||
private readonly ModCollection.Manager _collectionManager;
|
||||
private readonly CollectionManager _collectionManager;
|
||||
|
||||
public ModPanelConflictsTab(ModCollection.Manager collectionManager, ModFileSystemSelector selector)
|
||||
public ModPanelConflictsTab(CollectionManager collectionManager, ModFileSystemSelector selector)
|
||||
{
|
||||
_collectionManager = collectionManager;
|
||||
_selector = selector;
|
||||
|
|
|
|||
|
|
@ -13,11 +13,11 @@ public class ModPanelDescriptionTab : ITab
|
|||
{
|
||||
private readonly ModFileSystemSelector _selector;
|
||||
private readonly TutorialService _tutorial;
|
||||
private readonly Mod.Manager _modManager;
|
||||
private readonly ModManager _modManager;
|
||||
private readonly TagButtons _localTags = new();
|
||||
private readonly TagButtons _modTags = new();
|
||||
|
||||
public ModPanelDescriptionTab(ModFileSystemSelector selector, TutorialService tutorial, Mod.Manager modManager)
|
||||
public ModPanelDescriptionTab(ModFileSystemSelector selector, TutorialService tutorial, ModManager modManager)
|
||||
{
|
||||
_selector = selector;
|
||||
_tutorial = tutorial;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ namespace Penumbra.UI.ModsTab;
|
|||
public class ModPanelEditTab : ITab
|
||||
{
|
||||
private readonly ChatService _chat;
|
||||
private readonly Mod.Manager _modManager;
|
||||
private readonly ModManager _modManager;
|
||||
private readonly ModFileSystem _fileSystem;
|
||||
private readonly ModFileSystemSelector _selector;
|
||||
private readonly ModEditWindow _editWindow;
|
||||
|
|
@ -33,7 +33,7 @@ public class ModPanelEditTab : ITab
|
|||
private ModFileSystem.Leaf _leaf = null!;
|
||||
private Mod _mod = null!;
|
||||
|
||||
public ModPanelEditTab(Mod.Manager modManager, ModFileSystemSelector selector, ModFileSystem fileSystem, ChatService chat,
|
||||
public ModPanelEditTab(ModManager modManager, ModFileSystemSelector selector, ModFileSystem fileSystem, ChatService chat,
|
||||
ModEditWindow editWindow, ModEditor editor)
|
||||
{
|
||||
_modManager = modManager;
|
||||
|
|
@ -219,7 +219,7 @@ public class ModPanelEditTab : ITab
|
|||
public static void Reset()
|
||||
=> _newGroupName = string.Empty;
|
||||
|
||||
public static void Draw(Mod.Manager modManager, Mod mod)
|
||||
public static void Draw(ModManager modManager, Mod mod)
|
||||
{
|
||||
using var spacing = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, new Vector2(UiHelpers.ScaleX3));
|
||||
ImGui.SetNextItemWidth(UiHelpers.InputTextMinusButton3);
|
||||
|
|
@ -250,15 +250,15 @@ public class ModPanelEditTab : ITab
|
|||
private static class MoveDirectory
|
||||
{
|
||||
private static string? _currentModDirectory;
|
||||
private static Mod.Manager.NewDirectoryState _state = Mod.Manager.NewDirectoryState.Identical;
|
||||
private static ModManager.NewDirectoryState _state = ModManager.NewDirectoryState.Identical;
|
||||
|
||||
public static void Reset()
|
||||
{
|
||||
_currentModDirectory = null;
|
||||
_state = Mod.Manager.NewDirectoryState.Identical;
|
||||
_state = ModManager.NewDirectoryState.Identical;
|
||||
}
|
||||
|
||||
public static void Draw(Mod.Manager modManager, Mod mod, Vector2 buttonSize)
|
||||
public static void Draw(ModManager modManager, Mod mod, Vector2 buttonSize)
|
||||
{
|
||||
ImGui.SetNextItemWidth(buttonSize.X * 2 + ImGui.GetStyle().ItemSpacing.X);
|
||||
var tmp = _currentModDirectory ?? mod.ModPath.Name;
|
||||
|
|
@ -270,13 +270,13 @@ public class ModPanelEditTab : ITab
|
|||
|
||||
var (disabled, tt) = _state switch
|
||||
{
|
||||
Mod.Manager.NewDirectoryState.Identical => (true, "Current directory name is identical to new one."),
|
||||
Mod.Manager.NewDirectoryState.Empty => (true, "Please enter a new directory name first."),
|
||||
Mod.Manager.NewDirectoryState.NonExisting => (false, $"Move mod from {mod.ModPath.Name} to {_currentModDirectory}."),
|
||||
Mod.Manager.NewDirectoryState.ExistsEmpty => (false, $"Move mod from {mod.ModPath.Name} to {_currentModDirectory}."),
|
||||
Mod.Manager.NewDirectoryState.ExistsNonEmpty => (true, $"{_currentModDirectory} already exists and is not empty."),
|
||||
Mod.Manager.NewDirectoryState.ExistsAsFile => (true, $"{_currentModDirectory} exists as a file."),
|
||||
Mod.Manager.NewDirectoryState.ContainsInvalidSymbols => (true,
|
||||
ModManager.NewDirectoryState.Identical => (true, "Current directory name is identical to new one."),
|
||||
ModManager.NewDirectoryState.Empty => (true, "Please enter a new directory name first."),
|
||||
ModManager.NewDirectoryState.NonExisting => (false, $"Move mod from {mod.ModPath.Name} to {_currentModDirectory}."),
|
||||
ModManager.NewDirectoryState.ExistsEmpty => (false, $"Move mod from {mod.ModPath.Name} to {_currentModDirectory}."),
|
||||
ModManager.NewDirectoryState.ExistsNonEmpty => (true, $"{_currentModDirectory} already exists and is not empty."),
|
||||
ModManager.NewDirectoryState.ExistsAsFile => (true, $"{_currentModDirectory} exists as a file."),
|
||||
ModManager.NewDirectoryState.ContainsInvalidSymbols => (true,
|
||||
$"{_currentModDirectory} contains invalid symbols for FFXIV."),
|
||||
_ => (true, "Unknown error."),
|
||||
};
|
||||
|
|
@ -317,7 +317,7 @@ public class ModPanelEditTab : ITab
|
|||
ImGui.OpenPopup(PopupName);
|
||||
}
|
||||
|
||||
public static void DrawPopup(Mod.Manager modManager)
|
||||
public static void DrawPopup(ModManager modManager)
|
||||
{
|
||||
if (_mod == null)
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -18,11 +18,11 @@ namespace Penumbra.UI.ModsTab;
|
|||
public class ModPanelSettingsTab : ITab
|
||||
{
|
||||
private readonly Configuration _config;
|
||||
private readonly ModCollection.Manager _collectionManager;
|
||||
private readonly CollectionManager _collectionManager;
|
||||
private readonly ModFileSystemSelector _selector;
|
||||
private readonly TutorialService _tutorial;
|
||||
private readonly PenumbraApi _api;
|
||||
private readonly Mod.Manager _modManager;
|
||||
private readonly ModManager _modManager;
|
||||
|
||||
private bool _inherited;
|
||||
private ModSettings _settings = null!;
|
||||
|
|
@ -30,7 +30,7 @@ public class ModPanelSettingsTab : ITab
|
|||
private bool _empty;
|
||||
private int? _currentPriority = null;
|
||||
|
||||
public ModPanelSettingsTab(ModCollection.Manager collectionManager, Mod.Manager modManager, ModFileSystemSelector selector,
|
||||
public ModPanelSettingsTab(CollectionManager collectionManager, ModManager modManager, ModFileSystemSelector selector,
|
||||
TutorialService tutorial, PenumbraApi api, Configuration config)
|
||||
{
|
||||
_collectionManager = collectionManager;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public class ModPanelTabBar
|
|||
public readonly ModPanelChangedItemsTab ChangedItems;
|
||||
public readonly ModPanelEditTab Edit;
|
||||
private readonly ModEditWindow _modEditWindow;
|
||||
private readonly Mod.Manager _modManager;
|
||||
private readonly ModManager _modManager;
|
||||
private readonly TutorialService _tutorial;
|
||||
|
||||
public readonly ITab[] Tabs;
|
||||
|
|
@ -35,7 +35,7 @@ public class ModPanelTabBar
|
|||
private Mod? _lastMod = null;
|
||||
|
||||
public ModPanelTabBar(ModEditWindow modEditWindow, ModPanelSettingsTab settings, ModPanelDescriptionTab description,
|
||||
ModPanelConflictsTab conflicts, ModPanelChangedItemsTab changedItems, ModPanelEditTab edit, Mod.Manager modManager,
|
||||
ModPanelConflictsTab conflicts, ModPanelChangedItemsTab changedItems, ModPanelEditTab edit, ModManager modManager,
|
||||
TutorialService tutorial)
|
||||
{
|
||||
_modEditWindow = modEditWindow;
|
||||
|
|
@ -107,7 +107,7 @@ public class ModPanelTabBar
|
|||
if (ImGui.TabItemButton("Advanced Editing", ImGuiTabItemFlags.Trailing | ImGuiTabItemFlags.NoTooltip))
|
||||
{
|
||||
_modEditWindow.ChangeMod(mod);
|
||||
_modEditWindow.ChangeOption((Mod.SubMod) mod.Default);
|
||||
_modEditWindow.ChangeOption((SubMod) mod.Default);
|
||||
_modEditWindow.IsOpen = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,10 +16,10 @@ namespace Penumbra.UI.Tabs;
|
|||
|
||||
public class ChangedItemsTab : ITab
|
||||
{
|
||||
private readonly ModCollection.Manager _collectionManager;
|
||||
private readonly CollectionManager _collectionManager;
|
||||
private readonly PenumbraApi _api;
|
||||
|
||||
public ChangedItemsTab(ModCollection.Manager collectionManager, PenumbraApi api)
|
||||
public ChangedItemsTab(CollectionManager collectionManager, PenumbraApi api)
|
||||
{
|
||||
_collectionManager = collectionManager;
|
||||
_api = api;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ public class CollectionsTab : IDisposable, ITab
|
|||
{
|
||||
private readonly CommunicatorService _communicator;
|
||||
private readonly Configuration _config;
|
||||
private readonly ModCollection.Manager _collectionManager;
|
||||
private readonly CollectionManager _collectionManager;
|
||||
private readonly TutorialService _tutorial;
|
||||
private readonly SpecialCombo _specialCollectionCombo;
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ public class CollectionsTab : IDisposable, ITab
|
|||
private readonly InheritanceUi _inheritance;
|
||||
private readonly IndividualCollectionUi _individualCollections;
|
||||
|
||||
public CollectionsTab(ActorService actorService, CommunicatorService communicator, ModCollection.Manager collectionManager,
|
||||
public CollectionsTab(ActorService actorService, CommunicatorService communicator, CollectionManager collectionManager,
|
||||
TutorialService tutorial, Configuration config)
|
||||
{
|
||||
_communicator = communicator;
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@ public class DebugTab : ITab
|
|||
private readonly StartTracker _timer;
|
||||
private readonly PerformanceTracker _performance;
|
||||
private readonly Configuration _config;
|
||||
private readonly ModCollection.Manager _collectionManager;
|
||||
private readonly Mod.Manager _modManager;
|
||||
private readonly CollectionManager _collectionManager;
|
||||
private readonly ModManager _modManager;
|
||||
private readonly ValidityChecker _validityChecker;
|
||||
private readonly HttpApi _httpApi;
|
||||
private readonly ActorService _actorService;
|
||||
|
|
@ -52,8 +52,8 @@ public class DebugTab : ITab
|
|||
private readonly IdentifiedCollectionCache _identifiedCollectionCache;
|
||||
private readonly CutsceneService _cutsceneService;
|
||||
|
||||
public DebugTab(StartTracker timer, PerformanceTracker performance, Configuration config, ModCollection.Manager collectionManager,
|
||||
ValidityChecker validityChecker, Mod.Manager modManager, HttpApi httpApi, ActorService actorService,
|
||||
public DebugTab(StartTracker timer, PerformanceTracker performance, Configuration config, CollectionManager collectionManager,
|
||||
ValidityChecker validityChecker, ModManager modManager, HttpApi httpApi, ActorService actorService,
|
||||
DalamudServices dalamud, StainService stains, CharacterUtility characterUtility, ResidentResourceManager residentResources,
|
||||
ResourceManagerService resourceManager, PenumbraIpcProviders ipc, CollectionResolver collectionResolver,
|
||||
DrawObjectState drawObjectState, PathState pathState, SubfileHelper subfileHelper, IdentifiedCollectionCache identifiedCollectionCache,
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@ namespace Penumbra.UI.Tabs;
|
|||
|
||||
public class EffectiveTab : ITab
|
||||
{
|
||||
private readonly ModCollection.Manager _collectionManager;
|
||||
private readonly CollectionManager _collectionManager;
|
||||
|
||||
public EffectiveTab(ModCollection.Manager collectionManager)
|
||||
public EffectiveTab(CollectionManager collectionManager)
|
||||
=> _collectionManager = collectionManager;
|
||||
|
||||
public ReadOnlySpan<byte> Label
|
||||
|
|
|
|||
|
|
@ -23,13 +23,13 @@ public class ModsTab : ITab
|
|||
private readonly ModFileSystemSelector _selector;
|
||||
private readonly ModPanel _panel;
|
||||
private readonly TutorialService _tutorial;
|
||||
private readonly Mod.Manager _modManager;
|
||||
private readonly ModCollection.Manager _collectionManager;
|
||||
private readonly ModManager _modManager;
|
||||
private readonly CollectionManager _collectionManager;
|
||||
private readonly RedrawService _redrawService;
|
||||
private readonly Configuration _config;
|
||||
private readonly CollectionsTab _collectionsTab;
|
||||
|
||||
public ModsTab(Mod.Manager modManager, ModCollection.Manager collectionManager, ModFileSystemSelector selector, ModPanel panel,
|
||||
public ModsTab(ModManager modManager, CollectionManager collectionManager, ModFileSystemSelector selector, ModPanel panel,
|
||||
TutorialService tutorial, RedrawService redrawService, Configuration config, CollectionsTab collectionsTab)
|
||||
{
|
||||
_modManager = modManager;
|
||||
|
|
|
|||
|
|
@ -31,14 +31,14 @@ public class SettingsTab : ITab
|
|||
private readonly TutorialService _tutorial;
|
||||
private readonly Penumbra _penumbra;
|
||||
private readonly FileDialogService _fileDialog;
|
||||
private readonly Mod.Manager _modManager;
|
||||
private readonly ModManager _modManager;
|
||||
private readonly ModFileSystemSelector _selector;
|
||||
private readonly CharacterUtility _characterUtility;
|
||||
private readonly ResidentResourceManager _residentResources;
|
||||
private readonly DalamudServices _dalamud;
|
||||
|
||||
public SettingsTab(Configuration config, FontReloader fontReloader, TutorialService tutorial, Penumbra penumbra,
|
||||
FileDialogService fileDialog, Mod.Manager modManager, ModFileSystemSelector selector, CharacterUtility characterUtility,
|
||||
FileDialogService fileDialog, ModManager modManager, ModFileSystemSelector selector, CharacterUtility characterUtility,
|
||||
ResidentResourceManager residentResources, DalamudServices dalamud)
|
||||
{
|
||||
_config = config;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue