muffin v7.4.16
This commit is contained in:
parent
0b1b2d38c7
commit
e21aa9ca07
4 changed files with 1067 additions and 993 deletions
|
|
@ -16,8 +16,8 @@ internal sealed class AutomatonIpc : IDisposable
|
|||
{
|
||||
private static readonly ImmutableHashSet<string> ConflictingTweaks = new HashSet<string>
|
||||
{
|
||||
"DateWithDestiny", "AutoFollow", "AutoPillion", "AutoInvite", "AutoBusy", "FateToolKit", "AutoQueue", "EnhancedDutyStartEnd", "EnhancedLoginLogout", "GettingTooAttached",
|
||||
"RetrieveMateria"
|
||||
"DateWithDestiny", "AutoFollow", "ClickToMove", "AutoPillion", "AutoInvite", "AutoBusy", "FateToolKit", "AutoQueue", "EnhancedDutyStartEnd", "EnhancedLoginLogout",
|
||||
"GettingTooAttached", "RetrieveMateria"
|
||||
}.ToImmutableHashSet();
|
||||
|
||||
private const string AutoSnipeTweak = "AutoSnipeQuests";
|
||||
|
|
@ -26,10 +26,14 @@ 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;
|
||||
|
|
@ -38,16 +42,21 @@ internal sealed class AutomatonIpc : IDisposable
|
|||
|
||||
private HashSet<string>? _pausedTweaks;
|
||||
|
||||
public AutomatonIpc(Configuration configuration, IDalamudPluginInterface pluginInterface, QuestController questController, TerritoryData territoryData, IClientState clientState, ILogger<AutomatonIpc> logger)
|
||||
private bool _wasFateRunning;
|
||||
|
||||
public AutomatonIpc(Configuration configuration, IDalamudPluginInterface pluginInterface, QuestController questController, FateController fateController, TerritoryData territoryData, IClientState clientState, IFramework framework, 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)
|
||||
|
|
@ -56,12 +65,29 @@ internal sealed class AutomatonIpc : IDisposable
|
|||
{
|
||||
Task.Run((Action)DisableConflictingTweaks);
|
||||
}
|
||||
else
|
||||
else if (!_fateController.IsRunning)
|
||||
{
|
||||
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)
|
||||
|
|
@ -117,6 +143,7 @@ internal sealed class AutomatonIpc : IDisposable
|
|||
|
||||
public void Dispose()
|
||||
{
|
||||
_framework.Update -= OnFrameworkUpdate;
|
||||
_questController.AutomationTypeChanged -= OnAutomationTypeChanged;
|
||||
RestoreConflictingTweaks();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,10 +27,14 @@ 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;
|
||||
|
|
@ -39,16 +43,21 @@ internal sealed class PandorasBoxIpc : IDisposable
|
|||
|
||||
private HashSet<string>? _pausedFeatures;
|
||||
|
||||
public PandorasBoxIpc(Configuration configuration, IDalamudPluginInterface pluginInterface, QuestController questController, TerritoryData territoryData, IClientState clientState, ILogger<PandorasBoxIpc> logger)
|
||||
private bool _wasFateRunning;
|
||||
|
||||
public PandorasBoxIpc(Configuration configuration, IDalamudPluginInterface pluginInterface, QuestController questController, FateController fateController, TerritoryData territoryData, IClientState clientState, IFramework framework, 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)
|
||||
|
|
@ -57,14 +66,32 @@ internal sealed class PandorasBoxIpc : IDisposable
|
|||
{
|
||||
Task.Run((Action)DisableConflictingFeatures);
|
||||
}
|
||||
else
|
||||
else if (!_fateController.IsRunning)
|
||||
{
|
||||
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,6 +38,8 @@ internal sealed class TextAdvanceIpc : IDisposable
|
|||
|
||||
private readonly QuestController _questController;
|
||||
|
||||
private readonly FateController _fateController;
|
||||
|
||||
private readonly Configuration _configuration;
|
||||
|
||||
private readonly ICondition _condition;
|
||||
|
|
@ -52,10 +54,11 @@ internal sealed class TextAdvanceIpc : IDisposable
|
|||
|
||||
private readonly string _pluginName;
|
||||
|
||||
public TextAdvanceIpc(IDalamudPluginInterface pluginInterface, IFramework framework, QuestController questController, Configuration configuration, ICondition condition)
|
||||
public TextAdvanceIpc(IDalamudPluginInterface pluginInterface, IFramework framework, QuestController questController, FateController fateController, Configuration configuration, ICondition condition)
|
||||
{
|
||||
_framework = framework;
|
||||
_questController = questController;
|
||||
_fateController = fateController;
|
||||
_configuration = configuration;
|
||||
_condition = condition;
|
||||
_isInExternalControl = pluginInterface.GetIpcSubscriber<bool>("TextAdvance.IsInExternalControl");
|
||||
|
|
@ -76,7 +79,7 @@ internal sealed class TextAdvanceIpc : IDisposable
|
|||
|
||||
private void OnUpdate(IFramework framework)
|
||||
{
|
||||
bool flag = _questController.IsRunning || _questController.AutomationType != QuestController.EAutomationType.Manual;
|
||||
bool flag = _questController.IsRunning || _questController.AutomationType != QuestController.EAutomationType.Manual || _fateController.IsRunning;
|
||||
if (!_configuration.General.ConfigureTextAdvance || !flag)
|
||||
{
|
||||
if (_isExternalControlActivated && (_disableExternalControl.InvokeFunc(_pluginName) || !_isInExternalControl.InvokeFunc()))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue