-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added more bothers and SelectOk support (#109)
* added clicklib as submodule * added dtrbar support * redundant dtr setting removal & tooltip fix * add ipc * added punishlib * disabled the about tab, kawaii pls fix * disable hotkey fix? * revert the readme * fixed lootboxes results not printing to chat * fixed logs that were supposed to be chat prints * fixed multi line handling in selectyesno * fixed zonelistwindow * added bothers and selectOk support Bothers: RetainerItemTransferProgress auto confirm PurifyResult auto confirm SalvageResult auto confirm added Ok menu to deal with SelectOk addons in the same way as SelectYesno * description clarification * changed from framework update to addonlifecycle
- Loading branch information
Showing
12 changed files
with
474 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using Dalamud.Game.Addon.Lifecycle.AddonArgTypes; | ||
using Dalamud.Game.Addon.Lifecycle; | ||
using ECommons.Automation; | ||
using ECommons.DalamudServices; | ||
using FFXIVClientStructs.FFXIV.Component.GUI; | ||
using Lumina.Excel.GeneratedSheets; | ||
using System.Linq; | ||
using YesAlready.BaseFeatures; | ||
|
||
namespace YesAlready.Features; | ||
|
||
internal class AddonPurifyResult : BaseFeature | ||
{ | ||
public override void Enable() | ||
{ | ||
base.Enable(); | ||
AddonLifecycle.RegisterListener(AddonEvent.PostUpdate, "PurifyResult", 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.AetherialReductionResults) | ||
return; | ||
|
||
if (addon->UldManager.NodeList[17]->GetAsAtkTextNode()->NodeText.ToString() == Svc.Data.GetExcelSheet<Addon>().First(x => x.RowId == 2171).Text.RawString) | ||
{ | ||
Svc.Log.Debug("Closing Purify Results menu"); | ||
Callback.Fire(addon, true, -1); | ||
} | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
YesAlready/Features/AddonRetainerItemTransferProgressFeature.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using Dalamud.Game.Addon.Lifecycle; | ||
using Dalamud.Game.Addon.Lifecycle.AddonArgTypes; | ||
using Dalamud.Memory; | ||
using ECommons.Automation; | ||
using ECommons.DalamudServices; | ||
using FFXIVClientStructs.FFXIV.Component.GUI; | ||
using Lumina.Excel.GeneratedSheets; | ||
using System.Linq; | ||
using YesAlready.BaseFeatures; | ||
|
||
namespace YesAlready.Features; | ||
|
||
internal class AddonRetainerItemTransferProgressFeature : BaseFeature | ||
{ | ||
public override void Enable() | ||
{ | ||
base.Enable(); | ||
AddonLifecycle.RegisterListener(AddonEvent.PostUpdate, "RetainerItemTransferProgress", 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.RetainerTransferProgressConfirm) | ||
return; | ||
|
||
if (MemoryHelper.ReadSeStringNullTerminated(new nint(addon->AtkValues[0].String)).ToString() == Svc.Data.GetExcelSheet<Addon>().First(x => x.RowId == 13528).Text.RawString) | ||
{ | ||
Svc.Log.Debug("Closing Entrust Duplicates menu"); | ||
Callback.Fire(addon, true, -1); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using Dalamud.Game.Addon.Lifecycle.AddonArgTypes; | ||
using Dalamud.Game.Addon.Lifecycle; | ||
using ECommons.Automation; | ||
using ECommons.DalamudServices; | ||
using FFXIVClientStructs.FFXIV.Component.GUI; | ||
using YesAlready.BaseFeatures; | ||
|
||
namespace YesAlready.Features; | ||
|
||
internal class AddonSalvageResult : BaseFeature | ||
{ | ||
public override void Enable() | ||
{ | ||
base.Enable(); | ||
AddonLifecycle.RegisterListener(AddonEvent.PostUpdate, "SalvageResult", 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.DesynthesisResults) | ||
return; | ||
|
||
if (addon->AtkValues[17].Byte == 0) | ||
{ | ||
Svc.Log.Debug("Closing Salvage Auto Results menu"); | ||
Callback.Fire(addon, true, 1); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using System.Linq; | ||
|
||
using ClickLib.Clicks; | ||
using Dalamud.Game.Addon.Lifecycle; | ||
using Dalamud.Game.Addon.Lifecycle.AddonArgTypes; | ||
using ECommons.DalamudServices; | ||
using FFXIVClientStructs.FFXIV.Component.GUI; | ||
using YesAlready.BaseFeatures; | ||
|
||
namespace YesAlready.Features; | ||
|
||
internal class AddonSelectOkFeature : BaseFeature | ||
{ | ||
public override void Enable() | ||
{ | ||
base.Enable(); | ||
AddonLifecycle.RegisterListener(AddonEvent.PostSetup, "SelectOk", AddonSetup); | ||
} | ||
|
||
public override void Disable() | ||
{ | ||
base.Disable(); | ||
AddonLifecycle.UnregisterListener(AddonSetup); | ||
} | ||
|
||
protected unsafe void AddonSetup(AddonEvent eventType, AddonArgs addonInfo) | ||
{ | ||
var addon = (AtkUnitBase*)addonInfo.Addon; | ||
|
||
if (!P.Active) | ||
return; | ||
|
||
var text = P.LastSeenOkText = Utils.SEString.GetSeStringText(new nint(addon->AtkValues[0].String)); | ||
Svc.Log.Debug($"AddonSelectOk: text={text}"); | ||
|
||
var nodes = P.Config.GetAllNodes().OfType<OkEntryNode>(); | ||
foreach (var node in nodes) | ||
{ | ||
if (!node.Enabled || string.IsNullOrEmpty(node.Text)) | ||
continue; | ||
|
||
if (!EntryMatchesText(node, text)) | ||
continue; | ||
|
||
Svc.Log.Debug("AddonSelectYesNo: Selecting yes"); | ||
ClickSelectOk.Using(new nint(addon)).Ok(); | ||
return; | ||
} | ||
} | ||
|
||
private static bool EntryMatchesText(OkEntryNode node, string text) | ||
{ | ||
return (node.IsTextRegex && (node.TextRegex?.IsMatch(text) ?? false)) || | ||
(!node.IsTextRegex && text.Contains(node.Text)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.