mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Make everything services.
This commit is contained in:
parent
cf1dcfcb7c
commit
e05dbe9885
81 changed files with 220 additions and 317 deletions
2
OtterGui
2
OtterGui
|
|
@ -1 +1 @@
|
|||
Subproject commit e95c0f04edc7e85aea67498fd8bf495a7fe6d3c8
|
||||
Subproject commit caa9e9b9a5dc3928eba10b315cf6a0f6f1d84b65
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
using OtterGui.Services;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Collections;
|
||||
using Penumbra.Meta.Manipulations;
|
||||
|
|
@ -18,7 +19,7 @@ public enum RedirectResult
|
|||
FilteredGamePath = 3,
|
||||
}
|
||||
|
||||
public class TempModManager : IDisposable
|
||||
public class TempModManager : IDisposable, IService
|
||||
{
|
||||
private readonly CommunicatorService _communicator;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using Dalamud.Plugin.Services;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Api;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Collections.Manager;
|
||||
|
|
@ -17,7 +18,7 @@ using Penumbra.String.Classes;
|
|||
|
||||
namespace Penumbra.Collections.Cache;
|
||||
|
||||
public class CollectionCacheManager : IDisposable
|
||||
public class CollectionCacheManager : IDisposable, IService
|
||||
{
|
||||
private readonly FrameworkManager _framework;
|
||||
private readonly CommunicatorService _communicator;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ using Newtonsoft.Json;
|
|||
using Newtonsoft.Json.Linq;
|
||||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Communication;
|
||||
using Penumbra.GameData.Actors;
|
||||
using Penumbra.GameData.Enums;
|
||||
|
|
@ -11,7 +12,7 @@ using Penumbra.UI;
|
|||
|
||||
namespace Penumbra.Collections.Manager;
|
||||
|
||||
public class ActiveCollectionData
|
||||
public class ActiveCollectionData : IService
|
||||
{
|
||||
public ModCollection Current { get; internal set; } = ModCollection.Empty;
|
||||
public ModCollection Default { get; internal set; } = ModCollection.Empty;
|
||||
|
|
@ -20,7 +21,7 @@ public class ActiveCollectionData
|
|||
public readonly ModCollection?[] SpecialCollections = new ModCollection?[Enum.GetValues<Api.Enums.ApiCollectionType>().Length - 3];
|
||||
}
|
||||
|
||||
public class ActiveCollections : ISavable, IDisposable
|
||||
public class ActiveCollections : ISavable, IDisposable, IService
|
||||
{
|
||||
public const int Version = 2;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using OtterGui;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Mods;
|
||||
using Penumbra.Mods.Manager;
|
||||
|
|
@ -7,7 +8,7 @@ using Penumbra.Services;
|
|||
|
||||
namespace Penumbra.Collections.Manager;
|
||||
|
||||
public class CollectionEditor(SaveService saveService, CommunicatorService communicator, ModStorage modStorage)
|
||||
public class CollectionEditor(SaveService saveService, CommunicatorService communicator, ModStorage modStorage) : IService
|
||||
{
|
||||
/// <summary> Enable or disable the mod inheritance of mod idx. </summary>
|
||||
public bool SetModInheritance(ModCollection collection, Mod mod, bool inherit)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
using OtterGui.Services;
|
||||
using Penumbra.Collections.Cache;
|
||||
|
||||
namespace Penumbra.Collections.Manager;
|
||||
|
|
@ -8,7 +9,7 @@ public class CollectionManager(
|
|||
InheritanceManager inheritances,
|
||||
CollectionCacheManager caches,
|
||||
TempCollectionManager temp,
|
||||
CollectionEditor editor)
|
||||
CollectionEditor editor) : IService
|
||||
{
|
||||
public readonly CollectionStorage Storage = storage;
|
||||
public readonly ActiveCollections Active = active;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
using System;
|
||||
using Dalamud.Interface.Internal.Notifications;
|
||||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Communication;
|
||||
using Penumbra.Mods;
|
||||
using Penumbra.Mods.Editor;
|
||||
|
|
@ -11,7 +11,6 @@ using Penumbra.Mods.Manager.OptionEditor;
|
|||
using Penumbra.Mods.Settings;
|
||||
using Penumbra.Mods.SubMods;
|
||||
using Penumbra.Services;
|
||||
using Penumbra.UI.CollectionTab;
|
||||
|
||||
namespace Penumbra.Collections.Manager;
|
||||
|
||||
|
|
@ -24,7 +23,7 @@ public readonly record struct LocalCollectionId(int Id) : IAdditionOperators<Loc
|
|||
=> new(left.Id + right);
|
||||
}
|
||||
|
||||
public class CollectionStorage : IReadOnlyList<ModCollection>, IDisposable
|
||||
public class CollectionStorage : IReadOnlyList<ModCollection>, IDisposable, IService
|
||||
{
|
||||
private readonly CommunicatorService _communicator;
|
||||
private readonly SaveService _saveService;
|
||||
|
|
|
|||
|
|
@ -2,11 +2,10 @@ using Dalamud.Interface.Internal.Notifications;
|
|||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Filesystem;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Communication;
|
||||
using Penumbra.Mods.Manager;
|
||||
using Penumbra.Services;
|
||||
using Penumbra.UI.CollectionTab;
|
||||
using Penumbra.Util;
|
||||
|
||||
namespace Penumbra.Collections.Manager;
|
||||
|
||||
|
|
@ -15,7 +14,7 @@ namespace Penumbra.Collections.Manager;
|
|||
/// This is transitive, so a collection A inheriting from B also inherits from everything B inherits.
|
||||
/// Circular dependencies are resolved by distinctness.
|
||||
/// </summary>
|
||||
public class InheritanceManager : IDisposable
|
||||
public class InheritanceManager : IDisposable, IService
|
||||
{
|
||||
public enum ValidInheritance
|
||||
{
|
||||
|
|
@ -144,7 +143,8 @@ public class InheritanceManager : IDisposable
|
|||
continue;
|
||||
|
||||
changes = true;
|
||||
Penumbra.Messager.NotificationMessage($"{collection.Name} can not inherit from {subCollection.Name}, removed.", NotificationType.Warning);
|
||||
Penumbra.Messager.NotificationMessage($"{collection.Name} can not inherit from {subCollection.Name}, removed.",
|
||||
NotificationType.Warning);
|
||||
}
|
||||
else if (_storage.ByName(subCollectionName, out subCollection))
|
||||
{
|
||||
|
|
@ -153,12 +153,14 @@ public class InheritanceManager : IDisposable
|
|||
if (AddInheritance(collection, subCollection, false))
|
||||
continue;
|
||||
|
||||
Penumbra.Messager.NotificationMessage($"{collection.Name} can not inherit from {subCollection.Name}, removed.", NotificationType.Warning);
|
||||
Penumbra.Messager.NotificationMessage($"{collection.Name} can not inherit from {subCollection.Name}, removed.",
|
||||
NotificationType.Warning);
|
||||
}
|
||||
else
|
||||
{
|
||||
Penumbra.Messager.NotificationMessage(
|
||||
$"Inherited collection {subCollectionName} for {collection.AnonymizedName} does not exist, it was removed.", NotificationType.Warning);
|
||||
$"Inherited collection {subCollectionName} for {collection.AnonymizedName} does not exist, it was removed.",
|
||||
NotificationType.Warning);
|
||||
changes = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using OtterGui;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Api;
|
||||
using Penumbra.Communication;
|
||||
using Penumbra.GameData.Actors;
|
||||
|
|
@ -8,7 +9,7 @@ using Penumbra.String;
|
|||
|
||||
namespace Penumbra.Collections.Manager;
|
||||
|
||||
public class TempCollectionManager : IDisposable
|
||||
public class TempCollectionManager : IDisposable, IService
|
||||
{
|
||||
public int GlobalChangeCounter { get; private set; }
|
||||
public readonly IndividualCollections Collections;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ using Dalamud.Game.Text.SeStringHandling;
|
|||
using Dalamud.Plugin.Services;
|
||||
using ImGuiNET;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Collections;
|
||||
using Penumbra.Collections.Manager;
|
||||
|
|
@ -10,12 +11,11 @@ using Penumbra.GameData.Actors;
|
|||
using Penumbra.Interop.Services;
|
||||
using Penumbra.Mods;
|
||||
using Penumbra.Mods.Manager;
|
||||
using Penumbra.Services;
|
||||
using Penumbra.UI;
|
||||
|
||||
namespace Penumbra;
|
||||
|
||||
public class CommandHandler : IDisposable
|
||||
public class CommandHandler : IDisposable, IApiService
|
||||
{
|
||||
private const string CommandName = "/penumbra";
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ using Newtonsoft.Json;
|
|||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Filesystem;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.Import.Structs;
|
||||
using Penumbra.Interop.Services;
|
||||
|
|
@ -18,7 +19,7 @@ using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs;
|
|||
namespace Penumbra;
|
||||
|
||||
[Serializable]
|
||||
public class Configuration : IPluginConfiguration, ISavable
|
||||
public class Configuration : IPluginConfiguration, ISavable, IService
|
||||
{
|
||||
[JsonIgnore]
|
||||
private readonly SaveService _saveService;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using Dalamud.Interface.Internal.Notifications;
|
||||
using Newtonsoft.Json;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Communication;
|
||||
using Penumbra.Enums;
|
||||
|
|
@ -14,7 +15,7 @@ using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs;
|
|||
|
||||
namespace Penumbra;
|
||||
|
||||
public class EphemeralConfig : ISavable, IDisposable
|
||||
public class EphemeralConfig : ISavable, IDisposable, IService
|
||||
{
|
||||
[JsonIgnore]
|
||||
private readonly SaveService _saveService;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using Dalamud.Plugin.Services;
|
||||
using Lumina.Data.Parsing;
|
||||
using OtterGui;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Tasks;
|
||||
using Penumbra.Collections.Manager;
|
||||
using Penumbra.GameData;
|
||||
|
|
@ -21,7 +22,8 @@ namespace Penumbra.Import.Models;
|
|||
using Schema2 = SharpGLTF.Schema2;
|
||||
using LuminaMaterial = Lumina.Models.Materials.Material;
|
||||
|
||||
public sealed class ModelManager(IFramework framework, ActiveCollections collections, GamePathParser parser) : SingleTaskQueue, IDisposable
|
||||
public sealed class ModelManager(IFramework framework, ActiveCollections collections, GamePathParser parser)
|
||||
: SingleTaskQueue, IDisposable, IService
|
||||
{
|
||||
private readonly IFramework _framework = framework;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ using Dalamud.Interface.Internal;
|
|||
using Dalamud.Plugin.Services;
|
||||
using Lumina.Data.Files;
|
||||
using OtterGui.Log;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Tasks;
|
||||
using OtterTex;
|
||||
using SixLabors.ImageSharp;
|
||||
|
|
@ -12,22 +13,14 @@ using Image = SixLabors.ImageSharp.Image;
|
|||
|
||||
namespace Penumbra.Import.Textures;
|
||||
|
||||
public sealed class TextureManager : SingleTaskQueue, IDisposable
|
||||
public sealed class TextureManager(UiBuilder uiBuilder, IDataManager gameData, Logger logger)
|
||||
: SingleTaskQueue, IDisposable, IService
|
||||
{
|
||||
private readonly Logger _logger;
|
||||
private readonly UiBuilder _uiBuilder;
|
||||
private readonly IDataManager _gameData;
|
||||
private readonly Logger _logger = logger;
|
||||
|
||||
private readonly ConcurrentDictionary<IAction, (Task, CancellationTokenSource)> _tasks = new();
|
||||
private readonly ConcurrentDictionary<IAction, (Task, CancellationTokenSource)> _tasks = new();
|
||||
private bool _disposed;
|
||||
|
||||
public TextureManager(UiBuilder uiBuilder, IDataManager gameData, Logger logger)
|
||||
{
|
||||
_uiBuilder = uiBuilder;
|
||||
_gameData = gameData;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public IReadOnlyDictionary<IAction, (Task, CancellationTokenSource)> Tasks
|
||||
=> _tasks;
|
||||
|
||||
|
|
@ -64,7 +57,8 @@ public sealed class TextureManager : SingleTaskQueue, IDisposable
|
|||
{
|
||||
var token = new CancellationTokenSource();
|
||||
var task = Enqueue(a, token.Token);
|
||||
task.ContinueWith(_ => _tasks.TryRemove(a, out var unused), CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.Default);
|
||||
task.ContinueWith(_ => _tasks.TryRemove(a, out var unused), CancellationToken.None, TaskContinuationOptions.None,
|
||||
TaskScheduler.Default);
|
||||
return (task, token);
|
||||
}).Item1;
|
||||
}
|
||||
|
|
@ -217,7 +211,7 @@ public sealed class TextureManager : SingleTaskQueue, IDisposable
|
|||
|
||||
/// <summary> Load a texture wrap for a given image. </summary>
|
||||
public IDalamudTextureWrap LoadTextureWrap(byte[] rgba, int width, int height)
|
||||
=> _uiBuilder.LoadImageRaw(rgba, width, height, 4);
|
||||
=> uiBuilder.LoadImageRaw(rgba, width, height, 4);
|
||||
|
||||
/// <summary> Load any supported file from game data or drive depending on extension and if the path is rooted. </summary>
|
||||
public (BaseImage, TextureType) Load(string path)
|
||||
|
|
@ -326,7 +320,7 @@ public sealed class TextureManager : SingleTaskQueue, IDisposable
|
|||
}
|
||||
|
||||
public bool GameFileExists(string path)
|
||||
=> _gameData.FileExists(path);
|
||||
=> gameData.FileExists(path);
|
||||
|
||||
/// <summary> Add up to 13 mip maps to the input if mip maps is true, otherwise return input. </summary>
|
||||
public static ScratchImage AddMipMaps(ScratchImage input, bool mipMaps)
|
||||
|
|
@ -382,7 +376,7 @@ public sealed class TextureManager : SingleTaskQueue, IDisposable
|
|||
if (Path.IsPathRooted(path))
|
||||
return File.OpenRead(path);
|
||||
|
||||
var file = _gameData.GetFile(path);
|
||||
var file = gameData.GetFile(path);
|
||||
return file != null ? new MemoryStream(file.Data) : throw new Exception($"Unable to obtain \"{path}\" from game files.");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
using Dalamud.Plugin.Services;
|
||||
using FFXIVClientStructs.FFXIV.Client.Game.Character;
|
||||
using FFXIVClientStructs.FFXIV.Client.Game.Object;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.GameData.Enums;
|
||||
using Penumbra.GameData.Interop;
|
||||
|
|
@ -9,7 +8,7 @@ using Penumbra.String;
|
|||
|
||||
namespace Penumbra.Interop.PathResolving;
|
||||
|
||||
public sealed class CutsceneService : IService, IDisposable
|
||||
public sealed class CutsceneService : IRequiredService, IDisposable
|
||||
{
|
||||
public const int CutsceneStartIdx = (int)ScreenActor.CutsceneStart;
|
||||
public const int CutsceneEndIdx = (int)ScreenActor.CutsceneEnd;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using Dalamud.Plugin.Services;
|
||||
using FFXIVClientStructs.FFXIV.Client.Game.Character;
|
||||
using FFXIVClientStructs.FFXIV.Client.Game.Object;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Collections;
|
||||
using Penumbra.Collections.Manager;
|
||||
using Penumbra.Communication;
|
||||
|
|
@ -10,7 +11,8 @@ using Penumbra.Services;
|
|||
|
||||
namespace Penumbra.Interop.PathResolving;
|
||||
|
||||
public unsafe class IdentifiedCollectionCache : IDisposable, IEnumerable<(nint Address, ActorIdentifier Identifier, ModCollection Collection)>
|
||||
public unsafe class IdentifiedCollectionCache : IDisposable, IEnumerable<(nint Address, ActorIdentifier Identifier, ModCollection Collection)>,
|
||||
IService
|
||||
{
|
||||
private readonly CommunicatorService _communicator;
|
||||
private readonly CharacterDestructor _characterDestructor;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using FFXIVClientStructs.FFXIV.Client.Graphics.Scene;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Collections;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.GameData.Structs;
|
||||
|
|
@ -34,7 +35,7 @@ namespace Penumbra.Interop.PathResolving;
|
|||
// ChangeCustomize and RspSetupCharacter, which is hooked here, as well as Character.CalculateHeight.
|
||||
|
||||
// GMP Entries seem to be only used by "48 8B ?? 53 55 57 48 83 ?? ?? 48 8B", which is SetupVisor.
|
||||
public sealed unsafe class MetaState : IDisposable
|
||||
public sealed unsafe class MetaState : IDisposable, IService
|
||||
{
|
||||
private readonly Configuration _config;
|
||||
private readonly CommunicatorService _communicator;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using FFXIVClientStructs.FFXIV.Client.System.Resource;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Collections;
|
||||
using Penumbra.Collections.Manager;
|
||||
|
|
@ -9,7 +10,7 @@ using Penumbra.Util;
|
|||
|
||||
namespace Penumbra.Interop.PathResolving;
|
||||
|
||||
public class PathResolver : IDisposable
|
||||
public class PathResolver : IDisposable, IService
|
||||
{
|
||||
private readonly PerformanceTracker _performance;
|
||||
private readonly Configuration _config;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
using OtterGui.Services;
|
||||
using Penumbra.Collections;
|
||||
using Penumbra.Interop.Services;
|
||||
using Penumbra.String;
|
||||
|
|
@ -5,7 +6,7 @@ using Penumbra.String;
|
|||
namespace Penumbra.Interop.PathResolving;
|
||||
|
||||
public sealed class PathState(CollectionResolver collectionResolver, MetaState metaState, CharacterUtility characterUtility)
|
||||
: IDisposable
|
||||
: IDisposable, IService
|
||||
{
|
||||
public readonly CollectionResolver CollectionResolver = collectionResolver;
|
||||
public readonly MetaState MetaState = metaState;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
using OtterGui.Services;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Collections;
|
||||
using Penumbra.Interop.Hooks.Resources;
|
||||
using Penumbra.Interop.ResourceLoading;
|
||||
using Penumbra.Interop.Structs;
|
||||
using Penumbra.String;
|
||||
using Penumbra.String.Classes;
|
||||
|
||||
namespace Penumbra.Interop.PathResolving;
|
||||
|
|
@ -13,7 +13,7 @@ namespace Penumbra.Interop.PathResolving;
|
|||
/// Those are loaded synchronously.
|
||||
/// Thus, we need to ensure the correct files are loaded when a material is loaded.
|
||||
/// </summary>
|
||||
public sealed unsafe class SubfileHelper : IDisposable, IReadOnlyCollection<KeyValuePair<nint, ResolveData>>
|
||||
public sealed unsafe class SubfileHelper : IDisposable, IReadOnlyCollection<KeyValuePair<nint, ResolveData>>, IService
|
||||
{
|
||||
private readonly GameState _gameState;
|
||||
private readonly ResourceLoader _loader;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
using Dalamud.Hooking;
|
||||
using Dalamud.Plugin.Services;
|
||||
using Dalamud.Utility.Signatures;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.GameData;
|
||||
using Penumbra.Interop.Structs;
|
||||
using Penumbra.Util;
|
||||
|
||||
namespace Penumbra.Interop.ResourceLoading;
|
||||
|
||||
public unsafe class FileReadService : IDisposable
|
||||
public unsafe class FileReadService : IDisposable, IRequiredService
|
||||
{
|
||||
public FileReadService(PerformanceTracker performance, ResourceManagerService resourceManager, IGameInteropProvider interop)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using FFXIVClientStructs.FFXIV.Client.System.Resource;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Collections;
|
||||
using Penumbra.Interop.PathResolving;
|
||||
|
|
@ -10,7 +11,7 @@ using FileMode = Penumbra.Interop.Structs.FileMode;
|
|||
|
||||
namespace Penumbra.Interop.ResourceLoading;
|
||||
|
||||
public unsafe class ResourceLoader : IDisposable
|
||||
public unsafe class ResourceLoader : IDisposable, IService
|
||||
{
|
||||
private readonly ResourceService _resources;
|
||||
private readonly FileReadService _fileReadService;
|
||||
|
|
@ -212,7 +213,7 @@ public unsafe class ResourceLoader : IDisposable
|
|||
/// <summary>
|
||||
/// Catch weird errors with invalid decrements of the reference count.
|
||||
/// </summary>
|
||||
private void DecRefProtection(ResourceHandle* handle, ref byte? returnValue)
|
||||
private static void DecRefProtection(ResourceHandle* handle, ref byte? returnValue)
|
||||
{
|
||||
if (handle->RefCount != 0)
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -4,12 +4,13 @@ using FFXIVClientStructs.FFXIV.Client.System.Resource;
|
|||
using FFXIVClientStructs.FFXIV.Client.System.Resource.Handle;
|
||||
using FFXIVClientStructs.Interop;
|
||||
using FFXIVClientStructs.STD;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.GameData;
|
||||
|
||||
namespace Penumbra.Interop.ResourceLoading;
|
||||
|
||||
public unsafe class ResourceManagerService
|
||||
public unsafe class ResourceManagerService : IRequiredService
|
||||
{
|
||||
public ResourceManagerService(IGameInteropProvider interop)
|
||||
=> interop.InitializeFromAttributes(this);
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ using Dalamud.Hooking;
|
|||
using Dalamud.Plugin.Services;
|
||||
using Dalamud.Utility.Signatures;
|
||||
using FFXIVClientStructs.FFXIV.Client.System.Resource;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.GameData;
|
||||
using Penumbra.Interop.SafeHandles;
|
||||
|
|
@ -13,7 +14,7 @@ using CSResourceHandle = FFXIVClientStructs.FFXIV.Client.System.Resource.Handle.
|
|||
|
||||
namespace Penumbra.Interop.ResourceLoading;
|
||||
|
||||
public unsafe class ResourceService : IDisposable
|
||||
public unsafe class ResourceService : IDisposable, IRequiredService
|
||||
{
|
||||
private readonly PerformanceTracker _performance;
|
||||
private readonly ResourceManagerService _resourceManager;
|
||||
|
|
|
|||
|
|
@ -2,13 +2,14 @@ using Dalamud.Hooking;
|
|||
using Dalamud.Plugin.Services;
|
||||
using Dalamud.Utility.Signatures;
|
||||
using FFXIVClientStructs.FFXIV.Client.System.Resource.Handle;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.GameData;
|
||||
using Penumbra.String.Classes;
|
||||
|
||||
namespace Penumbra.Interop.ResourceLoading;
|
||||
|
||||
public unsafe class TexMdlService : IDisposable
|
||||
public unsafe class TexMdlService : IDisposable, IRequiredService
|
||||
{
|
||||
/// <summary> Custom ulong flag to signal our files as opposed to SE files. </summary>
|
||||
public static readonly IntPtr CustomFileFlag = new(0xDEADBEEF);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using Dalamud.Plugin.Services;
|
||||
using FFXIVClientStructs.FFXIV.Client.Game.Object;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.GameData.Actors;
|
||||
using Penumbra.GameData.Data;
|
||||
|
|
@ -17,7 +18,7 @@ public class ResourceTreeFactory(
|
|||
ObjectIdentification identifier,
|
||||
Configuration config,
|
||||
ActorManager actors,
|
||||
PathState pathState)
|
||||
PathState pathState) : IService
|
||||
{
|
||||
private TreeBuildCache CreateTreeBuildCache()
|
||||
=> new(objects, gameData, actors);
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
using Dalamud.Plugin.Services;
|
||||
using Dalamud.Utility.Signatures;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.GameData;
|
||||
using Penumbra.Interop.Structs;
|
||||
|
||||
namespace Penumbra.Interop.Services;
|
||||
|
||||
public unsafe class CharacterUtility : IDisposable
|
||||
public unsafe class CharacterUtility : IDisposable, IRequiredService
|
||||
{
|
||||
public record struct InternalIndex(int Value);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using Dalamud.Plugin.Services;
|
||||
using FFXIVClientStructs.FFXIV.Client.System.Framework;
|
||||
using FFXIVClientStructs.FFXIV.Component.GUI;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.GameData;
|
||||
|
||||
namespace Penumbra.Interop.Services;
|
||||
|
|
@ -9,7 +10,7 @@ namespace Penumbra.Interop.Services;
|
|||
/// Handle font reloading via game functions.
|
||||
/// May cause a interface flicker while reloading.
|
||||
/// </summary>
|
||||
public unsafe class FontReloader
|
||||
public unsafe class FontReloader : IService
|
||||
{
|
||||
public bool Valid
|
||||
=> _reloadFontsFunc != null;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
using Dalamud.Plugin.Services;
|
||||
using FFXIVClientStructs.FFXIV.Client.Graphics.Render;
|
||||
using FFXIVClientStructs.FFXIV.Client.System.Resource.Handle;
|
||||
using OtterGui.Services;
|
||||
|
||||
namespace Penumbra.Interop.Services;
|
||||
|
||||
public unsafe class ModelRenderer : IDisposable
|
||||
public unsafe class ModelRenderer : IDisposable, IRequiredService
|
||||
{
|
||||
public bool Ready { get; private set; }
|
||||
|
||||
|
|
@ -37,14 +38,14 @@ public unsafe class ModelRenderer : IDisposable
|
|||
|
||||
if (DefaultCharacterGlassShaderPackage == null)
|
||||
{
|
||||
DefaultCharacterGlassShaderPackage = *CharacterGlassShaderPackage;
|
||||
anyMissing |= DefaultCharacterGlassShaderPackage == null;
|
||||
DefaultCharacterGlassShaderPackage = *CharacterGlassShaderPackage;
|
||||
anyMissing |= DefaultCharacterGlassShaderPackage == null;
|
||||
}
|
||||
|
||||
if (anyMissing)
|
||||
return;
|
||||
|
||||
Ready = true;
|
||||
Ready = true;
|
||||
_framework.Update -= LoadDefaultResources;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ using Dalamud.Game.ClientState.Objects.Types;
|
|||
using Dalamud.Plugin.Services;
|
||||
using FFXIVClientStructs.FFXIV.Client.Game.Housing;
|
||||
using FFXIVClientStructs.Interop;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Api;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Communication;
|
||||
|
|
@ -20,7 +21,7 @@ using Character = FFXIVClientStructs.FFXIV.Client.Game.Character.Character;
|
|||
|
||||
namespace Penumbra.Interop.Services;
|
||||
|
||||
public unsafe partial class RedrawService
|
||||
public unsafe partial class RedrawService : IService
|
||||
{
|
||||
public const int GPosePlayerIdx = 201;
|
||||
public const int GPoseSlots = 42;
|
||||
|
|
@ -171,7 +172,8 @@ public sealed unsafe partial class RedrawService : IDisposable
|
|||
if (gPose)
|
||||
DisableDraw(actor!);
|
||||
|
||||
if (actor is PlayerCharacter && _objects.GetDalamudObject(tableIndex + 1) is { ObjectKind: ObjectKind.MountType or ObjectKind.Ornament } mountOrOrnament)
|
||||
if (actor is PlayerCharacter
|
||||
&& _objects.GetDalamudObject(tableIndex + 1) is { ObjectKind: ObjectKind.MountType or ObjectKind.Ornament } mountOrOrnament)
|
||||
{
|
||||
*ActorDrawState(mountOrOrnament) |= DrawState.Invisibility;
|
||||
if (gPose)
|
||||
|
|
@ -190,7 +192,8 @@ public sealed unsafe partial class RedrawService : IDisposable
|
|||
if (gPose)
|
||||
EnableDraw(actor!);
|
||||
|
||||
if (actor is PlayerCharacter && _objects.GetDalamudObject(tableIndex + 1) is { ObjectKind: ObjectKind.MountType or ObjectKind.Ornament } mountOrOrnament)
|
||||
if (actor is PlayerCharacter
|
||||
&& _objects.GetDalamudObject(tableIndex + 1) is { ObjectKind: ObjectKind.MountType or ObjectKind.Ornament } mountOrOrnament)
|
||||
{
|
||||
*ActorDrawState(mountOrOrnament) &= ~DrawState.Invisibility;
|
||||
if (gPose)
|
||||
|
|
@ -380,7 +383,7 @@ public sealed unsafe partial class RedrawService : IDisposable
|
|||
if (!ret && lowerName.Length > 1 && lowerName[0] == '#' && ushort.TryParse(lowerName[1..], out var objectIndex))
|
||||
{
|
||||
ret = true;
|
||||
actor = _objects.GetDalamudObject((int) objectIndex);
|
||||
actor = _objects.GetDalamudObject((int)objectIndex);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
using Dalamud.Plugin.Services;
|
||||
using Dalamud.Plugin.Services;
|
||||
using Dalamud.Utility.Signatures;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.GameData;
|
||||
|
||||
namespace Penumbra.Interop.Services;
|
||||
|
||||
public unsafe class ResidentResourceManager
|
||||
public unsafe class ResidentResourceManager : IService
|
||||
{
|
||||
// A static pointer to the resident resource manager address.
|
||||
[Signature(Sigs.ResidentResourceManager, ScanType = ScanType.StaticAddress)]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using Dalamud.Plugin.Services;
|
||||
using OtterGui.Compression;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Collections;
|
||||
using Penumbra.Collections.Manager;
|
||||
using Penumbra.GameData.Data;
|
||||
|
|
@ -13,7 +14,7 @@ using ResidentResourceManager = Penumbra.Interop.Services.ResidentResourceManage
|
|||
|
||||
namespace Penumbra.Meta;
|
||||
|
||||
public unsafe class MetaFileManager
|
||||
public class MetaFileManager : IService
|
||||
{
|
||||
internal readonly Configuration Config;
|
||||
internal readonly CharacterUtility CharacterUtility;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using OtterGui.Classes;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Mods.Groups;
|
||||
using Penumbra.Mods.Manager;
|
||||
using Penumbra.Mods.SubMods;
|
||||
|
|
@ -7,7 +8,7 @@ using Penumbra.String.Classes;
|
|||
|
||||
namespace Penumbra.Mods.Editor;
|
||||
|
||||
public class DuplicateManager(ModManager modManager, SaveService saveService, Configuration config)
|
||||
public class DuplicateManager(ModManager modManager, SaveService saveService, Configuration config) : IService
|
||||
{
|
||||
private readonly SHA256 _hasher = SHA256.Create();
|
||||
private readonly List<(FullPath[] Paths, long Size, byte[] Hash)> _duplicates = [];
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
using OtterGui;
|
||||
using OtterGui.Compression;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.GameData.Enums;
|
||||
using Penumbra.GameData.Files;
|
||||
|
||||
namespace Penumbra.Mods.Editor;
|
||||
|
||||
public partial class MdlMaterialEditor(ModFileCollection files)
|
||||
public partial class MdlMaterialEditor(ModFileCollection files) : IService
|
||||
{
|
||||
[GeneratedRegex(@"/mt_c(?'RaceCode'\d{4})b0001_(?'Suffix'.*?)\.mtrl", RegexOptions.ExplicitCapture | RegexOptions.NonBacktracking)]
|
||||
private static partial Regex MaterialRegex();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using OtterGui;
|
||||
using OtterGui.Compression;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Mods.Groups;
|
||||
using Penumbra.Mods.SubMods;
|
||||
|
||||
|
|
@ -14,7 +14,7 @@ public class ModEditor(
|
|||
ModSwapEditor swapEditor,
|
||||
MdlMaterialEditor mdlMaterialEditor,
|
||||
FileCompactor compactor)
|
||||
: IDisposable
|
||||
: IDisposable, IService
|
||||
{
|
||||
public readonly ModNormalizer ModNormalizer = modNormalizer;
|
||||
public readonly ModMetaEditor MetaEditor = metaEditor;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
using OtterGui;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Mods.SubMods;
|
||||
using Penumbra.String.Classes;
|
||||
|
||||
namespace Penumbra.Mods.Editor;
|
||||
|
||||
public class ModFileCollection : IDisposable
|
||||
public class ModFileCollection : IDisposable, IService
|
||||
{
|
||||
private readonly List<FileRegistry> _available = [];
|
||||
private readonly List<FileRegistry> _mtrl = [];
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
using OtterGui.Services;
|
||||
using Penumbra.Mods.Manager;
|
||||
using Penumbra.Mods.SubMods;
|
||||
using Penumbra.Services;
|
||||
|
|
@ -5,7 +6,7 @@ using Penumbra.String.Classes;
|
|||
|
||||
namespace Penumbra.Mods.Editor;
|
||||
|
||||
public class ModFileEditor(ModFileCollection files, ModManager modManager, CommunicatorService communicator)
|
||||
public class ModFileEditor(ModFileCollection files, ModManager modManager, CommunicatorService communicator) : IService
|
||||
{
|
||||
public bool Changes { get; private set; }
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ using Dalamud.Interface.Internal.Notifications;
|
|||
using Dalamud.Utility;
|
||||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Communication;
|
||||
using Penumbra.Mods.Manager;
|
||||
|
|
@ -13,7 +14,7 @@ using Penumbra.UI.ModsTab;
|
|||
|
||||
namespace Penumbra.Mods.Editor;
|
||||
|
||||
public class ModMerger : IDisposable
|
||||
public class ModMerger : IDisposable, IService
|
||||
{
|
||||
private readonly Configuration _config;
|
||||
private readonly CommunicatorService _communicator;
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
using Dalamud.Interface.Internal.Notifications;
|
||||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Tasks;
|
||||
using Penumbra.Mods.Groups;
|
||||
using Penumbra.Mods.Manager;
|
||||
using Penumbra.Mods.SubMods;
|
||||
using Penumbra.String.Classes;
|
||||
|
||||
namespace Penumbra.Mods.Editor;
|
||||
|
||||
public class ModNormalizer(ModManager _modManager, Configuration _config)
|
||||
public class ModNormalizer(ModManager _modManager, Configuration _config) : IService
|
||||
{
|
||||
private readonly List<List<Dictionary<Utf8GamePath, FullPath>>> _redirections = [];
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
using Penumbra.Mods;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Mods.Manager;
|
||||
using Penumbra.Mods.SubMods;
|
||||
using Penumbra.String.Classes;
|
||||
using Penumbra.Util;
|
||||
|
||||
public class ModSwapEditor(ModManager modManager)
|
||||
public class ModSwapEditor(ModManager modManager) : IService
|
||||
{
|
||||
private readonly Dictionary<Utf8GamePath, FullPath> _swaps = [];
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
using OtterGui.Services;
|
||||
using Penumbra.Communication;
|
||||
using Penumbra.GameData.Data;
|
||||
using Penumbra.Mods.Groups;
|
||||
|
|
@ -8,7 +9,7 @@ using Penumbra.Util;
|
|||
|
||||
namespace Penumbra.Mods.Manager;
|
||||
|
||||
public class ModCacheManager : IDisposable
|
||||
public class ModCacheManager : IDisposable, IService
|
||||
{
|
||||
private readonly Configuration _config;
|
||||
private readonly CommunicatorService _communicator;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using Dalamud.Utility;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Services;
|
||||
|
||||
namespace Penumbra.Mods.Manager;
|
||||
|
|
@ -23,7 +24,7 @@ public enum ModDataChangeType : ushort
|
|||
Note = 0x0800,
|
||||
}
|
||||
|
||||
public class ModDataEditor(SaveService saveService, CommunicatorService communicatorService)
|
||||
public class ModDataEditor(SaveService saveService, CommunicatorService communicatorService) : IService
|
||||
{
|
||||
/// <summary> Create the file containing the meta information about a mod from scratch. </summary>
|
||||
public void CreateMeta(DirectoryInfo directory, string? name, string? author, string? description, string? version,
|
||||
|
|
@ -49,7 +50,6 @@ public class ModDataEditor(SaveService saveService, CommunicatorService communic
|
|||
|
||||
var save = true;
|
||||
if (File.Exists(dataFile))
|
||||
{
|
||||
try
|
||||
{
|
||||
var text = File.ReadAllText(dataFile);
|
||||
|
|
@ -65,7 +65,6 @@ public class ModDataEditor(SaveService saveService, CommunicatorService communic
|
|||
{
|
||||
Penumbra.Log.Error($"Could not load local mod data:\n{e}");
|
||||
}
|
||||
}
|
||||
|
||||
if (importDate == 0)
|
||||
importDate = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
using OtterGui.Services;
|
||||
using Penumbra.Communication;
|
||||
using Penumbra.Mods.Editor;
|
||||
using Penumbra.Services;
|
||||
|
||||
namespace Penumbra.Mods.Manager;
|
||||
|
||||
public class ModExportManager : IDisposable
|
||||
public class ModExportManager : IDisposable, IService
|
||||
{
|
||||
private readonly Configuration _config;
|
||||
private readonly CommunicatorService _communicator;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
using Newtonsoft.Json.Linq;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Filesystem;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Communication;
|
||||
using Penumbra.Services;
|
||||
|
||||
namespace Penumbra.Mods.Manager;
|
||||
|
||||
public sealed class ModFileSystem : FileSystem<Mod>, IDisposable, ISavable
|
||||
public sealed class ModFileSystem : FileSystem<Mod>, IDisposable, ISavable, IService
|
||||
{
|
||||
private readonly ModManager _modManager;
|
||||
private readonly CommunicatorService _communicator;
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
using Dalamud.Interface.Internal.Notifications;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Import;
|
||||
using Penumbra.Mods.Editor;
|
||||
|
||||
namespace Penumbra.Mods.Manager;
|
||||
|
||||
public class ModImportManager(ModManager modManager, Configuration config, ModEditor modEditor) : IDisposable
|
||||
public class ModImportManager(ModManager modManager, Configuration config, ModEditor modEditor) : IDisposable, IService
|
||||
{
|
||||
private readonly ConcurrentQueue<string[]> _modsToUnpack = new();
|
||||
|
||||
|
|
@ -32,7 +33,8 @@ public class ModImportManager(ModManager modManager, Configuration config, ModEd
|
|||
if (File.Exists(s))
|
||||
return true;
|
||||
|
||||
Penumbra.Messager.NotificationMessage($"Failed to import queued mod at {s}, the file does not exist.", NotificationType.Warning, false);
|
||||
Penumbra.Messager.NotificationMessage($"Failed to import queued mod at {s}, the file does not exist.", NotificationType.Warning,
|
||||
false);
|
||||
return false;
|
||||
}).Select(s => new FileInfo(s)).ToArray();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
using OtterGui.Services;
|
||||
using Penumbra.Communication;
|
||||
using Penumbra.Mods.Editor;
|
||||
using Penumbra.Mods.Manager.OptionEditor;
|
||||
|
|
@ -27,7 +28,7 @@ public enum ModPathChangeType
|
|||
StartingReload,
|
||||
}
|
||||
|
||||
public sealed class ModManager : ModStorage, IDisposable
|
||||
public sealed class ModManager : ModStorage, IDisposable, IService
|
||||
{
|
||||
private readonly Configuration _config;
|
||||
private readonly CommunicatorService _communicator;
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ using Newtonsoft.Json.Linq;
|
|||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Filesystem;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.GameData.Data;
|
||||
using Penumbra.Import;
|
||||
|
|
@ -23,7 +24,7 @@ public partial class ModCreator(
|
|||
Configuration config,
|
||||
ModDataEditor _dataEditor,
|
||||
MetaFileManager _metaFileManager,
|
||||
GamePathParser _gamePathParser)
|
||||
GamePathParser _gamePathParser) : IService
|
||||
{
|
||||
public readonly Configuration Config = config;
|
||||
|
||||
|
|
|
|||
|
|
@ -5,36 +5,15 @@ using Dalamud.Plugin;
|
|||
using Dalamud.Plugin.Services;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Log;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Api;
|
||||
using Penumbra.Api.Api;
|
||||
using Penumbra.Collections.Cache;
|
||||
using Penumbra.Collections.Manager;
|
||||
using Penumbra.GameData.Actors;
|
||||
using Penumbra.Import.Models;
|
||||
using Penumbra.GameData.Structs;
|
||||
using Penumbra.Import.Textures;
|
||||
using Penumbra.Interop.PathResolving;
|
||||
using Penumbra.Interop.ResourceLoading;
|
||||
using Penumbra.Interop.ResourceTree;
|
||||
using Penumbra.Interop.Services;
|
||||
using Penumbra.Meta;
|
||||
using Penumbra.Mods;
|
||||
using Penumbra.Mods.Editor;
|
||||
using Penumbra.Mods.Manager;
|
||||
using Penumbra.UI;
|
||||
using Penumbra.UI.AdvancedWindow;
|
||||
using Penumbra.UI.Classes;
|
||||
using Penumbra.UI.ModsTab;
|
||||
using Penumbra.UI.ResourceWatcher;
|
||||
using Penumbra.UI.Tabs;
|
||||
using Penumbra.UI.Tabs.Debug;
|
||||
using IPenumbraApi = Penumbra.Api.Api.IPenumbraApi;
|
||||
using MdlMaterialEditor = Penumbra.Mods.Editor.MdlMaterialEditor;
|
||||
using ResidentResourceManager = Penumbra.Interop.Services.ResidentResourceManager;
|
||||
using Penumbra.Api.IpcTester;
|
||||
|
||||
namespace Penumbra.Services;
|
||||
|
||||
|
|
@ -45,19 +24,18 @@ public static class StaticServiceManager
|
|||
var services = new ServiceManager(log)
|
||||
.AddDalamudServices(pi)
|
||||
.AddExistingService(log)
|
||||
.AddExistingService(penumbra)
|
||||
.AddInterop()
|
||||
.AddConfiguration()
|
||||
.AddCollections()
|
||||
.AddMods()
|
||||
.AddResources()
|
||||
.AddResolvers()
|
||||
.AddInterface()
|
||||
.AddModEditor()
|
||||
.AddApi();
|
||||
.AddExistingService(penumbra);
|
||||
services.AddIServices(typeof(EquipItem).Assembly);
|
||||
services.AddIServices(typeof(Penumbra).Assembly);
|
||||
services.AddIServices(typeof(ImGuiUtil).Assembly);
|
||||
services.AddSingleton(p =>
|
||||
{
|
||||
var cutsceneService = p.GetRequiredService<CutsceneService>();
|
||||
return new CutsceneResolver(cutsceneService.GetParentIndex);
|
||||
})
|
||||
.AddSingleton(p => p.GetRequiredService<MetaFileManager>().ImcChecker)
|
||||
.AddSingleton(s => (ModStorage)s.GetRequiredService<ModManager>())
|
||||
.AddSingleton<IPenumbraApi>(x => x.GetRequiredService<PenumbraApi>());
|
||||
services.CreateProvider();
|
||||
return services;
|
||||
}
|
||||
|
|
@ -83,118 +61,4 @@ public static class StaticServiceManager
|
|||
.AddDalamudService<IGameInteropProvider>(pi)
|
||||
.AddDalamudService<IPluginLog>(pi)
|
||||
.AddDalamudService<INotificationManager>(pi);
|
||||
|
||||
private static ServiceManager AddInterop(this ServiceManager services)
|
||||
=> services.AddSingleton<FrameworkManager>()
|
||||
.AddSingleton<CutsceneService>()
|
||||
.AddSingleton(p =>
|
||||
{
|
||||
var cutsceneService = p.GetRequiredService<CutsceneService>();
|
||||
return new CutsceneResolver(cutsceneService.GetParentIndex);
|
||||
})
|
||||
.AddSingleton<CharacterUtility>()
|
||||
.AddSingleton<ModelRenderer>()
|
||||
.AddSingleton<ResourceManagerService>()
|
||||
.AddSingleton<ResourceService>()
|
||||
.AddSingleton<FileReadService>()
|
||||
.AddSingleton<TexMdlService>()
|
||||
.AddSingleton<CreateFileWHook>()
|
||||
.AddSingleton<ResidentResourceManager>()
|
||||
.AddSingleton<FontReloader>()
|
||||
.AddSingleton<RedrawService>()
|
||||
.AddSingleton(p => p.GetRequiredService<MetaFileManager>().ImcChecker);
|
||||
|
||||
private static ServiceManager AddConfiguration(this ServiceManager services)
|
||||
=> services.AddSingleton<Configuration>()
|
||||
.AddSingleton<EphemeralConfig>()
|
||||
.AddSingleton<PredefinedTagManager>();
|
||||
|
||||
private static ServiceManager AddCollections(this ServiceManager services)
|
||||
=> services.AddSingleton<CollectionStorage>()
|
||||
.AddSingleton<ActiveCollectionData>()
|
||||
.AddSingleton<ActiveCollections>()
|
||||
.AddSingleton<InheritanceManager>()
|
||||
.AddSingleton<CollectionCacheManager>()
|
||||
.AddSingleton<TempCollectionManager>()
|
||||
.AddSingleton<CollectionEditor>()
|
||||
.AddSingleton<CollectionManager>();
|
||||
|
||||
private static ServiceManager AddMods(this ServiceManager services)
|
||||
=> services.AddSingleton<TempModManager>()
|
||||
.AddSingleton<ModDataEditor>()
|
||||
.AddSingleton<ModCreator>()
|
||||
.AddSingleton<ModManager>()
|
||||
.AddSingleton<ModExportManager>()
|
||||
.AddSingleton<ModImportManager>()
|
||||
.AddSingleton<ModFileSystem>()
|
||||
.AddSingleton<ModCacheManager>()
|
||||
.AddSingleton(s => (ModStorage)s.GetRequiredService<ModManager>());
|
||||
|
||||
private static ServiceManager AddResources(this ServiceManager services)
|
||||
=> services.AddSingleton<ResourceLoader>()
|
||||
.AddSingleton<ResourceWatcher>()
|
||||
.AddSingleton<ResourceTreeFactory>()
|
||||
.AddSingleton<MetaFileManager>();
|
||||
|
||||
private static ServiceManager AddResolvers(this ServiceManager services)
|
||||
=> services.AddSingleton<CollectionResolver>()
|
||||
.AddSingleton<CutsceneService>()
|
||||
.AddSingleton<DrawObjectState>()
|
||||
.AddSingleton<MetaState>()
|
||||
.AddSingleton<PathState>()
|
||||
.AddSingleton<SubfileHelper>()
|
||||
.AddSingleton<IdentifiedCollectionCache>()
|
||||
.AddSingleton<PathResolver>();
|
||||
|
||||
private static ServiceManager AddInterface(this ServiceManager services)
|
||||
=> services.AddSingleton<FileDialogService>()
|
||||
.AddSingleton<TutorialService>()
|
||||
.AddSingleton<PenumbraChangelog>()
|
||||
.AddSingleton<LaunchButton>()
|
||||
.AddSingleton<ConfigWindow>()
|
||||
.AddSingleton<PenumbraWindowSystem>()
|
||||
.AddSingleton<ModEditWindow>()
|
||||
.AddSingleton<CommandHandler>()
|
||||
.AddSingleton<SettingsTab>()
|
||||
.AddSingleton<ModsTab>()
|
||||
.AddSingleton<MultiModPanel>()
|
||||
.AddSingleton<ModPanel>()
|
||||
.AddSingleton<ModFileSystemSelector>()
|
||||
.AddSingleton<CollectionSelectHeader>()
|
||||
.AddSingleton<ImportPopup>()
|
||||
.AddSingleton<ModPanelDescriptionTab>()
|
||||
.AddSingleton<ModPanelEditTab>()
|
||||
.AddSingleton<ModPanelChangedItemsTab>()
|
||||
.AddSingleton<ModPanelConflictsTab>()
|
||||
.AddSingleton<ModPanelCollectionsTab>()
|
||||
.AddSingleton<ModPanelTabBar>()
|
||||
.AddSingleton<ModFileSystemSelector>()
|
||||
.AddSingleton<CollectionsTab>()
|
||||
.AddSingleton<ChangedItemsTab>()
|
||||
.AddSingleton<EffectiveTab>()
|
||||
.AddSingleton<OnScreenTab>()
|
||||
.AddSingleton<DebugTab>()
|
||||
.AddSingleton<MessagesTab>()
|
||||
.AddSingleton<ResourceTab>()
|
||||
.AddSingleton<ConfigTabBar>()
|
||||
.AddSingleton<ResourceWatcher>()
|
||||
.AddSingleton<ItemSwapTab>()
|
||||
.AddSingleton<ModMergeTab>()
|
||||
.AddSingleton<ChangedItemDrawer>()
|
||||
.AddSingleton(p => new Diagnostics(p));
|
||||
|
||||
private static ServiceManager AddModEditor(this ServiceManager services)
|
||||
=> services.AddSingleton<ModFileCollection>()
|
||||
.AddSingleton<DuplicateManager>()
|
||||
.AddSingleton<MdlMaterialEditor>()
|
||||
.AddSingleton<ModFileEditor>()
|
||||
.AddSingleton<ModSwapEditor>()
|
||||
.AddSingleton<ModNormalizer>()
|
||||
.AddSingleton<ModMerger>()
|
||||
.AddSingleton<ModEditor>()
|
||||
.AddSingleton<TextureManager>()
|
||||
.AddSingleton<ModelManager>();
|
||||
|
||||
private static ServiceManager AddApi(this ServiceManager services)
|
||||
=> services.AddSingleton<IPenumbraApi>(x => x.GetRequiredService<PenumbraApi>());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ using ImGuiNET;
|
|||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Collections;
|
||||
|
|
@ -24,7 +25,7 @@ using Penumbra.UI.Classes;
|
|||
|
||||
namespace Penumbra.UI.AdvancedWindow;
|
||||
|
||||
public class ItemSwapTab : IDisposable, ITab
|
||||
public class ItemSwapTab : IDisposable, ITab, IUiService
|
||||
{
|
||||
private readonly Configuration _config;
|
||||
private readonly CommunicatorService _communicator;
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ using Dalamud.Plugin.Services;
|
|||
using ImGuiNET;
|
||||
using OtterGui;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Collections.Manager;
|
||||
using Penumbra.Communication;
|
||||
|
|
@ -32,7 +33,7 @@ using MdlMaterialEditor = Penumbra.Mods.Editor.MdlMaterialEditor;
|
|||
|
||||
namespace Penumbra.UI.AdvancedWindow;
|
||||
|
||||
public partial class ModEditWindow : Window, IDisposable
|
||||
public partial class ModEditWindow : Window, IDisposable, IUiService
|
||||
{
|
||||
private const string WindowBaseLabel = "###SubModEdit";
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ using Dalamud.Interface.Utility;
|
|||
using ImGuiNET;
|
||||
using OtterGui;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Mods.Editor;
|
||||
using Penumbra.Mods.Manager;
|
||||
using Penumbra.Mods.SubMods;
|
||||
|
|
@ -9,7 +10,7 @@ using Penumbra.UI.Classes;
|
|||
|
||||
namespace Penumbra.UI.AdvancedWindow;
|
||||
|
||||
public class ModMergeTab(ModMerger modMerger)
|
||||
public class ModMergeTab(ModMerger modMerger) : IUiService
|
||||
{
|
||||
private readonly ModCombo _modCombo = new(() => modMerger.ModsWithoutCurrent.ToList());
|
||||
private string _newModName = string.Empty;
|
||||
|
|
@ -183,7 +184,7 @@ public class ModMergeTab(ModMerger modMerger)
|
|||
else
|
||||
{
|
||||
ImGuiUtil.DrawTableColumn(option.GetName());
|
||||
|
||||
|
||||
ImGui.TableNextColumn();
|
||||
ImGui.Selectable(group.Name, false);
|
||||
if (ImGui.BeginPopupContextItem("##groupContext"))
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ using Lumina.Excel.GeneratedSheets;
|
|||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.GameData.Enums;
|
||||
using Penumbra.GameData.Structs;
|
||||
|
|
@ -19,7 +20,7 @@ using ApiChangedItemIcon = Penumbra.Api.Enums.ChangedItemIcon;
|
|||
|
||||
namespace Penumbra.UI;
|
||||
|
||||
public class ChangedItemDrawer : IDisposable
|
||||
public class ChangedItemDrawer : IDisposable, IUiService
|
||||
{
|
||||
[Flags]
|
||||
public enum ChangedItemIcon : uint
|
||||
|
|
@ -99,8 +100,10 @@ public class ChangedItemDrawer : IDisposable
|
|||
|
||||
slot = 0;
|
||||
foreach (var (item, flag) in LowerNames.Zip(Order))
|
||||
{
|
||||
if (item.Contains(lowerInput, StringComparison.Ordinal))
|
||||
slot |= flag;
|
||||
}
|
||||
|
||||
return slot != 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
|
||||
namespace Penumbra.UI;
|
||||
|
||||
public class PenumbraChangelog
|
||||
public class PenumbraChangelog : IUiService
|
||||
{
|
||||
public const int LastChangelogVersion = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using ImGuiNET;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Collections;
|
||||
using Penumbra.Collections.Manager;
|
||||
using Penumbra.Interop.PathResolving;
|
||||
|
|
@ -9,7 +10,7 @@ using Penumbra.UI.ModsTab;
|
|||
|
||||
namespace Penumbra.UI.Classes;
|
||||
|
||||
public class CollectionSelectHeader
|
||||
public class CollectionSelectHeader : IUiService
|
||||
{
|
||||
private readonly CollectionCombo _collectionCombo;
|
||||
private readonly ActiveCollections _activeCollections;
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ using ImGuiNET;
|
|||
using OtterGui;
|
||||
using OtterGui.Custom;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Text;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Services;
|
||||
|
|
@ -13,7 +14,7 @@ using Penumbra.Util;
|
|||
|
||||
namespace Penumbra.UI;
|
||||
|
||||
public sealed class ConfigWindow : Window
|
||||
public sealed class ConfigWindow : Window, IUiService
|
||||
{
|
||||
private readonly DalamudPluginInterface _pluginInterface;
|
||||
private readonly Configuration _config;
|
||||
|
|
|
|||
|
|
@ -3,12 +3,13 @@ using Dalamud.Interface.ImGuiFileDialog;
|
|||
using Dalamud.Utility;
|
||||
using ImGuiNET;
|
||||
using OtterGui;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Communication;
|
||||
using Penumbra.Services;
|
||||
|
||||
namespace Penumbra.UI;
|
||||
|
||||
public class FileDialogService : IDisposable
|
||||
public class FileDialogService : IDisposable, IUiService
|
||||
{
|
||||
private readonly CommunicatorService _communicator;
|
||||
private readonly FileDialogManager _manager;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
using Dalamud.Interface.Windowing;
|
||||
using ImGuiNET;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Import.Structs;
|
||||
using Penumbra.Mods.Manager;
|
||||
|
||||
namespace Penumbra.UI;
|
||||
|
||||
/// <summary> Draw the progress information for import. </summary>
|
||||
public sealed class ImportPopup : Window
|
||||
public sealed class ImportPopup : Window, IUiService
|
||||
{
|
||||
public const string WindowLabel = "Penumbra Import Status";
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ using Dalamud.Interface;
|
|||
using Dalamud.Interface.Internal;
|
||||
using Dalamud.Plugin;
|
||||
using Dalamud.Plugin.Services;
|
||||
using OtterGui.Services;
|
||||
|
||||
namespace Penumbra.UI;
|
||||
|
||||
|
|
@ -9,7 +10,7 @@ namespace Penumbra.UI;
|
|||
/// A Launch Button used in the title screen of the game,
|
||||
/// using the Dalamud-provided collapsible submenu.
|
||||
/// </summary>
|
||||
public class LaunchButton : IDisposable
|
||||
public class LaunchButton : IDisposable, IUiService
|
||||
{
|
||||
private readonly ConfigWindow _configWindow;
|
||||
private readonly UiBuilder _uiBuilder;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ using OtterGui.Classes;
|
|||
using OtterGui.Filesystem;
|
||||
using OtterGui.FileSystem.Selector;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Collections;
|
||||
using Penumbra.Collections.Manager;
|
||||
|
|
@ -21,7 +22,7 @@ using MessageService = Penumbra.Services.MessageService;
|
|||
|
||||
namespace Penumbra.UI.ModsTab;
|
||||
|
||||
public sealed class ModFileSystemSelector : FileSystemSelector<Mod, ModFileSystemSelector.ModState>
|
||||
public sealed class ModFileSystemSelector : FileSystemSelector<Mod, ModFileSystemSelector.ModState>, IUiService
|
||||
{
|
||||
private readonly CommunicatorService _communicator;
|
||||
private readonly MessageService _messager;
|
||||
|
|
@ -33,9 +34,9 @@ public sealed class ModFileSystemSelector : FileSystemSelector<Mod, ModFileSyste
|
|||
private readonly ModImportManager _modImportManager;
|
||||
private readonly IDragDropManager _dragDrop;
|
||||
private readonly ModSearchStringSplitter Filter = new();
|
||||
|
||||
public ModSettings SelectedSettings { get; private set; } = ModSettings.Empty;
|
||||
public ModCollection SelectedSettingCollection { get; private set; } = ModCollection.Empty;
|
||||
|
||||
public ModSettings SelectedSettings { get; private set; } = ModSettings.Empty;
|
||||
public ModCollection SelectedSettingCollection { get; private set; } = ModCollection.Empty;
|
||||
|
||||
|
||||
public ModFileSystemSelector(IKeyState keyState, CommunicatorService communicator, ModFileSystem fileSystem, ModManager modManager,
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
using Dalamud.Interface.Utility.Raii;
|
||||
using Dalamud.Plugin;
|
||||
using ImGuiNET;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Mods;
|
||||
using Penumbra.Services;
|
||||
using Penumbra.UI.AdvancedWindow;
|
||||
|
||||
namespace Penumbra.UI.ModsTab;
|
||||
|
||||
public class ModPanel : IDisposable
|
||||
public class ModPanel : IDisposable, IUiService
|
||||
{
|
||||
private readonly MultiModPanel _multiModPanel;
|
||||
private readonly ModFileSystemSelector _selector;
|
||||
|
|
|
|||
|
|
@ -2,39 +2,29 @@ using ImGuiNET;
|
|||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
|
||||
namespace Penumbra.UI.ModsTab;
|
||||
|
||||
public class ModPanelChangedItemsTab : ITab
|
||||
public class ModPanelChangedItemsTab(ModFileSystemSelector selector, ChangedItemDrawer drawer) : ITab, IUiService
|
||||
{
|
||||
private readonly ModFileSystemSelector _selector;
|
||||
private readonly ChangedItemDrawer _drawer;
|
||||
|
||||
private ChangedItemDrawer.ChangedItemIcon _filter = Enum.GetValues<ChangedItemDrawer.ChangedItemIcon>().Aggregate((a, b) => a | b);
|
||||
|
||||
public ReadOnlySpan<byte> Label
|
||||
=> "Changed Items"u8;
|
||||
|
||||
public ModPanelChangedItemsTab(ModFileSystemSelector selector, ChangedItemDrawer drawer)
|
||||
{
|
||||
_selector = selector;
|
||||
_drawer = drawer;
|
||||
}
|
||||
|
||||
public bool IsVisible
|
||||
=> _selector.Selected!.ChangedItems.Count > 0;
|
||||
=> selector.Selected!.ChangedItems.Count > 0;
|
||||
|
||||
public void DrawContent()
|
||||
{
|
||||
_drawer.DrawTypeFilter();
|
||||
drawer.DrawTypeFilter();
|
||||
ImGui.Separator();
|
||||
using var table = ImRaii.Table("##changedItems", 1, ImGuiTableFlags.RowBg | ImGuiTableFlags.ScrollY,
|
||||
new Vector2(ImGui.GetContentRegionAvail().X, -1));
|
||||
if (!table)
|
||||
return;
|
||||
|
||||
var zipList = ZipList.FromSortedList((SortedList<string, object?>)_selector.Selected!.ChangedItems);
|
||||
var zipList = ZipList.FromSortedList((SortedList<string, object?>)selector.Selected!.ChangedItems);
|
||||
var height = ImGui.GetFrameHeightWithSpacing();
|
||||
ImGui.TableNextColumn();
|
||||
var skips = ImGuiClip.GetNecessarySkips(height);
|
||||
|
|
@ -43,14 +33,14 @@ public class ModPanelChangedItemsTab : ITab
|
|||
}
|
||||
|
||||
private bool CheckFilter((string Name, object? Data) kvp)
|
||||
=> _drawer.FilterChangedItem(kvp.Name, kvp.Data, LowerString.Empty);
|
||||
=> drawer.FilterChangedItem(kvp.Name, kvp.Data, LowerString.Empty);
|
||||
|
||||
private void DrawChangedItem((string Name, object? Data) kvp)
|
||||
{
|
||||
ImGui.TableNextColumn();
|
||||
_drawer.DrawCategoryIcon(kvp.Name, kvp.Data);
|
||||
drawer.DrawCategoryIcon(kvp.Name, kvp.Data);
|
||||
ImGui.SameLine();
|
||||
_drawer.DrawChangedItem(kvp.Name, kvp.Data);
|
||||
_drawer.DrawModelData(kvp.Data);
|
||||
drawer.DrawChangedItem(kvp.Name, kvp.Data);
|
||||
drawer.DrawModelData(kvp.Data);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ using Dalamud.Interface.Utility;
|
|||
using ImGuiNET;
|
||||
using OtterGui;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.Collections;
|
||||
using Penumbra.Collections.Manager;
|
||||
|
|
@ -10,25 +11,16 @@ using Penumbra.UI.Classes;
|
|||
|
||||
namespace Penumbra.UI.ModsTab;
|
||||
|
||||
public class ModPanelCollectionsTab : ITab
|
||||
public class ModPanelCollectionsTab(CollectionStorage storage, ModFileSystemSelector selector) : ITab, IUiService
|
||||
{
|
||||
private readonly ModFileSystemSelector _selector;
|
||||
private readonly CollectionStorage _collections;
|
||||
|
||||
private readonly List<(ModCollection, ModCollection, uint, string)> _cache = new();
|
||||
|
||||
public ModPanelCollectionsTab(CollectionStorage storage, ModFileSystemSelector selector)
|
||||
{
|
||||
_collections = storage;
|
||||
_selector = selector;
|
||||
}
|
||||
private readonly List<(ModCollection, ModCollection, uint, string)> _cache = [];
|
||||
|
||||
public ReadOnlySpan<byte> Label
|
||||
=> "Collections"u8;
|
||||
|
||||
public void DrawContent()
|
||||
{
|
||||
var (direct, inherited) = CountUsage(_selector.Selected!);
|
||||
var (direct, inherited) = CountUsage(selector.Selected!);
|
||||
ImGui.NewLine();
|
||||
if (direct == 1)
|
||||
ImGui.TextUnformatted("This Mod is directly configured in 1 collection.");
|
||||
|
|
@ -80,7 +72,7 @@ public class ModPanelCollectionsTab : ITab
|
|||
var disInherited = ColorId.InheritedDisabledMod.Value();
|
||||
var directCount = 0;
|
||||
var inheritedCount = 0;
|
||||
foreach (var collection in _collections)
|
||||
foreach (var collection in storage)
|
||||
{
|
||||
var (settings, parent) = collection[mod.Index];
|
||||
var (color, text) = settings == null
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ using Dalamud.Interface.Utility;
|
|||
using ImGuiNET;
|
||||
using OtterGui;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Text;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.Collections.Cache;
|
||||
|
|
@ -16,7 +17,7 @@ using Penumbra.UI.Classes;
|
|||
|
||||
namespace Penumbra.UI.ModsTab;
|
||||
|
||||
public class ModPanelConflictsTab(CollectionManager collectionManager, ModFileSystemSelector selector) : ITab
|
||||
public class ModPanelConflictsTab(CollectionManager collectionManager, ModFileSystemSelector selector) : ITab, IUiService
|
||||
{
|
||||
private int? _currentPriority;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ using Dalamud.Interface.Utility;
|
|||
using ImGuiNET;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.Mods.Manager;
|
||||
|
||||
|
|
@ -12,7 +13,7 @@ public class ModPanelDescriptionTab(
|
|||
TutorialService tutorial,
|
||||
ModManager modManager,
|
||||
PredefinedTagManager predefinedTagsConfig)
|
||||
: ITab
|
||||
: ITab, IUiService
|
||||
{
|
||||
private readonly TagButtons _localTags = new();
|
||||
private readonly TagButtons _modTags = new();
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@ using OtterGui;
|
|||
using OtterGui.Raii;
|
||||
using OtterGui.Widgets;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Mods;
|
||||
using Penumbra.Mods.Editor;
|
||||
using Penumbra.Mods.Manager;
|
||||
using Penumbra.Services;
|
||||
using Penumbra.UI.AdvancedWindow;
|
||||
using Penumbra.Mods.Settings;
|
||||
using Penumbra.Mods.Manager.OptionEditor;
|
||||
using Penumbra.UI.ModsTab.Groups;
|
||||
|
||||
namespace Penumbra.UI.ModsTab;
|
||||
|
|
@ -31,7 +31,7 @@ public class ModPanelEditTab(
|
|||
ModGroupEditDrawer groupEditDrawer,
|
||||
DescriptionEditPopup descriptionPopup,
|
||||
AddGroupDrawer addGroupDrawer)
|
||||
: ITab
|
||||
: ITab, IUiService
|
||||
{
|
||||
private readonly TagButtons _modTags = new();
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ using Dalamud.Interface;
|
|||
using ImGuiNET;
|
||||
using OtterGui;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.Mods;
|
||||
using Penumbra.Mods.Manager;
|
||||
|
|
@ -9,7 +10,7 @@ using Penumbra.UI.AdvancedWindow;
|
|||
|
||||
namespace Penumbra.UI.ModsTab;
|
||||
|
||||
public class ModPanelTabBar
|
||||
public class ModPanelTabBar : IUiService
|
||||
{
|
||||
private enum ModPanelTabType
|
||||
{
|
||||
|
|
@ -33,7 +34,7 @@ public class ModPanelTabBar
|
|||
|
||||
public readonly ITab[] Tabs;
|
||||
private ModPanelTabType _preferredTab = ModPanelTabType.Settings;
|
||||
private Mod? _lastMod = null;
|
||||
private Mod? _lastMod;
|
||||
|
||||
public ModPanelTabBar(ModEditWindow modEditWindow, ModPanelSettingsTab settings, ModPanelDescriptionTab description,
|
||||
ModPanelConflictsTab conflicts, ModPanelChangedItemsTab changedItems, ModPanelEditTab edit, ModManager modManager,
|
||||
|
|
@ -49,15 +50,15 @@ public class ModPanelTabBar
|
|||
_tutorial = tutorial;
|
||||
Collections = collections;
|
||||
|
||||
Tabs = new ITab[]
|
||||
{
|
||||
Tabs =
|
||||
[
|
||||
Settings,
|
||||
Description,
|
||||
Conflicts,
|
||||
ChangedItems,
|
||||
Collections,
|
||||
Edit,
|
||||
};
|
||||
];
|
||||
}
|
||||
|
||||
public void Draw(Mod mod)
|
||||
|
|
|
|||
|
|
@ -3,12 +3,13 @@ using Dalamud.Interface.Utility;
|
|||
using ImGuiNET;
|
||||
using OtterGui;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Mods;
|
||||
using Penumbra.Mods.Manager;
|
||||
|
||||
namespace Penumbra.UI.ModsTab;
|
||||
|
||||
public class MultiModPanel(ModFileSystemSelector _selector, ModDataEditor _editor)
|
||||
public class MultiModPanel(ModFileSystemSelector _selector, ModDataEditor _editor) : IUiService
|
||||
{
|
||||
public void Draw()
|
||||
{
|
||||
|
|
@ -65,8 +66,8 @@ public class MultiModPanel(ModFileSystemSelector _selector, ModDataEditor _edito
|
|||
}
|
||||
|
||||
private string _tag = string.Empty;
|
||||
private readonly List<Mod> _addMods = [];
|
||||
private readonly List<(Mod, int)> _removeMods = [];
|
||||
private readonly List<Mod> _addMods = [];
|
||||
private readonly List<(Mod, int)> _removeMods = [];
|
||||
|
||||
private void DrawMultiTagger()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,14 +6,14 @@ using Newtonsoft.Json.Linq;
|
|||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.Mods.Manager;
|
||||
using Penumbra.Services;
|
||||
using Penumbra.UI.Classes;
|
||||
using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs;
|
||||
|
||||
namespace Penumbra.UI;
|
||||
|
||||
public sealed class PredefinedTagManager : ISavable, IReadOnlyList<string>
|
||||
public sealed class PredefinedTagManager : ISavable, IReadOnlyList<string>, IService
|
||||
{
|
||||
public const int Version = 1;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ using FFXIVClientStructs.FFXIV.Client.Game.Object;
|
|||
using FFXIVClientStructs.FFXIV.Client.System.Resource;
|
||||
using ImGuiNET;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Collections;
|
||||
|
|
@ -15,7 +16,7 @@ using Penumbra.UI.Classes;
|
|||
|
||||
namespace Penumbra.UI.ResourceWatcher;
|
||||
|
||||
public sealed class ResourceWatcher : IDisposable, ITab
|
||||
public sealed class ResourceWatcher : IDisposable, ITab, IUiService
|
||||
{
|
||||
public const int DefaultMaxEntries = 1024;
|
||||
public const RecordType AllRecords = RecordType.Request | RecordType.ResourceLoad | RecordType.FileLoad | RecordType.Destruction;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ using ImGuiNET;
|
|||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Collections.Manager;
|
||||
|
|
@ -17,7 +18,7 @@ public class ChangedItemsTab(
|
|||
CollectionSelectHeader collectionHeader,
|
||||
ChangedItemDrawer drawer,
|
||||
CommunicatorService communicator)
|
||||
: ITab
|
||||
: ITab, IUiService
|
||||
{
|
||||
public ReadOnlySpan<byte> Label
|
||||
=> "Changed Items"u8;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ using Dalamud.Game.ClientState.Objects;
|
|||
using Dalamud.Plugin;
|
||||
using ImGuiNET;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.Collections.Manager;
|
||||
using Penumbra.GameData.Actors;
|
||||
|
|
@ -11,7 +12,7 @@ using Penumbra.UI.CollectionTab;
|
|||
|
||||
namespace Penumbra.UI.Tabs;
|
||||
|
||||
public sealed class CollectionsTab : IDisposable, ITab
|
||||
public sealed class CollectionsTab : IDisposable, ITab, IUiService
|
||||
{
|
||||
private readonly EphemeralConfig _config;
|
||||
private readonly CollectionSelector _selector;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using ImGuiNET;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Mods;
|
||||
|
|
@ -8,7 +9,7 @@ using Watcher = Penumbra.UI.ResourceWatcher.ResourceWatcher;
|
|||
|
||||
namespace Penumbra.UI.Tabs;
|
||||
|
||||
public class ConfigTabBar : IDisposable
|
||||
public class ConfigTabBar : IDisposable, IUiService
|
||||
{
|
||||
private readonly CommunicatorService _communicator;
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ using Penumbra.Api.IpcTester;
|
|||
|
||||
namespace Penumbra.UI.Tabs.Debug;
|
||||
|
||||
public class Diagnostics(IServiceProvider provider)
|
||||
public class Diagnostics(ServiceManager provider) : IUiService
|
||||
{
|
||||
public void DrawDiagnostics()
|
||||
{
|
||||
|
|
@ -55,7 +55,7 @@ public class Diagnostics(IServiceProvider provider)
|
|||
foreach (var type in typeof(ActorManager).Assembly.GetTypes()
|
||||
.Where(t => t is { IsAbstract: false, IsInterface: false } && t.IsAssignableTo(typeof(IAsyncDataContainer))))
|
||||
{
|
||||
var container = (IAsyncDataContainer)provider.GetRequiredService(type);
|
||||
var container = (IAsyncDataContainer)provider.Provider!.GetRequiredService(type);
|
||||
ImGuiUtil.DrawTableColumn(container.Name);
|
||||
ImGuiUtil.DrawTableColumn(container.Time.ToString());
|
||||
ImGuiUtil.DrawTableColumn(Functions.HumanReadableSize(container.Memory));
|
||||
|
|
@ -64,7 +64,7 @@ public class Diagnostics(IServiceProvider provider)
|
|||
}
|
||||
}
|
||||
|
||||
public class DebugTab : Window, ITab
|
||||
public class DebugTab : Window, ITab, IUiService
|
||||
{
|
||||
private readonly PerformanceTracker _performance;
|
||||
private readonly Configuration _config;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ using ImGuiNET;
|
|||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.Collections;
|
||||
using Penumbra.Collections.Cache;
|
||||
|
|
@ -15,7 +16,7 @@ using Penumbra.UI.Classes;
|
|||
namespace Penumbra.UI.Tabs;
|
||||
|
||||
public class EffectiveTab(CollectionManager collectionManager, CollectionSelectHeader collectionHeader)
|
||||
: ITab
|
||||
: ITab, IUiService
|
||||
{
|
||||
public ReadOnlySpan<byte> Label
|
||||
=> "Effective Changes"u8;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.Services;
|
||||
|
||||
namespace Penumbra.UI.Tabs;
|
||||
|
||||
public class MessagesTab(MessageService messages) : ITab
|
||||
public class MessagesTab(MessageService messages) : ITab, IUiService
|
||||
{
|
||||
public ReadOnlySpan<byte> Label
|
||||
=> "Messages"u8;
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ using Penumbra.UI.Classes;
|
|||
using Dalamud.Interface;
|
||||
using Dalamud.Plugin.Services;
|
||||
using FFXIVClientStructs.FFXIV.Client.Game.Housing;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.Api.Enums;
|
||||
using Penumbra.Interop.Services;
|
||||
|
|
@ -30,7 +31,7 @@ public class ModsTab(
|
|||
CollectionSelectHeader collectionHeader,
|
||||
ITargetManager targets,
|
||||
ObjectManager objects)
|
||||
: ITab
|
||||
: ITab, IUiService
|
||||
{
|
||||
private readonly ActiveCollections _activeCollections = collectionManager.Active;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,16 +1,12 @@
|
|||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.UI.AdvancedWindow;
|
||||
|
||||
namespace Penumbra.UI.Tabs;
|
||||
|
||||
public class OnScreenTab : ITab
|
||||
public class OnScreenTab(ResourceTreeViewerFactory resourceTreeViewerFactory) : ITab, IUiService
|
||||
{
|
||||
private readonly ResourceTreeViewer _viewer;
|
||||
|
||||
public OnScreenTab(ResourceTreeViewerFactory resourceTreeViewerFactory)
|
||||
{
|
||||
_viewer = resourceTreeViewerFactory.Create(0, delegate { }, delegate { });
|
||||
}
|
||||
private readonly ResourceTreeViewer _viewer = resourceTreeViewerFactory.Create(0, delegate { }, delegate { });
|
||||
|
||||
public ReadOnlySpan<byte> Label
|
||||
=> "On-Screen"u8;
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ using FFXIVClientStructs.STD;
|
|||
using ImGuiNET;
|
||||
using OtterGui;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.Interop.ResourceLoading;
|
||||
using Penumbra.String.Classes;
|
||||
|
|
@ -13,7 +14,7 @@ using Penumbra.String.Classes;
|
|||
namespace Penumbra.UI.Tabs;
|
||||
|
||||
public class ResourceTab(Configuration config, ResourceManagerService resourceManager, ISigScanner sigScanner)
|
||||
: ITab
|
||||
: ITab, IUiService
|
||||
{
|
||||
public ReadOnlySpan<byte> Label
|
||||
=> "Resource Manager"u8;
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ using OtterGui;
|
|||
using OtterGui.Compression;
|
||||
using OtterGui.Custom;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.Api;
|
||||
using Penumbra.Interop.Services;
|
||||
|
|
@ -19,7 +20,7 @@ using Penumbra.UI.ModsTab;
|
|||
|
||||
namespace Penumbra.UI.Tabs;
|
||||
|
||||
public class SettingsTab : ITab
|
||||
public class SettingsTab : ITab, IUiService
|
||||
{
|
||||
public const int RootDirectoryMaxLength = 64;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
using OtterGui.Services;
|
||||
using OtterGui.Widgets;
|
||||
using Penumbra.Collections;
|
||||
using Penumbra.Collections.Manager;
|
||||
|
|
@ -40,7 +41,7 @@ public enum BasicTutorialSteps
|
|||
}
|
||||
|
||||
/// <summary> Service for the in-game tutorial. </summary>
|
||||
public class TutorialService
|
||||
public class TutorialService : IUiService
|
||||
{
|
||||
public const string SelectedCollection = "Selected Collection";
|
||||
public const string DefaultCollection = "Base Collection";
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.Windowing;
|
||||
using Dalamud.Plugin;
|
||||
using OtterGui.Services;
|
||||
using Penumbra.UI.AdvancedWindow;
|
||||
using Penumbra.UI.Tabs.Debug;
|
||||
|
||||
namespace Penumbra.UI;
|
||||
|
||||
public class PenumbraWindowSystem : IDisposable
|
||||
public class PenumbraWindowSystem : IDisposable, IUiService
|
||||
{
|
||||
private readonly UiBuilder _uiBuilder;
|
||||
private readonly WindowSystem _windowSystem;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue