},
"TerritoryId": 613,
"InteractionType": "WalkTo",
- "$": "Sui-no-Sato, NE inside"
+ "$": "Sui-no-Sato, NE inside",
+ "RestartNavigationIfCancelled": false
},
{
"Position": {
},
"TerritoryId": 613,
"InteractionType": "WalkTo",
- "$": "Sui-no-Sato, NE outside"
+ "$": "Sui-no-Sato, NE outside",
+ "RestartNavigationIfCancelled": false
},
{
"DataId": 1023280,
},
"TerritoryId": 613,
"InteractionType": "WalkTo",
- "$": "Sui-no-Sato, NE outside"
+ "$": "Sui-no-Sato, NE outside",
+ "RestartNavigationIfCancelled": false
},
{
"DataId": 1023280,
},
"TerritoryId": 613,
"InteractionType": "WalkTo",
- "$": "Sui-no-Sato, NE outside"
+ "$": "Sui-no-Sato, NE outside",
+ "RestartNavigationIfCancelled": false
},
{
"DataId": 1023280,
"TerritoryId": 613,
"InteractionType": "WalkTo",
"$": "Exile, outside",
+ "RestartNavigationIfCancelled": false,
"Fly": true
},
{
"TerritoryId": 613,
"InteractionType": "WalkTo",
"$": "Sui-no-Sato, SW outside",
+ "RestartNavigationIfCancelled": false,
"Fly": true
},
{
},
"TerritoryId": 613,
"InteractionType": "WalkTo",
- "$": "Sui-no-Sato, NE outside"
+ "$": "Sui-no-Sato, NE outside",
+ "RestartNavigationIfCancelled": false
},
{
"DataId": 1019970,
},
"TerritoryId": 613,
"InteractionType": "WalkTo",
- "$": "Sui-no-Sato, NE inside"
+ "$": "Sui-no-Sato, NE inside",
+ "RestartNavigationIfCancelled": false
},
{
"DataId": 1019978,
"type": "boolean",
"description": "Most interactions with objects are checked for a Y (height) difference of 2 in-game units. If set to true, the game won't attempt to get any closer if the height difference is larger than this."
},
+ "RestartNavigationIfCancelled": {
+ "type": "boolean",
+ "description": "For some specific loading screen transitions (e.g. when entering/leaving the water through the portals in the ruby sea), setting this to 'false' means it won't re-attempt to move to the portal after the loading animation"
+ },
"TerritoryId": {
"type": "integer",
"description": "The territory id associated with the location",
public bool? Land { get; set; }
public bool? Sprint { get; set; }
public bool? IgnoreDistanceToObject { get; set; }
+ public bool? RestartNavigationIfCancelled { get; set; }
public string? Comment { get; set; }
/// <summary>
if (IsPathRunning && Destination != null)
{
- if (_gameFunctions.IsLoadingScreenVisible(false))
+ if (_gameFunctions.IsLoadingScreenVisible())
{
_logger.LogInformation("Stopping movement, loading screen visible");
Stop();
using System;
using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Numerics;
using Dalamud.Game.ClientState.Conditions;
public ITask Move(MoveParams moveParams)
{
return new MoveInternal(moveParams, movementController, gameFunctions,
- loggerFactory.CreateLogger<MoveInternal>(), condition, dataManager);
+ loggerFactory.CreateLogger<MoveInternal>(), condition, clientState, dataManager);
}
public ITask Land()
private readonly MovementController _movementController;
private readonly ILogger<MoveInternal> _logger;
private readonly ICondition _condition;
+ private readonly IClientState _clientState;
private readonly Action _startAction;
private readonly Vector3 _destination;
+ private readonly MoveParams _moveParams;
public MoveInternal(MoveParams moveParams,
MovementController movementController,
GameFunctions gameFunctions,
ILogger<MoveInternal> logger,
ICondition condition,
+ IClientState clientState,
IDataManager dataManager)
{
_movementController = movementController;
_logger = logger;
_condition = condition;
+ _clientState = clientState;
_cannotExecuteAtThisTime = dataManager.GetString<LogMessage>(579, x => x.Text)!;
_destination = moveParams.Destination;
ignoreDistanceToObject: moveParams.IgnoreDistanceToObject,
land: moveParams.Land);
}
+
+ _moveParams = moveParams;
}
public bool Start()
if (movementStartedAt == DateTime.MaxValue || movementStartedAt.AddSeconds(2) >= DateTime.Now)
return ETaskResult.StillRunning;
+ if (_moveParams.RestartNavigation &&
+ Vector3.Distance(_clientState.LocalPlayer!.Position, _destination) >
+ (_moveParams.StopDistance ?? QuestStep.DefaultStopDistance) + 5f)
+ {
+ _logger.LogInformation("Looks like movement was interrupted, re-attempting to move");
+ _startAction();
+ return ETaskResult.StillRunning;
+ }
+
return ETaskResult.TaskComplete;
}
bool Sprint = true,
bool Fly = false,
bool Land = false,
- bool IgnoreDistanceToObject = false)
+ bool IgnoreDistanceToObject = false,
+ bool RestartNavigation = true)
{
public MoveParams(QuestStep step, Vector3 destination)
: this(step.TerritoryId,
step.Sprint != false,
step.Fly == true,
step.Land == true,
- step.IgnoreDistanceToObject == true)
+ step.IgnoreDistanceToObject == true,
+ step.RestartNavigationIfCancelled != false)
{
}
}
if (!_clientState.IsLoggedIn || _clientState.LocalPlayer == null)
return true;
- if (IsLoadingScreenVisible(true))
+ if (IsLoadingScreenVisible())
return true;
if (_condition[ConditionFlag.Crafting])
flags.Contains(ConditionFlag.OccupiedInQuestEvent);
}
- public bool IsLoadingScreenVisible(bool all)
+ public bool IsLoadingScreenVisible()
{
if (_gameGui.TryGetAddonByName("FadeMiddle", out AtkUnitBase* fade) && LAddon.IsAddonReady(fade) && fade->IsVisible)
return true;
- if (all)
- {
- if (_gameGui.TryGetAddonByName("FadeBack", out fade) && LAddon.IsAddonReady(fade) && fade->IsVisible)
- return true;
+ if (_gameGui.TryGetAddonByName("FadeBack", out fade) && LAddon.IsAddonReady(fade) && fade->IsVisible)
+ return true;
- if (_gameGui.TryGetAddonByName("NowLoading", out fade) && LAddon.IsAddonReady(fade) && fade->IsVisible)
- return true;
- }
+ if (_gameGui.TryGetAddonByName("NowLoading", out fade) && LAddon.IsAddonReady(fade) && fade->IsVisible)
+ return true;
return false;
}