Skip to content

Commit

Permalink
Added AddonRetainerItemTransferListFeature (#116)
Browse files Browse the repository at this point in the history
Co-authored-by: xPumaa <35280763+xpumaa@users.noreply.github.com>
  • Loading branch information
Cyenia and Cyenia authored Dec 2, 2023
1 parent 123c800 commit 59761d8
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ClickLib
1 change: 1 addition & 0 deletions YesAlready/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public partial class Configuration() : IPluginConfiguration
public bool GuildLeveDifficultyConfirm { get; set; } = false;
public bool FallGuysRegisterConfirm { get; set; } = false;
public bool FallGuysExitConfirm { get; set; } = false;
public bool RetainerTransferListConfirm { get; set; } = false;
public bool RetainerTransferProgressConfirm { get; set; } = false;
public bool DesynthesisResults { get; set; } = false;
public bool AetherialReductionResults { get; set; } = false;
Expand Down
33 changes: 33 additions & 0 deletions YesAlready/Features/AddonRetainerItemTransferListFeature.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using Dalamud.Game.Addon.Lifecycle;
using Dalamud.Game.Addon.Lifecycle.AddonArgTypes;
using FFXIVClientStructs.FFXIV.Component.GUI;
using ClickLib.Clicks;
using YesAlready.BaseFeatures;

namespace YesAlready.Features;

internal class AddonRetainerItemTransferListFeature : BaseFeature
{
public override void Enable()
{
base.Enable();
AddonLifecycle.RegisterListener(AddonEvent.PostDraw, "RetainerItemTransferList", AddonUpdate);
}

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

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

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


ClickRetainerItemTransferList.Using((nint)addon).Confirm();
}
}
16 changes: 15 additions & 1 deletion YesAlready/UI/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,21 @@ private void DisplayBotherOptions()
IndentedTextColored(shadedColor, "Automatically send a retainer on the same venture as before when receiving an item.");

#endregion
#region RetainerProgress
#region RetainerTransferList

var retainerListDialog = P.Config.RetainerTransferListConfirm;
if (ImGui.Checkbox("RetainerItemTransferList", ref retainerListDialog))
{
P.Config.RetainerTransferListConfirm = retainerListDialog;
P.Config.Save();
}

IndentedTextColored(shadedColor, "Skip the confirmation in the RetainerItemTransferList window to entrust all items to the retainer.");

#endregion
#region RetainerTransferProgress



var retainerProgressDialog = P.Config.RetainerTransferProgressConfirm;
if (ImGui.Checkbox("RetainerItemTransferProgress", ref retainerProgressDialog))
Expand Down

0 comments on commit 59761d8

Please sign in to comment.