muffin v7.38.7
This commit is contained in:
parent
317800fb39
commit
5e2d8f648b
7 changed files with 703 additions and 486 deletions
|
|
@ -350,28 +350,32 @@ internal sealed class QuestController : MiniTaskController<QuestController>
|
||||||
_escPressCount = 0;
|
_escPressCount = 0;
|
||||||
_lastEscPressTime = DateTime.MinValue;
|
_lastEscPressTime = DateTime.MinValue;
|
||||||
}
|
}
|
||||||
if (_configuration.Stop.Enabled && _configuration.Stop.LevelToStopAfter && _clientState.LocalPlayer != null)
|
if (_configuration.Stop.Enabled && _startedQuest != null)
|
||||||
{
|
{
|
||||||
int level = _clientState.LocalPlayer.Level;
|
string text = _startedQuest.Quest.Id.ToString();
|
||||||
if (level >= _configuration.Stop.TargetLevel && IsRunning)
|
if (_configuration.Stop.QuestSequences.TryGetValue(text, out var value) && value.HasValue)
|
||||||
{
|
{
|
||||||
_logger.LogInformation("Reached level stop condition (level: {CurrentLevel}, target: {TargetLevel})", level, _configuration.Stop.TargetLevel);
|
int sequence = _startedQuest.Sequence;
|
||||||
_chatGui.Print($"Reached or exceeded target level {_configuration.Stop.TargetLevel}.", "Questionable", 576);
|
if (sequence >= value.Value && IsRunning)
|
||||||
Stop($"Level stop condition reached [{level}]");
|
{
|
||||||
|
_logger.LogInformation("Reached quest-specific sequence stop condition (quest: {QuestId}, sequence: {CurrentSequence}, target: {TargetSequence})", _startedQuest.Quest.Id, sequence, value.Value);
|
||||||
|
_chatGui.Print($"Quest '{_startedQuest.Quest.Info.Name}' reached sequence {sequence}, configured stop sequence is {value.Value}.", "Questionable", 576);
|
||||||
|
Stop($"Quest-specific sequence stop condition reached [{text}@{sequence}]");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (_configuration.Stop.Enabled && _configuration.Stop.SequenceToStopAfter && CurrentQuest != null)
|
else if (_configuration.Stop.SequenceToStopAfter && CurrentQuest != null)
|
||||||
{
|
{
|
||||||
int sequence = CurrentQuest.Sequence;
|
int sequence2 = CurrentQuest.Sequence;
|
||||||
if (sequence >= _configuration.Stop.TargetSequence && IsRunning)
|
if (sequence2 >= _configuration.Stop.TargetSequence && IsRunning)
|
||||||
{
|
{
|
||||||
_logger.LogInformation("Reached quest sequence stop condition (sequence: {CurrentSequence}, target: {TargetSequence})", sequence, _configuration.Stop.TargetSequence);
|
_logger.LogInformation("Reached global quest sequence stop condition (sequence: {CurrentSequence}, target: {TargetSequence})", sequence2, _configuration.Stop.TargetSequence);
|
||||||
_chatGui.Print($"Quest sequence {sequence} reached target sequence {_configuration.Stop.TargetSequence}.", "Questionable", 576);
|
_chatGui.Print($"Quest sequence {sequence2} reached target sequence {_configuration.Stop.TargetSequence}.", "Questionable", 576);
|
||||||
Stop($"Sequence stop condition reached [{sequence}]");
|
Stop($"Sequence stop condition reached [{sequence2}]");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
bool flag = AutomationType == EAutomationType.Automatic && (_taskQueue.AllTasksComplete || _taskQueue.CurrentTaskExecutor?.CurrentTask is WaitAtEnd.WaitQuestAccepted);
|
bool flag = AutomationType == EAutomationType.Automatic && (_taskQueue.AllTasksComplete || _taskQueue.CurrentTaskExecutor?.CurrentTask is WaitAtEnd.WaitQuestAccepted);
|
||||||
bool flag2;
|
bool flag2;
|
||||||
if (flag)
|
if (flag)
|
||||||
|
|
@ -383,14 +387,17 @@ internal sealed class QuestController : MiniTaskController<QuestController>
|
||||||
if (step == 0 || step == 255)
|
if (step == 0 || step == 255)
|
||||||
{
|
{
|
||||||
flag2 = true;
|
flag2 = true;
|
||||||
goto IL_04f5;
|
goto IL_054c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
flag2 = false;
|
flag2 = false;
|
||||||
goto IL_04f5;
|
goto IL_054c;
|
||||||
}
|
}
|
||||||
goto IL_04f9;
|
goto IL_0550;
|
||||||
IL_04f9:
|
IL_054c:
|
||||||
|
flag = flag2;
|
||||||
|
goto IL_0550;
|
||||||
|
IL_0550:
|
||||||
if (flag && DateTime.Now >= CurrentQuest.StepProgress.StartedAt.AddSeconds(15.0))
|
if (flag && DateTime.Now >= CurrentQuest.StepProgress.StartedAt.AddSeconds(15.0))
|
||||||
{
|
{
|
||||||
lock (_progressLock)
|
lock (_progressLock)
|
||||||
|
|
@ -405,10 +412,6 @@ internal sealed class QuestController : MiniTaskController<QuestController>
|
||||||
CheckAutoRefreshCondition();
|
CheckAutoRefreshCondition();
|
||||||
UpdateCurrentTask();
|
UpdateCurrentTask();
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
IL_04f5:
|
|
||||||
flag = flag2;
|
|
||||||
goto IL_04f9;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckAutoRefreshCondition()
|
private void CheckAutoRefreshCondition()
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -137,6 +137,14 @@ internal sealed class QuestionableIpc : IDisposable
|
||||||
|
|
||||||
private const string IpcSetSequenceStopCondition = "Questionable.SetSequenceStopCondition";
|
private const string IpcSetSequenceStopCondition = "Questionable.SetSequenceStopCondition";
|
||||||
|
|
||||||
|
private const string IpcGetQuestSequenceStopCondition = "Questionable.GetQuestSequenceStopCondition";
|
||||||
|
|
||||||
|
private const string IpcSetQuestSequenceStopCondition = "Questionable.SetQuestSequenceStopCondition";
|
||||||
|
|
||||||
|
private const string IpcRemoveQuestSequenceStopCondition = "Questionable.RemoveQuestSequenceStopCondition";
|
||||||
|
|
||||||
|
private const string IpcGetAllQuestSequenceStopConditions = "Questionable.GetAllQuestSequenceStopConditions";
|
||||||
|
|
||||||
private const string IpcGetAlliedSocietyRemainingAllowances = "Questionable.AlliedSociety.GetRemainingAllowances";
|
private const string IpcGetAlliedSocietyRemainingAllowances = "Questionable.AlliedSociety.GetRemainingAllowances";
|
||||||
|
|
||||||
private const string IpcGetAlliedSocietyTimeUntilReset = "Questionable.AlliedSociety.GetTimeUntilReset";
|
private const string IpcGetAlliedSocietyTimeUntilReset = "Questionable.AlliedSociety.GetTimeUntilReset";
|
||||||
|
|
@ -259,6 +267,14 @@ internal sealed class QuestionableIpc : IDisposable
|
||||||
|
|
||||||
private readonly ICallGateProvider<bool, int, bool> _setSequenceStopCondition;
|
private readonly ICallGateProvider<bool, int, bool> _setSequenceStopCondition;
|
||||||
|
|
||||||
|
private readonly ICallGateProvider<string, int> _getQuestSequenceStopCondition;
|
||||||
|
|
||||||
|
private readonly ICallGateProvider<string, int, bool> _setQuestSequenceStopCondition;
|
||||||
|
|
||||||
|
private readonly ICallGateProvider<string, bool> _removeQuestSequenceStopCondition;
|
||||||
|
|
||||||
|
private readonly ICallGateProvider<Dictionary<string, int>> _getAllQuestSequenceStopConditions;
|
||||||
|
|
||||||
private readonly ICallGateProvider<int> _getAlliedSocietyRemainingAllowances;
|
private readonly ICallGateProvider<int> _getAlliedSocietyRemainingAllowances;
|
||||||
|
|
||||||
private readonly ICallGateProvider<long> _getAlliedSocietyTimeUntilReset;
|
private readonly ICallGateProvider<long> _getAlliedSocietyTimeUntilReset;
|
||||||
|
|
@ -376,6 +392,14 @@ internal sealed class QuestionableIpc : IDisposable
|
||||||
_getSequenceStopCondition.RegisterFunc(GetSequenceStopCondition);
|
_getSequenceStopCondition.RegisterFunc(GetSequenceStopCondition);
|
||||||
_setSequenceStopCondition = pluginInterface.GetIpcProvider<bool, int, bool>("Questionable.SetSequenceStopCondition");
|
_setSequenceStopCondition = pluginInterface.GetIpcProvider<bool, int, bool>("Questionable.SetSequenceStopCondition");
|
||||||
_setSequenceStopCondition.RegisterFunc(SetSequenceStopCondition);
|
_setSequenceStopCondition.RegisterFunc(SetSequenceStopCondition);
|
||||||
|
_getQuestSequenceStopCondition = pluginInterface.GetIpcProvider<string, int>("Questionable.GetQuestSequenceStopCondition");
|
||||||
|
_getQuestSequenceStopCondition.RegisterFunc(GetQuestSequenceStopCondition);
|
||||||
|
_setQuestSequenceStopCondition = pluginInterface.GetIpcProvider<string, int, bool>("Questionable.SetQuestSequenceStopCondition");
|
||||||
|
_setQuestSequenceStopCondition.RegisterFunc(SetQuestSequenceStopCondition);
|
||||||
|
_removeQuestSequenceStopCondition = pluginInterface.GetIpcProvider<string, bool>("Questionable.RemoveQuestSequenceStopCondition");
|
||||||
|
_removeQuestSequenceStopCondition.RegisterFunc(RemoveQuestSequenceStopCondition);
|
||||||
|
_getAllQuestSequenceStopConditions = pluginInterface.GetIpcProvider<Dictionary<string, int>>("Questionable.GetAllQuestSequenceStopConditions");
|
||||||
|
_getAllQuestSequenceStopConditions.RegisterFunc(GetAllQuestSequenceStopConditions);
|
||||||
_getAlliedSocietyRemainingAllowances = pluginInterface.GetIpcProvider<int>("Questionable.AlliedSociety.GetRemainingAllowances");
|
_getAlliedSocietyRemainingAllowances = pluginInterface.GetIpcProvider<int>("Questionable.AlliedSociety.GetRemainingAllowances");
|
||||||
_getAlliedSocietyRemainingAllowances.RegisterFunc(GetAlliedSocietyRemainingAllowances);
|
_getAlliedSocietyRemainingAllowances.RegisterFunc(GetAlliedSocietyRemainingAllowances);
|
||||||
_getAlliedSocietyTimeUntilReset = pluginInterface.GetIpcProvider<long>("Questionable.AlliedSociety.GetTimeUntilReset");
|
_getAlliedSocietyTimeUntilReset = pluginInterface.GetIpcProvider<long>("Questionable.AlliedSociety.GetTimeUntilReset");
|
||||||
|
|
@ -925,6 +949,7 @@ internal sealed class QuestionableIpc : IDisposable
|
||||||
bool num = _configuration.Stop.QuestsToStopAfter.Remove(elementId);
|
bool num = _configuration.Stop.QuestsToStopAfter.Remove(elementId);
|
||||||
if (num)
|
if (num)
|
||||||
{
|
{
|
||||||
|
_configuration.Stop.QuestSequences.Remove(questId);
|
||||||
_pluginInterface.SavePluginConfig(_configuration);
|
_pluginInterface.SavePluginConfig(_configuration);
|
||||||
}
|
}
|
||||||
return num;
|
return num;
|
||||||
|
|
@ -935,6 +960,7 @@ internal sealed class QuestionableIpc : IDisposable
|
||||||
private bool ClearStopQuests()
|
private bool ClearStopQuests()
|
||||||
{
|
{
|
||||||
_configuration.Stop.QuestsToStopAfter.Clear();
|
_configuration.Stop.QuestsToStopAfter.Clear();
|
||||||
|
_configuration.Stop.QuestSequences.Clear();
|
||||||
_pluginInterface.SavePluginConfig(_configuration);
|
_pluginInterface.SavePluginConfig(_configuration);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -981,6 +1007,49 @@ internal sealed class QuestionableIpc : IDisposable
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int GetQuestSequenceStopCondition(string questId)
|
||||||
|
{
|
||||||
|
if (_configuration.Stop.QuestSequences.TryGetValue(questId, out var value) && value.HasValue)
|
||||||
|
{
|
||||||
|
return value.Value;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool SetQuestSequenceStopCondition(string questId, int targetSequence)
|
||||||
|
{
|
||||||
|
if (targetSequence < 0 || targetSequence > 255)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (ElementId.TryFromString(questId, out ElementId elementId) && elementId != null && _questRegistry.IsKnownQuest(elementId))
|
||||||
|
{
|
||||||
|
if (!_configuration.Stop.QuestsToStopAfter.Contains(elementId))
|
||||||
|
{
|
||||||
|
_configuration.Stop.QuestsToStopAfter.Add(elementId);
|
||||||
|
}
|
||||||
|
_configuration.Stop.QuestSequences[questId] = targetSequence;
|
||||||
|
_pluginInterface.SavePluginConfig(_configuration);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool RemoveQuestSequenceStopCondition(string questId)
|
||||||
|
{
|
||||||
|
bool num = _configuration.Stop.QuestSequences.Remove(questId);
|
||||||
|
if (num)
|
||||||
|
{
|
||||||
|
_pluginInterface.SavePluginConfig(_configuration);
|
||||||
|
}
|
||||||
|
return num;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Dictionary<string, int> GetAllQuestSequenceStopConditions()
|
||||||
|
{
|
||||||
|
return _configuration.Stop.QuestSequences.Where<KeyValuePair<string, int?>>((KeyValuePair<string, int?> kvp) => kvp.Value.HasValue).ToDictionary((KeyValuePair<string, int?> kvp) => kvp.Key, (KeyValuePair<string, int?> kvp) => kvp.Value.Value);
|
||||||
|
}
|
||||||
|
|
||||||
private unsafe int GetAlliedSocietyRemainingAllowances()
|
private unsafe int GetAlliedSocietyRemainingAllowances()
|
||||||
{
|
{
|
||||||
QuestManager* ptr = QuestManager.Instance();
|
QuestManager* ptr = QuestManager.Instance();
|
||||||
|
|
@ -1179,6 +1248,10 @@ internal sealed class QuestionableIpc : IDisposable
|
||||||
_reorderPriorityQuest.UnregisterFunc();
|
_reorderPriorityQuest.UnregisterFunc();
|
||||||
_removePriorityQuest.UnregisterFunc();
|
_removePriorityQuest.UnregisterFunc();
|
||||||
_getPriorityQuests.UnregisterFunc();
|
_getPriorityQuests.UnregisterFunc();
|
||||||
|
_getAllQuestSequenceStopConditions.UnregisterFunc();
|
||||||
|
_removeQuestSequenceStopCondition.UnregisterFunc();
|
||||||
|
_setQuestSequenceStopCondition.UnregisterFunc();
|
||||||
|
_getQuestSequenceStopCondition.UnregisterFunc();
|
||||||
_setSequenceStopCondition.UnregisterFunc();
|
_setSequenceStopCondition.UnregisterFunc();
|
||||||
_getSequenceStopCondition.UnregisterFunc();
|
_getSequenceStopCondition.UnregisterFunc();
|
||||||
_setLevelStopCondition.UnregisterFunc();
|
_setLevelStopCondition.UnregisterFunc();
|
||||||
|
|
|
||||||
|
|
@ -37,12 +37,14 @@ internal sealed class DutyConfigComponent : ConfigComponent
|
||||||
|
|
||||||
private readonly Dictionary<EExpansionVersion, List<DutyInfo>> _contentFinderConditionNames;
|
private readonly Dictionary<EExpansionVersion, List<DutyInfo>> _contentFinderConditionNames;
|
||||||
|
|
||||||
|
private readonly Dictionary<EExpansionVersion, List<DutyInfo>> _allTrialNames;
|
||||||
|
|
||||||
public DutyConfigComponent(IDalamudPluginInterface pluginInterface, Configuration configuration, IDataManager dataManager, QuestRegistry questRegistry, AutoDutyIpc autoDutyIpc, TerritoryData territoryData)
|
public DutyConfigComponent(IDalamudPluginInterface pluginInterface, Configuration configuration, IDataManager dataManager, QuestRegistry questRegistry, AutoDutyIpc autoDutyIpc, TerritoryData territoryData)
|
||||||
: base(pluginInterface, configuration)
|
: base(pluginInterface, configuration)
|
||||||
{
|
{
|
||||||
_questRegistry = questRegistry;
|
_questRegistry = questRegistry;
|
||||||
_autoDutyIpc = autoDutyIpc;
|
_autoDutyIpc = autoDutyIpc;
|
||||||
_contentFinderConditionNames = (from x in dataManager.GetExcelSheet<DawnContent>()
|
var source = (from x in dataManager.GetExcelSheet<DawnContent>()
|
||||||
where x.RowId != 0 && !x.Unknown16
|
where x.RowId != 0 && !x.Unknown16
|
||||||
orderby x.Unknown15
|
orderby x.Unknown15
|
||||||
select x.Content.ValueNullable into x
|
select x.Content.ValueNullable into x
|
||||||
|
|
@ -57,7 +59,22 @@ internal sealed class DutyConfigComponent : ConfigComponent
|
||||||
ContentType = x.ContentType.RowId,
|
ContentType = x.ContentType.RowId,
|
||||||
Level = x.ClassJobLevelRequired,
|
Level = x.ClassJobLevelRequired,
|
||||||
SortKey = x.SortKey
|
SortKey = x.SortKey
|
||||||
|
}).ToList();
|
||||||
|
_contentFinderConditionNames = (from x in source
|
||||||
|
where x.ContentType == 2
|
||||||
|
group x by x.Expansion).ToDictionary(x => x.Key, x => x.Select(y => new DutyInfo(y.CfcId, y.TerritoryId, ConfigComponent.FormatLevel(y.Level) + " " + y.Name)).ToList());
|
||||||
|
_allTrialNames = (from x in dataManager.GetExcelSheet<ContentFinderCondition>()
|
||||||
|
where x.RowId != 0 && x.Content.RowId != 0 && x.ContentType.RowId == 4
|
||||||
|
select new
|
||||||
|
{
|
||||||
|
Expansion = (EExpansionVersion)x.TerritoryType.Value.ExVersion.RowId,
|
||||||
|
CfcId = x.RowId,
|
||||||
|
Name = (territoryData.GetContentFinderCondition(x.RowId)?.Name ?? x.Name.ToDalamudString().ToString()),
|
||||||
|
TerritoryId = x.TerritoryType.RowId,
|
||||||
|
Level = x.ClassJobLevelRequired,
|
||||||
|
SortKey = x.SortKey
|
||||||
} into x
|
} into x
|
||||||
|
orderby x.SortKey
|
||||||
group x by x.Expansion).ToDictionary(x => x.Key, x => x.Select(y => new DutyInfo(y.CfcId, y.TerritoryId, ConfigComponent.FormatLevel(y.Level) + " " + y.Name)).ToList());
|
group x by x.Expansion).ToDictionary(x => x.Key, x => x.Select(y => new DutyInfo(y.CfcId, y.TerritoryId, ConfigComponent.FormatLevel(y.Level) + " " + y.Name)).ToList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -78,6 +95,16 @@ internal sealed class DutyConfigComponent : ConfigComponent
|
||||||
ImGuiComponents.HelpMarker("The combat module used for this is configured by AutoDuty, ignoring whichever selection you've made in Questionable's \"General\" configuration.");
|
ImGuiComponents.HelpMarker("The combat module used for this is configured by AutoDuty, ignoring whichever selection you've made in Questionable's \"General\" configuration.");
|
||||||
using (ImRaii.Disabled(!v))
|
using (ImRaii.Disabled(!v))
|
||||||
{
|
{
|
||||||
|
using (ImRaii.PushIndent(ImGui.GetFrameHeight() + ImGui.GetStyle().ItemInnerSpacing.X))
|
||||||
|
{
|
||||||
|
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed))
|
||||||
|
{
|
||||||
|
ImGui.TextUnformatted("Work in Progress:");
|
||||||
|
ImGui.BulletText("Duty Support mode is limited.");
|
||||||
|
ImGui.BulletText("Unsynced modes require being significantly overleveled or having a high-level party member.");
|
||||||
|
ImGui.BulletText("Most players will need to use Duty Support mode when progressing normally through the game.");
|
||||||
|
}
|
||||||
|
}
|
||||||
ImGui.Spacing();
|
ImGui.Spacing();
|
||||||
ImGui.Text("Default duty mode:");
|
ImGui.Text("Default duty mode:");
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
|
|
@ -102,7 +129,22 @@ internal sealed class DutyConfigComponent : ConfigComponent
|
||||||
}
|
}
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
ImGui.Text("You can override the settings for each individual dungeon/trial:");
|
ImGui.Text("You can override the settings for each individual dungeon/trial:");
|
||||||
DrawConfigTable(v);
|
using ImRaii.IEndObject endObject2 = ImRaii.TabBar("DutyTypeTabs");
|
||||||
|
if (endObject2)
|
||||||
|
{
|
||||||
|
using (ImRaii.IEndObject endObject3 = ImRaii.TabItem("Dungeons"))
|
||||||
|
{
|
||||||
|
if (endObject3)
|
||||||
|
{
|
||||||
|
DrawConfigTable(v, _contentFinderConditionNames);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
using ImRaii.IEndObject endObject4 = ImRaii.TabItem("Trials");
|
||||||
|
if (endObject4)
|
||||||
|
{
|
||||||
|
DrawConfigTable(v, _allTrialNames);
|
||||||
|
}
|
||||||
|
}
|
||||||
DrawEnableAllButton();
|
DrawEnableAllButton();
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
DrawClipboardButtons();
|
DrawClipboardButtons();
|
||||||
|
|
@ -111,9 +153,9 @@ internal sealed class DutyConfigComponent : ConfigComponent
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawConfigTable(bool runInstancedContentWithAutoDuty)
|
private void DrawConfigTable(bool runInstancedContentWithAutoDuty, Dictionary<EExpansionVersion, List<DutyInfo>> contentByExpansion)
|
||||||
{
|
{
|
||||||
using ImRaii.IEndObject endObject = ImRaii.Child("DutyConfiguration", new Vector2(950f, 400f), border: true);
|
using ImRaii.IEndObject endObject = ImRaii.Child("DutyConfiguration", new Vector2(725f, 400f), border: true);
|
||||||
if (!endObject)
|
if (!endObject)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|
@ -122,7 +164,7 @@ internal sealed class DutyConfigComponent : ConfigComponent
|
||||||
for (int i = 0; i < values.Length; i++)
|
for (int i = 0; i < values.Length; i++)
|
||||||
{
|
{
|
||||||
EExpansionVersion eExpansionVersion = values[i];
|
EExpansionVersion eExpansionVersion = values[i];
|
||||||
(int enabledCount, int totalCount) dutyCountsForExpansion = GetDutyCountsForExpansion(eExpansionVersion);
|
(int enabledCount, int totalCount) dutyCountsForExpansion = GetDutyCountsForExpansion(eExpansionVersion, contentByExpansion);
|
||||||
int item = dutyCountsForExpansion.enabledCount;
|
int item = dutyCountsForExpansion.enabledCount;
|
||||||
int item2 = dutyCountsForExpansion.totalCount;
|
int item2 = dutyCountsForExpansion.totalCount;
|
||||||
string obj = ((item2 > 0) ? $"{eExpansionVersion.ToFriendlyString()} ({item}/{item2})" : eExpansionVersion.ToFriendlyString());
|
string obj = ((item2 > 0) ? $"{eExpansionVersion.ToFriendlyString()} ({item}/{item2})" : eExpansionVersion.ToFriendlyString());
|
||||||
|
|
@ -146,7 +188,7 @@ internal sealed class DutyConfigComponent : ConfigComponent
|
||||||
ImGui.TableSetupColumn("Name", ImGuiTableColumnFlags.WidthStretch);
|
ImGui.TableSetupColumn("Name", ImGuiTableColumnFlags.WidthStretch);
|
||||||
ImGui.TableSetupColumn("Enabled", ImGuiTableColumnFlags.WidthFixed, 200f);
|
ImGui.TableSetupColumn("Enabled", ImGuiTableColumnFlags.WidthFixed, 200f);
|
||||||
ImGui.TableSetupColumn("Mode", ImGuiTableColumnFlags.WidthFixed, 150f);
|
ImGui.TableSetupColumn("Mode", ImGuiTableColumnFlags.WidthFixed, 150f);
|
||||||
if (!_contentFinderConditionNames.TryGetValue(eExpansionVersion, out List<DutyInfo> value))
|
if (!contentByExpansion.TryGetValue(eExpansionVersion, out List<DutyInfo> value))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -156,13 +198,15 @@ internal sealed class DutyConfigComponent : ConfigComponent
|
||||||
uint num = CfcId;
|
uint num = CfcId;
|
||||||
uint value2 = TerritoryId;
|
uint value2 = TerritoryId;
|
||||||
string text = Name;
|
string text = Name;
|
||||||
if (!_questRegistry.TryGetDutyByContentFinderConditionId(num, out DutyOptions dutyOptions))
|
DutyOptions dutyOptions;
|
||||||
{
|
bool flag = _questRegistry.TryGetDutyByContentFinderConditionId(num, out dutyOptions);
|
||||||
continue;
|
|
||||||
}
|
|
||||||
ImGui.TableNextRow();
|
ImGui.TableNextRow();
|
||||||
string[] items = (dutyOptions.Enabled ? SupportedCfcOptions : UnsupportedCfcOptions);
|
string[] items;
|
||||||
int currentItem = 0;
|
int currentItem;
|
||||||
|
if (flag)
|
||||||
|
{
|
||||||
|
items = (dutyOptions.Enabled ? SupportedCfcOptions : UnsupportedCfcOptions);
|
||||||
|
currentItem = 0;
|
||||||
if (base.Configuration.Duties.WhitelistedDutyCfcIds.Contains(num))
|
if (base.Configuration.Duties.WhitelistedDutyCfcIds.Contains(num))
|
||||||
{
|
{
|
||||||
currentItem = 1;
|
currentItem = 1;
|
||||||
|
|
@ -171,6 +215,12 @@ internal sealed class DutyConfigComponent : ConfigComponent
|
||||||
{
|
{
|
||||||
currentItem = 2;
|
currentItem = 2;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
items = new string[2] { "Disabled", "Enabled" };
|
||||||
|
currentItem = (base.Configuration.Duties.WhitelistedDutyCfcIds.Contains(num) ? 1 : 0);
|
||||||
|
}
|
||||||
if (ImGui.TableNextColumn())
|
if (ImGui.TableNextColumn())
|
||||||
{
|
{
|
||||||
ImGui.AlignTextToFramePadding();
|
ImGui.AlignTextToFramePadding();
|
||||||
|
|
@ -190,13 +240,17 @@ internal sealed class DutyConfigComponent : ConfigComponent
|
||||||
table.AppendLiteral("ContentFinderConditionId: ");
|
table.AppendLiteral("ContentFinderConditionId: ");
|
||||||
table.AppendFormatted(num);
|
table.AppendFormatted(num);
|
||||||
ImGui.BulletText(table);
|
ImGui.BulletText(table);
|
||||||
|
if (flag)
|
||||||
|
{
|
||||||
|
ImGui.BulletText("Duty Support: Available");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (runInstancedContentWithAutoDuty && !_autoDutyIpc.HasPath(num))
|
if (runInstancedContentWithAutoDuty && !_autoDutyIpc.HasPath(num))
|
||||||
{
|
{
|
||||||
ImGuiComponents.HelpMarker("This duty is not supported by AutoDuty", FontAwesomeIcon.Times, ImGuiColors.DalamudRed);
|
ImGuiComponents.HelpMarker("This duty is not supported by AutoDuty", FontAwesomeIcon.Times, ImGuiColors.DalamudRed);
|
||||||
}
|
}
|
||||||
else if (dutyOptions.Notes.Count > 0)
|
else if (flag && dutyOptions.Notes.Count > 0)
|
||||||
{
|
{
|
||||||
ConfigComponent.DrawNotes(dutyOptions.Enabled, dutyOptions.Notes);
|
ConfigComponent.DrawNotes(dutyOptions.Enabled, dutyOptions.Notes);
|
||||||
}
|
}
|
||||||
|
|
@ -213,6 +267,8 @@ internal sealed class DutyConfigComponent : ConfigComponent
|
||||||
{
|
{
|
||||||
base.Configuration.Duties.WhitelistedDutyCfcIds.Remove(num);
|
base.Configuration.Duties.WhitelistedDutyCfcIds.Remove(num);
|
||||||
base.Configuration.Duties.BlacklistedDutyCfcIds.Remove(num);
|
base.Configuration.Duties.BlacklistedDutyCfcIds.Remove(num);
|
||||||
|
if (flag)
|
||||||
|
{
|
||||||
switch (currentItem)
|
switch (currentItem)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
|
|
@ -222,6 +278,11 @@ internal sealed class DutyConfigComponent : ConfigComponent
|
||||||
base.Configuration.Duties.BlacklistedDutyCfcIds.Add(num);
|
base.Configuration.Duties.BlacklistedDutyCfcIds.Add(num);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else if (currentItem == 1)
|
||||||
|
{
|
||||||
|
base.Configuration.Duties.WhitelistedDutyCfcIds.Add(num);
|
||||||
|
}
|
||||||
Save();
|
Save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -236,8 +297,8 @@ internal sealed class DutyConfigComponent : ConfigComponent
|
||||||
using (ImRaii.PushId(table))
|
using (ImRaii.PushId(table))
|
||||||
{
|
{
|
||||||
EDutyMode value3;
|
EDutyMode value3;
|
||||||
bool flag = base.Configuration.Duties.DutyModeOverrides.TryGetValue(num, out value3);
|
bool flag2 = base.Configuration.Duties.DutyModeOverrides.TryGetValue(num, out value3);
|
||||||
EDutyMode num2 = (flag ? value3 : ((EDutyMode)(-1)));
|
EDutyMode num2 = (flag2 ? value3 : ((EDutyMode)(-1)));
|
||||||
Name = "Use Default";
|
Name = "Use Default";
|
||||||
string[] dutyModeLabels = DutyModeLabels;
|
string[] dutyModeLabels = DutyModeLabels;
|
||||||
int num3 = 0;
|
int num3 = 0;
|
||||||
|
|
@ -264,8 +325,8 @@ internal sealed class DutyConfigComponent : ConfigComponent
|
||||||
}
|
}
|
||||||
if (ImGui.IsItemHovered())
|
if (ImGui.IsItemHovered())
|
||||||
{
|
{
|
||||||
EDutyMode eDutyMode = (flag ? value3 : base.Configuration.Duties.DefaultDutyMode);
|
EDutyMode eDutyMode = (flag2 ? value3 : base.Configuration.Duties.DefaultDutyMode);
|
||||||
ImGui.SetTooltip(flag ? ("Override: " + DutyModeLabels[(int)eDutyMode]) : ("Using default: " + DutyModeLabels[(int)eDutyMode]));
|
ImGui.SetTooltip(flag2 ? ("Override: " + DutyModeLabels[(int)eDutyMode]) : ("Using default: " + DutyModeLabels[(int)eDutyMode]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -278,9 +339,9 @@ internal sealed class DutyConfigComponent : ConfigComponent
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private (int enabledCount, int totalCount) GetDutyCountsForExpansion(EExpansionVersion expansion)
|
private (int enabledCount, int totalCount) GetDutyCountsForExpansion(EExpansionVersion expansion, Dictionary<EExpansionVersion, List<DutyInfo>> contentByExpansion)
|
||||||
{
|
{
|
||||||
if (!_contentFinderConditionNames.TryGetValue(expansion, out List<DutyInfo> value))
|
if (!contentByExpansion.TryGetValue(expansion, out List<DutyInfo> value))
|
||||||
{
|
{
|
||||||
return (enabledCount: 0, totalCount: 0);
|
return (enabledCount: 0, totalCount: 0);
|
||||||
}
|
}
|
||||||
|
|
@ -296,6 +357,14 @@ internal sealed class DutyConfigComponent : ConfigComponent
|
||||||
num++;
|
num++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
num2++;
|
||||||
|
if (base.Configuration.Duties.WhitelistedDutyCfcIds.Contains(num5))
|
||||||
|
{
|
||||||
|
num++;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return (enabledCount: num, totalCount: num2);
|
return (enabledCount: num, totalCount: num2);
|
||||||
}
|
}
|
||||||
|
|
@ -306,14 +375,11 @@ internal sealed class DutyConfigComponent : ConfigComponent
|
||||||
{
|
{
|
||||||
base.Configuration.Duties.BlacklistedDutyCfcIds.Clear();
|
base.Configuration.Duties.BlacklistedDutyCfcIds.Clear();
|
||||||
base.Configuration.Duties.WhitelistedDutyCfcIds.Clear();
|
base.Configuration.Duties.WhitelistedDutyCfcIds.Clear();
|
||||||
foreach (List<DutyInfo> value in _contentFinderConditionNames.Values)
|
foreach (List<DutyInfo> item2 in _contentFinderConditionNames.Values.Concat<List<DutyInfo>>(_allTrialNames.Values))
|
||||||
{
|
{
|
||||||
foreach (var (num3, _, _) in value)
|
foreach (var (item, _, _) in item2)
|
||||||
{
|
{
|
||||||
if (_questRegistry.TryGetDutyByContentFinderConditionId(num3, out DutyOptions _))
|
base.Configuration.Duties.WhitelistedDutyCfcIds.Add(item);
|
||||||
{
|
|
||||||
base.Configuration.Duties.WhitelistedDutyCfcIds.Add(num3);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Save();
|
Save();
|
||||||
|
|
|
||||||
|
|
@ -716,7 +716,7 @@ internal sealed class SinglePlayerDutyConfigComponent : ConfigComponent
|
||||||
|
|
||||||
private static ImRaii.IEndObject BeginChildArea()
|
private static ImRaii.IEndObject BeginChildArea()
|
||||||
{
|
{
|
||||||
return ImRaii.Child("DutyConfiguration", new Vector2(675f, 400f), border: true);
|
return ImRaii.Child("DutyConfiguration", new Vector2(725f, 400f), border: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawEnableAllButton()
|
private void DrawEnableAllButton()
|
||||||
|
|
|
||||||
|
|
@ -100,9 +100,9 @@ internal sealed class StopConditionComponent : ConfigComponent
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
ImGui.Text("Stop when quest sequence reaches:");
|
ImGui.Text("Stop on quest sequence:");
|
||||||
bool v3 = base.Configuration.Stop.SequenceToStopAfter;
|
bool v3 = base.Configuration.Stop.SequenceToStopAfter;
|
||||||
if (ImGui.Checkbox("Enable quest sequence stop condition", ref v3))
|
if (ImGui.Checkbox("Enable global quest sequence stop condition", ref v3))
|
||||||
{
|
{
|
||||||
base.Configuration.Stop.SequenceToStopAfter = v3;
|
base.Configuration.Stop.SequenceToStopAfter = v3;
|
||||||
Save();
|
Save();
|
||||||
|
|
@ -127,9 +127,10 @@ internal sealed class StopConditionComponent : ConfigComponent
|
||||||
text.AppendLiteral(")");
|
text.AppendLiteral(")");
|
||||||
ImGui.TextDisabled(text);
|
ImGui.TextDisabled(text);
|
||||||
}
|
}
|
||||||
|
ImGui.TextWrapped("Note: Individual quest sequences below override this global setting.");
|
||||||
}
|
}
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
ImGui.Text("Stop when completing any of the quests selected below:");
|
ImGui.Text("Stop when completing quests (or reaching specific sequences):");
|
||||||
DrawCurrentlyAcceptedQuests();
|
DrawCurrentlyAcceptedQuests();
|
||||||
_questSelector.DrawSelection();
|
_questSelector.DrawSelection();
|
||||||
List<ElementId> questsToStopAfter = base.Configuration.Stop.QuestsToStopAfter;
|
List<ElementId> questsToStopAfter = base.Configuration.Stop.QuestsToStopAfter;
|
||||||
|
|
@ -140,6 +141,10 @@ internal sealed class StopConditionComponent : ConfigComponent
|
||||||
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Trash, "Clear All"))
|
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Trash, "Clear All"))
|
||||||
{
|
{
|
||||||
base.Configuration.Stop.QuestsToStopAfter.Clear();
|
base.Configuration.Stop.QuestsToStopAfter.Clear();
|
||||||
|
foreach (ElementId item in questsToStopAfter)
|
||||||
|
{
|
||||||
|
base.Configuration.Stop.QuestSequences.Remove(item.ToString());
|
||||||
|
}
|
||||||
Save();
|
Save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -178,6 +183,45 @@ internal sealed class StopConditionComponent : ConfigComponent
|
||||||
{
|
{
|
||||||
_questTooltipComponent.Draw(quest2.Info);
|
_questTooltipComponent.Draw(quest2.Info);
|
||||||
}
|
}
|
||||||
|
ImGui.SameLine();
|
||||||
|
string text2 = elementId.ToString();
|
||||||
|
base.Configuration.Stop.QuestSequences.TryGetValue(text2, out var value);
|
||||||
|
bool v4 = value.HasValue;
|
||||||
|
text = new ImU8String(8, 1);
|
||||||
|
text.AppendLiteral("##UseSeq");
|
||||||
|
text.AppendFormatted(text2);
|
||||||
|
if (ImGui.Checkbox(text, ref v4))
|
||||||
|
{
|
||||||
|
if (v4)
|
||||||
|
{
|
||||||
|
base.Configuration.Stop.QuestSequences[text2] = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
base.Configuration.Stop.QuestSequences.Remove(text2);
|
||||||
|
}
|
||||||
|
Save();
|
||||||
|
}
|
||||||
|
if (ImGui.IsItemHovered())
|
||||||
|
{
|
||||||
|
ImGui.SetTooltip("Stop at specific sequence (unchecked = stop on quest completion)");
|
||||||
|
}
|
||||||
|
using (ImRaii.Disabled(!v4))
|
||||||
|
{
|
||||||
|
ImGui.SameLine();
|
||||||
|
ImGui.Text("Seq:");
|
||||||
|
ImGui.SameLine();
|
||||||
|
ImGui.SetNextItemWidth(85f);
|
||||||
|
int data3 = value ?? 1;
|
||||||
|
text = new ImU8String(10, 1);
|
||||||
|
text.AppendLiteral("##SeqValue");
|
||||||
|
text.AppendFormatted(text2);
|
||||||
|
if (ImGui.InputInt(text, ref data3, 1, 1) && v4)
|
||||||
|
{
|
||||||
|
base.Configuration.Stop.QuestSequences[text2] = Math.Max(0, Math.Min(255, data3));
|
||||||
|
Save();
|
||||||
|
}
|
||||||
|
}
|
||||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||||
{
|
{
|
||||||
ImGui.SameLine(ImGui.GetContentRegionAvail().X + ImGui.GetStyle().WindowPadding.X - ImGui.CalcTextSize(FontAwesomeIcon.Times.ToIconString()).X - ImGui.GetStyle().FramePadding.X * 2f);
|
ImGui.SameLine(ImGui.GetContentRegionAvail().X + ImGui.GetStyle().WindowPadding.X - ImGui.CalcTextSize(FontAwesomeIcon.Times.ToIconString()).X - ImGui.GetStyle().FramePadding.X * 2f);
|
||||||
|
|
@ -191,6 +235,7 @@ internal sealed class StopConditionComponent : ConfigComponent
|
||||||
if (quest != null)
|
if (quest != null)
|
||||||
{
|
{
|
||||||
base.Configuration.Stop.QuestsToStopAfter.Remove(quest.Id);
|
base.Configuration.Stop.QuestsToStopAfter.Remove(quest.Id);
|
||||||
|
base.Configuration.Stop.QuestSequences.Remove(quest.Id.ToString());
|
||||||
Save();
|
Save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,8 @@ internal sealed class Configuration : IPluginConfiguration
|
||||||
[JsonProperty(ItemConverterType = typeof(ElementIdNConverter))]
|
[JsonProperty(ItemConverterType = typeof(ElementIdNConverter))]
|
||||||
public List<ElementId> QuestsToStopAfter { get; set; } = new List<ElementId>();
|
public List<ElementId> QuestsToStopAfter { get; set; } = new List<ElementId>();
|
||||||
|
|
||||||
|
public Dictionary<string, int?> QuestSequences { get; set; } = new Dictionary<string, int?>();
|
||||||
|
|
||||||
public bool LevelToStopAfter { get; set; }
|
public bool LevelToStopAfter { get; set; }
|
||||||
|
|
||||||
public int TargetLevel { get; set; } = 50;
|
public int TargetLevel { get; set; } = 50;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue