Compare commits
No commits in common. "53aa9fdee872891c47c397c6aaa089530aaff9b4" and "0b1b2d38c7528d3a3a2808851a490f58867094b0" have entirely different histories.
53aa9fdee8
...
0b1b2d38c7
5 changed files with 1904 additions and 2057 deletions
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -16,8 +16,8 @@ internal sealed class AutomatonIpc : IDisposable
|
|||
{
|
||||
private static readonly ImmutableHashSet<string> ConflictingTweaks = new HashSet<string>
|
||||
{
|
||||
"DateWithDestiny", "AutoFollow", "ClickToMove", "AutoPillion", "AutoInvite", "AutoBusy", "FateToolKit", "AutoQueue", "EnhancedDutyStartEnd", "EnhancedLoginLogout",
|
||||
"GettingTooAttached", "RetrieveMateria"
|
||||
"DateWithDestiny", "AutoFollow", "AutoPillion", "AutoInvite", "AutoBusy", "FateToolKit", "AutoQueue", "EnhancedDutyStartEnd", "EnhancedLoginLogout", "GettingTooAttached",
|
||||
"RetrieveMateria"
|
||||
}.ToImmutableHashSet();
|
||||
|
||||
private const string AutoSnipeTweak = "AutoSnipeQuests";
|
||||
|
|
@ -26,14 +26,10 @@ internal sealed class AutomatonIpc : IDisposable
|
|||
|
||||
private readonly QuestController _questController;
|
||||
|
||||
private readonly FateController _fateController;
|
||||
|
||||
private readonly TerritoryData _territoryData;
|
||||
|
||||
private readonly IClientState _clientState;
|
||||
|
||||
private readonly IFramework _framework;
|
||||
|
||||
private readonly ILogger<AutomatonIpc> _logger;
|
||||
|
||||
private readonly ICallGateSubscriber<string, bool> _isTweakEnabled;
|
||||
|
|
@ -42,21 +38,16 @@ internal sealed class AutomatonIpc : IDisposable
|
|||
|
||||
private HashSet<string>? _pausedTweaks;
|
||||
|
||||
private bool _wasFateRunning;
|
||||
|
||||
public AutomatonIpc(Configuration configuration, IDalamudPluginInterface pluginInterface, QuestController questController, FateController fateController, TerritoryData territoryData, IClientState clientState, IFramework framework, ILogger<AutomatonIpc> logger)
|
||||
public AutomatonIpc(Configuration configuration, IDalamudPluginInterface pluginInterface, QuestController questController, TerritoryData territoryData, IClientState clientState, ILogger<AutomatonIpc> logger)
|
||||
{
|
||||
_configuration = configuration;
|
||||
_questController = questController;
|
||||
_fateController = fateController;
|
||||
_territoryData = territoryData;
|
||||
_clientState = clientState;
|
||||
_framework = framework;
|
||||
_logger = logger;
|
||||
_isTweakEnabled = pluginInterface.GetIpcSubscriber<string, bool>("Automaton.IsTweakEnabled");
|
||||
_setTweakState = pluginInterface.GetIpcSubscriber<string, bool, object>("Automaton.SetTweakState");
|
||||
_questController.AutomationTypeChanged += OnAutomationTypeChanged;
|
||||
_framework.Update += OnFrameworkUpdate;
|
||||
}
|
||||
|
||||
private void OnAutomationTypeChanged(object sender, QuestController.EAutomationType automationType)
|
||||
|
|
@ -65,29 +56,12 @@ internal sealed class AutomatonIpc : IDisposable
|
|||
{
|
||||
Task.Run((Action)DisableConflictingTweaks);
|
||||
}
|
||||
else if (!_fateController.IsRunning)
|
||||
else
|
||||
{
|
||||
Task.Run((Action)RestoreConflictingTweaks);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnFrameworkUpdate(IFramework framework)
|
||||
{
|
||||
bool isRunning = _fateController.IsRunning;
|
||||
if (isRunning != _wasFateRunning)
|
||||
{
|
||||
_wasFateRunning = isRunning;
|
||||
if (isRunning && !_territoryData.IsDutyInstance(_clientState.TerritoryType))
|
||||
{
|
||||
Task.Run((Action)DisableConflictingTweaks);
|
||||
}
|
||||
else if (_questController.AutomationType == QuestController.EAutomationType.Manual)
|
||||
{
|
||||
Task.Run((Action)RestoreConflictingTweaks);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void DisableConflictingTweaks()
|
||||
{
|
||||
if (_pausedTweaks != null)
|
||||
|
|
@ -143,7 +117,6 @@ internal sealed class AutomatonIpc : IDisposable
|
|||
|
||||
public void Dispose()
|
||||
{
|
||||
_framework.Update -= OnFrameworkUpdate;
|
||||
_questController.AutomationTypeChanged -= OnAutomationTypeChanged;
|
||||
RestoreConflictingTweaks();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,14 +27,10 @@ internal sealed class PandorasBoxIpc : IDisposable
|
|||
|
||||
private readonly QuestController _questController;
|
||||
|
||||
private readonly FateController _fateController;
|
||||
|
||||
private readonly TerritoryData _territoryData;
|
||||
|
||||
private readonly IClientState _clientState;
|
||||
|
||||
private readonly IFramework _framework;
|
||||
|
||||
private readonly ILogger<PandorasBoxIpc> _logger;
|
||||
|
||||
private readonly ICallGateSubscriber<string, bool?> _getFeatureEnabled;
|
||||
|
|
@ -43,21 +39,16 @@ internal sealed class PandorasBoxIpc : IDisposable
|
|||
|
||||
private HashSet<string>? _pausedFeatures;
|
||||
|
||||
private bool _wasFateRunning;
|
||||
|
||||
public PandorasBoxIpc(Configuration configuration, IDalamudPluginInterface pluginInterface, QuestController questController, FateController fateController, TerritoryData territoryData, IClientState clientState, IFramework framework, ILogger<PandorasBoxIpc> logger)
|
||||
public PandorasBoxIpc(Configuration configuration, IDalamudPluginInterface pluginInterface, QuestController questController, TerritoryData territoryData, IClientState clientState, ILogger<PandorasBoxIpc> logger)
|
||||
{
|
||||
_configuration = configuration;
|
||||
_questController = questController;
|
||||
_fateController = fateController;
|
||||
_territoryData = territoryData;
|
||||
_clientState = clientState;
|
||||
_framework = framework;
|
||||
_logger = logger;
|
||||
_getFeatureEnabled = pluginInterface.GetIpcSubscriber<string, bool?>("PandorasBox.GetFeatureEnabled");
|
||||
_setFeatureEnabled = pluginInterface.GetIpcSubscriber<string, bool, object>("PandorasBox.SetFeatureEnabled");
|
||||
_questController.AutomationTypeChanged += OnAutomationTypeChanged;
|
||||
_framework.Update += OnFrameworkUpdate;
|
||||
}
|
||||
|
||||
private void OnAutomationTypeChanged(object sender, QuestController.EAutomationType automationType)
|
||||
|
|
@ -66,32 +57,14 @@ internal sealed class PandorasBoxIpc : IDisposable
|
|||
{
|
||||
Task.Run((Action)DisableConflictingFeatures);
|
||||
}
|
||||
else if (!_fateController.IsRunning)
|
||||
else
|
||||
{
|
||||
Task.Run((Action)RestoreConflictingFeatures);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnFrameworkUpdate(IFramework framework)
|
||||
{
|
||||
bool isRunning = _fateController.IsRunning;
|
||||
if (isRunning != _wasFateRunning)
|
||||
{
|
||||
_wasFateRunning = isRunning;
|
||||
if (isRunning && !_territoryData.IsDutyInstance(_clientState.TerritoryType))
|
||||
{
|
||||
Task.Run((Action)DisableConflictingFeatures);
|
||||
}
|
||||
else if (_questController.AutomationType == QuestController.EAutomationType.Manual)
|
||||
{
|
||||
Task.Run((Action)RestoreConflictingFeatures);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_framework.Update -= OnFrameworkUpdate;
|
||||
_questController.AutomationTypeChanged -= OnAutomationTypeChanged;
|
||||
RestoreConflictingFeatures();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,8 +38,6 @@ internal sealed class TextAdvanceIpc : IDisposable
|
|||
|
||||
private readonly QuestController _questController;
|
||||
|
||||
private readonly FateController _fateController;
|
||||
|
||||
private readonly Configuration _configuration;
|
||||
|
||||
private readonly ICondition _condition;
|
||||
|
|
@ -54,11 +52,10 @@ internal sealed class TextAdvanceIpc : IDisposable
|
|||
|
||||
private readonly string _pluginName;
|
||||
|
||||
public TextAdvanceIpc(IDalamudPluginInterface pluginInterface, IFramework framework, QuestController questController, FateController fateController, Configuration configuration, ICondition condition)
|
||||
public TextAdvanceIpc(IDalamudPluginInterface pluginInterface, IFramework framework, QuestController questController, Configuration configuration, ICondition condition)
|
||||
{
|
||||
_framework = framework;
|
||||
_questController = questController;
|
||||
_fateController = fateController;
|
||||
_configuration = configuration;
|
||||
_condition = condition;
|
||||
_isInExternalControl = pluginInterface.GetIpcSubscriber<bool>("TextAdvance.IsInExternalControl");
|
||||
|
|
@ -79,7 +76,7 @@ internal sealed class TextAdvanceIpc : IDisposable
|
|||
|
||||
private void OnUpdate(IFramework framework)
|
||||
{
|
||||
bool flag = _questController.IsRunning || _questController.AutomationType != QuestController.EAutomationType.Manual || _fateController.IsRunning;
|
||||
bool flag = _questController.IsRunning || _questController.AutomationType != QuestController.EAutomationType.Manual;
|
||||
if (!_configuration.General.ConfigureTextAdvance || !flag)
|
||||
{
|
||||
if (_isExternalControlActivated && (_disableExternalControl.InvokeFunc(_pluginName) || !_isInExternalControl.InvokeFunc()))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue