muffin v7.4.7

This commit is contained in:
alydev 2025-12-28 12:35:39 +10:00
parent 1cc65e495d
commit 63f975ff4f
16 changed files with 1659 additions and 939 deletions

View file

@ -35,6 +35,10 @@ internal sealed class AutoDutyIpc
private bool _loggedContentHasPathQueryWarning;
private bool _loggedLevelingModeWarning;
public const int MinimumLevelForLevelingMode = 15;
public AutoDutyIpc(IDalamudPluginInterface pluginInterface, Configuration configuration, TerritoryData territoryData, ILogger<AutoDutyIpc> logger)
{
_configuration = configuration;
@ -46,6 +50,7 @@ internal sealed class AutoDutyIpc
_isStopped = pluginInterface.GetIpcSubscriber<bool>("AutoDuty.IsStopped");
_stop = pluginInterface.GetIpcSubscriber<object>("AutoDuty.Stop");
_loggedContentHasPathQueryWarning = false;
_loggedLevelingModeWarning = false;
}
public bool IsConfiguredToRunContent(DutyOptions? dutyOptions)
@ -73,6 +78,24 @@ internal sealed class AutoDutyIpc
return false;
}
public bool IsConfiguredToRunLevelingMode()
{
return _configuration.Duties.RunLevelingModeWhenUnderleveled;
}
public bool IsConfiguredToRunLevelingMode(int currentPlayerLevel)
{
if (!_configuration.Duties.RunLevelingModeWhenUnderleveled)
{
return false;
}
if (currentPlayerLevel < 15)
{
return false;
}
return true;
}
public bool HasPath(uint cfcId)
{
if (!_territoryData.TryGetContentFinderCondition(cfcId, out TerritoryData.ContentFinderConditionData contentFinderConditionData))
@ -118,6 +141,35 @@ internal sealed class AutoDutyIpc
}
}
public bool StartLevelingMode()
{
try
{
_logger.LogInformation("Starting AutoDuty Leveling mode (Support) - AutoDuty will select the best dungeon");
_setConfig.InvokeAction("leveling", "Support");
_run.InvokeAction(0u, 1, !_configuration.Advanced.DisableAutoDutyBareMode);
return true;
}
catch (IpcError ipcError)
{
if (!_loggedLevelingModeWarning)
{
_logger.LogWarning("Unable to start AutoDuty Leveling mode: {Message}", ipcError.Message);
_loggedLevelingModeWarning = true;
}
return false;
}
catch (Exception exception)
{
if (!_loggedLevelingModeWarning)
{
_logger.LogWarning(exception, "Unable to start AutoDuty Leveling mode");
_loggedLevelingModeWarning = true;
}
return false;
}
}
public bool IsStopped()
{
try