diff --git a/AutoHook/AutoHook.csproj b/AutoHook/AutoHook.csproj index ae1081e..05d548d 100644 --- a/AutoHook/AutoHook.csproj +++ b/AutoHook/AutoHook.csproj @@ -2,7 +2,7 @@ Det - 2.4.0.1 + 2.4.1.0 Auto hooks for you https://github.com/InitialDet/AutoHook Release;Debug diff --git a/AutoHook/AutoHook.json b/AutoHook/AutoHook.json index 33ea5b2..fea0877 100644 --- a/AutoHook/AutoHook.json +++ b/AutoHook/AutoHook.json @@ -10,5 +10,5 @@ "DalamudApiLevel": 8, "AcceptsFeedback": false, "IconUrl": "https://raw.githubusercontent.com/InitialDet/AutoHook/main/AutoHook/images/icon.png", - "Changelog": "- Presets for custom baits added, you can now swap configs without needing to recreate it every time\n- Added an option to only cast Chum when under the effect of Fisher's Intuition\n- Added an option to only cast Prize Catch when Mooch II is not available, saving you 100gp if all you want is to mooch\n- Added Custom Timer when under the effect of Chum\n- Added an option to only use Prize Catch when under the effect of Identical Cast\n- Upgrade to .net7 and API8" + "Changelog": "- Presets for custom baits added, you can now swap configs without needing to recreate it every time\n- Added options to cast Chum or Mooch only when under the effect of Fisher's Intuition\n- Added an option to only cast Prize Catch when Mooch II is not available, saving you 100gp if all you want is to mooch\n- Added Custom Timer when under the effect of Chum\n- Added an option to only use Prize Catch when under the effect of Identical Cast\n- Upgrade to .net7 and API8" } \ No newline at end of file diff --git a/AutoHook/Configurations/AutoCastsConfig.cs b/AutoHook/Configurations/AutoCastsConfig.cs index f451118..fc7c1e3 100644 --- a/AutoHook/Configurations/AutoCastsConfig.cs +++ b/AutoHook/Configurations/AutoCastsConfig.cs @@ -11,9 +11,10 @@ public class AutoCastsConfig { public bool EnableAll = false; public bool EnableAutoCast = false; - public bool EnableMooch = false; + public bool EnableMooch = false; public bool EnableMooch2 = false; + public bool OnlyMoochIntuition = false; public bool EnablePatience = false; public static bool EnableMakeshiftPatience = false; @@ -119,20 +120,29 @@ private bool UseMooch(out uint id) bool useAutoMooch = false; bool useAutoMooch2 = false; + bool onlyMoochIntuition = false; + // if (BaitConfig == null || BaitConfig?.BaitName == "DefaultCast" || BaitConfig?.BaitName == "DefaultMooch") { useAutoMooch = EnableMooch; useAutoMooch2 = EnableMooch2; + onlyMoochIntuition = OnlyMoochIntuition; + } else { useAutoMooch = BaitConfig?.UseAutoMooch ?? false; useAutoMooch2 = BaitConfig?.UseAutoMooch2 ?? false; + onlyMoochIntuition = BaitConfig?.OnlyMoochIntuition ?? false; } if (useAutoMooch) { + + if (onlyMoochIntuition && !PlayerResources.HasStatus(IDs.Status.IdenticalCast)) + return false; + if (PlayerResources.ActionAvailable(IDs.Actions.Mooch)) { id = IDs.Actions.Mooch; diff --git a/AutoHook/Configurations/BaitConfig.cs b/AutoHook/Configurations/BaitConfig.cs index 31622cc..1bda4eb 100644 --- a/AutoHook/Configurations/BaitConfig.cs +++ b/AutoHook/Configurations/BaitConfig.cs @@ -34,7 +34,8 @@ public class BaitConfig public bool UseAutoMooch = true; public bool UseAutoMooch2 = false; - + public bool OnlyMoochIntuition = false; + public bool UseSurfaceSlap = false; public bool UseIdenticalCast = false; diff --git a/AutoHook/Ui/TabAutoCasts.cs b/AutoHook/Ui/TabAutoCasts.cs index a96c259..d69259b 100644 --- a/AutoHook/Ui/TabAutoCasts.cs +++ b/AutoHook/Ui/TabAutoCasts.cs @@ -23,13 +23,17 @@ public override void DrawHeader() // Disable all casts ImGui.Spacing(); if (DrawUtil.Checkbox("Enable Auto Casts", ref cfg.EnableAll)) - { } + { + Service.Configuration.Save(); + } if (cfg.EnableAll) { ImGui.SameLine(); if (DrawUtil.Checkbox("Don't Cancel Mooch", ref AutoCastsConfig.DontCancelMooch, "Actions that cancel mooch wont be used (e.g. Chum, Fish Eyes, Prize Catch etc.)")) - { } + { + Service.Configuration.Save(); + } } ImGui.Spacing(); @@ -59,7 +63,9 @@ public override void Draw() private void DrawAutoCast() { if (DrawUtil.Checkbox("Global Auto Cast Line", ref cfg.EnableAutoCast, "Cast (FSH Action) will be used after a fish bite\n\nIMPORTANT!!!\nIf you have this option enabled and you don't have a Custom Auto Mooch or the Global Auto Mooch option enabled, the line will be casted normally and you'll lose your mooch oportunity (If available).")) - { } + { + Service.Configuration.Save(); + } if (cfg.EnableAutoCast) { @@ -76,8 +82,10 @@ private void DrawExtraOptionsAutoCast() private void DrawAutoMooch() { - if (DrawUtil.Checkbox("Global Auto Mooch", ref cfg.EnableMooch, "All fish will be mooched if available. This option have priority over Auto Cast Line\n\nIf you want to Auto Mooch only a especific fish and ignore others, disable this option and add Custom Preset.")) - { } + if (DrawUtil.Checkbox("Global Auto Mooch", ref cfg.EnableMooch, "This option have priority over Auto Cast Line\n\nIf you want to Auto Mooch only a especific fish and ignore others, disable this option and add Custom Preset.")) + { + Service.Configuration.Save(); + } if (cfg.EnableMooch) { @@ -89,7 +97,15 @@ private void DrawAutoMooch() private void DrawExtraOptionsAutoMooch() { - ImGui.Checkbox("Use Mooch II", ref cfg.EnableMooch2); + if (ImGui.Checkbox("Use Mooch II", ref cfg.EnableMooch2)) + { + Service.Configuration.Save(); + } + + if (ImGui.Checkbox("Only use when Fisher's Intution is active", ref cfg.OnlyMoochIntuition)) + { + Service.Configuration.Save(); + } } private void DrawPatience() @@ -202,9 +218,7 @@ private void DrawExtraOptionsMakeShiftBait() else cfg.AutoMakeShiftBait.MakeshiftBaitStacks = stack; - Service.Configuration.Save(); - } } @@ -215,7 +229,6 @@ private void DrawPrizeCatch() { cfg.AutoPrizeCatch.Enabled = enabled; Service.Configuration.Save(); - } if (enabled) @@ -223,7 +236,7 @@ private void DrawPrizeCatch() ImGui.Indent(); DrawExtraOptionPrizeCatch(); ImGui.Unindent(); - } + } } private void DrawExtraOptionPrizeCatch() diff --git a/AutoHook/Ui/TabBaseConfig.cs b/AutoHook/Ui/TabBaseConfig.cs index f41c873..50358bb 100644 --- a/AutoHook/Ui/TabBaseConfig.cs +++ b/AutoHook/Ui/TabBaseConfig.cs @@ -276,9 +276,9 @@ public void DrawAutoMooch(BaitConfig cfg) { ImGui.TextColored(ImGuiColors.DalamudYellow, "Auto Mooch"); ImGui.Spacing(); - ImGui.Text("- If this is a Bait, all fish caught by this bait will be mooched"); + ImGui.Text("- If this is a Bait (Ex: Versatile Lure), all fish caught by this bait will be mooched"); ImGui.Text("- If this is a Fish/Mooch (Ex: Harbor Herring), it'll be mooched when caught"); - ImGui.Text("If this option is disabled, it will NOT be mooched even if Auto Mooch is also enabled in the general tab"); + ImGui.Text("If this option is disabled, the fish will NOT be mooched even if Auto Mooch is also enabled in the general tab"); if (Utils.DrawUtil.Checkbox("Auto Mooch", ref cfg.UseAutoMooch, "This option takes priority over the Auto Cast Line")) { if (!cfg.UseAutoMooch) @@ -288,7 +288,16 @@ public void DrawAutoMooch(BaitConfig cfg) if (cfg.UseAutoMooch) { ImGui.Indent(); - ImGui.Checkbox("Use Mooch II", ref cfg.UseAutoMooch2); + + if (ImGui.Checkbox("Use Mooch II", ref cfg.UseAutoMooch2)) + { + Service.Configuration.Save(); + } + + if (ImGui.Checkbox("Only use when Fisher's Intution is active", ref cfg.OnlyMoochIntuition)) + { + Service.Configuration.Save(); + } ImGui.Unindent(); } ImGui.EndPopup(); diff --git a/AutoHook/Ui/TabPresets.cs b/AutoHook/Ui/TabPresets.cs index 38d7f5a..2e05a81 100644 --- a/AutoHook/Ui/TabPresets.cs +++ b/AutoHook/Ui/TabPresets.cs @@ -97,7 +97,6 @@ public override void DrawHeader() { cfg.BaitPresetList.Remove(cfg.CurrentPreset); cfg.CurrentPreset = null; - } cfg.Save(); @@ -130,6 +129,13 @@ public override void DrawHeader() ImGui.SameLine(); ImGuiComponents.HelpMarker("Make sure to edit the bait/fish name correctly like ingame (Ex: Versatile Lure)"); + // I hate ImGui and i dont care to make this look good + ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudYellow); + ImGui.TextWrapped("Auto Mooch"); + ImGui.PopStyleColor(); + ImGui.SameLine(); + ImGui.TextWrapped("is enabled by default when new bait/fish is added "); + if (ImGui.Button("Add Current Bait/Fish")) { var setting = new BaitConfig(HookingManager.CurrentBait ?? "-"); @@ -224,7 +230,6 @@ private void DrawImportExport() if (ImGui.Button("Import")) { - if (Service.Configuration.BaitPresetList.Contains(new(name))) { _alertMessage = "A preset with the same name already exists"; @@ -258,7 +263,6 @@ private void DrawImportExport() ImGui.SetTooltip("Import stack from clipboard."); TimedWarning(); - } private static readonly double _timelimit = 5000; @@ -276,7 +280,6 @@ private void TimedWarning() } } } - public override void Draw() { if (_hasPreset)