Skip to content

Commit

Permalink
Update BrioAPI_V2.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
Minmoose committed Jan 9, 2025
1 parent 0d57eeb commit 68f67f5
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
28 changes: 27 additions & 1 deletion BrioAPI_V2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ public static class BrioAPI
private static ICallGateSubscriber<IGameObject, bool> Actor_Freeze_IPC;
private static ICallGateSubscriber<IGameObject, bool> Actor_UnFreeze_IPC;

private static ICallGateSubscriber<bool> FreezePhysics_IPC;
private static ICallGateSubscriber<bool> UnFreezePhysics_IPC;

//
//

Expand Down Expand Up @@ -73,12 +76,15 @@ public static void InitBrioAPI(IDalamudPluginInterface pluginInterface)

Actor_Exists_IPC = pluginInterface.GetIpcSubscriber<IGameObject, bool>("Brio.Actor.Exists");
Actor_GetAll_IPC = pluginInterface.GetIpcSubscriber<IGameObject[]?>("Brio.Actor.GetAll");

Actor_SetSpeed_IPC = pluginInterface.GetIpcSubscriber<IGameObject, float, bool>("Brio.Actor.SetSpeed");
Actor_GetSpeed_IPC = pluginInterface.GetIpcSubscriber<IGameObject, float>("Brio.Actor.GetSpeed");

Actor_Freeze_IPC = pluginInterface.GetIpcSubscriber<IGameObject, bool>("Brio.Actor.Freeze");
Actor_UnFreeze_IPC = pluginInterface.GetIpcSubscriber<IGameObject, bool>("Brio.Actor.UnFreeze");

FreezePhysics_IPC = pluginInterface.GetIpcSubscriber<bool>("Brio.FreezePhysics");
UnFreezePhysics_IPC = pluginInterface.GetIpcSubscriber<bool>("Brio.UnFreezePhysics");
}

/// <summary>
Expand Down Expand Up @@ -359,4 +365,24 @@ public static bool UnFreezeActor(IGameObject actor)

return Actor_UnFreeze_IPC.InvokeFunc(actor);
}

/// <summary>
/// Freezes FFXIV's physics simulation.
/// </summary>
public static bool FreezePhysics()
{
if (hasInit is false) throw new Exception("Call BrioAPI.InitBrioAPI first!");

return FreezePhysics_IPC.InvokeFunc();
}

/// <summary>
/// Unfreezes FFXIV's physics simulation.
/// </summary>
public static bool UnFreezePhysics()
{
if (hasInit is false) throw new Exception("Call BrioAPI.InitBrioAPI first!");

return UnFreezePhysics_IPC.InvokeFunc();
}
}
7 changes: 6 additions & 1 deletion BrioTester/BrioAPI_V2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -366,18 +366,23 @@ public static bool UnFreezeActor(IGameObject actor)
return Actor_UnFreeze_IPC.InvokeFunc(actor);
}

/// <summary>
/// Freezes FFXIV's physics simulation.
/// </summary>
public static bool FreezePhysics()
{
if (hasInit is false) throw new Exception("Call BrioAPI.InitBrioAPI first!");

return FreezePhysics_IPC.InvokeFunc();
}

/// <summary>
/// Unfreezes FFXIV's physics simulation.
/// </summary>
public static bool UnFreezePhysics()
{
if (hasInit is false) throw new Exception("Call BrioAPI.InitBrioAPI first!");

return UnFreezePhysics_IPC.InvokeFunc();
}

}

0 comments on commit 68f67f5

Please sign in to comment.