IServiceProvider serviceProvider,
IDataManager dataManager,
IPluginLog pluginLog)
- : base(chatGui, condition, serviceProvider, logger)
+ : base(chatGui, condition, serviceProvider, dataManager, logger)
{
_movementController = movementController;
_gatheringPointRegistry = gatheringPointRegistry;
using System.Collections.Generic;
using System.Linq;
using Dalamud.Game.ClientState.Conditions;
+using Dalamud.Game.Text.SeStringHandling;
using Dalamud.Plugin.Services;
+using LLib;
+using Lumina.Excel.GeneratedSheets;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Questionable.Controller.Steps;
-using Questionable.Controller.Steps.Common;
using Questionable.Controller.Steps.Interactions;
using Questionable.Controller.Steps.Shared;
+using Questionable.Functions;
using Questionable.Model.Questing;
+using Mount = Questionable.Controller.Steps.Common.Mount;
namespace Questionable.Controller;
private readonly IServiceProvider _serviceProvider;
private readonly ILogger<T> _logger;
+ private readonly string _actionCanceledText;
+
protected MiniTaskController(IChatGui chatGui, ICondition condition, IServiceProvider serviceProvider,
- ILogger<T> logger)
+ IDataManager dataManager, ILogger<T> logger)
{
_chatGui = chatGui;
_logger = logger;
_serviceProvider = serviceProvider;
_condition = condition;
+
+ _actionCanceledText = dataManager.GetString<LogMessage>(1314, x => x.Text)!;
}
protected virtual void UpdateCurrentTask()
foreach (ITask task in _taskQueue.RemainingTasks)
_logger.LogInformation("- {TaskName}", task);
}
+
+ public void OnErrorToast(ref SeString message, ref bool isHandled)
+ {
+ if (_taskQueue.CurrentTaskExecutor is IToastAware toastAware)
+ {
+ if (toastAware.OnErrorToast(message))
+ {
+ isHandled = true;
+ }
+ }
+
+ if (!isHandled)
+ {
+ if (GameFunctions.GameStringEquals(_actionCanceledText, message.TextValue) &&
+ !_condition[ConditionFlag.InFlight])
+ InterruptQueueWithCombat();
+ }
+ }
}
private readonly TaskCreator _taskCreator;
private readonly ILogger<QuestController> _logger;
- private readonly string _actionCanceledText;
-
private readonly object _progressLock = new();
private QuestProgress? _startedQuest;
TaskCreator taskCreator,
IServiceProvider serviceProvider,
IDataManager dataManager)
- : base(chatGui, condition, serviceProvider, logger)
+ : base(chatGui, condition, serviceProvider, dataManager, logger)
{
_clientState = clientState;
_gameFunctions = gameFunctions;
_condition.ConditionChange += OnConditionChange;
_toastGui.Toast += OnNormalToast;
_toastGui.ErrorToast += OnErrorToast;
-
- _actionCanceledText = dataManager.GetString<LogMessage>(1314, x => x.Text)!;
}
public EAutomationType AutomationType
_gatheringController.OnNormalToast(message);
}
- private void OnErrorToast(ref SeString message, ref bool isHandled)
- {
- if (_taskQueue.CurrentTaskExecutor is IToastAware toastAware)
- {
- if (toastAware.OnErrorToast(message))
- {
- isHandled = true;
- }
- }
-
- if (!isHandled)
- {
- if (GameFunctions.GameStringEquals(_actionCanceledText, message.TextValue) &&
- !_condition[ConditionFlag.InFlight])
- InterruptQueueWithCombat();
- }
- }
-
public void Dispose()
{
_toastGui.ErrorToast -= OnErrorToast;
using System.Linq;
using System.Numerics;
using Dalamud.Game.ClientState.Objects.Enums;
+using Dalamud.Game.Text.SeStringHandling;
using Dalamud.Plugin.Services;
using Microsoft.Extensions.Logging;
using Questionable.Controller.Steps.Shared;
MoveTo.MoveExecutor moveExecutor,
GameFunctions gameFunctions,
IObjectTable objectTable,
- ILogger<MoveToLandingLocationExecutor> logger) : TaskExecutor<Task>
+ ILogger<MoveToLandingLocationExecutor> logger) : TaskExecutor<Task>, IToastAware
{
private ITask _moveTask = null!;
}
public override ETaskResult Update() => moveExecutor.Update();
+ public bool OnErrorToast(SeString message) => moveExecutor.OnErrorToast(message);
}
}
using System.Collections.Generic;
using System.Linq;
using Dalamud.Game.Text;
+using Dalamud.Game.Text.SeStringHandling;
using Dalamud.Plugin.Services;
using FFXIVClientStructs.FFXIV.Application.Network.WorkDefinitions;
using FFXIVClientStructs.FFXIV.Client.Game;
}
}
- internal sealed class StartGathering(GatheringController gatheringController) : TaskExecutor<GatheringTask>
+ internal sealed class StartGathering(GatheringController gatheringController) : TaskExecutor<GatheringTask>,
+ IToastAware
{
protected override bool Start()
{
return ETaskResult.StillRunning;
}
+
+ public bool OnErrorToast(SeString message)
+ {
+ bool isHandled = false;
+ gatheringController.OnErrorToast(ref message, ref isHandled);
+ return isHandled;
+ }
}
/// <summary>