diff --git a/QuestPaths/4.x - Stormblood/Aether Currents/The Azim Steppe/2771_Sheep Snatcher.json b/QuestPaths/4.x - Stormblood/Aether Currents/The Azim Steppe/2771_Sheep Snatcher.json index 3d3167abd..034df26b6 100644 --- a/QuestPaths/4.x - Stormblood/Aether Currents/The Azim Steppe/2771_Sheep Snatcher.json +++ b/QuestPaths/4.x - Stormblood/Aether Currents/The Azim Steppe/2771_Sheep Snatcher.json @@ -28,7 +28,7 @@ "Z": -210.22363 }, "TerritoryId": 622, - "InteractionType": "Instruction", + "InteractionType": "Snipe", "Comment": "Snipe sheep" } ] diff --git a/QuestPaths/4.x - Stormblood/Alliance Raid Quests/3091_Desire.json b/QuestPaths/4.x - Stormblood/Alliance Raid Quests/3091_Desire.json index 4242e0f79..d0c8d2a91 100644 --- a/QuestPaths/4.x - Stormblood/Alliance Raid Quests/3091_Desire.json +++ b/QuestPaths/4.x - Stormblood/Alliance Raid Quests/3091_Desire.json @@ -54,7 +54,7 @@ "Z": 208.484 }, "TerritoryId": 787, - "InteractionType": "Instruction", + "InteractionType": "Snipe", "Comment": "Far on the left" } ] diff --git a/QuestPaths/4.x - Stormblood/MSQ/A3.2-Yanxia 1/2495_A New Ruby Tithe.json b/QuestPaths/4.x - Stormblood/MSQ/A3.2-Yanxia 1/2495_A New Ruby Tithe.json index b86394da0..1045490b6 100644 --- a/QuestPaths/4.x - Stormblood/MSQ/A3.2-Yanxia 1/2495_A New Ruby Tithe.json +++ b/QuestPaths/4.x - Stormblood/MSQ/A3.2-Yanxia 1/2495_A New Ruby Tithe.json @@ -111,7 +111,7 @@ "Z": 147.23425 }, "TerritoryId": 614, - "InteractionType": "Instruction", + "InteractionType": "Snipe", "Comment": "Snipe soldiers" } ] @@ -127,7 +127,7 @@ "Z": 237.04883 }, "TerritoryId": 614, - "InteractionType": "Instruction", + "InteractionType": "Snipe", "Comment": "Snipe soldiers" } ] @@ -158,7 +158,7 @@ "Z": 603.2959 }, "TerritoryId": 614, - "InteractionType": "Instruction", + "InteractionType": "Snipe", "Comment": "Snipe soldiers" } ] diff --git a/QuestPaths/4.x - Stormblood/MSQ/B-4.1/2970_Securing the Saltery.json b/QuestPaths/4.x - Stormblood/MSQ/B-4.1/2970_Securing the Saltery.json index 284a29d32..b7da884eb 100644 --- a/QuestPaths/4.x - Stormblood/MSQ/B-4.1/2970_Securing the Saltery.json +++ b/QuestPaths/4.x - Stormblood/MSQ/B-4.1/2970_Securing the Saltery.json @@ -62,7 +62,7 @@ "Z": 196.55139 }, "TerritoryId": 621, - "InteractionType": "Instruction", + "InteractionType": "Snipe", "Comment": "Aim at jaw", "Fly": true } @@ -95,7 +95,7 @@ "Z": 282.7954 }, "TerritoryId": 621, - "InteractionType": "Instruction", + "InteractionType": "Snipe", "Fly": true, "Comment": "Aim at nearest eye" } diff --git a/QuestPaths/5.x - Shadowbringers/Allied Societies/Pixies/Dailies/3707_Not the Beavers.json b/QuestPaths/5.x - Shadowbringers/Allied Societies/Pixies/Dailies/3707_Not the Beavers.json index ae181ec1c..8d99337d1 100644 --- a/QuestPaths/5.x - Shadowbringers/Allied Societies/Pixies/Dailies/3707_Not the Beavers.json +++ b/QuestPaths/5.x - Shadowbringers/Allied Societies/Pixies/Dailies/3707_Not the Beavers.json @@ -28,7 +28,7 @@ "Z": 755.58093 }, "TerritoryId": 816, - "InteractionType": "Instruction", + "InteractionType": "Snipe", "Fly": true, "Comment": "Throw Porxies at Beavers" } diff --git a/QuestPaths/5.x - Shadowbringers/MSQ/A2-Kholusia 1/3285_A Fickle Existence.json b/QuestPaths/5.x - Shadowbringers/MSQ/A2-Kholusia 1/3285_A Fickle Existence.json index d70949f9f..78b6e3cac 100644 --- a/QuestPaths/5.x - Shadowbringers/MSQ/A2-Kholusia 1/3285_A Fickle Existence.json +++ b/QuestPaths/5.x - Shadowbringers/MSQ/A2-Kholusia 1/3285_A Fickle Existence.json @@ -48,7 +48,7 @@ "Z": 656.9772 }, "TerritoryId": 814, - "InteractionType": "Instruction", + "InteractionType": "Snipe", "Comment": "Click the guy in front of (or near) the light house stairs" } ] diff --git a/QuestPaths/5.x - Shadowbringers/MSQ/A3-Amh Araeng 1/3292_City of the Mord.json b/QuestPaths/5.x - Shadowbringers/MSQ/A3-Amh Araeng 1/3292_City of the Mord.json index ded86bd5f..813814f30 100644 --- a/QuestPaths/5.x - Shadowbringers/MSQ/A3-Amh Araeng 1/3292_City of the Mord.json +++ b/QuestPaths/5.x - Shadowbringers/MSQ/A3-Amh Araeng 1/3292_City of the Mord.json @@ -48,7 +48,7 @@ "Z": -186.14484 }, "TerritoryId": 815, - "InteractionType": "Instruction", + "InteractionType": "Snipe", "Comment": "Click all four foods" } ] diff --git a/QuestPaths/5.x - Shadowbringers/MSQ/C-Rak'tika/3323_A Little Faith.json b/QuestPaths/5.x - Shadowbringers/MSQ/C-Rak'tika/3323_A Little Faith.json index a5286f4e7..b5c2d0d61 100644 --- a/QuestPaths/5.x - Shadowbringers/MSQ/C-Rak'tika/3323_A Little Faith.json +++ b/QuestPaths/5.x - Shadowbringers/MSQ/C-Rak'tika/3323_A Little Faith.json @@ -104,7 +104,7 @@ "Z": -92.97333 }, "TerritoryId": 813, - "InteractionType": "WaitForManualProgress", + "InteractionType": "Snipe", "Comment": "Tablet is on the right middle shelf of the table" } ] diff --git a/QuestPaths/5.x - Shadowbringers/MSQ/C-Rak'tika/3330_A Beeautiful Plan.json b/QuestPaths/5.x - Shadowbringers/MSQ/C-Rak'tika/3330_A Beeautiful Plan.json index 960e92937..51a28c182 100644 --- a/QuestPaths/5.x - Shadowbringers/MSQ/C-Rak'tika/3330_A Beeautiful Plan.json +++ b/QuestPaths/5.x - Shadowbringers/MSQ/C-Rak'tika/3330_A Beeautiful Plan.json @@ -84,7 +84,7 @@ "Z": -359.4873 }, "TerritoryId": 817, - "InteractionType": "WaitForManualProgress", + "InteractionType": "Snipe", "Comment": "Click murals" } ] diff --git a/QuestPaths/5.x - Shadowbringers/MSQ/E-Kholusia 2/3634_The View from Above.json b/QuestPaths/5.x - Shadowbringers/MSQ/E-Kholusia 2/3634_The View from Above.json index 2c9e1fff4..5285a8a24 100644 --- a/QuestPaths/5.x - Shadowbringers/MSQ/E-Kholusia 2/3634_The View from Above.json +++ b/QuestPaths/5.x - Shadowbringers/MSQ/E-Kholusia 2/3634_The View from Above.json @@ -73,7 +73,7 @@ "Z": 22.47644 }, "TerritoryId": 814, - "InteractionType": "WaitForManualProgress", + "InteractionType": "Snipe", "Comment": "Click on the guy left of the the rock" } ] diff --git a/QuestPaths/5.x - Shadowbringers/MSQ/E-Kholusia 2/3637_Meet the Tholls.json b/QuestPaths/5.x - Shadowbringers/MSQ/E-Kholusia 2/3637_Meet the Tholls.json index ee2b89dc8..8396eed78 100644 --- a/QuestPaths/5.x - Shadowbringers/MSQ/E-Kholusia 2/3637_Meet the Tholls.json +++ b/QuestPaths/5.x - Shadowbringers/MSQ/E-Kholusia 2/3637_Meet the Tholls.json @@ -59,7 +59,7 @@ "Z": -616.47974 }, "TerritoryId": 814, - "InteractionType": "WaitForManualProgress", + "InteractionType": "Snipe", "Comment": "Click red hat dwarf (always shows up in the same location)" } ] @@ -75,7 +75,7 @@ "Z": -616.47974 }, "TerritoryId": 814, - "InteractionType": "WaitForManualProgress", + "InteractionType": "Snipe", "Comment": "Click red hat dwarf" } ] diff --git a/QuestPaths/5.x - Shadowbringers/MSQ/F-Tempest/3649_City of the Ancients.json b/QuestPaths/5.x - Shadowbringers/MSQ/F-Tempest/3649_City of the Ancients.json index 34fa28fc2..3242f9d59 100644 --- a/QuestPaths/5.x - Shadowbringers/MSQ/F-Tempest/3649_City of the Ancients.json +++ b/QuestPaths/5.x - Shadowbringers/MSQ/F-Tempest/3649_City of the Ancients.json @@ -54,7 +54,7 @@ "Z": -414.38928 }, "TerritoryId": 818, - "InteractionType": "WaitForManualProgress", + "InteractionType": "Snipe", "Comment": "Click top left (broken) window", "CompletionQuestVariablesFlags": [ null, diff --git a/QuestPaths/5.x - Shadowbringers/MSQ/G-5.1/3680_Finding Good Help.json b/QuestPaths/5.x - Shadowbringers/MSQ/G-5.1/3680_Finding Good Help.json index 19ac49063..2416c087c 100644 --- a/QuestPaths/5.x - Shadowbringers/MSQ/G-5.1/3680_Finding Good Help.json +++ b/QuestPaths/5.x - Shadowbringers/MSQ/G-5.1/3680_Finding Good Help.json @@ -44,7 +44,7 @@ "Z": -161.45575 }, "TerritoryId": 814, - "InteractionType": "WaitForManualProgress", + "InteractionType": "Snipe", "Comment": "Help Master Chai dodge enemies" } ] diff --git a/QuestPaths/6.x - Endwalker/MSQ/A-Thavnair1-Labyrinthos1/4363_Deeper into the Maze.json b/QuestPaths/6.x - Endwalker/MSQ/A-Thavnair1-Labyrinthos1/4363_Deeper into the Maze.json index 75cf15c68..15fb42ae6 100644 --- a/QuestPaths/6.x - Endwalker/MSQ/A-Thavnair1-Labyrinthos1/4363_Deeper into the Maze.json +++ b/QuestPaths/6.x - Endwalker/MSQ/A-Thavnair1-Labyrinthos1/4363_Deeper into the Maze.json @@ -119,7 +119,7 @@ "Z": -519.18823 }, "TerritoryId": 956, - "InteractionType": "WaitForManualProgress", + "InteractionType": "Snipe", "Comment": "Shoot Large Green Bird" } ] diff --git a/QuestPaths/6.x - Endwalker/MSQ/C-MareLamentorum/4406_Setting Things Straight.json b/QuestPaths/6.x - Endwalker/MSQ/C-MareLamentorum/4406_Setting Things Straight.json index 00c79a9a8..b84bfe286 100644 --- a/QuestPaths/6.x - Endwalker/MSQ/C-MareLamentorum/4406_Setting Things Straight.json +++ b/QuestPaths/6.x - Endwalker/MSQ/C-MareLamentorum/4406_Setting Things Straight.json @@ -160,7 +160,7 @@ "Z": -654.13904 }, "TerritoryId": 959, - "InteractionType": "WaitForManualProgress", + "InteractionType": "Snipe", "Comment": "Find \"Runninway?\"" } ] diff --git a/QuestPaths/6.x - Endwalker/MSQ/F-Labyrinthos2/4443_Wise Guides.json b/QuestPaths/6.x - Endwalker/MSQ/F-Labyrinthos2/4443_Wise Guides.json index d7c5efa7b..56b49ff63 100644 --- a/QuestPaths/6.x - Endwalker/MSQ/F-Labyrinthos2/4443_Wise Guides.json +++ b/QuestPaths/6.x - Endwalker/MSQ/F-Labyrinthos2/4443_Wise Guides.json @@ -45,7 +45,7 @@ }, "StopDistance": 5, "TerritoryId": 956, - "InteractionType": "WaitForManualProgress", + "InteractionType": "Snipe", "Comment": "Find Points of Interest" } ] diff --git a/QuestPaths/6.x - Endwalker/MSQ/G-UltimaThule/4460_x.json b/QuestPaths/6.x - Endwalker/MSQ/G-UltimaThule/4460_x.json index 35dcefaf1..de94694bd 100644 --- a/QuestPaths/6.x - Endwalker/MSQ/G-UltimaThule/4460_x.json +++ b/QuestPaths/6.x - Endwalker/MSQ/G-UltimaThule/4460_x.json @@ -104,7 +104,7 @@ "Z": 375.50916 }, "TerritoryId": 960, - "InteractionType": "WaitForManualProgress", + "InteractionType": "Snipe", "Comment": "Find Errant Omicron" } ] diff --git a/QuestPaths/6.x - Endwalker/MSQ/G-UltimaThule/4461_Hello World.json b/QuestPaths/6.x - Endwalker/MSQ/G-UltimaThule/4461_Hello World.json index 48ae66728..300ba5658 100644 --- a/QuestPaths/6.x - Endwalker/MSQ/G-UltimaThule/4461_Hello World.json +++ b/QuestPaths/6.x - Endwalker/MSQ/G-UltimaThule/4461_Hello World.json @@ -44,7 +44,7 @@ "Z": 398.42822 }, "TerritoryId": 960, - "InteractionType": "WaitForManualProgress", + "InteractionType": "Snipe", "Comment": "Identify Anomaly (Head, Elbow or Knee)" } ] diff --git a/QuestPaths/6.x - Endwalker/Side Quests/Old Sharlayan/4181_Scholarly Perspective.json b/QuestPaths/6.x - Endwalker/Side Quests/Old Sharlayan/4181_Scholarly Perspective.json index d78b2a99f..ae1835167 100644 --- a/QuestPaths/6.x - Endwalker/Side Quests/Old Sharlayan/4181_Scholarly Perspective.json +++ b/QuestPaths/6.x - Endwalker/Side Quests/Old Sharlayan/4181_Scholarly Perspective.json @@ -28,7 +28,7 @@ "Z": 276.81384 }, "TerritoryId": 962, - "InteractionType": "Instruction", + "InteractionType": "Snipe", "Comment": "Click ewer, head and feet", "AethernetShortcut": [ "[Old Sharlayan] Aetheryte Plaza", diff --git a/QuestPaths/7.x - Dawntrail/MSQ/A-Kozama'uka1-Urqopacha1/4867_The Feat of Reeds.json b/QuestPaths/7.x - Dawntrail/MSQ/A-Kozama'uka1-Urqopacha1/4867_The Feat of Reeds.json index c69575bd4..b3a2d6b25 100644 --- a/QuestPaths/7.x - Dawntrail/MSQ/A-Kozama'uka1-Urqopacha1/4867_The Feat of Reeds.json +++ b/QuestPaths/7.x - Dawntrail/MSQ/A-Kozama'uka1-Urqopacha1/4867_The Feat of Reeds.json @@ -136,7 +136,7 @@ "Z": -532.15845 }, "TerritoryId": 1188, - "InteractionType": "WaitForManualProgress", + "InteractionType": "Snipe", "Comment": "Inspect Eye, Carrying Pole and Tail", "AetheryteShortcut": "Kozama'uka - Ok'hanu" } diff --git a/QuestPaths/7.x - Dawntrail/MSQ/B-Kozama'uka2-Urqopacha2/4881_Lending a Helphand.json b/QuestPaths/7.x - Dawntrail/MSQ/B-Kozama'uka2-Urqopacha2/4881_Lending a Helphand.json index 5fbb423b1..29d5bcb02 100644 --- a/QuestPaths/7.x - Dawntrail/MSQ/B-Kozama'uka2-Urqopacha2/4881_Lending a Helphand.json +++ b/QuestPaths/7.x - Dawntrail/MSQ/B-Kozama'uka2-Urqopacha2/4881_Lending a Helphand.json @@ -28,7 +28,7 @@ "Z": 343.7704 }, "TerritoryId": 1188, - "InteractionType": "WaitForManualProgress", + "InteractionType": "Snipe", "Comment": "Click (from left to right) worn tools, Kaahe, crafting materials, untouched meal" } ] diff --git a/QuestPaths/7.x - Dawntrail/MSQ/D-Shaaloani-HeritageFound1/4921_Pick up the Pieces.json b/QuestPaths/7.x - Dawntrail/MSQ/D-Shaaloani-HeritageFound1/4921_Pick up the Pieces.json index bcace2059..a5347bfec 100644 --- a/QuestPaths/7.x - Dawntrail/MSQ/D-Shaaloani-HeritageFound1/4921_Pick up the Pieces.json +++ b/QuestPaths/7.x - Dawntrail/MSQ/D-Shaaloani-HeritageFound1/4921_Pick up the Pieces.json @@ -28,7 +28,7 @@ "Z": 25.680908 }, "TerritoryId": 1185, - "InteractionType": "WaitForManualProgress", + "InteractionType": "Snipe", "Comment": "Inspect Helm, Corpse, Weapon" } ] diff --git a/QuestPaths/7.x - Dawntrail/Side Quests/Shaaloani/5126_A Refined Perspective.json b/QuestPaths/7.x - Dawntrail/Side Quests/Shaaloani/5126_A Refined Perspective.json index 4412991d6..31d973757 100644 --- a/QuestPaths/7.x - Dawntrail/Side Quests/Shaaloani/5126_A Refined Perspective.json +++ b/QuestPaths/7.x - Dawntrail/Side Quests/Shaaloani/5126_A Refined Perspective.json @@ -28,7 +28,7 @@ "Z": -141.92426 }, "TerritoryId": 1190, - "InteractionType": "Instruction", + "InteractionType": "Snipe", "Comment": "Click (from left to right) pump, middle of the connecting pipes, barrels" } ] diff --git a/QuestPaths/7.x - Dawntrail/Side Quests/Yak T'el/5100_Carved in Stone.json b/QuestPaths/7.x - Dawntrail/Side Quests/Yak T'el/5100_Carved in Stone.json index b50e254d2..2244ebb92 100644 --- a/QuestPaths/7.x - Dawntrail/Side Quests/Yak T'el/5100_Carved in Stone.json +++ b/QuestPaths/7.x - Dawntrail/Side Quests/Yak T'el/5100_Carved in Stone.json @@ -28,7 +28,7 @@ "Z": 557.7018 }, "TerritoryId": 1189, - "InteractionType": "Instruction", + "InteractionType": "Snipe", "Comment": "Inspect Flag, Red Head, Blue Head" } ] diff --git a/QuestPaths/quest-v1.json b/QuestPaths/quest-v1.json index 8068adef1..a3bfd6f98 100644 --- a/QuestPaths/quest-v1.json +++ b/QuestPaths/quest-v1.json @@ -130,6 +130,7 @@ "Jump", "Dive", "Craft", + "Snipe", "Instruction", "AcceptQuest", "CompleteQuest", diff --git a/Questionable.Model/Questing/Converter/InteractionTypeConverter.cs b/Questionable.Model/Questing/Converter/InteractionTypeConverter.cs index 8683a57a7..bf856da99 100644 --- a/Questionable.Model/Questing/Converter/InteractionTypeConverter.cs +++ b/Questionable.Model/Questing/Converter/InteractionTypeConverter.cs @@ -27,6 +27,7 @@ public sealed class InteractionTypeConverter() : EnumConverter { EInteractionType.Jump, "Jump" }, { EInteractionType.Dive, "Dive" }, { EInteractionType.Craft, "Craft" }, + { EInteractionType.Snipe, "Snipe" }, { EInteractionType.Instruction, "Instruction" }, { EInteractionType.AcceptQuest, "AcceptQuest" }, { EInteractionType.CompleteQuest, "CompleteQuest" }, diff --git a/Questionable.Model/Questing/EInteractionType.cs b/Questionable.Model/Questing/EInteractionType.cs index c0b3eede2..f251b5aee 100644 --- a/Questionable.Model/Questing/EInteractionType.cs +++ b/Questionable.Model/Questing/EInteractionType.cs @@ -26,6 +26,7 @@ public enum EInteractionType Jump, Dive, Craft, + Snipe, /// /// Needs to be manually continued. diff --git a/Questionable/Configuration.cs b/Questionable/Configuration.cs index 9f86cb94f..3ea014cb8 100644 --- a/Questionable/Configuration.cs +++ b/Questionable/Configuration.cs @@ -19,6 +19,7 @@ internal sealed class Configuration : IPluginConfiguration public bool HideInAllInstances { get; set; } = true; public bool UseEscToCancelQuesting { get; set; } = true; public bool ShowIncompleteSeasonalEvents { get; set; } = true; + public bool AutomaticallyCompleteSnipeTasks { get; set; } } internal sealed class AdvancedConfiguration diff --git a/Questionable/Controller/Steps/Interactions/Interact.cs b/Questionable/Controller/Steps/Interactions/Interact.cs index 4988b2ae4..b048b7ff2 100644 --- a/Questionable/Controller/Steps/Interactions/Interact.cs +++ b/Questionable/Controller/Steps/Interactions/Interact.cs @@ -16,7 +16,8 @@ namespace Questionable.Controller.Steps.Interactions; internal static class Interact { - internal sealed class Factory(GameFunctions gameFunctions, ICondition condition, ILoggerFactory loggerFactory) + internal sealed class Factory(GameFunctions gameFunctions, Configuration configuration, ICondition condition, + ILoggerFactory loggerFactory) : ITaskFactory { public IEnumerable CreateAllTasks(Quest quest, QuestSequence sequence, QuestStep step) @@ -37,6 +38,11 @@ internal static class Interact if (step.DataId == null) yield break; } + else if (step.InteractionType == EInteractionType.Snipe) + { + if (!configuration.General.AutomaticallyCompleteSnipeTasks) + yield break; + } else if (step.InteractionType != EInteractionType.Interact) yield break; diff --git a/Questionable/Controller/Steps/Shared/WaitAtEnd.cs b/Questionable/Controller/Steps/Shared/WaitAtEnd.cs index 47c0fe4a5..e2a0864f5 100644 --- a/Questionable/Controller/Steps/Shared/WaitAtEnd.cs +++ b/Questionable/Controller/Steps/Shared/WaitAtEnd.cs @@ -49,6 +49,7 @@ internal static class WaitAtEnd case EInteractionType.WaitForManualProgress: case EInteractionType.Instruction: + case EInteractionType.Snipe: return [new WaitNextStepOrSequence()]; case EInteractionType.Duty: diff --git a/Questionable/Controller/Utils/AutoSnipeHandler.cs b/Questionable/Controller/Utils/AutoSnipeHandler.cs new file mode 100644 index 000000000..dc48c3aca --- /dev/null +++ b/Questionable/Controller/Utils/AutoSnipeHandler.cs @@ -0,0 +1,48 @@ +using System; +using Dalamud.Hooking; +using Dalamud.Plugin.Services; +using FFXIVClientStructs.FFXIV.Client.Game.Event; +using FFXIVClientStructs.FFXIV.Common.Lua; + +namespace Questionable.Controller.Utils; + +internal sealed unsafe class AutoSnipeHandler : IDisposable +{ + private readonly QuestController _questController; + private readonly Configuration _configuration; + private readonly Hook _enqueueSnipeTaskHook; + + private delegate ulong EnqueueSnipeTaskDelegate(EventSceneModuleImplBase* scene, lua_State* state); + + public AutoSnipeHandler(QuestController questController, Configuration configuration, IGameInteropProvider gameInteropProvider) + { + _questController = questController; + _configuration = configuration; + + _enqueueSnipeTaskHook = + gameInteropProvider.HookFromSignature( + "48 89 5C 24 ?? 48 89 6C 24 ?? 48 89 74 24 ?? 57 48 83 EC 50 48 8B F1 48 8D 4C 24 ?? E8 ?? ?? ?? ?? 48 8B 4C 24 ??", + EnqueueSnipeTask); + } + + public void Enable() => _enqueueSnipeTaskHook.Enable(); + + private ulong EnqueueSnipeTask(EventSceneModuleImplBase* scene, lua_State* state) + { + if (_configuration.General.AutomaticallyCompleteSnipeTasks && _questController.IsRunning) + { + var val = state->top; + val->tt = 3; + val->value.n = 1; + state->top += 1; + return 1; + } + else + return _enqueueSnipeTaskHook.Original.Invoke(scene, state); + } + + public void Dispose() + { + _enqueueSnipeTaskHook.Dispose(); + } +} diff --git a/Questionable/QuestionablePlugin.cs b/Questionable/QuestionablePlugin.cs index 5c74c00bd..b5be5760c 100644 --- a/Questionable/QuestionablePlugin.cs +++ b/Questionable/QuestionablePlugin.cs @@ -18,6 +18,7 @@ using Questionable.Controller.Steps.Common; using Questionable.Controller.Steps.Gathering; using Questionable.Controller.Steps.Interactions; using Questionable.Controller.Steps.Leves; +using Questionable.Controller.Utils; using Questionable.Data; using Questionable.External; using Questionable.Functions; @@ -108,6 +109,7 @@ public sealed class QuestionablePlugin : IDalamudPlugin serviceCollection.AddSingleton(); serviceCollection.AddSingleton(); serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(); serviceCollection.AddSingleton(); serviceCollection.AddSingleton(); @@ -240,6 +242,7 @@ public sealed class QuestionablePlugin : IDalamudPlugin serviceProvider.GetRequiredService(); serviceProvider.GetRequiredService(); serviceProvider.GetRequiredService(); + serviceProvider.GetRequiredService().Enable(); } public void Dispose() diff --git a/Questionable/Windows/ConfigWindow.cs b/Questionable/Windows/ConfigWindow.cs index a419249cc..e69a7c377 100644 --- a/Questionable/Windows/ConfigWindow.cs +++ b/Questionable/Windows/ConfigWindow.cs @@ -90,6 +90,16 @@ internal sealed class ConfigWindow : LWindow, IPersistableWindowConfig Save(); } + if (ImGui.CollapsingHeader("Cheats")) + { + bool automaticallyCompleteSnipeTasks = _configuration.General.AutomaticallyCompleteSnipeTasks; + if (ImGui.Checkbox("Automatically complete snipe tasks", ref automaticallyCompleteSnipeTasks)) + { + _configuration.General.AutomaticallyCompleteSnipeTasks = automaticallyCompleteSnipeTasks; + Save(); + } + } + ImGui.EndTabItem(); } diff --git a/Questionable/Windows/QuestComponents/ActiveQuestComponent.cs b/Questionable/Windows/QuestComponents/ActiveQuestComponent.cs index b1ffd40bd..34beb0907 100644 --- a/Questionable/Windows/QuestComponents/ActiveQuestComponent.cs +++ b/Questionable/Windows/QuestComponents/ActiveQuestComponent.cs @@ -84,7 +84,7 @@ internal sealed partial class ActiveQuestComponent if (!isMinimized) { bool colored = currentStep is - { InteractionType: EInteractionType.Instruction or EInteractionType.WaitForManualProgress }; + { InteractionType: EInteractionType.Instruction or EInteractionType.WaitForManualProgress or EInteractionType.Snipe }; if (colored) ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudOrange); ImGui.TextUnformatted(currentStep?.Comment ??