Compare commits

..

1 Commits

Author SHA1 Message Date
Simon Latusek
b6ee34d338 Don't tp in same zone 2025-01-13 10:27:56 +01:00
6 changed files with 38 additions and 64 deletions

View File

@ -1,6 +1,7 @@
{
{
"$schema": "https://git.carvel.li/liza/Questionable/raw/branch/master/QuestPaths/quest-v1.json",
"Author": "pot0to",
"Author": "liza",
"Disabled": true,
"QuestSequence": [
{
"Sequence": 0,
@ -21,43 +22,14 @@
"Sequence": 255,
"Steps": [
{
"DataId": 33005,
"Position": {
"X": 214.7744,
"Y": -19.57758,
"Z": 623.6767
"X": 788.1569,
"Y": -45.82557,
"Z": -212.9306
},
"TerritoryId": 817,
"InteractionType": "Gather",
"RequiredQuestAcceptedJob": [
"Miner"
],
"ItemsToGather": [
{
"ItemId": 29537,
"ItemCount": 3
}
],
"Fly": true
},
{
"DataId": 33020,
"Position": {
"X": 226.1767,
"Y": -20.10281,
"Z": 643.5543
},
"TerritoryId": 817,
"InteractionType": "Gather",
"RequiredQuestAcceptedJob": [
"Botanist"
],
"ItemsToGather": [
{
"ItemId": 29563,
"ItemCount": 3
}
],
"InteractionType": "WalkTo",
"AetheryteShortcut": "Rak'tika - Fanow",
"Fly": true
},
{
@ -67,10 +39,9 @@
"Y": -45.82774,
"Z": -218.555
},
"StopDistance": 7,
"TerritoryId": 817,
"InteractionType": "CompleteQuest",
"AetheryteShortcut": "Rak'tika - Fanow",
"Fly": true
"InteractionType": "CompleteQuest"
}
]
}

View File

@ -53,6 +53,8 @@ internal sealed class Configuration : IPluginConfiguration
{
public bool DebugOverlay { get; set; }
public bool NeverFly { get; set; }
public bool NeverPortInSameZone { get; set; }
public bool AdditionalStatusInformation { get; set; }
}

View File

@ -179,12 +179,10 @@ internal static class AethernetShortcut
}
}
}
else if (clientState.TerritoryType == aetheryteData.TerritoryIds[Task.To])
logger.LogWarning(
"Aethernet shortcut not unlocked (from: {FromAetheryte}, to: {ToAetheryte}), skipping as we are already in the destination territory",
Task.From, Task.To);
else
throw new TaskException($"Aethernet shortcut not unlocked (from: {Task.From}, to: {Task.To})");
logger.LogWarning(
"Aethernet shortcut not unlocked (from: {FromAetheryte}, to: {ToAetheryte}), walking manually",
Task.From, Task.To);
return false;
}

View File

@ -58,6 +58,7 @@ internal static class AetheryteShortcut
IClientState clientState,
IChatGui chatGui,
ICondition condition,
Configuration configuration,
AetheryteData aetheryteData) : TaskExecutor<Task>
{
private bool _teleported;
@ -154,7 +155,7 @@ internal static class AetheryteShortcut
{
if (!skipConditions.Never)
{
if (skipConditions is { InSameTerritory: true })
if (skipConditions is { InSameTerritory: true } || configuration.Advanced.NeverPortInSameZone)
{
logger.LogInformation("Skipping aetheryte teleport due to SkipCondition (InSameTerritory)");
return true;

View File

@ -22,16 +22,13 @@ internal sealed class TextAdvanceIpc : IDisposable
private readonly string _pluginName;
private readonly ExternalTerritoryConfig _externalTerritoryConfig = new();
public TextAdvanceIpc(IDalamudPluginInterface pluginInterface, IFramework framework,
QuestController questController, Configuration configuration)
public TextAdvanceIpc(IDalamudPluginInterface pluginInterface, IFramework framework, QuestController questController, Configuration configuration)
{
_framework = framework;
_questController = questController;
_configuration = configuration;
_isInExternalControl = pluginInterface.GetIpcSubscriber<bool>("TextAdvance.IsInExternalControl");
_enableExternalControl =
pluginInterface.GetIpcSubscriber<string, ExternalTerritoryConfig, bool>(
"TextAdvance.EnableExternalControl");
_enableExternalControl = pluginInterface.GetIpcSubscriber<string, ExternalTerritoryConfig, bool>("TextAdvance.EnableExternalControl");
_disableExternalControl = pluginInterface.GetIpcSubscriber<string, bool>("TextAdvance.DisableExternalControl");
_pluginName = pluginInterface.InternalName;
_framework.Update += OnUpdate;
@ -40,7 +37,7 @@ internal sealed class TextAdvanceIpc : IDisposable
public void Dispose()
{
_framework.Update -= OnUpdate;
if (_isExternalControlActivated)
if(_isExternalControlActivated)
{
_disableExternalControl.InvokeFunc(_pluginName);
}
@ -48,13 +45,11 @@ internal sealed class TextAdvanceIpc : IDisposable
private void OnUpdate(IFramework framework)
{
bool hasActiveQuest = _questController.IsRunning ||
_questController.AutomationType != QuestController.EAutomationType.Manual;
if (_configuration.General.ConfigureTextAdvance && hasActiveQuest)
if(_configuration.General.ConfigureTextAdvance && _questController.IsRunning)
{
if (!_isInExternalControl.InvokeFunc())
if(!_isInExternalControl.InvokeFunc())
{
if (_enableExternalControl.InvokeFunc(_pluginName, _externalTerritoryConfig))
if(_enableExternalControl.InvokeFunc(_pluginName, _externalTerritoryConfig))
{
_isExternalControlActivated = true;
}
@ -62,9 +57,9 @@ internal sealed class TextAdvanceIpc : IDisposable
}
else
{
if (_isExternalControlActivated)
if(_isExternalControlActivated)
{
if (_disableExternalControl.InvokeFunc(_pluginName) || !_isInExternalControl.InvokeFunc())
if(_disableExternalControl.InvokeFunc(_pluginName) || !_isInExternalControl.InvokeFunc())
{
_isExternalControlActivated = false;
}

View File

@ -452,6 +452,13 @@ internal sealed class ConfigWindow : LWindow, IPersistableWindowConfig
Save();
}
bool neverPortInSameZone = this._configuration.Advanced.NeverPortInSameZone;
if (ImGui.Checkbox("Disable Aetheryte teleport in same zone", ref neverPortInSameZone))
{
_configuration.Advanced.NeverPortInSameZone = neverPortInSameZone;
Save();
}
bool additionalStatusInformation = _configuration.Advanced.AdditionalStatusInformation;
if (ImGui.Checkbox("Draw additional status information", ref additionalStatusInformation))
{