Skip to content

Commit

Permalink
Dalamud v9 API and 6.5 prep (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
AsgardXIV authored Oct 2, 2023
1 parent bc70e36 commit 3e6ca36
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Dalamud/XAT.Plugin/Game/GPoseService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ public GPoseService(XATPlugin plugin)

public void Update()
{
bool nextGPoseState = Plugin.PluginInterface.UiBuilder.GposeActive;
bool nextGPoseState = Plugin.ClientState.IsGPosing;

if (IsInGPose != Plugin.PluginInterface.UiBuilder.GposeActive)
if (IsInGPose != Plugin.ClientState.IsGPosing)
{
IsInGPose= nextGPoseState;
OnGPoseChange?.Invoke(IsInGPose);
Expand Down
4 changes: 2 additions & 2 deletions Dalamud/XAT.Plugin/Game/Hooks/CameraHooks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ public CameraHooks(XATPlugin plugin)
this.Plugin = plugin;

var proj = Plugin.SigScanner.ScanText("E8 ?? ?? ?? ?? 4C 8B 2D ?? ?? ?? ?? 41 0F 28 C2");
ProjectionHook = Hook<MakeProjectionMatrix2>.FromAddress(proj, ProjectionDetour);
ProjectionHook = Plugin.GameInteropProvider.HookFromAddress<MakeProjectionMatrix2>(proj, ProjectionDetour);

var view = Plugin.SigScanner.ScanText("E8 ?? ?? ?? ?? 33 C0 48 89 83 ?? ?? ?? ?? 48 8B 9C 24 ?? ?? ?? ??");
ViewHook = Hook<CalculateViewMatrix>.FromAddress(view, ViewMatrixDetour);
ViewHook = Plugin.GameInteropProvider.HookFromAddress<CalculateViewMatrix>(view, ViewMatrixDetour);

ProjectionHook.Enable();
ViewHook.Enable();
Expand Down
22 changes: 15 additions & 7 deletions Dalamud/XAT.Plugin/XATPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Dalamud.Interface.Windowing;
using Dalamud.IoC;
using Dalamud.Plugin;
using Dalamud.Plugin.Services;
using XAT.Plugin.Cutscene;
using XAT.Plugin.Game;
using XAT.Plugin.Game.Hooks;
Expand All @@ -19,19 +20,26 @@ public class XATPlugin : IDalamudPlugin
private const string CommandName = "/xat";

[PluginService]
public CommandManager CommandManager { get; init; } = null!;
public ICommandManager CommandManager { get; init; } = null!;

[PluginService]
public Framework Framework { get; init; } = null!;
public IFramework Framework { get; init; } = null!;

[PluginService]
public SigScanner SigScanner { get; init; } = null!;
public ISigScanner SigScanner { get; init; } = null!;

[PluginService]
public ObjectTable ObjectTable { get; init; } = null!;
public IObjectTable ObjectTable { get; init; } = null!;

[PluginService]
public TargetManager TargetManager { get; init; } = null!;
public ITargetManager TargetManager { get; init; } = null!;

[PluginService]
public IGameInteropProvider GameInteropProvider { get; init; } = null!;

[PluginService]
public IClientState ClientState { get; init; } = null!;


public DalamudPluginInterface PluginInterface { get; }

Expand Down Expand Up @@ -74,7 +82,7 @@ public XATPlugin(DalamudPluginInterface pluginInterface)

private void OnCommand(string command, string args)
{
Window? window = WindowSystem.GetWindow(PluginName);
Window? window = this.Window;

if (window != null)
{
Expand All @@ -94,7 +102,7 @@ private void DrawUI()
this.WindowSystem.Draw();
}

private void Update(Framework framework)
private void Update(IFramework framework)
{
this.GPoseService.Update();
this.CutsceneManager.Update();
Expand Down
2 changes: 1 addition & 1 deletion base_repo.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"TestingAssemblyVersion": "1.0.0.0",
"RepoUrl": "https://github.com/AsgardXIV/XAT",
"ApplicableVersion": "any",
"DalamudApiLevel": 8,
"DalamudApiLevel": 9,
"IsHide": "False",
"IsTestingExclusive": "False",
"DownloadCount": 0,
Expand Down

0 comments on commit 3e6ca36

Please sign in to comment.