Reorganize namespaces; fix steps with 'fly: true' not mounting if close to target

This commit is contained in:
Liza 2024-07-12 21:18:53 +02:00
parent a0f0a058fc
commit 9848431962
Signed by: liza
GPG Key ID: 7199F8D727D55F67
30 changed files with 58 additions and 47 deletions

View File

@ -5,7 +5,7 @@ using Dalamud.Game.ClientState.Keys;
using Dalamud.Plugin.Services; using Dalamud.Plugin.Services;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Questionable.Controller.Steps; using Questionable.Controller.Steps;
using Questionable.Controller.Steps.BaseFactory; using Questionable.Controller.Steps.Shared;
using Questionable.External; using Questionable.External;
using Questionable.Model; using Questionable.Model;
using Questionable.Model.V1; using Questionable.Model.V1;

View File

@ -1,6 +1,6 @@
using System; using System;
namespace Questionable.Controller.Steps.BaseTasks; namespace Questionable.Controller.Steps.Common;
internal abstract class AbstractDelayedTask : ITask internal abstract class AbstractDelayedTask : ITask
{ {

View File

@ -5,7 +5,7 @@ using Dalamud.Plugin.Services;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Questionable.Data; using Questionable.Data;
namespace Questionable.Controller.Steps.BaseTasks; namespace Questionable.Controller.Steps.Common;
internal sealed class MountTask( internal sealed class MountTask(
GameFunctions gameFunctions, GameFunctions gameFunctions,

View File

@ -4,7 +4,7 @@ using Microsoft.Extensions.Logging;
using Questionable.Model; using Questionable.Model;
using Questionable.Model.V1; using Questionable.Model.V1;
namespace Questionable.Controller.Steps.BaseTasks; namespace Questionable.Controller.Steps.Common;
internal static class NextQuest internal static class NextQuest
{ {

View File

@ -3,7 +3,7 @@ using Dalamud.Game.ClientState.Conditions;
using Dalamud.Plugin.Services; using Dalamud.Plugin.Services;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
namespace Questionable.Controller.Steps.BaseTasks; namespace Questionable.Controller.Steps.Common;
internal sealed class UnmountTask(ICondition condition, ILogger<UnmountTask> logger, GameFunctions gameFunctions) internal sealed class UnmountTask(ICondition condition, ILogger<UnmountTask> logger, GameFunctions gameFunctions)
: ITask : ITask

View File

@ -1,6 +1,6 @@
using System; using System;
namespace Questionable.Controller.Steps.BaseTasks; namespace Questionable.Controller.Steps.Common;
internal sealed class WaitConditionTask(Func<bool> predicate, string description) : ITask internal sealed class WaitConditionTask(Func<bool> predicate, string description) : ITask
{ {

View File

@ -5,11 +5,11 @@ using Dalamud.Game.ClientState.Objects.Types;
using FFXIVClientStructs.FFXIV.Client.Game; using FFXIVClientStructs.FFXIV.Client.Game;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Questionable.Controller.Steps.BaseTasks; using Questionable.Controller.Steps.Common;
using Questionable.Model; using Questionable.Model;
using Questionable.Model.V1; using Questionable.Model.V1;
namespace Questionable.Controller.Steps.InteractionFactory; namespace Questionable.Controller.Steps.Interactions;
internal static class Action internal static class Action
{ {

View File

@ -6,7 +6,7 @@ using Questionable.Data;
using Questionable.Model; using Questionable.Model;
using Questionable.Model.V1; using Questionable.Model.V1;
namespace Questionable.Controller.Steps.InteractionFactory; namespace Questionable.Controller.Steps.Interactions;
internal static class AetherCurrent internal static class AetherCurrent
{ {

View File

@ -4,7 +4,7 @@ using Microsoft.Extensions.Logging;
using Questionable.Model; using Questionable.Model;
using Questionable.Model.V1; using Questionable.Model.V1;
namespace Questionable.Controller.Steps.InteractionFactory; namespace Questionable.Controller.Steps.Interactions;
internal static class AethernetShard internal static class AethernetShard
{ {

View File

@ -4,7 +4,7 @@ using Microsoft.Extensions.Logging;
using Questionable.Model; using Questionable.Model;
using Questionable.Model.V1; using Questionable.Model.V1;
namespace Questionable.Controller.Steps.InteractionFactory; namespace Questionable.Controller.Steps.Interactions;
internal static class Aetheryte internal static class Aetheryte
{ {

View File

@ -1,11 +1,11 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Questionable.Controller.Steps.BaseTasks; using Questionable.Controller.Steps.Common;
using Questionable.Model; using Questionable.Model;
using Questionable.Model.V1; using Questionable.Model.V1;
namespace Questionable.Controller.Steps.InteractionFactory; namespace Questionable.Controller.Steps.Interactions;
internal static class Combat internal static class Combat
{ {

View File

@ -5,7 +5,7 @@ using Microsoft.Extensions.DependencyInjection;
using Questionable.Model; using Questionable.Model;
using Questionable.Model.V1; using Questionable.Model.V1;
namespace Questionable.Controller.Steps.InteractionFactory; namespace Questionable.Controller.Steps.Interactions;
internal static class Duty internal static class Duty
{ {

View File

@ -1,11 +1,11 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Questionable.Controller.Steps.BaseTasks; using Questionable.Controller.Steps.Common;
using Questionable.Model; using Questionable.Model;
using Questionable.Model.V1; using Questionable.Model.V1;
namespace Questionable.Controller.Steps.InteractionFactory; namespace Questionable.Controller.Steps.Interactions;
internal static class Emote internal static class Emote
{ {

View File

@ -6,11 +6,11 @@ using FFXIVClientStructs.FFXIV.Client.Game;
using Lumina.Excel.GeneratedSheets; using Lumina.Excel.GeneratedSheets;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Questionable.Controller.Steps.BaseTasks; using Questionable.Controller.Steps.Common;
using Questionable.Model.V1; using Questionable.Model.V1;
using Quest = Questionable.Model.Quest; using Quest = Questionable.Model.Quest;
namespace Questionable.Controller.Steps.InteractionFactory; namespace Questionable.Controller.Steps.Interactions;
internal static class EquipItem internal static class EquipItem
{ {

View File

@ -6,11 +6,11 @@ using Dalamud.Game.ClientState.Objects.Types;
using Dalamud.Plugin.Services; using Dalamud.Plugin.Services;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Questionable.Controller.Steps.BaseFactory; using Questionable.Controller.Steps.Shared;
using Questionable.Model; using Questionable.Model;
using Questionable.Model.V1; using Questionable.Model.V1;
namespace Questionable.Controller.Steps.InteractionFactory; namespace Questionable.Controller.Steps.Interactions;
internal static class Interact internal static class Interact
{ {

View File

@ -2,11 +2,11 @@
using Dalamud.Plugin.Services; using Dalamud.Plugin.Services;
using FFXIVClientStructs.FFXIV.Client.Game; using FFXIVClientStructs.FFXIV.Client.Game;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Questionable.Controller.Steps.BaseTasks; using Questionable.Controller.Steps.Common;
using Questionable.Model; using Questionable.Model;
using Questionable.Model.V1; using Questionable.Model.V1;
namespace Questionable.Controller.Steps.InteractionFactory; namespace Questionable.Controller.Steps.Interactions;
internal static class Jump internal static class Jump
{ {

View File

@ -1,11 +1,11 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Questionable.Controller.Steps.BaseTasks; using Questionable.Controller.Steps.Common;
using Questionable.Model; using Questionable.Model;
using Questionable.Model.V1; using Questionable.Model.V1;
namespace Questionable.Controller.Steps.InteractionFactory; namespace Questionable.Controller.Steps.Interactions;
internal static class Say internal static class Say
{ {

View File

@ -6,7 +6,7 @@ using Questionable.External;
using Questionable.Model; using Questionable.Model;
using Questionable.Model.V1; using Questionable.Model.V1;
namespace Questionable.Controller.Steps.InteractionFactory; namespace Questionable.Controller.Steps.Interactions;
internal static class SinglePlayerDuty internal static class SinglePlayerDuty
{ {

View File

@ -3,11 +3,11 @@ using System.Collections.Generic;
using FFXIVClientStructs.FFXIV.Client.Game; using FFXIVClientStructs.FFXIV.Client.Game;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Questionable.Controller.Steps.BaseTasks; using Questionable.Controller.Steps.Common;
using Questionable.Model; using Questionable.Model;
using Questionable.Model.V1; using Questionable.Model.V1;
namespace Questionable.Controller.Steps.InteractionFactory; namespace Questionable.Controller.Steps.Interactions;
internal static class UseItem internal static class UseItem
{ {

View File

@ -11,7 +11,7 @@ using Questionable.Model;
using Questionable.Model.V1; using Questionable.Model.V1;
using Questionable.Model.V1.Converter; using Questionable.Model.V1.Converter;
namespace Questionable.Controller.Steps.BaseFactory; namespace Questionable.Controller.Steps.Shared;
internal static class AethernetShortcut internal static class AethernetShortcut
{ {

View File

@ -4,12 +4,12 @@ using System.Numerics;
using Dalamud.Plugin.Services; using Dalamud.Plugin.Services;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Questionable.Controller.Steps.BaseTasks; using Questionable.Controller.Steps.Common;
using Questionable.Data; using Questionable.Data;
using Questionable.Model; using Questionable.Model;
using Questionable.Model.V1; using Questionable.Model.V1;
namespace Questionable.Controller.Steps.BaseFactory; namespace Questionable.Controller.Steps.Shared;
internal static class AetheryteShortcut internal static class AetheryteShortcut
{ {

View File

@ -6,12 +6,12 @@ using Dalamud.Game.ClientState.Objects.Types;
using Dalamud.Plugin.Services; using Dalamud.Plugin.Services;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Questionable.Controller.Steps.BaseTasks; using Questionable.Controller.Steps.Common;
using Questionable.Data; using Questionable.Data;
using Questionable.Model; using Questionable.Model;
using Questionable.Model.V1; using Questionable.Model.V1;
namespace Questionable.Controller.Steps.BaseFactory; namespace Questionable.Controller.Steps.Shared;
internal static class Move internal static class Move
{ {
@ -82,8 +82,15 @@ internal static class Move
if (!Step.DisableNavmesh) if (!Step.DisableNavmesh)
{ {
if (Step.Mount == null) if (Step.Mount == null)
{
MountTask.EMountIf mountIf =
actualDistance > distance && Step.Fly == true &&
gameFunctions.IsFlyingUnlocked(Step.TerritoryId)
? MountTask.EMountIf.Always
: MountTask.EMountIf.AwayFromPosition;
yield return serviceProvider.GetRequiredService<MountTask>() yield return serviceProvider.GetRequiredService<MountTask>()
.With(Step.TerritoryId, MountTask.EMountIf.AwayFromPosition, Destination); .With(Step.TerritoryId, mountIf, Destination);
}
if (actualDistance > distance) if (actualDistance > distance)
{ {

View File

@ -11,7 +11,7 @@ using Microsoft.Extensions.Logging;
using Questionable.Model; using Questionable.Model;
using Questionable.Model.V1; using Questionable.Model.V1;
namespace Questionable.Controller.Steps.BaseFactory; namespace Questionable.Controller.Steps.Shared;
internal static class SkipCondition internal static class SkipCondition
{ {

View File

@ -4,7 +4,7 @@ using Microsoft.Extensions.Logging;
using Questionable.Model; using Questionable.Model;
using Questionable.Model.V1; using Questionable.Model.V1;
namespace Questionable.Controller.Steps.BaseFactory; namespace Questionable.Controller.Steps.Shared;
internal static class StepDisabled internal static class StepDisabled
{ {

View File

@ -8,12 +8,12 @@ using Dalamud.Plugin.Services;
using FFXIVClientStructs.FFXIV.Application.Network.WorkDefinitions; using FFXIVClientStructs.FFXIV.Application.Network.WorkDefinitions;
using FFXIVClientStructs.FFXIV.Client.Game; using FFXIVClientStructs.FFXIV.Client.Game;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Questionable.Controller.Steps.BaseTasks; using Questionable.Controller.Steps.Common;
using Questionable.Data; using Questionable.Data;
using Questionable.Model; using Questionable.Model;
using Questionable.Model.V1; using Questionable.Model.V1;
namespace Questionable.Controller.Steps.BaseFactory; namespace Questionable.Controller.Steps.Shared;
internal static class WaitAtEnd internal static class WaitAtEnd
{ {

View File

@ -1,10 +1,10 @@
using System; using System;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Questionable.Controller.Steps.BaseTasks; using Questionable.Controller.Steps.Common;
using Questionable.Model; using Questionable.Model;
using Questionable.Model.V1; using Questionable.Model.V1;
namespace Questionable.Controller.Steps.BaseFactory; namespace Questionable.Controller.Steps.Shared;
internal static class WaitAtStart internal static class WaitAtStart
{ {

View File

@ -2,7 +2,7 @@
"Name": "Questionable", "Name": "Questionable",
"Author": "Liza Carvelli", "Author": "Liza Carvelli",
"Punchline": "A tiny quest helper plugin.", "Punchline": "A tiny quest helper plugin.",
"Description": "A tiny quest helper plugin.", "Description": "A tiny little quest helper plugin, which does quests for you automatically where possible. Uses navmesh to automatically walk to all quest waypoints, and tries to automatically complete all steps along the way (excluding dungeons, single player duties and combat).\n\nNot all quests are supported, check the discord or git repository for an up-to-date list.\n\nRequired Plugins: vnavmesh, TextAdvance, Lifestream",
"Tags": [ "Tags": [
"quests", "quests",
"msq" "msq"

View File

@ -11,13 +11,13 @@ using Microsoft.Extensions.Logging;
using Questionable.Controller; using Questionable.Controller;
using Questionable.Controller.NavigationOverrides; using Questionable.Controller.NavigationOverrides;
using Questionable.Controller.Steps; using Questionable.Controller.Steps;
using Questionable.Controller.Steps.BaseFactory; using Questionable.Controller.Steps.Shared;
using Questionable.Controller.Steps.BaseTasks; using Questionable.Controller.Steps.Common;
using Questionable.Controller.Steps.InteractionFactory; using Questionable.Controller.Steps.Interactions;
using Questionable.Data; using Questionable.Data;
using Questionable.External; using Questionable.External;
using Questionable.Windows; using Questionable.Windows;
using Action = Questionable.Controller.Steps.InteractionFactory.Action; using Action = Questionable.Controller.Steps.Interactions.Action;
namespace Questionable; namespace Questionable;

View File

@ -41,7 +41,11 @@ internal sealed class DebugOverlay : Window
public ushort? HighlightedQuest { get; set; } public ushort? HighlightedQuest { get; set; }
public override bool DrawConditions() => _configuration.Advanced.DebugOverlay; public override bool DrawConditions()
{
return _configuration.Advanced.DebugOverlay && _clientState is
{ IsLoggedIn: true, LocalPlayer: not null, IsPvPExcludingDen: false };
}
public override void PreDraw() public override void PreDraw()
{ {

View File

@ -19,7 +19,7 @@ using ImGuiNET;
using LLib.ImGui; using LLib.ImGui;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Questionable.Controller; using Questionable.Controller;
using Questionable.Controller.Steps.BaseFactory; using Questionable.Controller.Steps.Shared;
using Questionable.Data; using Questionable.Data;
using Questionable.External; using Questionable.External;
using Questionable.Model; using Questionable.Model;
@ -96,7 +96,7 @@ internal sealed class QuestWindow : LWindow, IPersistableWindowConfig
public override bool DrawConditions() public override bool DrawConditions()
{ {
if (!_clientState.IsLoggedIn || _clientState.LocalPlayer == null) if (!_clientState.IsLoggedIn || _clientState.LocalPlayer == null || _clientState.IsPvPExcludingDen)
return false; return false;
if (_configuration.General.HideInAllInstances && _territoryData.IsDutyInstance(_clientState.TerritoryType)) if (_configuration.General.HideInAllInstances && _territoryData.IsDutyInstance(_clientState.TerritoryType))