diff --git a/AutoHook/Classes/AutoCasts/AutoPrizeCatch.cs b/AutoHook/Classes/AutoCasts/AutoPrizeCatch.cs index d621b14..667c549 100644 --- a/AutoHook/Classes/AutoCasts/AutoPrizeCatch.cs +++ b/AutoHook/Classes/AutoCasts/AutoPrizeCatch.cs @@ -11,6 +11,8 @@ public class AutoPrizeCatch : BaseActionCast public bool UseOnlyWithIdenticalCast = false; + public bool UseOnlyWithActiveSlap = false; + public AutoPrizeCatch() : base(UIStrings.Prize_Catch, Data.IDs.Actions.PrizeCatch, ActionType.Action) { DoesCancelMooch = true; @@ -31,6 +33,9 @@ public override bool CastCondition() if (UseOnlyWithIdenticalCast && !PlayerResources.HasStatus(IDs.Status.IdenticalCast)) return false; + if (UseOnlyWithActiveSlap && !PlayerResources.HasStatus(IDs.Status.SurfaceSlap)) + return false; + if (PlayerResources.HasStatus(IDs.Status.MakeshiftBait)) return false; @@ -56,5 +61,10 @@ public override bool CastCondition() { Service.Save(); } + + if (DrawUtil.Checkbox(UIStrings.OnlyUseWhenActiveSurfaceSlap, ref UseOnlyWithActiveSlap)) + { + Service.Save(); + } }; } \ No newline at end of file diff --git a/AutoHook/Configurations/HookConfig.cs b/AutoHook/Configurations/HookConfig.cs index 0bd4b2e..38b74ad 100644 --- a/AutoHook/Configurations/HookConfig.cs +++ b/AutoHook/Configurations/HookConfig.cs @@ -18,18 +18,24 @@ public class HookConfig public bool HookWeakEnabled = true; public bool HookWeakIntuitionEnabled = true; public bool HookWeakDHTHEnabled = true; + public bool HookWeakOnlyWhenActiveSlap = false; + public bool HookWeakOnlyWhenNOTActiveSlap = false; public HookType HookTypeWeak = HookType.Precision; public HookType HookTypeWeakIntuition = HookType.Precision; public bool HookStrongEnabled = true; public bool HookStrongIntuitionEnabled = true; public bool HookStrongDHTHEnabled = true; + public bool HookStrongOnlyWhenActiveSlap = false; + public bool HookStrongOnlyWhenNOTActiveSlap = false; public HookType HookTypeStrong = HookType.Powerful; public HookType HookTypeStrongIntuition = HookType.Powerful; public bool HookLegendaryEnabled = true; public bool HookLegendaryIntuitionEnabled = true; public bool HookLegendaryDHTHEnabled = true; + public bool HookLegendaryOnlyWhenActiveSlap = false; + public bool HookLegendaryOnlyWhenNOTActiveSlap = false; public HookType HookTypeLegendary = HookType.Powerful; public HookType HookTypeLegendaryIntuition = HookType.Powerful; @@ -45,6 +51,7 @@ public class HookConfig public bool UseDoubleHook = false; public bool UseTripleHook = false; public bool UseDHTHPatience = false; + public bool UseDHTHOnlyIdenticalCast = false; public bool UseDHTHOnlySurfaceSlap = false; public bool LetFishEscape = false; @@ -83,6 +90,12 @@ public HookConfig(BaitFishClass baitFish) else if (!CheckHookEnabled(bite)) return HookType.None; + if (CheckHookSurfaceSlapEnabled(bite) && !PlayerResources.HasStatus(IDs.Status.SurfaceSlap)) + return HookType.None; + + if (CheckHookSurfaceSlapNOTEnabled(bite) && PlayerResources.HasStatus(IDs.Status.SurfaceSlap)) + return HookType.None; + var hook = GetDoubleTripleHook(bite); if (hook != HookType.None) @@ -119,6 +132,16 @@ public bool CheckHookIntuitionEnabled(BiteType bite) => bite == BiteType.Strong ? HookStrongIntuitionEnabled : bite == BiteType.Legendary ? HookLegendaryIntuitionEnabled : false; + public bool CheckHookSurfaceSlapEnabled(BiteType bite) => + bite == BiteType.Weak ? HookWeakOnlyWhenActiveSlap : + bite == BiteType.Strong ? HookStrongOnlyWhenActiveSlap : + bite == BiteType.Legendary ? HookLegendaryOnlyWhenActiveSlap : false; + + public bool CheckHookSurfaceSlapNOTEnabled(BiteType bite) => + bite == BiteType.Weak ? HookWeakOnlyWhenNOTActiveSlap : + bite == BiteType.Strong ? HookStrongOnlyWhenNOTActiveSlap : + bite == BiteType.Legendary ? HookLegendaryOnlyWhenNOTActiveSlap : false; + public bool CheckHookDHTHEnabled(BiteType bite) => bite == BiteType.Weak ? HookWeakDHTHEnabled : bite == BiteType.Strong ? HookStrongDHTHEnabled : @@ -144,7 +167,10 @@ public bool CheckHookDHTHEnabled(BiteType bite) => { if (UseTripleHook || UseDoubleHook) { - if (UseDHTHOnlySurfaceSlap && !PlayerResources.HasStatus(IDs.Status.IdenticalCast)) + if (UseDHTHOnlyIdenticalCast && !PlayerResources.HasStatus(IDs.Status.IdenticalCast)) + return HookType.None; + + if (UseDHTHOnlySurfaceSlap && !PlayerResources.HasStatus(IDs.Status.SurfaceSlap)) return HookType.None; if (PlayerResources.HasStatus(IDs.Status.AnglersFortune) && !UseDHTHPatience) diff --git a/AutoHook/Resources/Localization/UIStrings.Designer.cs b/AutoHook/Resources/Localization/UIStrings.Designer.cs index f0e5045..91e0142 100644 --- a/AutoHook/Resources/Localization/UIStrings.Designer.cs +++ b/AutoHook/Resources/Localization/UIStrings.Designer.cs @@ -1,6 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -1353,6 +1354,15 @@ internal static string Only_When_Patience_Active { } } + /// + /// Looks up a localized string similar to Only use when Surface Slap is active. + /// + internal static string OnlyUseWhenActiveSurfaceSlap { + get { + return ResourceManager.GetString("OnlyUseWhenActiveSurfaceSlap", resourceCulture); + } + } + /// /// Looks up a localized string similar to Only use when Fisher's Intuition is active. /// @@ -1371,6 +1381,15 @@ internal static string OnlyUseWhenIdenticalCastIsActive { } } + /// + /// Looks up a localized string similar to Only use when Surface Slap is not active. + /// + internal static string OnlyUseWhenNOTActiveSurfaceSlap { + get { + return ResourceManager.GetString("OnlyUseWhenNOTActiveSurfaceSlap", resourceCulture); + } + } + /// /// Looks up a localized string similar to Open Console. /// diff --git a/AutoHook/Resources/Localization/UIStrings.resx b/AutoHook/Resources/Localization/UIStrings.resx index 6433b9a..ed23e0f 100644 --- a/AutoHook/Resources/Localization/UIStrings.resx +++ b/AutoHook/Resources/Localization/UIStrings.resx @@ -874,4 +874,10 @@ Check the Guide Tab for Guides. Preset set to: + + Only use when Surface Slap is active + + + Only use when Surface Slap is not active + \ No newline at end of file diff --git a/AutoHook/Ui/SubTabBaitMooch.cs b/AutoHook/Ui/SubTabBaitMooch.cs index d604f80..6aa29e8 100644 --- a/AutoHook/Ui/SubTabBaitMooch.cs +++ b/AutoHook/Ui/SubTabBaitMooch.cs @@ -22,6 +22,7 @@ public class SubTabBaitMooch private static string StrHookWeak => UIStrings.HookWeakExclamation; private static string StrHookStrong => UIStrings.HookStrongExclamation; private static string StrHookLegendary => UIStrings.HookLegendaryExclamation; + private static string StrHookWhenActiveSlap => UIStrings.OnlyUseWhenActiveSurfaceSlap; //private PresetConfig _selectedPreset; private List _listOfHooks = new(); @@ -124,12 +125,12 @@ private void DrawDeleteButton(HookConfig hookConfig) private void DrawHookCheckboxes(HookConfig hookConfig) { - DrawSelectTugs(StrHookWeak, ref hookConfig.HookWeakEnabled, ref hookConfig.HookTypeWeak); - DrawSelectTugs(StrHookStrong, ref hookConfig.HookStrongEnabled, ref hookConfig.HookTypeStrong); - DrawSelectTugs(StrHookLegendary, ref hookConfig.HookLegendaryEnabled, ref hookConfig.HookTypeLegendary); + DrawSelectTugs(StrHookWeak, ref hookConfig.HookWeakEnabled, ref hookConfig.HookTypeWeak, ref hookConfig.HookWeakOnlyWhenActiveSlap, ref hookConfig.HookWeakOnlyWhenNOTActiveSlap); + DrawSelectTugs(StrHookStrong, ref hookConfig.HookStrongEnabled, ref hookConfig.HookTypeStrong, ref hookConfig.HookStrongOnlyWhenActiveSlap, ref hookConfig.HookStrongOnlyWhenNOTActiveSlap); + DrawSelectTugs(StrHookLegendary, ref hookConfig.HookLegendaryEnabled, ref hookConfig.HookTypeLegendary, ref hookConfig.HookLegendaryOnlyWhenActiveSlap, ref hookConfig.HookLegendaryOnlyWhenNOTActiveSlap); } - private void DrawSelectTugs(string hook, ref bool enabled, ref HookType type) + private void DrawSelectTugs(string hook, ref bool enabled, ref HookType type, ref bool hookOnlyWhenActiveSlap, ref bool hookOnlyWhenNOTActiveSlap) { ImGui.PushID($"{hook}"); if(ImGui.Checkbox($"", ref enabled)) @@ -161,6 +162,20 @@ private void DrawSelectTugs(string hook, ref bool enabled, ref HookType type) Service.Save(); } + ImGui.Spacing(); + + if (DrawUtil.Checkbox(UIStrings.OnlyUseWhenActiveSurfaceSlap, ref hookOnlyWhenActiveSlap)) + { + hookOnlyWhenNOTActiveSlap = false; + Service.Save(); + } + + if (DrawUtil.Checkbox(UIStrings.OnlyUseWhenNOTActiveSurfaceSlap, ref hookOnlyWhenNOTActiveSlap)) + { + hookOnlyWhenActiveSlap = false; + Service.Save(); + } + ImGui.TreePop(); } @@ -306,8 +321,12 @@ private void DrawCheckBoxDoubleTripleHook(HookConfig hookConfig) ImGui.TextColored(ImGuiColors.DalamudYellow, UIStrings.DoubleTripleHookSettings); ImGui.Spacing(); - if (ImGui.Checkbox($"{UIStrings.OnlyUseWhenIdenticalCastIsActive}##surface_slap", - ref hookConfig.UseDHTHOnlySurfaceSlap)) + if (ImGui.Checkbox($"{UIStrings.OnlyUseWhenIdenticalCastIsActive}##identical_cast", ref hookConfig.UseDHTHOnlyIdenticalCast)) + { + Service.Save(); + } + + if (ImGui.Checkbox($"{UIStrings.OnlyUseWhenActiveSurfaceSlap}##surface_slap", ref hookConfig.UseDHTHOnlySurfaceSlap)) { Service.Save(); } @@ -393,9 +412,9 @@ public void DrawFishersIntuitionConfig(HookConfig cfg) ImGui.Separator(); - DrawSelectTugs(StrHookWeak, ref cfg.HookWeakIntuitionEnabled, ref cfg.HookTypeWeakIntuition); - DrawSelectTugs(StrHookStrong, ref cfg.HookStrongIntuitionEnabled, ref cfg.HookTypeStrongIntuition); - DrawSelectTugs(StrHookLegendary, ref cfg.HookLegendaryIntuitionEnabled, ref cfg.HookTypeLegendaryIntuition); + DrawSelectTugs(StrHookWeak, ref cfg.HookWeakIntuitionEnabled, ref cfg.HookTypeWeakIntuition, ref cfg.HookWeakOnlyWhenActiveSlap, ref cfg.HookWeakOnlyWhenNOTActiveSlap); + DrawSelectTugs(StrHookStrong, ref cfg.HookStrongIntuitionEnabled, ref cfg.HookTypeStrongIntuition, ref cfg.HookStrongOnlyWhenActiveSlap, ref cfg.HookStrongOnlyWhenNOTActiveSlap); + DrawSelectTugs(StrHookLegendary, ref cfg.HookLegendaryIntuitionEnabled, ref cfg.HookTypeLegendaryIntuition, ref cfg.HookLegendaryOnlyWhenActiveSlap, ref cfg.HookLegendaryOnlyWhenNOTActiveSlap); ImGui.EndPopup(); }