Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AutoDuty/AutoDuty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1827,7 +1827,7 @@ private void CheckRetainerWindow()
return;

if (Svc.Condition[ConditionFlag.OccupiedSummoningBell])
while(!AutoRetainerHelper.Instance.CloseAddons());
AutoRetainerHelper.Instance.CloseAddons();
}

private void InteractablesCheck()
Expand Down
4 changes: 2 additions & 2 deletions AutoDuty/Helpers/ActiveHelperBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,10 @@ public unsafe bool CloseAddons()
{
for (int i = 0; i < this.AddonsToClose.Length; i++)
{
if (GenericHelpers.TryGetAddonByName(this.AddonsToClose[i], out AtkUnitBase* atkUnitBase) && atkUnitBase->IsVisible)
if (GenericHelpers.TryGetAddonByName(this.AddonsToClose[i], out AtkUnitBase* atkUnitBase) && atkUnitBase->IsReady)
{
this.DebugLog("Closing Addon " + this.AddonsToClose[i]);
atkUnitBase->Close(true);
atkUnitBase->FireCallbackInt(-1);
return false;
}
}
Expand Down
88 changes: 54 additions & 34 deletions AutoDuty/Windows/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ namespace AutoDuty.Windows;
using System.IO.Pipes;
using System.Numerics;
using System.Text;
using FFXIVClientStructs.FFXIV.Client.UI.Agent;
using Achievement = Lumina.Excel.Sheets.Achievement;
using ExitDutyHelper = Helpers.ExitDutyHelper;
using Map = Lumina.Excel.Sheets.Map;
Expand Down Expand Up @@ -1176,7 +1177,10 @@ public bool AutoDesynthSkillUp
AutoDesynth = false;
}
}
public int AutoDesynthSkillUpLimit = 50;
public int AutoDesynthSkillUpLimit = 50;
public bool AutoDesynthNoGearset = true;
public ulong AutoDesynthCategories = 0x1;

internal bool autoGCTurnin = false;
public bool AutoGCTurnin
{
Expand Down Expand Up @@ -2702,54 +2706,70 @@ public static void Draw()


ImGui.Columns(2, "##DesynthColumns");
float columnY = ImGui.GetCursorPosY();

if (ImGui.Checkbox("Auto Desynth", ref Configuration.autoDesynth))
{
Configuration.AutoDesynth = Configuration.autoDesynth;
Configuration.Save();
}
ImGui.NextColumn();
//ImGui.SameLine(0, 5);
using (ImGuiHelper.RequiresPlugin(ExternalPlugin.AutoRetainer, "GCTurnin"))
if (Configuration.AutoDesynth)
{
if (ImGui.Checkbox("Auto GC Turnin", ref Configuration.autoGCTurnin))
ImGui.Indent();
if (ImGui.Checkbox("Only Skill Ups", ref Configuration.autoDesynthSkillUp))
{
Configuration.AutoGCTurnin = Configuration.autoGCTurnin;
Configuration.AutoDesynthSkillUp = Configuration.autoDesynthSkillUp;
Configuration.Save();
}

ImGui.NextColumn();
if (Configuration.AutoDesynthSkillUp)
{
ImGui.Indent();
ImGui.Text("Item Level Limit");
ImGuiComponents.HelpMarker("Stops desynthesising an item once your desynthesis skill reaches the Item Level + this limit.");
ImGui.SameLine();
ImGui.PushItemWidth(ImGui.GetContentRegionAvail().X);
if (ImGui.SliderInt("##AutoDesynthSkillUpLimit", ref Configuration.AutoDesynthSkillUpLimit, 0, 50))
{
Configuration.AutoDesynthSkillUpLimit = Math.Clamp(Configuration.AutoDesynthSkillUpLimit, 0, 50);
Configuration.Save();
}
ImGui.PopItemWidth();
ImGui.Unindent();
}

if (ImGui.Checkbox($"Protect Gearsets##Desynth{nameof(Configuration.AutoDesynthNoGearset)}", ref Configuration.AutoDesynthNoGearset))
Configuration.Save();

//slightly cursed
using (ImRaii.Enabled())
if (ImGui.CollapsingHeader("Desynth Categories"))
{
if (Configuration.AutoDesynth)
ImGui.Indent();
AgentSalvage.SalvageItemCategory[] values = Enum.GetValues<AgentSalvage.SalvageItemCategory>();
for (int index = 0; index < values.Length; index++)
{
ImGui.Indent();
if (ImGui.Checkbox("Only Skill Ups", ref Configuration.autoDesynthSkillUp))
{
Configuration.AutoDesynthSkillUp = Configuration.autoDesynthSkillUp;
Configuration.Save();
}
if (Configuration.AutoDesynthSkillUp)
{
ImGui.Indent();
ImGui.Text("Item Level Limit");
ImGuiComponents.HelpMarker("Stops desynthesising an item once your desynthesis skill reaches the Item Level + this limit.");
ImGui.SameLine();
ImGui.PushItemWidth(ImGui.GetContentRegionAvail().X);
if (ImGui.SliderInt("##AutoDesynthSkillUpLimit", ref Configuration.AutoDesynthSkillUpLimit, 0, 50))
{
Configuration.AutoDesynthSkillUpLimit = Math.Clamp(Configuration.AutoDesynthSkillUpLimit, 0, 50);
Configuration.Save();
}
ImGui.PopItemWidth();
ImGui.Unindent();
}
ImGui.Unindent();
bool x = Bitmask.IsBitSet(Configuration.AutoDesynthCategories, index);
string categoryName = values[index].ToCustomString();
if (ImGui.Checkbox(categoryName + $"##DesynthCategory{categoryName}", ref x))
if (x)
Bitmask.SetBit(ref Configuration.AutoDesynthCategories, index);
else
Bitmask.ResetBit(ref Configuration.AutoDesynthCategories, index);
}
ImGui.Unindent();
}

ImGui.Unindent();
}

ImGui.NextColumn();
ImGui.SetCursorPosY(columnY);
//ImGui.SameLine(0, 5);
using (ImGuiHelper.RequiresPlugin(ExternalPlugin.AutoRetainer, "GCTurnin"))
{
if (ImGui.Checkbox("Auto GC Turnin", ref Configuration.autoGCTurnin))
{
Configuration.AutoGCTurnin = Configuration.autoGCTurnin;
Configuration.Save();
}
ImGui.NextColumn();
if (Configuration.AutoGCTurnin)
{
ImGui.Indent();
Expand Down
Loading