Skip to content

Commit af536b3

Browse files
committed
Update some Dalamud Services.
1 parent 09ca32f commit af536b3

24 files changed

+78
-91
lines changed

OtterGui

Penumbra/CommandHandler.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using Dalamud.Game.Command;
66
using Dalamud.Game.Gui;
77
using Dalamud.Game.Text.SeStringHandling;
8+
using Dalamud.Plugin.Services;
89
using ImGuiNET;
910
using OtterGui.Classes;
1011
using Penumbra.Api.Enums;
@@ -16,15 +17,14 @@
1617
using Penumbra.Mods.Manager;
1718
using Penumbra.Services;
1819
using Penumbra.UI;
19-
using Penumbra.Util;
2020

2121
namespace Penumbra;
2222

2323
public class CommandHandler : IDisposable
2424
{
2525
private const string CommandName = "/penumbra";
2626

27-
private readonly CommandManager _commandManager;
27+
private readonly ICommandManager _commandManager;
2828
private readonly RedrawService _redrawService;
2929
private readonly ChatGui _chat;
3030
private readonly Configuration _config;
@@ -35,7 +35,7 @@ public class CommandHandler : IDisposable
3535
private readonly Penumbra _penumbra;
3636
private readonly CollectionEditor _collectionEditor;
3737

38-
public CommandHandler(Framework framework, CommandManager commandManager, ChatGui chat, RedrawService redrawService, Configuration config,
38+
public CommandHandler(Framework framework, ICommandManager commandManager, ChatGui chat, RedrawService redrawService, Configuration config,
3939
ConfigWindow configWindow, ModManager modManager, CollectionManager collectionManager, ActorService actors, Penumbra penumbra,
4040
CollectionEditor collectionEditor)
4141
{

Penumbra/Import/Textures/TextureManager.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
using System.Numerics;
77
using System.Threading;
88
using System.Threading.Tasks;
9-
using Dalamud.Data;
109
using Dalamud.Interface;
10+
using Dalamud.Plugin.Services;
1111
using ImGuiScene;
1212
using Lumina.Data.Files;
1313
using OtterGui.Log;
@@ -16,21 +16,20 @@
1616
using SixLabors.ImageSharp;
1717
using SixLabors.ImageSharp.Formats.Png;
1818
using SixLabors.ImageSharp.PixelFormats;
19-
using Swan;
2019
using Image = SixLabors.ImageSharp.Image;
2120

2221
namespace Penumbra.Import.Textures;
2322

2423
public sealed class TextureManager : SingleTaskQueue, IDisposable
2524
{
26-
private readonly Logger _logger;
27-
private readonly UiBuilder _uiBuilder;
28-
private readonly DataManager _gameData;
25+
private readonly Logger _logger;
26+
private readonly UiBuilder _uiBuilder;
27+
private readonly IDataManager _gameData;
2928

3029
private readonly ConcurrentDictionary<IAction, (Task, CancellationTokenSource)> _tasks = new();
3130
private bool _disposed = false;
3231

33-
public TextureManager(UiBuilder uiBuilder, DataManager gameData, Logger logger)
32+
public TextureManager(UiBuilder uiBuilder, IDataManager gameData, Logger logger)
3433
{
3534
_uiBuilder = uiBuilder;
3635
_gameData = gameData;

Penumbra/Interop/PathResolving/AnimationHookService.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
using System;
22
using System.Threading;
33
using Dalamud.Game.ClientState.Conditions;
4-
using Dalamud.Game.ClientState.Objects;
54
using Dalamud.Hooking;
5+
using Dalamud.Plugin.Services;
66
using Dalamud.Utility.Signatures;
7-
using FFXIVClientStructs.FFXIV.Client.Game.Event;
87
using FFXIVClientStructs.FFXIV.Client.Graphics.Scene;
98
using Penumbra.Collections;
109
using Penumbra.GameData;
@@ -20,7 +19,7 @@ namespace Penumbra.Interop.PathResolving;
2019
public unsafe class AnimationHookService : IDisposable
2120
{
2221
private readonly PerformanceTracker _performance;
23-
private readonly ObjectTable _objects;
22+
private readonly IObjectTable _objects;
2423
private readonly CollectionResolver _collectionResolver;
2524
private readonly DrawObjectState _drawObjectState;
2625
private readonly CollectionResolver _resolver;
@@ -29,7 +28,7 @@ public unsafe class AnimationHookService : IDisposable
2928
private readonly ThreadLocal<ResolveData> _animationLoadData = new(() => ResolveData.Invalid, true);
3029
private readonly ThreadLocal<ResolveData> _characterSoundData = new(() => ResolveData.Invalid, true);
3130

32-
public AnimationHookService(PerformanceTracker performance, ObjectTable objects, CollectionResolver collectionResolver,
31+
public AnimationHookService(PerformanceTracker performance, IObjectTable objects, CollectionResolver collectionResolver,
3332
DrawObjectState drawObjectState, CollectionResolver resolver, Condition conditions)
3433
{
3534
_performance = performance;

Penumbra/Interop/PathResolving/CollectionResolver.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
2-
using Dalamud.Game.ClientState;
3-
using Dalamud.Game.Gui;
2+
using Dalamud.Plugin.Services;
43
using FFXIVClientStructs.FFXIV.Client.Graphics.Scene;
54
using Penumbra.Collections;
65
using Penumbra.Collections.Manager;
@@ -21,8 +20,8 @@ public unsafe class CollectionResolver
2120
private readonly IdentifiedCollectionCache _cache;
2221
private readonly HumanModelList _humanModels;
2322

24-
private readonly ClientState _clientState;
25-
private readonly GameGui _gameGui;
23+
private readonly IClientState _clientState;
24+
private readonly IGameGui _gameGui;
2625
private readonly ActorService _actors;
2726
private readonly CutsceneService _cutscenes;
2827

@@ -31,7 +30,7 @@ public unsafe class CollectionResolver
3130
private readonly TempCollectionManager _tempCollections;
3231
private readonly DrawObjectState _drawObjectState;
3332

34-
public CollectionResolver(PerformanceTracker performance, IdentifiedCollectionCache cache, ClientState clientState, GameGui gameGui,
33+
public CollectionResolver(PerformanceTracker performance, IdentifiedCollectionCache cache, IClientState clientState, IGameGui gameGui,
3534
ActorService actors, CutsceneService cutscenes, Configuration config, CollectionManager collectionManager,
3635
TempCollectionManager tempCollections, DrawObjectState drawObjectState, HumanModelList humanModels)
3736
{

Penumbra/Interop/PathResolving/CutsceneService.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System.Collections.Generic;
33
using System.Diagnostics;
44
using System.Linq;
5-
using Dalamud.Game.ClientState.Objects;
5+
using Dalamud.Plugin.Services;
66
using FFXIVClientStructs.FFXIV.Client.Game.Character;
77
using Penumbra.GameData.Actors;
88
using Penumbra.Interop.Services;
@@ -16,15 +16,15 @@ public class CutsceneService : IDisposable
1616
public const int CutsceneSlots = CutsceneEndIdx - CutsceneStartIdx;
1717

1818
private readonly GameEventManager _events;
19-
private readonly ObjectTable _objects;
19+
private readonly IObjectTable _objects;
2020
private readonly short[] _copiedCharacters = Enumerable.Repeat((short)-1, CutsceneSlots).ToArray();
2121

2222
public IEnumerable<KeyValuePair<int, Dalamud.Game.ClientState.Objects.Types.GameObject>> Actors
2323
=> Enumerable.Range(CutsceneStartIdx, CutsceneSlots)
2424
.Where(i => _objects[i] != null)
2525
.Select(i => KeyValuePair.Create(i, this[i] ?? _objects[i]!));
2626

27-
public unsafe CutsceneService(ObjectTable objects, GameEventManager events)
27+
public unsafe CutsceneService(IObjectTable objects, GameEventManager events)
2828
{
2929
_objects = objects;
3030
_events = events;

Penumbra/Interop/PathResolving/DrawObjectState.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System.Collections;
55
using System.Collections.Generic;
66
using System.Threading;
7-
using Dalamud.Game.ClientState.Objects;
7+
using Dalamud.Plugin.Services;
88
using FFXIVClientStructs.FFXIV.Client.Game.Object;
99
using Penumbra.GameData;
1010
using Penumbra.Interop.Services;
@@ -14,7 +14,7 @@ namespace Penumbra.Interop.PathResolving;
1414

1515
public class DrawObjectState : IDisposable, IReadOnlyDictionary<nint, (nint, bool)>
1616
{
17-
private readonly ObjectTable _objects;
17+
private readonly IObjectTable _objects;
1818
private readonly GameEventManager _gameEvents;
1919

2020
private readonly Dictionary<nint, (nint GameObject, bool IsChild)> _drawObjectToGameObject = new();
@@ -24,7 +24,7 @@ public class DrawObjectState : IDisposable, IReadOnlyDictionary<nint, (nint, boo
2424
public nint LastGameObject
2525
=> _lastGameObject.IsValueCreated && _lastGameObject.Value!.Count > 0 ? _lastGameObject.Value.Peek() : nint.Zero;
2626

27-
public DrawObjectState(ObjectTable objects, GameEventManager gameEvents)
27+
public DrawObjectState(IObjectTable objects, GameEventManager gameEvents)
2828
{
2929
SignatureHelper.Initialise(this);
3030
_enableDrawHook.Enable();

Penumbra/Interop/PathResolving/IdentifiedCollectionCache.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using System.Collections;
33
using System.Collections.Generic;
4-
using Dalamud.Game.ClientState;
4+
using Dalamud.Plugin.Services;
55
using FFXIVClientStructs.FFXIV.Client.Game.Character;
66
using FFXIVClientStructs.FFXIV.Client.Game.Object;
77
using Penumbra.Collections;
@@ -17,11 +17,11 @@ public unsafe class IdentifiedCollectionCache : IDisposable, IEnumerable<(nint A
1717
{
1818
private readonly CommunicatorService _communicator;
1919
private readonly GameEventManager _events;
20-
private readonly ClientState _clientState;
20+
private readonly IClientState _clientState;
2121
private readonly Dictionary<nint, (ActorIdentifier, ModCollection)> _cache = new(317);
2222
private bool _dirty;
2323

24-
public IdentifiedCollectionCache(ClientState clientState, CommunicatorService communicator, GameEventManager events)
24+
public IdentifiedCollectionCache(IClientState clientState, CommunicatorService communicator, GameEventManager events)
2525
{
2626
_clientState = clientState;
2727
_communicator = communicator;

Penumbra/Interop/ResourceTree/ResourceTreeFactory.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System.Collections.Generic;
22
using System.Linq;
3-
using Dalamud.Data;
4-
using Dalamud.Game.ClientState.Objects;
3+
using Dalamud.Plugin.Services;
54
using FFXIVClientStructs.FFXIV.Client.Game.Character;
65
using FFXIVClientStructs.FFXIV.Client.Game.Object;
76
using Penumbra.GameData.Actors;
@@ -12,14 +11,14 @@ namespace Penumbra.Interop.ResourceTree;
1211

1312
public class ResourceTreeFactory
1413
{
15-
private readonly DataManager _gameData;
16-
private readonly ObjectTable _objects;
14+
private readonly IDataManager _gameData;
15+
private readonly IObjectTable _objects;
1716
private readonly CollectionResolver _collectionResolver;
1817
private readonly IdentifierService _identifier;
1918
private readonly Configuration _config;
2019
private readonly ActorService _actors;
2120

22-
public ResourceTreeFactory(DataManager gameData, ObjectTable objects, CollectionResolver resolver, IdentifierService identifier,
21+
public ResourceTreeFactory(IDataManager gameData, IObjectTable objects, CollectionResolver resolver, IdentifierService identifier,
2322
Configuration config, ActorService actors)
2423
{
2524
_gameData = gameData;

0 commit comments

Comments
 (0)