forked from aly/qstbak
muffin v7.4.7
This commit is contained in:
parent
1cc65e495d
commit
63f975ff4f
16 changed files with 1659 additions and 939 deletions
|
|
@ -39,29 +39,27 @@ internal sealed class DutyConfigComponent : ConfigComponent
|
|||
|
||||
private readonly Dictionary<EExpansionVersion, List<DutyInfo>> _allTrialNames;
|
||||
|
||||
private readonly Dictionary<EExpansionVersion, List<DutyInfo>> _allNormalRaidNames;
|
||||
|
||||
private readonly Dictionary<EExpansionVersion, List<DutyInfo>> _allAllianceRaidNames;
|
||||
|
||||
public DutyConfigComponent(IDalamudPluginInterface pluginInterface, Configuration configuration, IDataManager dataManager, QuestRegistry questRegistry, AutoDutyIpc autoDutyIpc, TerritoryData territoryData)
|
||||
: base(pluginInterface, configuration)
|
||||
{
|
||||
_questRegistry = questRegistry;
|
||||
_autoDutyIpc = autoDutyIpc;
|
||||
var source = (from x in dataManager.GetExcelSheet<DawnContent>()
|
||||
where x.RowId != 0 && !x.Unknown16
|
||||
orderby x.Unknown15
|
||||
select x.Content.ValueNullable into x
|
||||
where x.HasValue
|
||||
select x.Value into x
|
||||
_contentFinderConditionNames = (from x in dataManager.GetExcelSheet<ContentFinderCondition>()
|
||||
where x.RowId != 0 && x.Content.RowId != 0 && x.ContentType.RowId == 2
|
||||
select new
|
||||
{
|
||||
Expansion = (EExpansionVersion)x.TerritoryType.Value.ExVersion.RowId,
|
||||
CfcId = x.RowId,
|
||||
Name = (territoryData.GetContentFinderCondition(x.RowId)?.Name ?? "?"),
|
||||
Name = (territoryData.GetContentFinderCondition(x.RowId)?.Name ?? x.Name.ToDalamudString().ToString()),
|
||||
TerritoryId = x.TerritoryType.RowId,
|
||||
ContentType = x.ContentType.RowId,
|
||||
Level = x.ClassJobLevelRequired,
|
||||
SortKey = x.SortKey
|
||||
}).ToList();
|
||||
_contentFinderConditionNames = (from x in source
|
||||
where x.ContentType == 2
|
||||
} 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());
|
||||
_allTrialNames = (from x in dataManager.GetExcelSheet<ContentFinderCondition>()
|
||||
where x.RowId != 0 && x.Content.RowId != 0 && x.ContentType.RowId == 4
|
||||
|
|
@ -76,6 +74,34 @@ internal sealed class DutyConfigComponent : ConfigComponent
|
|||
} 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());
|
||||
_allNormalRaidNames = (from x in dataManager.GetExcelSheet<ContentFinderCondition>()
|
||||
where x.RowId != 0 && x.Content.RowId != 0 && x.ContentType.RowId == 5
|
||||
where x.ContentMemberType.RowId == 3
|
||||
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
|
||||
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());
|
||||
_allAllianceRaidNames = (from x in dataManager.GetExcelSheet<ContentFinderCondition>()
|
||||
where x.RowId != 0 && x.Content.RowId != 0 && x.ContentType.RowId == 5
|
||||
where x.ContentMemberType.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
|
||||
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());
|
||||
}
|
||||
|
||||
public override void DrawTab()
|
||||
|
|
@ -106,6 +132,15 @@ internal sealed class DutyConfigComponent : ConfigComponent
|
|||
}
|
||||
}
|
||||
ImGui.Spacing();
|
||||
bool v2 = base.Configuration.Duties.RunLevelingModeWhenUnderleveled;
|
||||
if (ImGui.Checkbox("Run AutoDuty Leveling mode when underleveled for MSQ", ref v2))
|
||||
{
|
||||
base.Configuration.Duties.RunLevelingModeWhenUnderleveled = v2;
|
||||
Save();
|
||||
}
|
||||
ImGui.SameLine();
|
||||
ImGuiComponents.HelpMarker("When enabled, Questionable will automatically run AutoDuty's Leveling mode when your character is underleveled for the next Main Scenario Quest.\n\nLeveling mode runs the highest available dungeon for your level to gain XP.\n\nThis is useful for characters without the Road to 90 XP buff who may not have enough XP to continue the MSQ.");
|
||||
ImGui.Spacing();
|
||||
ImGui.Text("Default duty mode:");
|
||||
ImGui.SameLine();
|
||||
int currentItem = (int)base.Configuration.Duties.DefaultDutyMode;
|
||||
|
|
@ -128,7 +163,7 @@ internal sealed class DutyConfigComponent : ConfigComponent
|
|||
Util.OpenLink("https://docs.google.com/spreadsheets/d/151RlpqRcCpiD_VbQn6Duf-u-S71EP7d0mx3j1PDNoNA/edit?pli=1#gid=0");
|
||||
}
|
||||
ImGui.Separator();
|
||||
ImGui.Text("You can override the settings for each individual dungeon/trial:");
|
||||
ImGui.Text("You can override the settings for each individual duty:");
|
||||
using ImRaii.IEndObject endObject2 = ImRaii.TabBar("DutyTypeTabs");
|
||||
if (endObject2)
|
||||
{
|
||||
|
|
@ -139,10 +174,24 @@ internal sealed class DutyConfigComponent : ConfigComponent
|
|||
DrawConfigTable(v, _contentFinderConditionNames);
|
||||
}
|
||||
}
|
||||
using ImRaii.IEndObject endObject4 = ImRaii.TabItem("Trials");
|
||||
if (endObject4)
|
||||
using (ImRaii.IEndObject endObject4 = ImRaii.TabItem("Trials"))
|
||||
{
|
||||
DrawConfigTable(v, _allTrialNames);
|
||||
if (endObject4)
|
||||
{
|
||||
DrawConfigTable(v, _allTrialNames);
|
||||
}
|
||||
}
|
||||
using (ImRaii.IEndObject endObject5 = ImRaii.TabItem("Normal Raids"))
|
||||
{
|
||||
if (endObject5)
|
||||
{
|
||||
DrawConfigTable(v, _allNormalRaidNames);
|
||||
}
|
||||
}
|
||||
using ImRaii.IEndObject endObject6 = ImRaii.TabItem("Alliance Raids");
|
||||
if (endObject6)
|
||||
{
|
||||
DrawConfigTable(v, _allAllianceRaidNames);
|
||||
}
|
||||
}
|
||||
DrawEnableAllButton();
|
||||
|
|
@ -375,7 +424,7 @@ internal sealed class DutyConfigComponent : ConfigComponent
|
|||
{
|
||||
base.Configuration.Duties.BlacklistedDutyCfcIds.Clear();
|
||||
base.Configuration.Duties.WhitelistedDutyCfcIds.Clear();
|
||||
foreach (List<DutyInfo> item2 in _contentFinderConditionNames.Values.Concat<List<DutyInfo>>(_allTrialNames.Values))
|
||||
foreach (List<DutyInfo> item2 in _contentFinderConditionNames.Values.Concat<List<DutyInfo>>(_allTrialNames.Values).Concat<List<DutyInfo>>(_allNormalRaidNames.Values).Concat<List<DutyInfo>>(_allAllianceRaidNames.Values))
|
||||
{
|
||||
foreach (var (item, _, _) in item2)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ namespace Questionable.Windows.ConfigComponents;
|
|||
|
||||
internal sealed class StopConditionComponent : ConfigComponent
|
||||
{
|
||||
private static readonly string[] StopModeNames = new string[3] { "Off", "Pause", "Stop" };
|
||||
|
||||
private readonly IDalamudPluginInterface _pluginInterface;
|
||||
|
||||
private readonly QuestSelector _questSelector;
|
||||
|
|
@ -55,6 +57,7 @@ internal sealed class StopConditionComponent : ConfigComponent
|
|||
_questSelector.QuestSelected = delegate(Quest quest)
|
||||
{
|
||||
configuration.Stop.QuestsToStopAfter.Add(quest.Id);
|
||||
configuration.Stop.QuestStopModes[quest.Id.ToString()] = Questionable.Configuration.EStopConditionMode.Stop;
|
||||
stopConditionComponent.Save();
|
||||
};
|
||||
}
|
||||
|
|
@ -67,26 +70,30 @@ internal sealed class StopConditionComponent : ConfigComponent
|
|||
return;
|
||||
}
|
||||
bool v = base.Configuration.Stop.Enabled;
|
||||
if (ImGui.Checkbox("Stop Questionable when any of the conditions below are met", ref v))
|
||||
if (ImGui.Checkbox("Enable stop conditions", ref v))
|
||||
{
|
||||
base.Configuration.Stop.Enabled = v;
|
||||
Save();
|
||||
}
|
||||
ImGui.SameLine();
|
||||
ImGuiComponents.HelpMarker("Pause: Stops automation when condition is met, but allows resuming past it.\nStop: True stop, blocks automation from starting/resuming if condition is already met.");
|
||||
ImGui.Separator();
|
||||
using (ImRaii.Disabled(!v))
|
||||
{
|
||||
ImGui.Text("Stop when character level reaches:");
|
||||
bool v2 = base.Configuration.Stop.LevelToStopAfter;
|
||||
if (ImGui.Checkbox("Enable level stop condition", ref v2))
|
||||
int currentItem = (int)base.Configuration.Stop.LevelStopMode;
|
||||
ImGui.SetNextItemWidth(100f);
|
||||
if (ImGui.Combo((ImU8String)"##LevelMode", ref currentItem, (ReadOnlySpan<string>)StopModeNames, StopModeNames.Length))
|
||||
{
|
||||
base.Configuration.Stop.LevelToStopAfter = v2;
|
||||
base.Configuration.Stop.LevelStopMode = (Configuration.EStopConditionMode)currentItem;
|
||||
Save();
|
||||
}
|
||||
using (ImRaii.Disabled(!v2))
|
||||
ImGui.SameLine();
|
||||
using (ImRaii.Disabled(base.Configuration.Stop.LevelStopMode == Questionable.Configuration.EStopConditionMode.Off))
|
||||
{
|
||||
int data = base.Configuration.Stop.TargetLevel;
|
||||
ImGui.SetNextItemWidth(100f);
|
||||
if (ImGui.InputInt("Stop at level", ref data, 1, 5))
|
||||
if (ImGui.InputInt("Target level", ref data, 1, 5))
|
||||
{
|
||||
base.Configuration.Stop.TargetLevel = Math.Max(1, Math.Min(100, data));
|
||||
Save();
|
||||
|
|
@ -103,18 +110,20 @@ internal sealed class StopConditionComponent : ConfigComponent
|
|||
}
|
||||
}
|
||||
ImGui.Separator();
|
||||
ImGui.Text("Stop on quest sequence:");
|
||||
bool v3 = base.Configuration.Stop.SequenceToStopAfter;
|
||||
if (ImGui.Checkbox("Enable global quest sequence stop condition", ref v3))
|
||||
ImGui.Text("Stop on quest sequence (global):");
|
||||
int currentItem2 = (int)base.Configuration.Stop.SequenceStopMode;
|
||||
ImGui.SetNextItemWidth(100f);
|
||||
if (ImGui.Combo((ImU8String)"##SequenceMode", ref currentItem2, (ReadOnlySpan<string>)StopModeNames, StopModeNames.Length))
|
||||
{
|
||||
base.Configuration.Stop.SequenceToStopAfter = v3;
|
||||
base.Configuration.Stop.SequenceStopMode = (Configuration.EStopConditionMode)currentItem2;
|
||||
Save();
|
||||
}
|
||||
using (ImRaii.Disabled(!v3))
|
||||
ImGui.SameLine();
|
||||
using (ImRaii.Disabled(base.Configuration.Stop.SequenceStopMode == Questionable.Configuration.EStopConditionMode.Off))
|
||||
{
|
||||
int data2 = base.Configuration.Stop.TargetSequence;
|
||||
ImGui.SetNextItemWidth(100f);
|
||||
if (ImGui.InputInt("Stop at sequence", ref data2, 1, 1))
|
||||
if (ImGui.InputInt("Target sequence", ref data2, 1, 1))
|
||||
{
|
||||
base.Configuration.Stop.TargetSequence = Math.Max(0, Math.Min(255, data2));
|
||||
Save();
|
||||
|
|
@ -130,8 +139,8 @@ internal sealed class StopConditionComponent : ConfigComponent
|
|||
text2.AppendLiteral(")");
|
||||
ImGui.TextDisabled(text2);
|
||||
}
|
||||
ImGui.TextWrapped("Note: Individual quest sequences below override this global setting.");
|
||||
}
|
||||
ImGui.TextWrapped("Note: Individual quest sequences below override this global setting.");
|
||||
ImGui.Separator();
|
||||
ImGui.Text("Stop when completing quests (or reaching specific sequences):");
|
||||
DrawCurrentlyAcceptedQuests();
|
||||
|
|
@ -143,11 +152,13 @@ internal sealed class StopConditionComponent : ConfigComponent
|
|||
{
|
||||
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Trash, "Clear All"))
|
||||
{
|
||||
base.Configuration.Stop.QuestsToStopAfter.Clear();
|
||||
foreach (ElementId item in questsToStopAfter)
|
||||
{
|
||||
base.Configuration.Stop.QuestSequences.Remove(item.ToString());
|
||||
string key = item.ToString();
|
||||
base.Configuration.Stop.QuestSequences.Remove(key);
|
||||
base.Configuration.Stop.QuestStopModes.Remove(key);
|
||||
}
|
||||
base.Configuration.Stop.QuestsToStopAfter.Clear();
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
|
@ -186,16 +197,34 @@ internal sealed class StopConditionComponent : ConfigComponent
|
|||
{
|
||||
_questTooltipComponent.Draw(quest2.Info);
|
||||
}
|
||||
ImGui.SameLine();
|
||||
string text3 = elementId.ToString();
|
||||
base.Configuration.Stop.QuestSequences.TryGetValue(text3, out var value);
|
||||
bool v4 = value.HasValue;
|
||||
ImU8String label = new ImU8String(8, 1);
|
||||
label.AppendLiteral("##UseSeq");
|
||||
int currentItem3 = (int)base.Configuration.Stop.QuestStopModes.GetValueOrDefault(text3, Questionable.Configuration.EStopConditionMode.Stop);
|
||||
ImGui.SameLine();
|
||||
ImGui.SetNextItemWidth(70f);
|
||||
ImU8String label = new ImU8String(6, 1);
|
||||
label.AppendLiteral("##Mode");
|
||||
label.AppendFormatted(text3);
|
||||
if (ImGui.Checkbox(label, ref v4))
|
||||
if (ImGui.Combo(label, ref currentItem3, (ReadOnlySpan<string>)StopModeNames, StopModeNames.Length))
|
||||
{
|
||||
if (v4)
|
||||
if (currentItem3 == 0)
|
||||
{
|
||||
quest = quest2;
|
||||
}
|
||||
else
|
||||
{
|
||||
base.Configuration.Stop.QuestStopModes[text3] = (Configuration.EStopConditionMode)currentItem3;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
ImGui.SameLine();
|
||||
base.Configuration.Stop.QuestSequences.TryGetValue(text3, out var value);
|
||||
bool v2 = value.HasValue;
|
||||
ImU8String label2 = new ImU8String(8, 1);
|
||||
label2.AppendLiteral("##UseSeq");
|
||||
label2.AppendFormatted(text3);
|
||||
if (ImGui.Checkbox(label2, ref v2))
|
||||
{
|
||||
if (v2)
|
||||
{
|
||||
base.Configuration.Stop.QuestSequences[text3] = 1;
|
||||
}
|
||||
|
|
@ -209,17 +238,17 @@ internal sealed class StopConditionComponent : ConfigComponent
|
|||
{
|
||||
ImGui.SetTooltip("Stop at specific sequence (unchecked = stop on quest completion)");
|
||||
}
|
||||
using (ImRaii.Disabled(!v4))
|
||||
using (ImRaii.Disabled(!v2))
|
||||
{
|
||||
ImGui.SameLine();
|
||||
ImGui.Text("Seq:");
|
||||
ImGui.SameLine();
|
||||
ImGui.SetNextItemWidth(85f);
|
||||
int data3 = value ?? 1;
|
||||
ImU8String label2 = new ImU8String(10, 1);
|
||||
label2.AppendLiteral("##SeqValue");
|
||||
label2.AppendFormatted(text3);
|
||||
if (ImGui.InputInt(label2, ref data3, 1, 1) && v4)
|
||||
ImU8String label3 = new ImU8String(10, 1);
|
||||
label3.AppendLiteral("##SeqValue");
|
||||
label3.AppendFormatted(text3);
|
||||
if (ImGui.InputInt(label3, ref data3, 1, 1) && v2)
|
||||
{
|
||||
base.Configuration.Stop.QuestSequences[text3] = Math.Max(0, Math.Min(255, data3));
|
||||
Save();
|
||||
|
|
@ -237,8 +266,10 @@ internal sealed class StopConditionComponent : ConfigComponent
|
|||
}
|
||||
if (quest != null)
|
||||
{
|
||||
string key2 = quest.Id.ToString();
|
||||
base.Configuration.Stop.QuestsToStopAfter.Remove(quest.Id);
|
||||
base.Configuration.Stop.QuestSequences.Remove(quest.Id.ToString());
|
||||
base.Configuration.Stop.QuestSequences.Remove(key2);
|
||||
base.Configuration.Stop.QuestStopModes.Remove(key2);
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
|
@ -286,6 +317,7 @@ internal sealed class StopConditionComponent : ConfigComponent
|
|||
if (ImGuiComponents.IconButton($"##Add{item.Id}", FontAwesomeIcon.Plus))
|
||||
{
|
||||
base.Configuration.Stop.QuestsToStopAfter.Add(item.Id);
|
||||
base.Configuration.Stop.QuestStopModes[item.Id.ToString()] = Questionable.Configuration.EStopConditionMode.Stop;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue