mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-14 20:54:16 +01:00
Rework DalamudServices,
This commit is contained in:
parent
d8f5851e0c
commit
f022d2be64
19 changed files with 230 additions and 250 deletions
2
OtterGui
2
OtterGui
|
|
@ -1 +1 @@
|
||||||
Subproject commit ac88abfe9eb0bb5d03aec092dc8f4db642ecbd6a
|
Subproject commit 197d23eee167c232000f22ef40a7a2bded913b6c
|
||||||
|
|
@ -40,23 +40,24 @@ public class IpcTester : IDisposable
|
||||||
private readonly Temporary _temporary;
|
private readonly Temporary _temporary;
|
||||||
private readonly ResourceTree _resourceTree;
|
private readonly ResourceTree _resourceTree;
|
||||||
|
|
||||||
public IpcTester(Configuration config, DalamudServices dalamud, PenumbraIpcProviders ipcProviders, ModManager modManager,
|
public IpcTester(Configuration config, DalamudPluginInterface pi, IObjectTable objects, IClientState clientState,
|
||||||
CollectionManager collections, TempModManager tempMods, TempCollectionManager tempCollections, SaveService saveService)
|
PenumbraIpcProviders ipcProviders, ModManager modManager, CollectionManager collections, TempModManager tempMods,
|
||||||
|
TempCollectionManager tempCollections, SaveService saveService)
|
||||||
{
|
{
|
||||||
_ipcProviders = ipcProviders;
|
_ipcProviders = ipcProviders;
|
||||||
_pluginState = new PluginState(dalamud.PluginInterface);
|
_pluginState = new PluginState(pi);
|
||||||
_ipcConfiguration = new IpcConfiguration(dalamud.PluginInterface);
|
_ipcConfiguration = new IpcConfiguration(pi);
|
||||||
_ui = new Ui(dalamud.PluginInterface);
|
_ui = new Ui(pi);
|
||||||
_redrawing = new Redrawing(dalamud);
|
_redrawing = new Redrawing(pi, objects, clientState);
|
||||||
_gameState = new GameState(dalamud.PluginInterface);
|
_gameState = new GameState(pi);
|
||||||
_resolve = new Resolve(dalamud.PluginInterface);
|
_resolve = new Resolve(pi);
|
||||||
_collections = new Collections(dalamud.PluginInterface);
|
_collections = new Collections(pi);
|
||||||
_meta = new Meta(dalamud.PluginInterface);
|
_meta = new Meta(pi);
|
||||||
_mods = new Mods(dalamud.PluginInterface);
|
_mods = new Mods(pi);
|
||||||
_modSettings = new ModSettings(dalamud.PluginInterface);
|
_modSettings = new ModSettings(pi);
|
||||||
_editing = new Editing(dalamud.PluginInterface);
|
_editing = new Editing(pi);
|
||||||
_temporary = new Temporary(dalamud.PluginInterface, modManager, collections, tempMods, tempCollections, saveService, config);
|
_temporary = new Temporary(pi, modManager, collections, tempMods, tempCollections, saveService, config);
|
||||||
_resourceTree = new ResourceTree(dalamud.PluginInterface, dalamud.Objects);
|
_resourceTree = new ResourceTree(pi, objects);
|
||||||
UnsubscribeEvents();
|
UnsubscribeEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -398,17 +399,21 @@ public class IpcTester : IDisposable
|
||||||
|
|
||||||
private class Redrawing
|
private class Redrawing
|
||||||
{
|
{
|
||||||
private readonly DalamudServices _dalamud;
|
private readonly DalamudPluginInterface _pi;
|
||||||
|
private readonly IClientState _clientState;
|
||||||
|
private readonly IObjectTable _objects;
|
||||||
public readonly EventSubscriber<IntPtr, int> Redrawn;
|
public readonly EventSubscriber<IntPtr, int> Redrawn;
|
||||||
|
|
||||||
private string _redrawName = string.Empty;
|
private string _redrawName = string.Empty;
|
||||||
private int _redrawIndex = 0;
|
private int _redrawIndex = 0;
|
||||||
private string _lastRedrawnString = "None";
|
private string _lastRedrawnString = "None";
|
||||||
|
|
||||||
public Redrawing(DalamudServices dalamud)
|
public Redrawing(DalamudPluginInterface pi, IObjectTable objects, IClientState clientState)
|
||||||
{
|
{
|
||||||
_dalamud = dalamud;
|
_pi = pi;
|
||||||
Redrawn = Ipc.GameObjectRedrawn.Subscriber(_dalamud.PluginInterface, SetLastRedrawn);
|
_objects = objects;
|
||||||
|
_clientState = clientState;
|
||||||
|
Redrawn = Ipc.GameObjectRedrawn.Subscriber(_pi, SetLastRedrawn);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Draw()
|
public void Draw()
|
||||||
|
|
@ -426,25 +431,25 @@ public class IpcTester : IDisposable
|
||||||
ImGui.InputTextWithHint("##redrawName", "Name...", ref _redrawName, 32);
|
ImGui.InputTextWithHint("##redrawName", "Name...", ref _redrawName, 32);
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
if (ImGui.Button("Redraw##Name"))
|
if (ImGui.Button("Redraw##Name"))
|
||||||
Ipc.RedrawObjectByName.Subscriber(_dalamud.PluginInterface).Invoke(_redrawName, RedrawType.Redraw);
|
Ipc.RedrawObjectByName.Subscriber(_pi).Invoke(_redrawName, RedrawType.Redraw);
|
||||||
|
|
||||||
DrawIntro(Ipc.RedrawObject.Label, "Redraw Player Character");
|
DrawIntro(Ipc.RedrawObject.Label, "Redraw Player Character");
|
||||||
if (ImGui.Button("Redraw##pc") && _dalamud.ClientState.LocalPlayer != null)
|
if (ImGui.Button("Redraw##pc") && _clientState.LocalPlayer != null)
|
||||||
Ipc.RedrawObject.Subscriber(_dalamud.PluginInterface).Invoke(_dalamud.ClientState.LocalPlayer, RedrawType.Redraw);
|
Ipc.RedrawObject.Subscriber(_pi).Invoke(_clientState.LocalPlayer, RedrawType.Redraw);
|
||||||
|
|
||||||
DrawIntro(Ipc.RedrawObjectByIndex.Label, "Redraw by Index");
|
DrawIntro(Ipc.RedrawObjectByIndex.Label, "Redraw by Index");
|
||||||
var tmp = _redrawIndex;
|
var tmp = _redrawIndex;
|
||||||
ImGui.SetNextItemWidth(100 * UiHelpers.Scale);
|
ImGui.SetNextItemWidth(100 * UiHelpers.Scale);
|
||||||
if (ImGui.DragInt("##redrawIndex", ref tmp, 0.1f, 0, _dalamud.Objects.Length))
|
if (ImGui.DragInt("##redrawIndex", ref tmp, 0.1f, 0, _objects.Length))
|
||||||
_redrawIndex = Math.Clamp(tmp, 0, _dalamud.Objects.Length);
|
_redrawIndex = Math.Clamp(tmp, 0, _objects.Length);
|
||||||
|
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
if (ImGui.Button("Redraw##Index"))
|
if (ImGui.Button("Redraw##Index"))
|
||||||
Ipc.RedrawObjectByIndex.Subscriber(_dalamud.PluginInterface).Invoke(_redrawIndex, RedrawType.Redraw);
|
Ipc.RedrawObjectByIndex.Subscriber(_pi).Invoke(_redrawIndex, RedrawType.Redraw);
|
||||||
|
|
||||||
DrawIntro(Ipc.RedrawAll.Label, "Redraw All");
|
DrawIntro(Ipc.RedrawAll.Label, "Redraw All");
|
||||||
if (ImGui.Button("Redraw##All"))
|
if (ImGui.Button("Redraw##All"))
|
||||||
Ipc.RedrawAll.Subscriber(_dalamud.PluginInterface).Invoke(RedrawType.Redraw);
|
Ipc.RedrawAll.Subscriber(_pi).Invoke(RedrawType.Redraw);
|
||||||
|
|
||||||
DrawIntro(Ipc.GameObjectRedrawn.Label, "Last Redrawn Object:");
|
DrawIntro(Ipc.GameObjectRedrawn.Label, "Last Redrawn Object:");
|
||||||
ImGui.TextUnformatted(_lastRedrawnString);
|
ImGui.TextUnformatted(_lastRedrawnString);
|
||||||
|
|
@ -453,12 +458,12 @@ public class IpcTester : IDisposable
|
||||||
private void SetLastRedrawn(IntPtr address, int index)
|
private void SetLastRedrawn(IntPtr address, int index)
|
||||||
{
|
{
|
||||||
if (index < 0
|
if (index < 0
|
||||||
|| index > _dalamud.Objects.Length
|
|| index > _objects.Length
|
||||||
|| address == IntPtr.Zero
|
|| address == IntPtr.Zero
|
||||||
|| _dalamud.Objects[index]?.Address != address)
|
|| _objects[index]?.Address != address)
|
||||||
_lastRedrawnString = "Invalid";
|
_lastRedrawnString = "Invalid";
|
||||||
|
|
||||||
_lastRedrawnString = $"{_dalamud.Objects[index]!.Name} (0x{address:X}, {index})";
|
_lastRedrawnString = $"{_objects[index]!.Name} (0x{address:X}, {index})";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1529,7 +1534,7 @@ public class IpcTester : IDisposable
|
||||||
if (ImGui.Button("Get##GameObjectResourceTrees"))
|
if (ImGui.Button("Get##GameObjectResourceTrees"))
|
||||||
{
|
{
|
||||||
var gameObjects = GetSelectedGameObjects();
|
var gameObjects = GetSelectedGameObjects();
|
||||||
var subscriber = Ipc.GetGameObjectResourceTrees.Subscriber(_pi);
|
var subscriber = Ipc.GetGameObjectResourceTrees.Subscriber(_pi);
|
||||||
_stopwatch.Restart();
|
_stopwatch.Restart();
|
||||||
var trees = subscriber.Invoke(_withUIData, gameObjects);
|
var trees = subscriber.Invoke(_withUIData, gameObjects);
|
||||||
|
|
||||||
|
|
@ -1563,7 +1568,7 @@ public class IpcTester : IDisposable
|
||||||
DrawPopup(nameof(Ipc.GetGameObjectResourcesOfType), ref _lastGameObjectResourcesOfType, DrawResourcesOfType, _lastCallDuration);
|
DrawPopup(nameof(Ipc.GetGameObjectResourcesOfType), ref _lastGameObjectResourcesOfType, DrawResourcesOfType, _lastCallDuration);
|
||||||
DrawPopup(nameof(Ipc.GetPlayerResourcesOfType), ref _lastPlayerResourcesOfType, DrawResourcesOfType, _lastCallDuration);
|
DrawPopup(nameof(Ipc.GetPlayerResourcesOfType), ref _lastPlayerResourcesOfType, DrawResourcesOfType, _lastCallDuration);
|
||||||
|
|
||||||
DrawPopup(nameof(Ipc.GetGameObjectResourceTrees), ref _lastGameObjectResourceTrees, DrawResourceTrees, _lastCallDuration);
|
DrawPopup(nameof(Ipc.GetGameObjectResourceTrees), ref _lastGameObjectResourceTrees, DrawResourceTrees, _lastCallDuration);
|
||||||
DrawPopup(nameof(Ipc.GetPlayerResourceTrees), ref _lastPlayerResourceTrees, DrawResourceTrees!, _lastCallDuration);
|
DrawPopup(nameof(Ipc.GetPlayerResourceTrees), ref _lastPlayerResourceTrees, DrawResourceTrees!, _lastCallDuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1695,9 +1700,10 @@ public class IpcTester : IDisposable
|
||||||
{
|
{
|
||||||
ImGui.TableSetupColumn("Type", ImGuiTableColumnFlags.WidthStretch, 0.5f);
|
ImGui.TableSetupColumn("Type", ImGuiTableColumnFlags.WidthStretch, 0.5f);
|
||||||
}
|
}
|
||||||
ImGui.TableSetupColumn("Game Path", ImGuiTableColumnFlags.WidthStretch, 0.5f);
|
|
||||||
ImGui.TableSetupColumn("Actual Path", ImGuiTableColumnFlags.WidthStretch, 0.5f);
|
ImGui.TableSetupColumn("Game Path", ImGuiTableColumnFlags.WidthStretch, 0.5f);
|
||||||
ImGui.TableSetupColumn("Object Address", ImGuiTableColumnFlags.WidthStretch, 0.2f);
|
ImGui.TableSetupColumn("Actual Path", ImGuiTableColumnFlags.WidthStretch, 0.5f);
|
||||||
|
ImGui.TableSetupColumn("Object Address", ImGuiTableColumnFlags.WidthStretch, 0.2f);
|
||||||
ImGui.TableSetupColumn("Resource Handle", ImGuiTableColumnFlags.WidthStretch, 0.2f);
|
ImGui.TableSetupColumn("Resource Handle", ImGuiTableColumnFlags.WidthStretch, 0.2f);
|
||||||
ImGui.TableHeadersRow();
|
ImGui.TableHeadersRow();
|
||||||
|
|
||||||
|
|
@ -1707,10 +1713,10 @@ public class IpcTester : IDisposable
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
var hasChildren = node.Children.Any();
|
var hasChildren = node.Children.Any();
|
||||||
using var treeNode = ImRaii.TreeNode(
|
using var treeNode = ImRaii.TreeNode(
|
||||||
$"{(_withUIData ? (node.Name ?? "Unknown") : node.Type)}##{node.ObjectAddress:X8}",
|
$"{(_withUIData ? node.Name ?? "Unknown" : node.Type)}##{node.ObjectAddress:X8}",
|
||||||
hasChildren ?
|
hasChildren
|
||||||
ImGuiTreeNodeFlags.SpanFullWidth :
|
? ImGuiTreeNodeFlags.SpanFullWidth
|
||||||
(ImGuiTreeNodeFlags.SpanFullWidth | ImGuiTreeNodeFlags.Leaf | ImGuiTreeNodeFlags.NoTreePushOnOpen));
|
: ImGuiTreeNodeFlags.SpanFullWidth | ImGuiTreeNodeFlags.Leaf | ImGuiTreeNodeFlags.NoTreePushOnOpen);
|
||||||
if (_withUIData)
|
if (_withUIData)
|
||||||
{
|
{
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
|
|
@ -1718,6 +1724,7 @@ public class IpcTester : IDisposable
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
TextUnformattedMono(node.Icon.ToString());
|
TextUnformattedMono(node.Icon.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImGui.TextUnformatted(node.GamePath ?? "Unknown");
|
ImGui.TextUnformatted(node.GamePath ?? "Unknown");
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
|
|
@ -1728,10 +1735,8 @@ public class IpcTester : IDisposable
|
||||||
TextUnformattedMono($"0x{node.ResourceHandle:X8}");
|
TextUnformattedMono($"0x{node.ResourceHandle:X8}");
|
||||||
|
|
||||||
if (treeNode)
|
if (treeNode)
|
||||||
{
|
|
||||||
foreach (var child in node.Children)
|
foreach (var child in node.Children)
|
||||||
DrawNode(child);
|
DrawNode(child);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var node in tree.Nodes)
|
foreach (var node in tree.Nodes)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using Dalamud.Game.ClientState.Objects.Types;
|
using Dalamud.Game.ClientState.Objects.Types;
|
||||||
|
using Dalamud.Plugin.Services;
|
||||||
using Lumina.Data;
|
using Lumina.Data;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
|
|
@ -88,11 +89,13 @@ public class PenumbraApi : IDisposable, IPenumbraApi
|
||||||
private CommunicatorService _communicator;
|
private CommunicatorService _communicator;
|
||||||
private Lumina.GameData? _lumina;
|
private Lumina.GameData? _lumina;
|
||||||
|
|
||||||
|
private IDataManager _gameData;
|
||||||
|
private IFramework _framework;
|
||||||
|
private IObjectTable _objects;
|
||||||
private ModManager _modManager;
|
private ModManager _modManager;
|
||||||
private ResourceLoader _resourceLoader;
|
private ResourceLoader _resourceLoader;
|
||||||
private Configuration _config;
|
private Configuration _config;
|
||||||
private CollectionManager _collectionManager;
|
private CollectionManager _collectionManager;
|
||||||
private DalamudServices _dalamud;
|
|
||||||
private TempCollectionManager _tempCollections;
|
private TempCollectionManager _tempCollections;
|
||||||
private TempModManager _tempMods;
|
private TempModManager _tempMods;
|
||||||
private ActorManager _actors;
|
private ActorManager _actors;
|
||||||
|
|
@ -106,18 +109,20 @@ public class PenumbraApi : IDisposable, IPenumbraApi
|
||||||
private TextureManager _textureManager;
|
private TextureManager _textureManager;
|
||||||
private ResourceTreeFactory _resourceTreeFactory;
|
private ResourceTreeFactory _resourceTreeFactory;
|
||||||
|
|
||||||
public unsafe PenumbraApi(CommunicatorService communicator, ModManager modManager, ResourceLoader resourceLoader,
|
public unsafe PenumbraApi(CommunicatorService communicator, IDataManager gameData, IFramework framework, IObjectTable objects,
|
||||||
Configuration config, CollectionManager collectionManager, DalamudServices dalamud, TempCollectionManager tempCollections,
|
ModManager modManager, ResourceLoader resourceLoader, Configuration config, CollectionManager collectionManager,
|
||||||
TempModManager tempMods, ActorManager actors, CollectionResolver collectionResolver, CutsceneService cutsceneService,
|
TempCollectionManager tempCollections, TempModManager tempMods, ActorManager actors, CollectionResolver collectionResolver,
|
||||||
ModImportManager modImportManager, CollectionEditor collectionEditor, RedrawService redrawService, ModFileSystem modFileSystem,
|
CutsceneService cutsceneService, ModImportManager modImportManager, CollectionEditor collectionEditor, RedrawService redrawService,
|
||||||
ConfigWindow configWindow, TextureManager textureManager, ResourceTreeFactory resourceTreeFactory)
|
ModFileSystem modFileSystem, ConfigWindow configWindow, TextureManager textureManager, ResourceTreeFactory resourceTreeFactory)
|
||||||
{
|
{
|
||||||
_communicator = communicator;
|
_communicator = communicator;
|
||||||
|
_gameData = gameData;
|
||||||
|
_framework = framework;
|
||||||
|
_objects = objects;
|
||||||
_modManager = modManager;
|
_modManager = modManager;
|
||||||
_resourceLoader = resourceLoader;
|
_resourceLoader = resourceLoader;
|
||||||
_config = config;
|
_config = config;
|
||||||
_collectionManager = collectionManager;
|
_collectionManager = collectionManager;
|
||||||
_dalamud = dalamud;
|
|
||||||
_tempCollections = tempCollections;
|
_tempCollections = tempCollections;
|
||||||
_tempMods = tempMods;
|
_tempMods = tempMods;
|
||||||
_actors = actors;
|
_actors = actors;
|
||||||
|
|
@ -130,7 +135,7 @@ public class PenumbraApi : IDisposable, IPenumbraApi
|
||||||
_configWindow = configWindow;
|
_configWindow = configWindow;
|
||||||
_textureManager = textureManager;
|
_textureManager = textureManager;
|
||||||
_resourceTreeFactory = resourceTreeFactory;
|
_resourceTreeFactory = resourceTreeFactory;
|
||||||
_lumina = _dalamud.GameData.GameData;
|
_lumina = gameData.GameData;
|
||||||
|
|
||||||
_resourceLoader.ResourceLoaded += OnResourceLoaded;
|
_resourceLoader.ResourceLoaded += OnResourceLoaded;
|
||||||
_communicator.ModPathChanged.Subscribe(ModPathChangeSubscriber, ModPathChanged.Priority.Api);
|
_communicator.ModPathChanged.Subscribe(ModPathChangeSubscriber, ModPathChanged.Priority.Api);
|
||||||
|
|
@ -153,7 +158,6 @@ public class PenumbraApi : IDisposable, IPenumbraApi
|
||||||
_resourceLoader = null!;
|
_resourceLoader = null!;
|
||||||
_config = null!;
|
_config = null!;
|
||||||
_collectionManager = null!;
|
_collectionManager = null!;
|
||||||
_dalamud = null!;
|
|
||||||
_tempCollections = null!;
|
_tempCollections = null!;
|
||||||
_tempMods = null!;
|
_tempMods = null!;
|
||||||
_actors = null!;
|
_actors = null!;
|
||||||
|
|
@ -166,6 +170,7 @@ public class PenumbraApi : IDisposable, IPenumbraApi
|
||||||
_configWindow = null!;
|
_configWindow = null!;
|
||||||
_textureManager = null!;
|
_textureManager = null!;
|
||||||
_resourceTreeFactory = null!;
|
_resourceTreeFactory = null!;
|
||||||
|
_framework = null!;
|
||||||
}
|
}
|
||||||
|
|
||||||
public event ChangedItemClick? ChangedItemClicked
|
public event ChangedItemClick? ChangedItemClicked
|
||||||
|
|
@ -399,7 +404,7 @@ public class PenumbraApi : IDisposable, IPenumbraApi
|
||||||
|
|
||||||
return await Task.Run(async () =>
|
return await Task.Run(async () =>
|
||||||
{
|
{
|
||||||
var playerCollection = await _dalamud.Framework.RunOnFrameworkThread(_collectionResolver.PlayerCollection).ConfigureAwait(false);
|
var playerCollection = await _framework.RunOnFrameworkThread(_collectionResolver.PlayerCollection).ConfigureAwait(false);
|
||||||
var forwardTask = Task.Run(() =>
|
var forwardTask = Task.Run(() =>
|
||||||
{
|
{
|
||||||
var forwardRet = new string[forward.Length];
|
var forwardRet = new string[forward.Length];
|
||||||
|
|
@ -851,7 +856,7 @@ public class PenumbraApi : IDisposable, IPenumbraApi
|
||||||
{
|
{
|
||||||
CheckInitialized();
|
CheckInitialized();
|
||||||
|
|
||||||
if (!ActorManager.VerifyPlayerName(character.AsSpan()) || tag.Length == 0)
|
if (!ActorIdentifierFactory.VerifyPlayerName(character.AsSpan()) || tag.Length == 0)
|
||||||
return (PenumbraApiEc.InvalidArgument, string.Empty);
|
return (PenumbraApiEc.InvalidArgument, string.Empty);
|
||||||
|
|
||||||
var identifier = NameToIdentifier(character, ushort.MaxValue);
|
var identifier = NameToIdentifier(character, ushort.MaxValue);
|
||||||
|
|
@ -889,10 +894,10 @@ public class PenumbraApi : IDisposable, IPenumbraApi
|
||||||
{
|
{
|
||||||
CheckInitialized();
|
CheckInitialized();
|
||||||
|
|
||||||
if (actorIndex < 0 || actorIndex >= _dalamud.Objects.Length)
|
if (actorIndex < 0 || actorIndex >= _objects.Length)
|
||||||
return PenumbraApiEc.InvalidArgument;
|
return PenumbraApiEc.InvalidArgument;
|
||||||
|
|
||||||
var identifier = _actors.FromObject(_dalamud.Objects[actorIndex], false, false, true);
|
var identifier = _actors.FromObject(_objects[actorIndex], false, false, true);
|
||||||
if (!identifier.IsValid)
|
if (!identifier.IsValid)
|
||||||
return PenumbraApiEc.InvalidArgument;
|
return PenumbraApiEc.InvalidArgument;
|
||||||
|
|
||||||
|
|
@ -1037,7 +1042,7 @@ public class PenumbraApi : IDisposable, IPenumbraApi
|
||||||
|
|
||||||
public IReadOnlyDictionary<string, string[]>?[] GetGameObjectResourcePaths(ushort[] gameObjects)
|
public IReadOnlyDictionary<string, string[]>?[] GetGameObjectResourcePaths(ushort[] gameObjects)
|
||||||
{
|
{
|
||||||
var characters = gameObjects.Select(index => _dalamud.Objects[index]).OfType<Character>();
|
var characters = gameObjects.Select(index => _objects[index]).OfType<Character>();
|
||||||
var resourceTrees = _resourceTreeFactory.FromCharacters(characters, 0);
|
var resourceTrees = _resourceTreeFactory.FromCharacters(characters, 0);
|
||||||
var pathDictionaries = ResourceTreeApiHelper.GetResourcePathDictionaries(resourceTrees);
|
var pathDictionaries = ResourceTreeApiHelper.GetResourcePathDictionaries(resourceTrees);
|
||||||
|
|
||||||
|
|
@ -1055,7 +1060,7 @@ public class PenumbraApi : IDisposable, IPenumbraApi
|
||||||
public IReadOnlyDictionary<nint, (string, string, ChangedItemIcon)>?[] GetGameObjectResourcesOfType(ResourceType type, bool withUIData,
|
public IReadOnlyDictionary<nint, (string, string, ChangedItemIcon)>?[] GetGameObjectResourcesOfType(ResourceType type, bool withUIData,
|
||||||
params ushort[] gameObjects)
|
params ushort[] gameObjects)
|
||||||
{
|
{
|
||||||
var characters = gameObjects.Select(index => _dalamud.Objects[index]).OfType<Character>();
|
var characters = gameObjects.Select(index => _objects[index]).OfType<Character>();
|
||||||
var resourceTrees = _resourceTreeFactory.FromCharacters(characters, withUIData ? ResourceTreeFactory.Flags.WithUiData : 0);
|
var resourceTrees = _resourceTreeFactory.FromCharacters(characters, withUIData ? ResourceTreeFactory.Flags.WithUiData : 0);
|
||||||
var resDictionaries = ResourceTreeApiHelper.GetResourcesOfType(resourceTrees, type);
|
var resDictionaries = ResourceTreeApiHelper.GetResourcesOfType(resourceTrees, type);
|
||||||
|
|
||||||
|
|
@ -1074,7 +1079,7 @@ public class PenumbraApi : IDisposable, IPenumbraApi
|
||||||
|
|
||||||
public Ipc.ResourceTree?[] GetGameObjectResourceTrees(bool withUIData, params ushort[] gameObjects)
|
public Ipc.ResourceTree?[] GetGameObjectResourceTrees(bool withUIData, params ushort[] gameObjects)
|
||||||
{
|
{
|
||||||
var characters = gameObjects.Select(index => _dalamud.Objects[index]).OfType<Character>();
|
var characters = gameObjects.Select(index => _objects[index]).OfType<Character>();
|
||||||
var resourceTrees = _resourceTreeFactory.FromCharacters(characters, withUIData ? ResourceTreeFactory.Flags.WithUiData : 0);
|
var resourceTrees = _resourceTreeFactory.FromCharacters(characters, withUIData ? ResourceTreeFactory.Flags.WithUiData : 0);
|
||||||
var resDictionary = ResourceTreeApiHelper.EncapsulateResourceTrees(resourceTrees);
|
var resDictionary = ResourceTreeApiHelper.EncapsulateResourceTrees(resourceTrees);
|
||||||
|
|
||||||
|
|
@ -1126,10 +1131,10 @@ public class PenumbraApi : IDisposable, IPenumbraApi
|
||||||
private unsafe bool AssociatedCollection(int gameObjectIdx, out ModCollection collection)
|
private unsafe bool AssociatedCollection(int gameObjectIdx, out ModCollection collection)
|
||||||
{
|
{
|
||||||
collection = _collectionManager.Active.Default;
|
collection = _collectionManager.Active.Default;
|
||||||
if (gameObjectIdx < 0 || gameObjectIdx >= _dalamud.Objects.Length)
|
if (gameObjectIdx < 0 || gameObjectIdx >= _objects.Length)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var ptr = (FFXIVClientStructs.FFXIV.Client.Game.Object.GameObject*)_dalamud.Objects.GetObjectAddress(gameObjectIdx);
|
var ptr = (FFXIVClientStructs.FFXIV.Client.Game.Object.GameObject*)_objects.GetObjectAddress(gameObjectIdx);
|
||||||
var data = _collectionResolver.IdentifyCollection(ptr, false);
|
var data = _collectionResolver.IdentifyCollection(ptr, false);
|
||||||
if (data.Valid)
|
if (data.Valid)
|
||||||
collection = data.ModCollection;
|
collection = data.ModCollection;
|
||||||
|
|
@ -1140,10 +1145,10 @@ public class PenumbraApi : IDisposable, IPenumbraApi
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
|
||||||
private unsafe ActorIdentifier AssociatedIdentifier(int gameObjectIdx)
|
private unsafe ActorIdentifier AssociatedIdentifier(int gameObjectIdx)
|
||||||
{
|
{
|
||||||
if (gameObjectIdx < 0 || gameObjectIdx >= _dalamud.Objects.Length)
|
if (gameObjectIdx < 0 || gameObjectIdx >= _objects.Length)
|
||||||
return ActorIdentifier.Invalid;
|
return ActorIdentifier.Invalid;
|
||||||
|
|
||||||
var ptr = (FFXIVClientStructs.FFXIV.Client.Game.Object.GameObject*)_dalamud.Objects.GetObjectAddress(gameObjectIdx);
|
var ptr = (FFXIVClientStructs.FFXIV.Client.Game.Object.GameObject*)_objects.GetObjectAddress(gameObjectIdx);
|
||||||
return _actors.FromObject(ptr, out _, false, true, true);
|
return _actors.FromObject(ptr, out _, false, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1168,7 +1173,7 @@ public class PenumbraApi : IDisposable, IPenumbraApi
|
||||||
if (Path.IsPathRooted(resolvedPath))
|
if (Path.IsPathRooted(resolvedPath))
|
||||||
return _lumina?.GetFileFromDisk<T>(resolvedPath);
|
return _lumina?.GetFileFromDisk<T>(resolvedPath);
|
||||||
|
|
||||||
return _dalamud.GameData.GetFile<T>(resolvedPath);
|
return _gameData.GetFile<T>(resolvedPath);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ using CurrentSettings = ValueTuple<PenumbraApiEc, (bool, int, IDictionary<string
|
||||||
public class PenumbraIpcProviders : IDisposable
|
public class PenumbraIpcProviders : IDisposable
|
||||||
{
|
{
|
||||||
internal readonly IPenumbraApi Api;
|
internal readonly IPenumbraApi Api;
|
||||||
internal readonly IpcTester Tester;
|
|
||||||
|
|
||||||
// Plugin State
|
// Plugin State
|
||||||
internal readonly EventProvider Initialized;
|
internal readonly EventProvider Initialized;
|
||||||
|
|
@ -133,10 +132,9 @@ public class PenumbraIpcProviders : IDisposable
|
||||||
internal readonly FuncProvider<bool, ushort[], Ipc.ResourceTree?[]> GetGameObjectResourceTrees;
|
internal readonly FuncProvider<bool, ushort[], Ipc.ResourceTree?[]> GetGameObjectResourceTrees;
|
||||||
internal readonly FuncProvider<bool, IReadOnlyDictionary<ushort, Ipc.ResourceTree>> GetPlayerResourceTrees;
|
internal readonly FuncProvider<bool, IReadOnlyDictionary<ushort, Ipc.ResourceTree>> GetPlayerResourceTrees;
|
||||||
|
|
||||||
public PenumbraIpcProviders(DalamudServices dalamud, IPenumbraApi api, ModManager modManager, CollectionManager collections,
|
public PenumbraIpcProviders(DalamudPluginInterface pi, IPenumbraApi api, ModManager modManager, CollectionManager collections,
|
||||||
TempModManager tempMods, TempCollectionManager tempCollections, SaveService saveService, Configuration config)
|
TempModManager tempMods, TempCollectionManager tempCollections, SaveService saveService, Configuration config)
|
||||||
{
|
{
|
||||||
var pi = dalamud.PluginInterface;
|
|
||||||
Api = api;
|
Api = api;
|
||||||
|
|
||||||
// Plugin State
|
// Plugin State
|
||||||
|
|
@ -260,15 +258,11 @@ public class PenumbraIpcProviders : IDisposable
|
||||||
GetGameObjectResourceTrees = Ipc.GetGameObjectResourceTrees.Provider(pi, Api.GetGameObjectResourceTrees);
|
GetGameObjectResourceTrees = Ipc.GetGameObjectResourceTrees.Provider(pi, Api.GetGameObjectResourceTrees);
|
||||||
GetPlayerResourceTrees = Ipc.GetPlayerResourceTrees.Provider(pi, Api.GetPlayerResourceTrees);
|
GetPlayerResourceTrees = Ipc.GetPlayerResourceTrees.Provider(pi, Api.GetPlayerResourceTrees);
|
||||||
|
|
||||||
Tester = new IpcTester(config, dalamud, this, modManager, collections, tempMods, tempCollections, saveService);
|
|
||||||
|
|
||||||
Initialized.Invoke();
|
Initialized.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
Tester.Dispose();
|
|
||||||
|
|
||||||
// Plugin State
|
// Plugin State
|
||||||
Initialized.Dispose();
|
Initialized.Dispose();
|
||||||
ApiVersion.Dispose();
|
ApiVersion.Dispose();
|
||||||
|
|
|
||||||
|
|
@ -44,8 +44,8 @@ public static class TexFileParser
|
||||||
if (offset == 0)
|
if (offset == 0)
|
||||||
return i;
|
return i;
|
||||||
|
|
||||||
var requiredSize = width * height * bits / 8;
|
var Size = width * height * bits / 8;
|
||||||
if (offset + requiredSize > data.Length)
|
if (offset + Size > data.Length)
|
||||||
return i;
|
return i;
|
||||||
|
|
||||||
var diff = offset - lastOffset;
|
var diff = offset - lastOffset;
|
||||||
|
|
@ -55,7 +55,7 @@ public static class TexFileParser
|
||||||
width = Math.Max(width / 2, minSize);
|
width = Math.Max(width / 2, minSize);
|
||||||
height = Math.Max(height / 2, minSize);
|
height = Math.Max(height / 2, minSize);
|
||||||
lastOffset = offset;
|
lastOffset = offset;
|
||||||
lastSize = requiredSize;
|
lastSize = Size;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 13;
|
return 13;
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ namespace Penumbra.Interop.ResourceLoading;
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public unsafe class CreateFileWHook : IDisposable
|
public unsafe class CreateFileWHook : IDisposable
|
||||||
{
|
{
|
||||||
public const int RequiredSize = 28;
|
public const int Size = 28;
|
||||||
|
|
||||||
public CreateFileWHook(IGameInteropProvider interop)
|
public CreateFileWHook(IGameInteropProvider interop)
|
||||||
{
|
{
|
||||||
|
|
@ -57,8 +57,8 @@ public unsafe class CreateFileWHook : IDisposable
|
||||||
ptr[22] = (byte)(l >> 16);
|
ptr[22] = (byte)(l >> 16);
|
||||||
ptr[24] = (byte)(l >> 24);
|
ptr[24] = (byte)(l >> 24);
|
||||||
|
|
||||||
ptr[RequiredSize - 2] = 0;
|
ptr[Size - 2] = 0;
|
||||||
ptr[RequiredSize - 1] = 0;
|
ptr[Size - 1] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,9 @@
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
using Dalamud.Plugin.Services;
|
|
||||||
using ImGuiNET;
|
using ImGuiNET;
|
||||||
using Lumina.Excel.GeneratedSheets;
|
using Lumina.Excel.GeneratedSheets;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
using OtterGui.Log;
|
using OtterGui.Log;
|
||||||
|
using OtterGui.Services;
|
||||||
using Penumbra.Api;
|
using Penumbra.Api;
|
||||||
using Penumbra.Api.Enums;
|
using Penumbra.Api.Enums;
|
||||||
using Penumbra.Collections;
|
using Penumbra.Collections;
|
||||||
|
|
@ -19,7 +18,6 @@ using Penumbra.UI.Tabs;
|
||||||
using ChangedItemClick = Penumbra.Communication.ChangedItemClick;
|
using ChangedItemClick = Penumbra.Communication.ChangedItemClick;
|
||||||
using ChangedItemHover = Penumbra.Communication.ChangedItemHover;
|
using ChangedItemHover = Penumbra.Communication.ChangedItemHover;
|
||||||
using OtterGui.Tasks;
|
using OtterGui.Tasks;
|
||||||
using Penumbra.GameData.Data;
|
|
||||||
using Penumbra.GameData.Enums;
|
using Penumbra.GameData.Enums;
|
||||||
using Penumbra.Interop.Structs;
|
using Penumbra.Interop.Structs;
|
||||||
using Penumbra.UI;
|
using Penumbra.UI;
|
||||||
|
|
@ -48,40 +46,40 @@ public class Penumbra : IDalamudPlugin
|
||||||
private PenumbraWindowSystem? _windowSystem;
|
private PenumbraWindowSystem? _windowSystem;
|
||||||
private bool _disposed;
|
private bool _disposed;
|
||||||
|
|
||||||
private readonly ServiceProvider _services;
|
private readonly ServiceManager _services;
|
||||||
|
|
||||||
public Penumbra(DalamudPluginInterface pluginInterface)
|
public Penumbra(DalamudPluginInterface pluginInterface)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_services = ServiceManager.CreateProvider(this, pluginInterface, Log);
|
_services = ServiceManagerA.CreateProvider(this, pluginInterface, Log);
|
||||||
Messager = _services.GetRequiredService<MessageService>();
|
Messager = _services.GetService<MessageService>();
|
||||||
_validityChecker = _services.GetRequiredService<ValidityChecker>();
|
_validityChecker = _services.GetService<ValidityChecker>();
|
||||||
var startup = _services.GetRequiredService<DalamudServices>().GetDalamudConfig(DalamudServices.WaitingForPluginsOption, out bool s)
|
var startup = _services.GetService<DalamudConfigService>().GetDalamudConfig(DalamudConfigService.WaitingForPluginsOption, out bool s)
|
||||||
? s.ToString()
|
? s.ToString()
|
||||||
: "Unknown";
|
: "Unknown";
|
||||||
Log.Information(
|
Log.Information(
|
||||||
$"Loading Penumbra Version {_validityChecker.Version}, Commit #{_validityChecker.CommitHash} with Waiting For Plugins: {startup}...");
|
$"Loading Penumbra Version {_validityChecker.Version}, Commit #{_validityChecker.CommitHash} with Waiting For Plugins: {startup}...");
|
||||||
_services.GetRequiredService<BackupService>(); // Initialize because not required anywhere else.
|
_services.GetService<BackupService>(); // Initialize because not required anywhere else.
|
||||||
_config = _services.GetRequiredService<Configuration>();
|
_config = _services.GetService<Configuration>();
|
||||||
_characterUtility = _services.GetRequiredService<CharacterUtility>();
|
_characterUtility = _services.GetService<CharacterUtility>();
|
||||||
_tempMods = _services.GetRequiredService<TempModManager>();
|
_tempMods = _services.GetService<TempModManager>();
|
||||||
_residentResources = _services.GetRequiredService<ResidentResourceManager>();
|
_residentResources = _services.GetService<ResidentResourceManager>();
|
||||||
_services.GetRequiredService<ResourceManagerService>(); // Initialize because not required anywhere else.
|
_services.GetService<ResourceManagerService>(); // Initialize because not required anywhere else.
|
||||||
_modManager = _services.GetRequiredService<ModManager>();
|
_modManager = _services.GetService<ModManager>();
|
||||||
_collectionManager = _services.GetRequiredService<CollectionManager>();
|
_collectionManager = _services.GetService<CollectionManager>();
|
||||||
_tempCollections = _services.GetRequiredService<TempCollectionManager>();
|
_tempCollections = _services.GetService<TempCollectionManager>();
|
||||||
_redrawService = _services.GetRequiredService<RedrawService>();
|
_redrawService = _services.GetService<RedrawService>();
|
||||||
_communicatorService = _services.GetRequiredService<CommunicatorService>();
|
_communicatorService = _services.GetService<CommunicatorService>();
|
||||||
_services.GetRequiredService<ResourceService>(); // Initialize because not required anywhere else.
|
_services.GetService<ResourceService>(); // Initialize because not required anywhere else.
|
||||||
_services.GetRequiredService<ModCacheManager>(); // Initialize because not required anywhere else.
|
_services.GetService<ModCacheManager>(); // Initialize because not required anywhere else.
|
||||||
_services.GetRequiredService<ModelResourceHandleUtility>(); // Initialize because not required anywhere else.
|
_services.GetService<ModelResourceHandleUtility>(); // Initialize because not required anywhere else.
|
||||||
_collectionManager.Caches.CreateNecessaryCaches();
|
_collectionManager.Caches.CreateNecessaryCaches();
|
||||||
_services.GetRequiredService<PathResolver>();
|
_services.GetService<PathResolver>();
|
||||||
|
|
||||||
_services.GetRequiredService<SkinFixer>();
|
_services.GetService<SkinFixer>();
|
||||||
|
|
||||||
_services.GetRequiredService<DalamudSubstitutionProvider>(); // Initialize before Interface.
|
_services.GetService<DalamudSubstitutionProvider>(); // Initialize before Interface.
|
||||||
SetupInterface();
|
SetupInterface();
|
||||||
SetupApi();
|
SetupApi();
|
||||||
|
|
||||||
|
|
@ -104,8 +102,8 @@ public class Penumbra : IDalamudPlugin
|
||||||
|
|
||||||
private void SetupApi()
|
private void SetupApi()
|
||||||
{
|
{
|
||||||
var api = _services.GetRequiredService<IPenumbraApi>();
|
var api = _services.GetService<IPenumbraApi>();
|
||||||
_services.GetRequiredService<PenumbraIpcProviders>();
|
_services.GetService<PenumbraIpcProviders>();
|
||||||
_communicatorService.ChangedItemHover.Subscribe(it =>
|
_communicatorService.ChangedItemHover.Subscribe(it =>
|
||||||
{
|
{
|
||||||
if (it is (Item, FullEquipType))
|
if (it is (Item, FullEquipType))
|
||||||
|
|
@ -123,9 +121,9 @@ public class Penumbra : IDalamudPlugin
|
||||||
{
|
{
|
||||||
AsyncTask.Run(() =>
|
AsyncTask.Run(() =>
|
||||||
{
|
{
|
||||||
var system = _services.GetRequiredService<PenumbraWindowSystem>();
|
var system = _services.GetService<PenumbraWindowSystem>();
|
||||||
system.Window.Setup(this, _services.GetRequiredService<ConfigTabBar>());
|
system.Window.Setup(this, _services.GetService<ConfigTabBar>());
|
||||||
_services.GetRequiredService<CommandHandler>();
|
_services.GetService<CommandHandler>();
|
||||||
if (!_disposed)
|
if (!_disposed)
|
||||||
_windowSystem = system;
|
_windowSystem = system;
|
||||||
else
|
else
|
||||||
|
|
@ -194,7 +192,7 @@ public class Penumbra : IDalamudPlugin
|
||||||
sb.Append($"> **`Auto-Deduplication: `** {_config.AutoDeduplicateOnImport}\n");
|
sb.Append($"> **`Auto-Deduplication: `** {_config.AutoDeduplicateOnImport}\n");
|
||||||
sb.Append($"> **`Debug Mode: `** {_config.DebugMode}\n");
|
sb.Append($"> **`Debug Mode: `** {_config.DebugMode}\n");
|
||||||
sb.Append(
|
sb.Append(
|
||||||
$"> **`Synchronous Load (Dalamud): `** {(_services.GetRequiredService<DalamudServices>().GetDalamudConfig(DalamudServices.WaitingForPluginsOption, out bool v) ? v.ToString() : "Unknown")}\n");
|
$"> **`Synchronous Load (Dalamud): `** {(_services.GetService<DalamudConfigService>().GetDalamudConfig(DalamudConfigService.WaitingForPluginsOption, out bool v) ? v.ToString() : "Unknown")}\n");
|
||||||
sb.Append(
|
sb.Append(
|
||||||
$"> **`Logging: `** Log: {_config.Ephemeral.EnableResourceLogging}, Watcher: {_config.Ephemeral.EnableResourceWatcher} ({_config.MaxResourceWatcherRecords})\n");
|
$"> **`Logging: `** Log: {_config.Ephemeral.EnableResourceLogging}, Watcher: {_config.Ephemeral.EnableResourceWatcher} ({_config.MaxResourceWatcherRecords})\n");
|
||||||
sb.Append($"> **`Use Ownership: `** {_config.UseOwnerNameForCharacterCollection}\n");
|
sb.Append($"> **`Use Ownership: `** {_config.UseOwnerNameForCharacterCollection}\n");
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
"Tags": [ "modding" ],
|
"Tags": [ "modding" ],
|
||||||
"DalamudApiLevel": 9,
|
"DalamudApiLevel": 9,
|
||||||
"LoadPriority": 69420,
|
"LoadPriority": 69420,
|
||||||
"LoadRequiredState": 2,
|
"LoadState": 2,
|
||||||
"LoadSync": true,
|
"LoadSync": true,
|
||||||
"IconUrl": "https://raw.githubusercontent.com/xivdev/Penumbra/master/images/icon.png"
|
"IconUrl": "https://raw.githubusercontent.com/xivdev/Penumbra/master/images/icon.png"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,15 +5,15 @@ using Dalamud.IoC;
|
||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
using Dalamud.Interface.DragDrop;
|
using Dalamud.Interface.DragDrop;
|
||||||
using Dalamud.Plugin.Services;
|
using Dalamud.Plugin.Services;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using OtterGui.Services;
|
||||||
|
|
||||||
// ReSharper disable AutoPropertyCanBeMadeGetOnly.Local
|
// ReSharper disable AutoPropertyCanBeMadeGetOnly.Local
|
||||||
|
|
||||||
namespace Penumbra.Services;
|
namespace Penumbra.Services;
|
||||||
|
|
||||||
public class DalamudServices
|
public class DalamudConfigService
|
||||||
{
|
{
|
||||||
public DalamudServices(DalamudPluginInterface pluginInterface)
|
public DalamudConfigService(DalamudPluginInterface pluginInterface)
|
||||||
{
|
{
|
||||||
pluginInterface.Inject(this);
|
pluginInterface.Inject(this);
|
||||||
try
|
try
|
||||||
|
|
@ -52,55 +52,6 @@ public class DalamudServices
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddServices(IServiceCollection services)
|
|
||||||
{
|
|
||||||
services.AddSingleton(PluginInterface);
|
|
||||||
services.AddSingleton(Commands);
|
|
||||||
services.AddSingleton(GameData);
|
|
||||||
services.AddSingleton(ClientState);
|
|
||||||
services.AddSingleton(Chat);
|
|
||||||
services.AddSingleton(Framework);
|
|
||||||
services.AddSingleton(Conditions);
|
|
||||||
services.AddSingleton(Targets);
|
|
||||||
services.AddSingleton(Objects);
|
|
||||||
services.AddSingleton(TitleScreenMenu);
|
|
||||||
services.AddSingleton(GameGui);
|
|
||||||
services.AddSingleton(KeyState);
|
|
||||||
services.AddSingleton(SigScanner);
|
|
||||||
services.AddSingleton(this);
|
|
||||||
services.AddSingleton(UiBuilder);
|
|
||||||
services.AddSingleton(DragDropManager);
|
|
||||||
services.AddSingleton(TextureProvider);
|
|
||||||
services.AddSingleton(TextureSubstitutionProvider);
|
|
||||||
services.AddSingleton(Interop);
|
|
||||||
services.AddSingleton(Log);
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO remove static
|
|
||||||
// @formatter:off
|
|
||||||
[PluginService][RequiredVersion("1.0")] public DalamudPluginInterface PluginInterface { get; private set; } = null!;
|
|
||||||
[PluginService][RequiredVersion("1.0")] public ICommandManager Commands { get; private set; } = null!;
|
|
||||||
[PluginService][RequiredVersion("1.0")] public IDataManager GameData { get; private set; } = null!;
|
|
||||||
[PluginService][RequiredVersion("1.0")] public IClientState ClientState { get; private set; } = null!;
|
|
||||||
[PluginService][RequiredVersion("1.0")] public IChatGui Chat { get; private set; } = null!;
|
|
||||||
[PluginService][RequiredVersion("1.0")] public IFramework Framework { get; private set; } = null!;
|
|
||||||
[PluginService][RequiredVersion("1.0")] public ICondition Conditions { get; private set; } = null!;
|
|
||||||
[PluginService][RequiredVersion("1.0")] public ITargetManager Targets { get; private set; } = null!;
|
|
||||||
[PluginService][RequiredVersion("1.0")] public IObjectTable Objects { get; private set; } = null!;
|
|
||||||
[PluginService][RequiredVersion("1.0")] public ITitleScreenMenu TitleScreenMenu { get; private set; } = null!;
|
|
||||||
[PluginService][RequiredVersion("1.0")] public IGameGui GameGui { get; private set; } = null!;
|
|
||||||
[PluginService][RequiredVersion("1.0")] public IKeyState KeyState { get; private set; } = null!;
|
|
||||||
[PluginService][RequiredVersion("1.0")] public ISigScanner SigScanner { get; private set; } = null!;
|
|
||||||
[PluginService][RequiredVersion("1.0")] public IDragDropManager DragDropManager { get; private set; } = null!;
|
|
||||||
[PluginService][RequiredVersion("1.0")] public ITextureProvider TextureProvider { get; private set; } = null!;
|
|
||||||
[PluginService][RequiredVersion("1.0")] public ITextureSubstitutionProvider TextureSubstitutionProvider { get; private set; } = null!;
|
|
||||||
[PluginService][RequiredVersion("1.0")] public IGameInteropProvider Interop { get; private set; } = null!;
|
|
||||||
[PluginService][RequiredVersion("1.0")] public IPluginLog Log { get; private set; } = null!;
|
|
||||||
// @formatter:on
|
|
||||||
|
|
||||||
public UiBuilder UiBuilder
|
|
||||||
=> PluginInterface.UiBuilder;
|
|
||||||
|
|
||||||
public const string WaitingForPluginsOption = "IsResumeGameAfterPluginLoad";
|
public const string WaitingForPluginsOption = "IsResumeGameAfterPluginLoad";
|
||||||
|
|
||||||
private readonly object? _dalamudConfig;
|
private readonly object? _dalamudConfig;
|
||||||
|
|
@ -164,3 +115,29 @@ public class DalamudServices
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class DalamudServices
|
||||||
|
{
|
||||||
|
public static void AddServices(ServiceManager services, DalamudPluginInterface pi)
|
||||||
|
{
|
||||||
|
services.AddExistingService(pi);
|
||||||
|
services.AddExistingService(pi.UiBuilder);
|
||||||
|
services.AddDalamudService<ICommandManager>(pi);
|
||||||
|
services.AddDalamudService<IDataManager>(pi);
|
||||||
|
services.AddDalamudService<IClientState>(pi);
|
||||||
|
services.AddDalamudService<IChatGui>(pi);
|
||||||
|
services.AddDalamudService<IFramework>(pi);
|
||||||
|
services.AddDalamudService<ICondition>(pi);
|
||||||
|
services.AddDalamudService<ITargetManager>(pi);
|
||||||
|
services.AddDalamudService<IObjectTable>(pi);
|
||||||
|
services.AddDalamudService<ITitleScreenMenu>(pi);
|
||||||
|
services.AddDalamudService<IGameGui>(pi);
|
||||||
|
services.AddDalamudService<IKeyState>(pi);
|
||||||
|
services.AddDalamudService<ISigScanner>(pi);
|
||||||
|
services.AddDalamudService<IDragDropManager>(pi);
|
||||||
|
services.AddDalamudService<ITextureProvider>(pi);
|
||||||
|
services.AddDalamudService<ITextureSubstitutionProvider>(pi);
|
||||||
|
services.AddDalamudService<IGameInteropProvider>(pi);
|
||||||
|
services.AddDalamudService<IPluginLog>(pi);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,10 @@ using OtterGui.Services;
|
||||||
using Penumbra.Api;
|
using Penumbra.Api;
|
||||||
using Penumbra.Collections.Cache;
|
using Penumbra.Collections.Cache;
|
||||||
using Penumbra.Collections.Manager;
|
using Penumbra.Collections.Manager;
|
||||||
using Penumbra.GameData;
|
|
||||||
using Penumbra.GameData.Actors;
|
using Penumbra.GameData.Actors;
|
||||||
using Penumbra.GameData.Data;
|
using Penumbra.GameData.Data;
|
||||||
using Penumbra.GameData.DataContainers;
|
using Penumbra.GameData.DataContainers;
|
||||||
using Penumbra.GameData.DataContainers.Bases;
|
using Penumbra.GameData.Structs;
|
||||||
using Penumbra.Import.Textures;
|
using Penumbra.Import.Textures;
|
||||||
using Penumbra.Interop.PathResolving;
|
using Penumbra.Interop.PathResolving;
|
||||||
using Penumbra.Interop.ResourceLoading;
|
using Penumbra.Interop.ResourceLoading;
|
||||||
|
|
@ -33,14 +32,13 @@ using ResidentResourceManager = Penumbra.Interop.Services.ResidentResourceManage
|
||||||
|
|
||||||
namespace Penumbra.Services;
|
namespace Penumbra.Services;
|
||||||
|
|
||||||
public static class ServiceManager
|
public static class ServiceManagerA
|
||||||
{
|
{
|
||||||
public static ServiceProvider CreateProvider(Penumbra penumbra, DalamudPluginInterface pi, Logger log)
|
public static ServiceManager CreateProvider(Penumbra penumbra, DalamudPluginInterface pi, Logger log)
|
||||||
{
|
{
|
||||||
var services = new ServiceCollection()
|
var services = new ServiceManager(log)
|
||||||
.AddSingleton(log)
|
.AddExistingService(log)
|
||||||
.AddSingleton(penumbra)
|
.AddExistingService(penumbra)
|
||||||
.AddDalamud(pi)
|
|
||||||
.AddMeta()
|
.AddMeta()
|
||||||
.AddGameData()
|
.AddGameData()
|
||||||
.AddInterop()
|
.AddInterop()
|
||||||
|
|
@ -51,37 +49,15 @@ public static class ServiceManager
|
||||||
.AddResolvers()
|
.AddResolvers()
|
||||||
.AddInterface()
|
.AddInterface()
|
||||||
.AddModEditor()
|
.AddModEditor()
|
||||||
.AddApi()
|
.AddApi();
|
||||||
.AddDataContainers()
|
services.AddIServices(typeof(EquipItem).Assembly);
|
||||||
.AddAsyncServices();
|
services.AddIServices(typeof(Penumbra).Assembly);
|
||||||
|
DalamudServices.AddServices(services, pi);
|
||||||
return services.BuildServiceProvider(new ServiceProviderOptions { ValidateOnBuild = true });
|
services.CreateProvider();
|
||||||
}
|
|
||||||
|
|
||||||
private static IServiceCollection AddDalamud(this IServiceCollection services, DalamudPluginInterface pi)
|
|
||||||
{
|
|
||||||
var dalamud = new DalamudServices(pi);
|
|
||||||
dalamud.AddServices(services);
|
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IServiceCollection AddDataContainers(this IServiceCollection services)
|
private static ServiceManager AddMeta(this ServiceManager services)
|
||||||
{
|
|
||||||
foreach (var type in typeof(IDataContainer).Assembly.GetExportedTypes()
|
|
||||||
.Where(t => t is { IsAbstract: false, IsInterface: false } && t.IsAssignableTo(typeof(IDataContainer))))
|
|
||||||
services.AddSingleton(type);
|
|
||||||
return services;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static IServiceCollection AddAsyncServices(this IServiceCollection services)
|
|
||||||
{
|
|
||||||
foreach (var type in typeof(ActorManager).Assembly.GetExportedTypes()
|
|
||||||
.Where(t => t is { IsAbstract: false, IsInterface: false } && t.IsAssignableTo(typeof(IService))))
|
|
||||||
services.AddSingleton(type);
|
|
||||||
return services;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static IServiceCollection AddMeta(this IServiceCollection services)
|
|
||||||
=> services.AddSingleton<ValidityChecker>()
|
=> services.AddSingleton<ValidityChecker>()
|
||||||
.AddSingleton<PerformanceTracker>()
|
.AddSingleton<PerformanceTracker>()
|
||||||
.AddSingleton<FilenameService>()
|
.AddSingleton<FilenameService>()
|
||||||
|
|
@ -89,15 +65,16 @@ public static class ServiceManager
|
||||||
.AddSingleton<CommunicatorService>()
|
.AddSingleton<CommunicatorService>()
|
||||||
.AddSingleton<MessageService>()
|
.AddSingleton<MessageService>()
|
||||||
.AddSingleton<SaveService>()
|
.AddSingleton<SaveService>()
|
||||||
.AddSingleton<FileCompactor>();
|
.AddSingleton<FileCompactor>()
|
||||||
|
.AddSingleton<DalamudConfigService>();
|
||||||
|
|
||||||
|
|
||||||
private static IServiceCollection AddGameData(this IServiceCollection services)
|
private static ServiceManager AddGameData(this ServiceManager services)
|
||||||
=> services.AddSingleton<GamePathParser>()
|
=> services.AddSingleton<GamePathParser>()
|
||||||
.AddSingleton<StainService>()
|
.AddSingleton<StainService>()
|
||||||
.AddSingleton<HumanModelList>();
|
.AddSingleton<HumanModelList>();
|
||||||
|
|
||||||
private static IServiceCollection AddInterop(this IServiceCollection services)
|
private static ServiceManager AddInterop(this ServiceManager services)
|
||||||
=> services.AddSingleton<GameEventManager>()
|
=> services.AddSingleton<GameEventManager>()
|
||||||
.AddSingleton<FrameworkManager>()
|
.AddSingleton<FrameworkManager>()
|
||||||
.AddSingleton<CutsceneService>()
|
.AddSingleton<CutsceneService>()
|
||||||
|
|
@ -117,12 +94,12 @@ public static class ServiceManager
|
||||||
.AddSingleton<RedrawService>()
|
.AddSingleton<RedrawService>()
|
||||||
.AddSingleton<ModelResourceHandleUtility>();
|
.AddSingleton<ModelResourceHandleUtility>();
|
||||||
|
|
||||||
private static IServiceCollection AddConfiguration(this IServiceCollection services)
|
private static ServiceManager AddConfiguration(this ServiceManager services)
|
||||||
=> services.AddTransient<ConfigMigrationService>()
|
=> services.AddSingleton<ConfigMigrationService>()
|
||||||
.AddSingleton<Configuration>()
|
.AddSingleton<Configuration>()
|
||||||
.AddSingleton<EphemeralConfig>();
|
.AddSingleton<EphemeralConfig>();
|
||||||
|
|
||||||
private static IServiceCollection AddCollections(this IServiceCollection services)
|
private static ServiceManager AddCollections(this ServiceManager services)
|
||||||
=> services.AddSingleton<CollectionStorage>()
|
=> services.AddSingleton<CollectionStorage>()
|
||||||
.AddSingleton<ActiveCollectionData>()
|
.AddSingleton<ActiveCollectionData>()
|
||||||
.AddSingleton<ActiveCollections>()
|
.AddSingleton<ActiveCollections>()
|
||||||
|
|
@ -132,7 +109,7 @@ public static class ServiceManager
|
||||||
.AddSingleton<CollectionEditor>()
|
.AddSingleton<CollectionEditor>()
|
||||||
.AddSingleton<CollectionManager>();
|
.AddSingleton<CollectionManager>();
|
||||||
|
|
||||||
private static IServiceCollection AddMods(this IServiceCollection services)
|
private static ServiceManager AddMods(this ServiceManager services)
|
||||||
=> services.AddSingleton<TempModManager>()
|
=> services.AddSingleton<TempModManager>()
|
||||||
.AddSingleton<ModDataEditor>()
|
.AddSingleton<ModDataEditor>()
|
||||||
.AddSingleton<ModOptionEditor>()
|
.AddSingleton<ModOptionEditor>()
|
||||||
|
|
@ -144,14 +121,14 @@ public static class ServiceManager
|
||||||
.AddSingleton<ModCacheManager>()
|
.AddSingleton<ModCacheManager>()
|
||||||
.AddSingleton(s => (ModStorage)s.GetRequiredService<ModManager>());
|
.AddSingleton(s => (ModStorage)s.GetRequiredService<ModManager>());
|
||||||
|
|
||||||
private static IServiceCollection AddResources(this IServiceCollection services)
|
private static ServiceManager AddResources(this ServiceManager services)
|
||||||
=> services.AddSingleton<ResourceLoader>()
|
=> services.AddSingleton<ResourceLoader>()
|
||||||
.AddSingleton<ResourceWatcher>()
|
.AddSingleton<ResourceWatcher>()
|
||||||
.AddSingleton<ResourceTreeFactory>()
|
.AddSingleton<ResourceTreeFactory>()
|
||||||
.AddSingleton<MetaFileManager>()
|
.AddSingleton<MetaFileManager>()
|
||||||
.AddSingleton<SkinFixer>();
|
.AddSingleton<SkinFixer>();
|
||||||
|
|
||||||
private static IServiceCollection AddResolvers(this IServiceCollection services)
|
private static ServiceManager AddResolvers(this ServiceManager services)
|
||||||
=> services.AddSingleton<AnimationHookService>()
|
=> services.AddSingleton<AnimationHookService>()
|
||||||
.AddSingleton<CollectionResolver>()
|
.AddSingleton<CollectionResolver>()
|
||||||
.AddSingleton<CutsceneService>()
|
.AddSingleton<CutsceneService>()
|
||||||
|
|
@ -162,7 +139,7 @@ public static class ServiceManager
|
||||||
.AddSingleton<IdentifiedCollectionCache>()
|
.AddSingleton<IdentifiedCollectionCache>()
|
||||||
.AddSingleton<PathResolver>();
|
.AddSingleton<PathResolver>();
|
||||||
|
|
||||||
private static IServiceCollection AddInterface(this IServiceCollection services)
|
private static ServiceManager AddInterface(this ServiceManager services)
|
||||||
=> services.AddSingleton<FileDialogService>()
|
=> services.AddSingleton<FileDialogService>()
|
||||||
.AddSingleton<TutorialService>()
|
.AddSingleton<TutorialService>()
|
||||||
.AddSingleton<PenumbraChangelog>()
|
.AddSingleton<PenumbraChangelog>()
|
||||||
|
|
@ -200,7 +177,7 @@ public static class ServiceManager
|
||||||
.AddSingleton<ChangedItemDrawer>()
|
.AddSingleton<ChangedItemDrawer>()
|
||||||
.AddSingleton(p => new Diagnostics(p));
|
.AddSingleton(p => new Diagnostics(p));
|
||||||
|
|
||||||
private static IServiceCollection AddModEditor(this IServiceCollection services)
|
private static ServiceManager AddModEditor(this ServiceManager services)
|
||||||
=> services.AddSingleton<ModFileCollection>()
|
=> services.AddSingleton<ModFileCollection>()
|
||||||
.AddSingleton<DuplicateManager>()
|
.AddSingleton<DuplicateManager>()
|
||||||
.AddSingleton<MdlMaterialEditor>()
|
.AddSingleton<MdlMaterialEditor>()
|
||||||
|
|
@ -212,10 +189,11 @@ public static class ServiceManager
|
||||||
.AddSingleton<ModEditor>()
|
.AddSingleton<ModEditor>()
|
||||||
.AddSingleton<TextureManager>();
|
.AddSingleton<TextureManager>();
|
||||||
|
|
||||||
private static IServiceCollection AddApi(this IServiceCollection services)
|
private static ServiceManager AddApi(this ServiceManager services)
|
||||||
=> services.AddSingleton<PenumbraApi>()
|
=> services.AddSingleton<PenumbraApi>()
|
||||||
.AddSingleton<IPenumbraApi>(x => x.GetRequiredService<PenumbraApi>())
|
.AddSingleton<IPenumbraApi>(x => x.GetRequiredService<PenumbraApi>())
|
||||||
.AddSingleton<PenumbraIpcProviders>()
|
.AddSingleton<PenumbraIpcProviders>()
|
||||||
.AddSingleton<HttpApi>()
|
.AddSingleton<HttpApi>()
|
||||||
|
.AddSingleton<IpcTester>()
|
||||||
.AddSingleton<DalamudSubstitutionProvider>();
|
.AddSingleton<DalamudSubstitutionProvider>();
|
||||||
}
|
}
|
||||||
|
|
@ -15,7 +15,7 @@ public class ValidityChecker
|
||||||
public readonly bool IsNotInstalledPenumbra;
|
public readonly bool IsNotInstalledPenumbra;
|
||||||
public readonly bool IsValidSourceRepo;
|
public readonly bool IsValidSourceRepo;
|
||||||
|
|
||||||
public readonly List<Exception> ImcExceptions = new();
|
public readonly List<Exception> ImcExceptions = [];
|
||||||
|
|
||||||
public readonly string Version;
|
public readonly string Version;
|
||||||
public readonly string CommitHash;
|
public readonly string CommitHash;
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ public partial class ModEditWindow
|
||||||
LoadedShpkPath = path;
|
LoadedShpkPath = path;
|
||||||
var data = LoadedShpkPath.IsRooted
|
var data = LoadedShpkPath.IsRooted
|
||||||
? File.ReadAllBytes(LoadedShpkPath.FullName)
|
? File.ReadAllBytes(LoadedShpkPath.FullName)
|
||||||
: _edit._dalamud.GameData.GetFile(LoadedShpkPath.InternalName.ToString())?.Data;
|
: _edit._gameData.GetFile(LoadedShpkPath.InternalName.ToString())?.Data;
|
||||||
AssociatedShpk = data?.Length > 0 ? new ShpkFile(data) : throw new Exception("Failure to load file data.");
|
AssociatedShpk = data?.Length > 0 ? new ShpkFile(data) : throw new Exception("Failure to load file data.");
|
||||||
LoadedShpkPathName = path.ToPath();
|
LoadedShpkPathName = path.ToPath();
|
||||||
}
|
}
|
||||||
|
|
@ -457,13 +457,13 @@ public partial class ModEditWindow
|
||||||
var foundMaterials = new HashSet<nint>();
|
var foundMaterials = new HashSet<nint>();
|
||||||
foreach (var materialInfo in instances)
|
foreach (var materialInfo in instances)
|
||||||
{
|
{
|
||||||
var material = materialInfo.GetDrawObjectMaterial(_edit._dalamud.Objects);
|
var material = materialInfo.GetDrawObjectMaterial(_edit._objects);
|
||||||
if (foundMaterials.Contains((nint)material))
|
if (foundMaterials.Contains((nint)material))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
MaterialPreviewers.Add(new LiveMaterialPreviewer(_edit._dalamud.Objects, materialInfo));
|
MaterialPreviewers.Add(new LiveMaterialPreviewer(_edit._objects, materialInfo));
|
||||||
foundMaterials.Add((nint)material);
|
foundMaterials.Add((nint)material);
|
||||||
}
|
}
|
||||||
catch (InvalidOperationException)
|
catch (InvalidOperationException)
|
||||||
|
|
@ -481,7 +481,7 @@ public partial class ModEditWindow
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ColorTablePreviewers.Add(new LiveColorTablePreviewer(_edit._dalamud.Objects, _edit._dalamud.Framework, materialInfo));
|
ColorTablePreviewers.Add(new LiveColorTablePreviewer(_edit._objects, _edit._framework, materialInfo));
|
||||||
}
|
}
|
||||||
catch (InvalidOperationException)
|
catch (InvalidOperationException)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ public partial class ModEditWindow
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var file = _dalamud.GameData.GetFile(path);
|
var file = _gameData.GetFile(path);
|
||||||
writable = file == null ? null : new RawGameFileWritable(file);
|
writable = file == null ? null : new RawGameFileWritable(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -219,7 +219,7 @@ public partial class ModEditWindow
|
||||||
if (tex.Path != path)
|
if (tex.Path != path)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_dalamud.Framework.RunOnFrameworkThread(() => tex.Reload(_textures));
|
_framework.RunOnFrameworkThread(() => tex.Reload(_textures));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,6 @@ public partial class ModEditWindow : Window, IDisposable
|
||||||
private readonly ModEditor _editor;
|
private readonly ModEditor _editor;
|
||||||
private readonly Configuration _config;
|
private readonly Configuration _config;
|
||||||
private readonly ItemSwapTab _itemSwapTab;
|
private readonly ItemSwapTab _itemSwapTab;
|
||||||
private readonly DalamudServices _dalamud;
|
|
||||||
private readonly MetaFileManager _metaFileManager;
|
private readonly MetaFileManager _metaFileManager;
|
||||||
private readonly ActiveCollections _activeCollections;
|
private readonly ActiveCollections _activeCollections;
|
||||||
private readonly StainService _stainService;
|
private readonly StainService _stainService;
|
||||||
|
|
@ -44,6 +43,9 @@ public partial class ModEditWindow : Window, IDisposable
|
||||||
private readonly CommunicatorService _communicator;
|
private readonly CommunicatorService _communicator;
|
||||||
private readonly IDragDropManager _dragDropManager;
|
private readonly IDragDropManager _dragDropManager;
|
||||||
private readonly GameEventManager _gameEvents;
|
private readonly GameEventManager _gameEvents;
|
||||||
|
private readonly IDataManager _gameData;
|
||||||
|
private readonly IFramework _framework;
|
||||||
|
private readonly IObjectTable _objects;
|
||||||
|
|
||||||
private Mod? _mod;
|
private Mod? _mod;
|
||||||
private Vector2 _iconSize = Vector2.Zero;
|
private Vector2 _iconSize = Vector2.Zero;
|
||||||
|
|
@ -562,37 +564,41 @@ public partial class ModEditWindow : Window, IDisposable
|
||||||
|
|
||||||
public ModEditWindow(PerformanceTracker performance, FileDialogService fileDialog, ItemSwapTab itemSwapTab, IDataManager gameData,
|
public ModEditWindow(PerformanceTracker performance, FileDialogService fileDialog, ItemSwapTab itemSwapTab, IDataManager gameData,
|
||||||
Configuration config, ModEditor editor, ResourceTreeFactory resourceTreeFactory, MetaFileManager metaFileManager,
|
Configuration config, ModEditor editor, ResourceTreeFactory resourceTreeFactory, MetaFileManager metaFileManager,
|
||||||
StainService stainService, ActiveCollections activeCollections, DalamudServices dalamud, ModMergeTab modMergeTab,
|
StainService stainService, ActiveCollections activeCollections, ModMergeTab modMergeTab,
|
||||||
CommunicatorService communicator, TextureManager textures, IDragDropManager dragDropManager, GameEventManager gameEvents,
|
CommunicatorService communicator, TextureManager textures, IDragDropManager dragDropManager, GameEventManager gameEvents,
|
||||||
ChangedItemDrawer changedItemDrawer)
|
ChangedItemDrawer changedItemDrawer, IObjectTable objects, IFramework framework)
|
||||||
: base(WindowBaseLabel)
|
: base(WindowBaseLabel)
|
||||||
{
|
{
|
||||||
_performance = performance;
|
_performance = performance;
|
||||||
_itemSwapTab = itemSwapTab;
|
_itemSwapTab = itemSwapTab;
|
||||||
|
_gameData = gameData;
|
||||||
_config = config;
|
_config = config;
|
||||||
_editor = editor;
|
_editor = editor;
|
||||||
_metaFileManager = metaFileManager;
|
_metaFileManager = metaFileManager;
|
||||||
_stainService = stainService;
|
_stainService = stainService;
|
||||||
_activeCollections = activeCollections;
|
_activeCollections = activeCollections;
|
||||||
_dalamud = dalamud;
|
|
||||||
_modMergeTab = modMergeTab;
|
_modMergeTab = modMergeTab;
|
||||||
_communicator = communicator;
|
_communicator = communicator;
|
||||||
_dragDropManager = dragDropManager;
|
_dragDropManager = dragDropManager;
|
||||||
_textures = textures;
|
_textures = textures;
|
||||||
_fileDialog = fileDialog;
|
_fileDialog = fileDialog;
|
||||||
_gameEvents = gameEvents;
|
_gameEvents = gameEvents;
|
||||||
|
_objects = objects;
|
||||||
|
_framework = framework;
|
||||||
_materialTab = new FileEditor<MtrlTab>(this, gameData, config, _editor.Compactor, _fileDialog, "Materials", ".mtrl",
|
_materialTab = new FileEditor<MtrlTab>(this, gameData, config, _editor.Compactor, _fileDialog, "Materials", ".mtrl",
|
||||||
() => PopulateIsOnPlayer(_editor.Files.Mtrl, ResourceType.Mtrl), DrawMaterialPanel, () => _mod?.ModPath.FullName ?? string.Empty,
|
() => PopulateIsOnPlayer(_editor.Files.Mtrl, ResourceType.Mtrl), DrawMaterialPanel, () => _mod?.ModPath.FullName ?? string.Empty,
|
||||||
(bytes, path, writable) => new MtrlTab(this, new MtrlFile(bytes), path, writable));
|
(bytes, path, writable) => new MtrlTab(this, new MtrlFile(bytes), path, writable));
|
||||||
_modelTab = new FileEditor<MdlFile>(this, gameData, config, _editor.Compactor, _fileDialog, "Models", ".mdl",
|
_modelTab = new FileEditor<MdlFile>(this, gameData, config, _editor.Compactor, _fileDialog, "Models", ".mdl",
|
||||||
() => PopulateIsOnPlayer(_editor.Files.Mdl, ResourceType.Mdl), DrawModelPanel, () => _mod?.ModPath.FullName ?? string.Empty, (bytes, _, _) => new MdlFile(bytes));
|
() => PopulateIsOnPlayer(_editor.Files.Mdl, ResourceType.Mdl), DrawModelPanel, () => _mod?.ModPath.FullName ?? string.Empty,
|
||||||
|
(bytes, _, _) => new MdlFile(bytes));
|
||||||
_shaderPackageTab = new FileEditor<ShpkTab>(this, gameData, config, _editor.Compactor, _fileDialog, "Shaders", ".shpk",
|
_shaderPackageTab = new FileEditor<ShpkTab>(this, gameData, config, _editor.Compactor, _fileDialog, "Shaders", ".shpk",
|
||||||
() => PopulateIsOnPlayer(_editor.Files.Shpk, ResourceType.Shpk), DrawShaderPackagePanel, () => _mod?.ModPath.FullName ?? string.Empty,
|
() => PopulateIsOnPlayer(_editor.Files.Shpk, ResourceType.Shpk), DrawShaderPackagePanel,
|
||||||
|
() => _mod?.ModPath.FullName ?? string.Empty,
|
||||||
(bytes, _, _) => new ShpkTab(_fileDialog, bytes));
|
(bytes, _, _) => new ShpkTab(_fileDialog, bytes));
|
||||||
_center = new CombinedTexture(_left, _right);
|
_center = new CombinedTexture(_left, _right);
|
||||||
_textureSelectCombo = new TextureDrawer.PathSelectCombo(textures, editor, () => GetPlayerResourcesOfType(ResourceType.Tex));
|
_textureSelectCombo = new TextureDrawer.PathSelectCombo(textures, editor, () => GetPlayerResourcesOfType(ResourceType.Tex));
|
||||||
_resourceTreeFactory = resourceTreeFactory;
|
_resourceTreeFactory = resourceTreeFactory;
|
||||||
_quickImportViewer =
|
_quickImportViewer =
|
||||||
new ResourceTreeViewer(_config, resourceTreeFactory, changedItemDrawer, 2, OnQuickImportRefresh, DrawQuickImportActions);
|
new ResourceTreeViewer(_config, resourceTreeFactory, changedItemDrawer, 2, OnQuickImportRefresh, DrawQuickImportActions);
|
||||||
_communicator.ModPathChanged.Subscribe(OnModPathChanged, ModPathChanged.Priority.ModEditWindow);
|
_communicator.ModPathChanged.Subscribe(OnModPathChanged, ModPathChanged.Priority.ModEditWindow);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -190,9 +190,9 @@ public sealed class ModFileSystemSelector : FileSystemSelector<Mod, ModFileSyste
|
||||||
var itemPos = ImGui.GetItemRectMax().X;
|
var itemPos = ImGui.GetItemRectMax().X;
|
||||||
var maxWidth = ImGui.GetWindowPos().X + ImGui.GetWindowContentRegionMax().X;
|
var maxWidth = ImGui.GetWindowPos().X + ImGui.GetWindowContentRegionMax().X;
|
||||||
var priorityString = $"[{state.Priority}]";
|
var priorityString = $"[{state.Priority}]";
|
||||||
var requiredSize = ImGui.CalcTextSize(priorityString).X;
|
var Size = ImGui.CalcTextSize(priorityString).X;
|
||||||
var remainingSpace = maxWidth - itemPos;
|
var remainingSpace = maxWidth - itemPos;
|
||||||
var offset = remainingSpace - requiredSize;
|
var offset = remainingSpace - Size;
|
||||||
if (ImGui.GetScrollMaxY() == 0)
|
if (ImGui.GetScrollMaxY() == 0)
|
||||||
offset -= ImGui.GetStyle().ItemInnerSpacing.X;
|
offset -= ImGui.GetStyle().ItemInnerSpacing.X;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using Dalamud.Interface.Windowing;
|
using Dalamud.Interface.Windowing;
|
||||||
|
using Dalamud.Plugin.Services;
|
||||||
using Dalamud.Utility;
|
using Dalamud.Utility;
|
||||||
using FFXIVClientStructs.FFXIV.Client.Game.Character;
|
using FFXIVClientStructs.FFXIV.Client.Game.Character;
|
||||||
using FFXIVClientStructs.FFXIV.Client.Game.Group;
|
using FFXIVClientStructs.FFXIV.Client.Game.Group;
|
||||||
|
|
@ -70,7 +71,6 @@ public class DebugTab : Window, ITab
|
||||||
private readonly ValidityChecker _validityChecker;
|
private readonly ValidityChecker _validityChecker;
|
||||||
private readonly HttpApi _httpApi;
|
private readonly HttpApi _httpApi;
|
||||||
private readonly ActorManager _actors;
|
private readonly ActorManager _actors;
|
||||||
private readonly DalamudServices _dalamud;
|
|
||||||
private readonly StainService _stains;
|
private readonly StainService _stains;
|
||||||
private readonly CharacterUtility _characterUtility;
|
private readonly CharacterUtility _characterUtility;
|
||||||
private readonly ResidentResourceManager _residentResources;
|
private readonly ResidentResourceManager _residentResources;
|
||||||
|
|
@ -90,14 +90,16 @@ public class DebugTab : Window, ITab
|
||||||
private readonly RedrawService _redraws;
|
private readonly RedrawService _redraws;
|
||||||
private readonly DictEmotes _emotes;
|
private readonly DictEmotes _emotes;
|
||||||
private readonly Diagnostics _diagnostics;
|
private readonly Diagnostics _diagnostics;
|
||||||
|
private readonly IObjectTable _objects;
|
||||||
|
private readonly IClientState _clientState;
|
||||||
|
private readonly IpcTester _ipcTester;
|
||||||
|
|
||||||
public DebugTab(PerformanceTracker performance, Configuration config, CollectionManager collectionManager,
|
public DebugTab(PerformanceTracker performance, Configuration config, CollectionManager collectionManager, IObjectTable objects, IClientState clientState,
|
||||||
ValidityChecker validityChecker, ModManager modManager, HttpApi httpApi, ActorManager actors,
|
ValidityChecker validityChecker, ModManager modManager, HttpApi httpApi, ActorManager actors, StainService stains, CharacterUtility characterUtility, ResidentResourceManager residentResources,
|
||||||
DalamudServices dalamud, StainService stains, CharacterUtility characterUtility, ResidentResourceManager residentResources,
|
|
||||||
ResourceManagerService resourceManager, PenumbraIpcProviders ipc, CollectionResolver collectionResolver,
|
ResourceManagerService resourceManager, PenumbraIpcProviders ipc, CollectionResolver collectionResolver,
|
||||||
DrawObjectState drawObjectState, PathState pathState, SubfileHelper subfileHelper, IdentifiedCollectionCache identifiedCollectionCache,
|
DrawObjectState drawObjectState, PathState pathState, SubfileHelper subfileHelper, IdentifiedCollectionCache identifiedCollectionCache,
|
||||||
CutsceneService cutsceneService, ModImportManager modImporter, ImportPopup importPopup, FrameworkManager framework,
|
CutsceneService cutsceneService, ModImportManager modImporter, ImportPopup importPopup, FrameworkManager framework,
|
||||||
TextureManager textureManager, SkinFixer skinFixer, RedrawService redraws, DictEmotes emotes, Diagnostics diagnostics)
|
TextureManager textureManager, SkinFixer skinFixer, RedrawService redraws, DictEmotes emotes, Diagnostics diagnostics, IpcTester ipcTester)
|
||||||
: base("Penumbra Debug Window", ImGuiWindowFlags.NoCollapse)
|
: base("Penumbra Debug Window", ImGuiWindowFlags.NoCollapse)
|
||||||
{
|
{
|
||||||
IsOpen = true;
|
IsOpen = true;
|
||||||
|
|
@ -113,7 +115,6 @@ public class DebugTab : Window, ITab
|
||||||
_modManager = modManager;
|
_modManager = modManager;
|
||||||
_httpApi = httpApi;
|
_httpApi = httpApi;
|
||||||
_actors = actors;
|
_actors = actors;
|
||||||
_dalamud = dalamud;
|
|
||||||
_stains = stains;
|
_stains = stains;
|
||||||
_characterUtility = characterUtility;
|
_characterUtility = characterUtility;
|
||||||
_residentResources = residentResources;
|
_residentResources = residentResources;
|
||||||
|
|
@ -133,6 +134,9 @@ public class DebugTab : Window, ITab
|
||||||
_redraws = redraws;
|
_redraws = redraws;
|
||||||
_emotes = emotes;
|
_emotes = emotes;
|
||||||
_diagnostics = diagnostics;
|
_diagnostics = diagnostics;
|
||||||
|
_ipcTester = ipcTester;
|
||||||
|
_objects = objects;
|
||||||
|
_clientState = clientState;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ReadOnlySpan<byte> Label
|
public ReadOnlySpan<byte> Label
|
||||||
|
|
@ -417,7 +421,7 @@ public class DebugTab : Window, ITab
|
||||||
DrawSpecial("Current Card", _actors.GetCardPlayer());
|
DrawSpecial("Current Card", _actors.GetCardPlayer());
|
||||||
DrawSpecial("Current Glamour", _actors.GetGlamourPlayer());
|
DrawSpecial("Current Glamour", _actors.GetGlamourPlayer());
|
||||||
|
|
||||||
foreach (var obj in _dalamud.Objects)
|
foreach (var obj in _objects)
|
||||||
{
|
{
|
||||||
ImGuiUtil.DrawTableColumn($"{((GameObject*)obj.Address)->ObjectIndex}");
|
ImGuiUtil.DrawTableColumn($"{((GameObject*)obj.Address)->ObjectIndex}");
|
||||||
ImGuiUtil.DrawTableColumn($"0x{obj.Address:X}");
|
ImGuiUtil.DrawTableColumn($"0x{obj.Address:X}");
|
||||||
|
|
@ -827,7 +831,7 @@ public class DebugTab : Window, ITab
|
||||||
/// <summary> Draw information about the models, materials and resources currently loaded by the local player. </summary>
|
/// <summary> Draw information about the models, materials and resources currently loaded by the local player. </summary>
|
||||||
private unsafe void DrawPlayerModelInfo()
|
private unsafe void DrawPlayerModelInfo()
|
||||||
{
|
{
|
||||||
var player = _dalamud.ClientState.LocalPlayer;
|
var player = _clientState.LocalPlayer;
|
||||||
var name = player?.Name.ToString() ?? "NULL";
|
var name = player?.Name.ToString() ?? "NULL";
|
||||||
if (!ImGui.CollapsingHeader($"Player Model Info: {name}##Draw") || player == null)
|
if (!ImGui.CollapsingHeader($"Player Model Info: {name}##Draw") || player == null)
|
||||||
return;
|
return;
|
||||||
|
|
@ -952,11 +956,11 @@ public class DebugTab : Window, ITab
|
||||||
{
|
{
|
||||||
if (!ImGui.CollapsingHeader("IPC"))
|
if (!ImGui.CollapsingHeader("IPC"))
|
||||||
{
|
{
|
||||||
_ipc.Tester.UnsubscribeEvents();
|
_ipcTester.UnsubscribeEvents();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_ipc.Tester.Draw();
|
_ipcTester.Draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary> Helper to print a property and its value in a 2-column table. </summary>
|
/// <summary> Helper to print a property and its value in a 2-column table. </summary>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Components;
|
using Dalamud.Interface.Components;
|
||||||
|
using Dalamud.Plugin;
|
||||||
|
using Dalamud.Plugin.Services;
|
||||||
using Dalamud.Utility;
|
using Dalamud.Utility;
|
||||||
using ImGuiNET;
|
using ImGuiNET;
|
||||||
using OtterGui;
|
using OtterGui;
|
||||||
|
|
@ -33,19 +35,23 @@ public class SettingsTab : ITab
|
||||||
private readonly ModFileSystemSelector _selector;
|
private readonly ModFileSystemSelector _selector;
|
||||||
private readonly CharacterUtility _characterUtility;
|
private readonly CharacterUtility _characterUtility;
|
||||||
private readonly ResidentResourceManager _residentResources;
|
private readonly ResidentResourceManager _residentResources;
|
||||||
private readonly DalamudServices _dalamud;
|
|
||||||
private readonly HttpApi _httpApi;
|
private readonly HttpApi _httpApi;
|
||||||
private readonly DalamudSubstitutionProvider _dalamudSubstitutionProvider;
|
private readonly DalamudSubstitutionProvider _dalamudSubstitutionProvider;
|
||||||
private readonly FileCompactor _compactor;
|
private readonly FileCompactor _compactor;
|
||||||
|
private readonly DalamudConfigService _dalamudConfig;
|
||||||
|
private readonly DalamudPluginInterface _pluginInterface;
|
||||||
|
private readonly IDataManager _gameData;
|
||||||
|
|
||||||
private int _minimumX = int.MaxValue;
|
private int _minimumX = int.MaxValue;
|
||||||
private int _minimumY = int.MaxValue;
|
private int _minimumY = int.MaxValue;
|
||||||
|
|
||||||
public SettingsTab(Configuration config, FontReloader fontReloader, TutorialService tutorial, Penumbra penumbra,
|
public SettingsTab(DalamudPluginInterface pluginInterface, Configuration config, FontReloader fontReloader, TutorialService tutorial,
|
||||||
FileDialogService fileDialog, ModManager modManager, ModFileSystemSelector selector, CharacterUtility characterUtility,
|
Penumbra penumbra, FileDialogService fileDialog, ModManager modManager, ModFileSystemSelector selector,
|
||||||
ResidentResourceManager residentResources, DalamudServices dalamud, ModExportManager modExportManager, HttpApi httpApi,
|
CharacterUtility characterUtility, ResidentResourceManager residentResources, ModExportManager modExportManager, HttpApi httpApi,
|
||||||
DalamudSubstitutionProvider dalamudSubstitutionProvider, FileCompactor compactor)
|
DalamudSubstitutionProvider dalamudSubstitutionProvider, FileCompactor compactor, DalamudConfigService dalamudConfig,
|
||||||
|
IDataManager gameData)
|
||||||
{
|
{
|
||||||
|
_pluginInterface = pluginInterface;
|
||||||
_config = config;
|
_config = config;
|
||||||
_fontReloader = fontReloader;
|
_fontReloader = fontReloader;
|
||||||
_tutorial = tutorial;
|
_tutorial = tutorial;
|
||||||
|
|
@ -55,11 +61,12 @@ public class SettingsTab : ITab
|
||||||
_selector = selector;
|
_selector = selector;
|
||||||
_characterUtility = characterUtility;
|
_characterUtility = characterUtility;
|
||||||
_residentResources = residentResources;
|
_residentResources = residentResources;
|
||||||
_dalamud = dalamud;
|
|
||||||
_modExportManager = modExportManager;
|
_modExportManager = modExportManager;
|
||||||
_httpApi = httpApi;
|
_httpApi = httpApi;
|
||||||
_dalamudSubstitutionProvider = dalamudSubstitutionProvider;
|
_dalamudSubstitutionProvider = dalamudSubstitutionProvider;
|
||||||
_compactor = compactor;
|
_compactor = compactor;
|
||||||
|
_dalamudConfig = dalamudConfig;
|
||||||
|
_gameData = gameData;
|
||||||
if (_compactor.CanCompact)
|
if (_compactor.CanCompact)
|
||||||
_compactor.Enabled = _config.UseFileSystemCompression;
|
_compactor.Enabled = _config.UseFileSystemCompression;
|
||||||
}
|
}
|
||||||
|
|
@ -164,14 +171,14 @@ public class SettingsTab : ITab
|
||||||
if (IsSubPathOf(programFiles, newName) || IsSubPathOf(programFilesX86, newName))
|
if (IsSubPathOf(programFiles, newName) || IsSubPathOf(programFilesX86, newName))
|
||||||
return ("Path is not allowed to be in ProgramFiles.", false);
|
return ("Path is not allowed to be in ProgramFiles.", false);
|
||||||
|
|
||||||
var dalamud = _dalamud.PluginInterface.ConfigDirectory.Parent!.Parent!;
|
var dalamud = _pluginInterface.ConfigDirectory.Parent!.Parent!;
|
||||||
if (IsSubPathOf(dalamud.FullName, newName))
|
if (IsSubPathOf(dalamud.FullName, newName))
|
||||||
return ("Path is not allowed to be inside your Dalamud directories.", false);
|
return ("Path is not allowed to be inside your Dalamud directories.", false);
|
||||||
|
|
||||||
if (Functions.GetDownloadsFolder(out var downloads) && IsSubPathOf(downloads, newName))
|
if (Functions.GetDownloadsFolder(out var downloads) && IsSubPathOf(downloads, newName))
|
||||||
return ("Path is not allowed to be inside your Downloads folder.", false);
|
return ("Path is not allowed to be inside your Downloads folder.", false);
|
||||||
|
|
||||||
var gameDir = _dalamud.GameData.GameData.DataPath.Parent!.Parent!.FullName;
|
var gameDir = _gameData.GameData.DataPath.Parent!.Parent!.FullName;
|
||||||
if (IsSubPathOf(gameDir, newName))
|
if (IsSubPathOf(gameDir, newName))
|
||||||
return ("Path is not allowed to be inside your game folder.", false);
|
return ("Path is not allowed to be inside your game folder.", false);
|
||||||
|
|
||||||
|
|
@ -368,21 +375,21 @@ public class SettingsTab : ITab
|
||||||
v =>
|
v =>
|
||||||
{
|
{
|
||||||
_config.HideUiWhenUiHidden = v;
|
_config.HideUiWhenUiHidden = v;
|
||||||
_dalamud.UiBuilder.DisableUserUiHide = !v;
|
_pluginInterface.UiBuilder.DisableUserUiHide = !v;
|
||||||
});
|
});
|
||||||
Checkbox("Hide Config Window when in Cutscenes",
|
Checkbox("Hide Config Window when in Cutscenes",
|
||||||
"Hide the Penumbra main window when you are currently watching a cutscene.", _config.HideUiInCutscenes,
|
"Hide the Penumbra main window when you are currently watching a cutscene.", _config.HideUiInCutscenes,
|
||||||
v =>
|
v =>
|
||||||
{
|
{
|
||||||
_config.HideUiInCutscenes = v;
|
_config.HideUiInCutscenes = v;
|
||||||
_dalamud.UiBuilder.DisableCutsceneUiHide = !v;
|
_pluginInterface.UiBuilder.DisableCutsceneUiHide = !v;
|
||||||
});
|
});
|
||||||
Checkbox("Hide Config Window when in GPose",
|
Checkbox("Hide Config Window when in GPose",
|
||||||
"Hide the Penumbra main window when you are currently in GPose mode.", _config.HideUiInGPose,
|
"Hide the Penumbra main window when you are currently in GPose mode.", _config.HideUiInGPose,
|
||||||
v =>
|
v =>
|
||||||
{
|
{
|
||||||
_config.HideUiInGPose = v;
|
_config.HideUiInGPose = v;
|
||||||
_dalamud.UiBuilder.DisableGposeUiHide = !v;
|
_pluginInterface.UiBuilder.DisableGposeUiHide = !v;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -847,7 +854,7 @@ public class SettingsTab : ITab
|
||||||
/// <summary> Draw a checkbox that toggles the dalamud setting to wait for plugins on open. </summary>
|
/// <summary> Draw a checkbox that toggles the dalamud setting to wait for plugins on open. </summary>
|
||||||
private void DrawWaitForPluginsReflection()
|
private void DrawWaitForPluginsReflection()
|
||||||
{
|
{
|
||||||
if (!_dalamud.GetDalamudConfig(DalamudServices.WaitingForPluginsOption, out bool value))
|
if (!_dalamudConfig.GetDalamudConfig(DalamudConfigService.WaitingForPluginsOption, out bool value))
|
||||||
{
|
{
|
||||||
using var disabled = ImRaii.Disabled();
|
using var disabled = ImRaii.Disabled();
|
||||||
Checkbox("Wait for Plugins on Startup (Disabled, can not access Dalamud Configuration)", string.Empty, false, v => { });
|
Checkbox("Wait for Plugins on Startup (Disabled, can not access Dalamud Configuration)", string.Empty, false, v => { });
|
||||||
|
|
@ -855,9 +862,12 @@ public class SettingsTab : ITab
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Checkbox("Wait for Plugins on Startup",
|
Checkbox("Wait for Plugins on Startup",
|
||||||
"Some mods need to change files that are loaded once when the game starts and never afterwards.\nThis can cause issues with Penumbra loading after the files are already loaded.\nThis setting causes the game to wait until certain plugins have finished loading, making those mods work (in the base collection).\n\nThis changes a setting in the Dalamud Configuration found at /xlsettings -> General.",
|
"Some mods need to change files that are loaded once when the game starts and never afterwards.\n"
|
||||||
|
+ "This can cause issues with Penumbra loading after the files are already loaded.\n"
|
||||||
|
+ "This setting causes the game to wait until certain plugins have finished loading, making those mods work (in the base collection).\n\n"
|
||||||
|
+ "This changes a setting in the Dalamud Configuration found at /xlsettings -> General.",
|
||||||
value,
|
value,
|
||||||
v => _dalamud.SetDalamudConfig(DalamudServices.WaitingForPluginsOption, v, "doWaitForPluginsOnStartup"));
|
v => _dalamudConfig.SetDalamudConfig(DalamudConfigService.WaitingForPluginsOption, v, "doWaitForPluginsOnStartup"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,10 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ottergui": {
|
"ottergui": {
|
||||||
"type": "Project"
|
"type": "Project",
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.Extensions.DependencyInjection": "[7.0.0, )"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"penumbra.api": {
|
"penumbra.api": {
|
||||||
"type": "Project"
|
"type": "Project"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue