Skip to content

Commit be24611

Browse files
committed
AutoGig Adjustments
oh god pls dont break
1 parent 980f96a commit be24611

File tree

7 files changed

+73
-10
lines changed

7 files changed

+73
-10
lines changed

AutoHook/AutoHook.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"InternalName": "AutoHook",
77
"RepoUrl": "https://github.com/InitialDet/AutoHook",
88
"ApplicableVersion": "any",
9-
"Tags": ["Gathering","Fishing"],
9+
"Tags": [ "Gathering", "Fishing" ],
1010
"DalamudApiLevel": 7,
1111
"IconUrl": "https://raw.githubusercontent.com/InitialDet/AutoHook/main/AutoHook/images/icon.png",
12-
"Changelog": "Patch 6.2 Update"
12+
"Changelog": "- New AutoGig (spearfishing) Option\n- Added GP management for autocast\n- Added selectable Tugs for Double/Triple hook\n\n-- Small changes --\n- Adjustments to the UI\n- A lot of code refactor\n- Some bugfixes"
1313
}

AutoHook/Configurations/Configuration.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ public class Configuration : IPluginConfiguration
1818
public HookConfig DefaultMoochConfig = new("DefaultMooch");
1919
public List<HookConfig> CustomBait = new();
2020

21-
public bool AutoGigEnabled = false;
21+
public bool AutoGigEnabled = true;
2222
public bool AutoGigHideOverlay = false;
2323
public bool AutoGigNaturesBountyEnabled = false;
2424

25-
public SpearfishSpeed currentSpeed = SpearfishSpeed.Slow;
26-
public SpearfishSize currentSize = SpearfishSize.Small;
25+
public SpearfishSpeed currentSpeed = SpearfishSpeed.All;
26+
public SpearfishSize currentSize = SpearfishSize.All;
2727

2828
public void Save()
2929
{

AutoHook/PluginUI.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public override void Draw()
5050

5151
Utils.DrawUtil.Checkbox("Enable AutoHook", ref Service.Configuration.PluginEnabled, "Enables/Disables the plugin for you");
5252
ShowKofi();
53+
ShowPaypal();
5354
ImGui.Indent();
5455

5556
if (Service.Configuration.PluginEnabled)
@@ -113,6 +114,22 @@ public static void ShowKofi()
113114
ImGui.PopStyleColor(3);
114115
}
115116

117+
public static void ShowPaypal()
118+
{
119+
string buttonText = "Support on PayPal";
120+
ImGui.SameLine();
121+
ImGui.PushStyleColor(ImGuiCol.Button, 0xFFA06020);
122+
ImGui.PushStyleColor(ImGuiCol.ButtonActive, 0xDD000000 | 0x005E5BFF);
123+
ImGui.PushStyleColor(ImGuiCol.ButtonHovered, 0xAA000000 | 0x005E5BFF);
124+
125+
if (ImGui.Button(buttonText))
126+
{
127+
OpenBrowser("https://www.paypal.com/donate/?business=PDZJVTF5484UA&no_recurring=0&currency_code=USD");
128+
}
129+
130+
ImGui.PopStyleColor(3);
131+
}
132+
116133
public static void OpenBrowser(string url)
117134
{
118135
Process.Start(new ProcessStartInfo { FileName = url, UseShellExecute = true });

AutoHook/Ui/TabAutoCasts.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ internal class TabAutoCasts : TabBaseConfig
1818

1919
public override void DrawHeader()
2020
{
21-
ImGui.TextWrapped("The new Auto Cast/Mooch is a experimental feature and can be a little confusing at first. I'll be trying to find a more simple and intuitive solution later\nPlease report any issues you encounter.");
21+
//ImGui.TextWrapped("The new Auto Cast/Mooch is a experimental feature and can be a little confusing at first. I'll be trying to find a more simple and intuitive solution later\nPlease report any issues you encounter.");
2222

2323
// Disable all casts
24+
ImGui.Spacing();
2425
if (DrawUtil.Checkbox("Enable Auto Casts", ref cfg.EnableAll, "You can uncheck this to not use any actions below"))
2526
{ }
2627

@@ -30,6 +31,8 @@ public override void DrawHeader()
3031
if (DrawUtil.Checkbox("Don't Cancel Mooch", ref AutoCastsConfig.DontCancelMooch, "If mooch is available & Auto Mooch is enabled, actions that cancel mooch wont be used (e.g. Chum, Fish Eyes, Prize Catch etc.)"))
3132
{ }
3233
}
34+
ImGui.Spacing();
35+
3336
}
3437

3538
public override void Draw()

AutoHook/Ui/TabAutoGig.cs

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using AutoHook.Configurations;
33
using AutoHook.Utils;
44
using Dalamud.Interface;
5+
using GatherBuddy.Enums;
56
using ImGuiNET;
67
using System;
78
using System.Collections.Generic;
@@ -15,6 +16,9 @@ internal class TabAutoGig : TabBaseConfig
1516
public override string TabName => "AutoGig";
1617
public override bool Enabled => true;
1718

19+
List<SpearfishSpeed> speedTypes = Enum.GetValues(typeof(SpearfishSpeed)).Cast<SpearfishSpeed>().ToList();
20+
List<SpearfishSize> sizeTypes = Enum.GetValues(typeof(SpearfishSize)).Cast<SpearfishSize>().ToList();
21+
1822
public override void DrawHeader()
1923
{
2024
ImGui.Spacing();
@@ -24,13 +28,12 @@ public override void DrawHeader()
2428

2529
public override void Draw()
2630
{
27-
if (DrawUtil.Checkbox("Enable AutoGig", ref Service.Configuration.AutoGigEnabled, "You can uncheck this to not use any actions below"))
31+
if (DrawUtil.Checkbox("Enable AutoGig", ref Service.Configuration.AutoGigEnabled))
2832
{
2933
if (Service.Configuration.AutoGigEnabled)
3034
{
3135
Service.Configuration.AutoGigHideOverlay = false;
3236
Service.Configuration.Save();
33-
3437
}
3538
}
3639

@@ -43,7 +46,45 @@ public override void Draw()
4346
}
4447

4548
ImGui.Unindent();
49+
}
50+
51+
ImGui.Separator();
52+
53+
DrawSpeedSize();
54+
}
4655

56+
57+
58+
59+
private void DrawSpeedSize()
60+
{
61+
ImGui.Spacing();
62+
ImGui.TextWrapped("Select the Size and Speed of the fish you want (Gatherbuddy's Spearfishing overlay helps a lot)");
63+
ImGui.Spacing();
64+
65+
ImGui.SetNextItemWidth(130);
66+
if (ImGui.BeginCombo("Size", Service.Configuration.currentSize.ToName()))
67+
{
68+
69+
foreach (SpearfishSize size in sizeTypes.Where(size =>
70+
ImGui.Selectable(size.ToName(), size == Service.Configuration.currentSize)))
71+
{
72+
Service.Configuration.currentSize = size;
73+
}
74+
ImGui.EndCombo();
75+
}
76+
77+
ImGui.SameLine();
78+
79+
ImGui.SetNextItemWidth(130);
80+
if (ImGui.BeginCombo("Speed", Service.Configuration.currentSpeed.ToName()))
81+
{
82+
foreach (SpearfishSpeed speed in speedTypes.Where(speed =>
83+
ImGui.Selectable(speed.ToName(), speed == Service.Configuration.currentSpeed)))
84+
{
85+
Service.Configuration.currentSpeed = speed;
86+
}
87+
ImGui.EndCombo();
4788
}
4889
}
4990

AutoHook/Ui/TabGPConfig.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ public override void Draw()
3737

3838
public override void DrawHeader()
3939
{
40-
40+
ImGui.Spacing();
41+
ImGui.TextWrapped("Here you can customize the GP Threshold for the actions and items used by the AutoCast feature.");
42+
ImGui.Spacing();
4143
}
4244

4345
private void DrawGPTab()

AutoHook/Ui/TabGeneral.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public override void DrawHeader()
2020

2121
ImGui.Separator();
2222
ImGui.Spacing();
23-
if (ImGui.Button("Click here to report an issue or make an suggestion"))
23+
if (ImGui.Button("Click here to report an issue or make a suggestion"))
2424
{
2525
Process.Start(new ProcessStartInfo { FileName = "https://github.com/InitialDet/AutoHook/issues", UseShellExecute = true });
2626
}

0 commit comments

Comments
 (0)