Skip to content

Commit

Permalink
added lovm, fashion report, chocobo racing auto quits (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaksuhn authored Dec 2, 2023
1 parent 68e2ed2 commit 88f85b7
Show file tree
Hide file tree
Showing 5 changed files with 132 additions and 0 deletions.
3 changes: 3 additions & 0 deletions YesAlready/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ public partial class Configuration() : IPluginConfiguration
public bool RetainerTransferProgressConfirm { get; set; } = false;
public bool DesynthesisResults { get; set; } = false;
public bool AetherialReductionResults { get; set; } = false;
public bool FashionCheckQuit { get; set; } = false;
public bool LordOfVerminionQuit { get; set; } = false;
public bool ChocoboRacingQuit { get; set; } = false;

public static Configuration Load(DirectoryInfo configDirectory)
{
Expand Down
31 changes: 31 additions & 0 deletions YesAlready/Features/AddonFashionCheckFeature.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using Dalamud.Game.Addon.Lifecycle;
using Dalamud.Game.Addon.Lifecycle.AddonArgTypes;
using ECommons.Automation;
using FFXIVClientStructs.FFXIV.Component.GUI;
using YesAlready.BaseFeatures;

namespace YesAlready.Features;

internal class AddonFashionCheckFeature : BaseFeature
{
public override void Enable()
{
base.Enable();
AddonLifecycle.RegisterListener(AddonEvent.PostSetup, "FashionCheck", AddonSetup);
}

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

protected static unsafe void AddonSetup(AddonEvent eventType, AddonArgs addonInfo)
{
var addon = (AtkUnitBase*)addonInfo.Addon;

if (!P.Active || !P.Config.FashionCheckQuit)
return;

Callback.Fire(addon, true, -1);
}
}
31 changes: 31 additions & 0 deletions YesAlready/Features/AddonLovmResultFeature.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using Dalamud.Game.Addon.Lifecycle;
using Dalamud.Game.Addon.Lifecycle.AddonArgTypes;
using ECommons.Automation;
using FFXIVClientStructs.FFXIV.Component.GUI;
using YesAlready.BaseFeatures;

namespace YesAlready.Features;

internal class AddonLovmResultFeature : BaseFeature
{
public override void Enable()
{
base.Enable();
AddonLifecycle.RegisterListener(AddonEvent.PostSetup, "LovmResult", AddonSetup);
}

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

protected static unsafe void AddonSetup(AddonEvent eventType, AddonArgs addonInfo)
{
var addon = (AtkUnitBase*)addonInfo.Addon;

if (!P.Active || !P.Config.LordOfVerminionQuit)
return;

Callback.Fire(addon, true, -1);
}
}
31 changes: 31 additions & 0 deletions YesAlready/Features/AddonRaceChocoboResultFeature.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using Dalamud.Game.Addon.Lifecycle;
using Dalamud.Game.Addon.Lifecycle.AddonArgTypes;
using ECommons.Automation;
using FFXIVClientStructs.FFXIV.Component.GUI;
using YesAlready.BaseFeatures;

namespace YesAlready.Features;

internal class AddonRaceChocoboResultFeature : BaseFeature
{
public override void Enable()
{
base.Enable();
AddonLifecycle.RegisterListener(AddonEvent.PostSetup, "RaceChocoboResult", AddonSetup);
}

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

protected static unsafe void AddonSetup(AddonEvent eventType, AddonArgs addonInfo)
{
var addon = (AtkUnitBase*)addonInfo.Addon;

if (!P.Active || !P.Config.ChocoboRacingQuit)
return;

Callback.Fire(addon, true, 1);
}
}
36 changes: 36 additions & 0 deletions YesAlready/UI/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,42 @@ private void DisplayBotherOptions()

IndentedTextColored(shadedColor, "Automatically confirm the exit prompt when leaving Blunderville.");

#endregion
#region FashionCheckQuit

var fashionQuit = P.Config.FashionCheckQuit;
if (ImGui.Checkbox("FashionCheck", ref fashionQuit))
{
P.Config.FashionCheckQuit = fashionQuit;
P.Config.Save();
}

IndentedTextColored(shadedColor, "Automatically confirm the Fashion Reports results.");

#endregion
#region ChocoboRacingQuit

var chocoboQuit = P.Config.ChocoboRacingQuit;
if (ImGui.Checkbox("RaceChocoboResult", ref chocoboQuit))
{
P.Config.ChocoboRacingQuit = chocoboQuit;
P.Config.Save();
}

IndentedTextColored(shadedColor, "Automatically quit Chocobo Racing when the resuls menu appears.");

#endregion
#region LordOfVerminionQuit

var lovQuit = P.Config.LordOfVerminionQuit;
if (ImGui.Checkbox("LovmResult", ref lovQuit))
{
P.Config.LordOfVerminionQuit = lovQuit;
P.Config.Save();
}

IndentedTextColored(shadedColor, "Automatically quit Lord of Verminion when the results menu appears.");

#endregion

ImGui.PopID();
Expand Down

0 comments on commit 88f85b7

Please sign in to comment.