mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-20 14:57:45 +01:00
Add Generic Helper (#2403)
This commit is contained in:
parent
0047e24031
commit
f07b308757
2 changed files with 19 additions and 2 deletions
|
|
@ -182,6 +182,10 @@ internal sealed unsafe class GameGui : IInternalDisposableService, IGameGui
|
|||
return (nint)unitManager->GetAddonByName(name, index);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public T* GetAddonByName<T>(string name, int index = 1) where T : unmanaged
|
||||
=> (T*)this.GetAddonByName(name, index).Address;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public AgentInterfacePtr GetAgentById(int id)
|
||||
{
|
||||
|
|
@ -328,7 +332,7 @@ internal sealed unsafe class GameGui : IInternalDisposableService, IGameGui
|
|||
return retVal;
|
||||
}
|
||||
|
||||
private unsafe void SetUiVisibilityDetour(RaptureAtkModule* thisPtr, bool uiVisible)
|
||||
private void SetUiVisibilityDetour(RaptureAtkModule* thisPtr, bool uiVisible)
|
||||
{
|
||||
this.setUiVisibilityHook.Original(thisPtr, uiVisible);
|
||||
|
||||
|
|
@ -441,6 +445,10 @@ internal class GameGuiPluginScoped : IInternalDisposableService, IGameGui
|
|||
public AtkUnitBasePtr GetAddonByName(string name, int index = 1)
|
||||
=> this.gameGuiService.GetAddonByName(name, index);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public unsafe T* GetAddonByName<T>(string name, int index = 1) where T : unmanaged
|
||||
=> (T*)this.gameGuiService.GetAddonByName(name, index).Address;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public AgentInterfacePtr GetAgentById(int id)
|
||||
=> this.gameGuiService.GetAgentById(id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue