78 lines
1.9 KiB
C#
78 lines
1.9 KiB
C#
using Dalamud.Plugin.Services;
|
|
using FFXIVClientStructs.FFXIV.Client.Game;
|
|
using FFXIVClientStructs.FFXIV.Component.GUI;
|
|
using LLib.GameUI;
|
|
|
|
namespace LLib.Gear;
|
|
|
|
public static class ExtractActions
|
|
{
|
|
public const uint ExtractionUnlockQuestId = 66174u;
|
|
|
|
public unsafe static bool TryOpenExtractionWindow()
|
|
{
|
|
ActionManager* ptr = ActionManager.Instance();
|
|
if (ptr == null)
|
|
{
|
|
return false;
|
|
}
|
|
return ptr->UseAction(ActionType.GeneralAction, 14u, 3758096384uL, 0u, ActionManager.UseActionMode.None, 0u, null);
|
|
}
|
|
|
|
public unsafe static bool IsExtractionAddonReady(IGameGui gameGui)
|
|
{
|
|
AtkUnitBase* addonPtr;
|
|
return gameGui.TryGetReadyAddon<AtkUnitBase>("Materialize", out addonPtr);
|
|
}
|
|
|
|
public unsafe static bool TryExtractFirst(IGameGui gameGui)
|
|
{
|
|
if (!gameGui.TryGetReadyAddon<AtkUnitBase>("Materialize", out var addonPtr))
|
|
{
|
|
return false;
|
|
}
|
|
AddonCallback.FireWithUpdate(addonPtr, 2, 0);
|
|
return true;
|
|
}
|
|
|
|
public unsafe static bool IsConfirmDialogReady(IGameGui gameGui)
|
|
{
|
|
AtkUnitBase* addonPtr;
|
|
return gameGui.TryGetReadyAddon<AtkUnitBase>("MaterializeDialog", out addonPtr);
|
|
}
|
|
|
|
public unsafe static bool TryConfirmExtraction(IGameGui gameGui)
|
|
{
|
|
if (!gameGui.TryGetReadyAddon<AtkUnitBase>("MaterializeDialog", out var addonPtr))
|
|
{
|
|
return false;
|
|
}
|
|
AddonCallback.Fire(addonPtr, default(int));
|
|
return true;
|
|
}
|
|
|
|
public unsafe static bool TrySwitchCategory(IGameGui gameGui, int category)
|
|
{
|
|
if (!gameGui.TryGetReadyAddon<AtkUnitBase>("Materialize", out var addonPtr))
|
|
{
|
|
return false;
|
|
}
|
|
AddonCallback.Fire(addonPtr, 1, category);
|
|
return true;
|
|
}
|
|
|
|
public unsafe static bool TryCloseExtractionWindow(IGameGui gameGui)
|
|
{
|
|
if (!gameGui.TryGetReadyAddon<AtkUnitBase>("Materialize", out var addonPtr))
|
|
{
|
|
return false;
|
|
}
|
|
AddonCallback.Fire(addonPtr, -1);
|
|
return true;
|
|
}
|
|
|
|
public static bool IsExtractionUnlocked()
|
|
{
|
|
return GearFeatures.IsExtractionUnlocked();
|
|
}
|
|
}
|