Skip to content

Commit

Permalink
add prisms
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaksuhn committed Sep 24, 2024
1 parent 198a98a commit e31be38
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 1 deletion.
2 changes: 2 additions & 0 deletions YesAlready/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ public partial class Configuration() : IPluginConfiguration
public bool DataCentreTravelConfirmEnabled { get; set; } = false;
public bool AirShipExplorationResultFinalize { get; set; } = false;
public bool AirShipExplorationResultRedeploy { get; set; } = false;
public bool MiragePrismRemoveDispel { get; set; } = false;
public bool MiragePrismExecuteCast { get; set; } = false;

public List<CustomBother> CustomBothers { get; set; } = [];

Expand Down
25 changes: 25 additions & 0 deletions YesAlready/Features/MiragePrismExecute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Dalamud.Game.Addon.Lifecycle;
using Dalamud.Game.Addon.Lifecycle.AddonArgTypes;
using YesAlready.BaseFeatures;

namespace YesAlready.Features;
public class MiragePrismExecute : BaseFeature
{
public override void Enable()
{
base.Enable();
Svc.AddonLifecycle.RegisterListener(AddonEvent.PostSetup, "MiragePrismExecute", AddonSetup);
}

public override void Disable()
{
base.Disable();
Svc.AddonLifecycle.UnregisterListener(AddonSetup);
}

protected static unsafe void AddonSetup(AddonEvent eventType, AddonArgs addonInfo)
{
if (!P.Active || !P.Config.MiragePrismExecuteCast) return;
new AddonMaster.MiragePrismExecute(addonInfo.Base()).Cast();
}
}
25 changes: 25 additions & 0 deletions YesAlready/Features/MiragePrismRemove.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Dalamud.Game.Addon.Lifecycle;
using Dalamud.Game.Addon.Lifecycle.AddonArgTypes;
using YesAlready.BaseFeatures;

namespace YesAlready.Features;
public class MiragePrismRemove : BaseFeature
{
public override void Enable()
{
base.Enable();
Svc.AddonLifecycle.RegisterListener(AddonEvent.PostSetup, "MiragePrismRemove", AddonSetup);
}

public override void Disable()
{
base.Disable();
Svc.AddonLifecycle.UnregisterListener(AddonSetup);
}

protected static unsafe void AddonSetup(AddonEvent eventType, AddonArgs addonInfo)
{
if (!P.Active || !P.Config.MiragePrismRemoveDispel) return;
new AddonMaster.MiragePrismRemove(addonInfo.Base()).Dispel();
}
}
16 changes: 16 additions & 0 deletions YesAlready/UI/Tabs/Bothers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,22 @@ public static void Draw()
P.Config.Save();
}
ImGuiEx.IndentedTextColored("Automatically accept the Data Center travel confirmation.");

var mpr = P.Config.MiragePrismRemoveDispel;
if (ImGui.Checkbox("MiragePrismRemoveDispel", ref mpr))
{
P.Config.MiragePrismRemoveDispel = mpr;
P.Config.Save();
}
ImGuiEx.IndentedTextColored("Automatically dispel glamours when using Glamour Dispellers.");

var mpe = P.Config.MiragePrismExecuteCast;
if (ImGui.Checkbox("MiragePrismExecuteCast", ref mpe))
{
P.Config.MiragePrismExecuteCast = mpe;
P.Config.Save();
}
ImGuiEx.IndentedTextColored("Automatically cast glamours when using Glamour Prisms.");
}

#endregion
Expand Down

0 comments on commit e31be38

Please sign in to comment.