1
0
Fork 0
forked from aly/qstbak

muffin v7.5.0

This commit is contained in:
alydev 2026-05-01 05:17:35 +10:00
parent afafd5e377
commit a6481e7b9a
67 changed files with 4281 additions and 2372 deletions

View file

@ -65,28 +65,39 @@ internal sealed class ARealmRebornComponent
private void DrawPrimals()
{
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
bool flag = UIState.IsInstanceContentCompleted(RequiredPrimalInstances.Last());
bool flag2 = _uiUtils.ChecklistItem("Hard Mode Primals", flag, _configuration.Advanced.SkipARealmRebornHardModePrimals ? new System.Numerics.Vector4?(ImGuiColors.DalamudGrey) : ((System.Numerics.Vector4?)null));
if (flag || !flag2)
{
return;
}
using ImRaii.IEndObject endObject = ImRaii.Tooltip();
if (!(!endObject))
TooltipDisposable val = ImRaii.Tooltip();
try
{
ushort[] requiredPrimalInstances = RequiredPrimalInstances;
foreach (ushort instanceId in requiredPrimalInstances)
if (((TooltipDisposable)(ref val)).Alive)
{
(System.Numerics.Vector4 color, FontAwesomeIcon icon) instanceStyle = UiUtils.GetInstanceStyle(instanceId);
FFXIVClientStructs.FFXIV.Common.Math.Vector4 vector = instanceStyle.color;
FontAwesomeIcon item = instanceStyle.icon;
_uiUtils.ChecklistItem(_territoryData.GetInstanceName(instanceId) ?? "?", vector, item, ImGui.GetStyle().FramePadding.X);
ushort[] requiredPrimalInstances = RequiredPrimalInstances;
foreach (ushort instanceId in requiredPrimalInstances)
{
(System.Numerics.Vector4 color, FontAwesomeIcon icon) instanceStyle = UiUtils.GetInstanceStyle(instanceId);
FFXIVClientStructs.FFXIV.Common.Math.Vector4 vector = instanceStyle.color;
FontAwesomeIcon item = instanceStyle.icon;
_uiUtils.ChecklistItem(_territoryData.GetInstanceName(instanceId) ?? "?", vector, item, ImGui.GetStyle().FramePadding.X);
}
}
}
finally
{
((TooltipDisposable)(ref val)).Dispose();
}
}
private void DrawAllianceRaids()
{
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_0063: Unknown result type (might be due to invalid IL or missing references)
QuestFunctions questFunctions = _questFunctions;
IReadOnlyList<QuestId> crystalTowerQuests = QuestData.CrystalTowerQuests;
bool flag = questFunctions.IsQuestComplete(crystalTowerQuests[crystalTowerQuests.Count - 1]);
@ -95,17 +106,24 @@ internal sealed class ARealmRebornComponent
{
return;
}
using ImRaii.IEndObject endObject = ImRaii.Tooltip();
if (!endObject)
TooltipDisposable val = ImRaii.Tooltip();
try
{
return;
if (!((TooltipDisposable)(ref val)).Alive)
{
return;
}
foreach (QuestId crystalTowerQuest in QuestData.CrystalTowerQuests)
{
(System.Numerics.Vector4 Color, FontAwesomeIcon Icon, string Status) questStyle = _uiUtils.GetQuestStyle(crystalTowerQuest);
FFXIVClientStructs.FFXIV.Common.Math.Vector4 vector = questStyle.Color;
FontAwesomeIcon item = questStyle.Icon;
_uiUtils.ChecklistItem(_questData.GetQuestInfo(crystalTowerQuest).Name, vector, item, ImGui.GetStyle().FramePadding.X);
}
}
foreach (QuestId crystalTowerQuest in QuestData.CrystalTowerQuests)
finally
{
(System.Numerics.Vector4 Color, FontAwesomeIcon Icon, string Status) questStyle = _uiUtils.GetQuestStyle(crystalTowerQuest);
FFXIVClientStructs.FFXIV.Common.Math.Vector4 vector = questStyle.Color;
FontAwesomeIcon item = questStyle.Icon;
_uiUtils.ChecklistItem(_questData.GetQuestInfo(crystalTowerQuest).Name, vector, item, ImGui.GetStyle().FramePadding.X);
((TooltipDisposable)(ref val)).Dispose();
}
}
}

View file

@ -61,7 +61,7 @@ internal sealed class ActiveQuestComponent
public event EventHandler? Reload;
[GeneratedRegex("\\s\\s+", RegexOptions.IgnoreCase, "en-US")]
[GeneratedCode("System.Text.RegularExpressions.Generator", "10.0.14.15411")]
[GeneratedCode("System.Text.RegularExpressions.Generator", "10.0.14.21808")]
private static Regex MultipleWhitespaceRegex()
{
return _003CRegexGenerator_g_003EFBB8301322196CF81C64F1652C2FA6E1D6BF3907141F781E9D97ABED51BF056C4__MultipleWhitespaceRegex_0.Instance;
@ -90,6 +90,8 @@ internal sealed class ActiveQuestComponent
public void Draw(bool isMinimized)
{
//IL_0150: Unknown result type (might be due to invalid IL or missing references)
//IL_0157: Expected O, but got Unknown
if (_fateController.IsRunning)
{
DrawFateActive(isMinimized);
@ -116,17 +118,27 @@ internal sealed class ActiveQuestComponent
string currentTaskState = _questController.CurrentTaskState;
if (currentTaskState != null)
{
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudOrange))
ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudOrange, true);
try
{
ImGui.TextUnformatted(currentTaskState);
}
finally
{
((IDisposable)val)?.Dispose();
}
}
else
{
using (ImRaii.Disabled())
DisabledDisposable val2 = ImRaii.Disabled();
try
{
ImGui.TextUnformatted(_questController.DebugState ?? string.Empty);
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
}
try
@ -135,7 +147,8 @@ internal sealed class ActiveQuestComponent
QuestStep questStep = questSequence?.FindStep(questProgress.Step);
if (!isMinimized)
{
using (ImRaii.Color color = new ImRaii.Color())
ColorDisposable val3 = new ColorDisposable();
try
{
bool flag;
if (questStep != null)
@ -152,10 +165,14 @@ internal sealed class ActiveQuestComponent
IL_017e:
if (flag)
{
color.Push(ImGuiCol.Text, ImGuiColors.DalamudOrange);
val3.Push(ImGuiCol.Text, ImGuiColors.DalamudOrange, true);
}
ImGui.TextUnformatted(questStep?.Comment ?? questSequence?.Comment ?? questProgress.Quest.Root.Comment ?? string.Empty);
}
finally
{
((IDisposable)val3)?.Dispose();
}
ImGui.Text(_questController.ToStatString());
}
DrawQuestButtons(questProgress, questStep, questProgressInfo, isMinimized);
@ -191,7 +208,8 @@ internal sealed class ActiveQuestComponent
text2.AppendFormatted((item2 == 1) ? string.Empty : "s");
text2.AppendLiteral(" - Leveling mode will start automatically");
ImGui.TextColored(in col, text2);
using (ImRaii.Disabled(_questController.IsRunning || _fateController.IsRunning || _seasonalDutyController.IsRunning || !_autoDutyIpc.IsStopped()))
DisabledDisposable val4 = ImRaii.Disabled(_questController.IsRunning || _fateController.IsRunning || _seasonalDutyController.IsRunning || !_autoDutyIpc.IsStopped());
try
{
if (ImGuiComponents.IconButton(FontAwesomeIcon.Play))
{
@ -206,6 +224,10 @@ internal sealed class ActiveQuestComponent
}
}
}
finally
{
((IDisposable)val4)?.Dispose();
}
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
{
if (!_autoDutyIpc.IsStopped())
@ -262,13 +284,18 @@ internal sealed class ActiveQuestComponent
private void DrawFateActive(bool isMinimized)
{
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGold))
ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGold, true);
try
{
ImU8String text = new ImU8String(6, 1);
text.AppendLiteral("FATE: ");
text.AppendFormatted(Shorten(_fateController.CurrentFate.Name));
ImGui.TextUnformatted(text);
}
finally
{
((IDisposable)val)?.Dispose();
}
IList<string> remainingTaskNames = _fateController.GetRemainingTaskNames();
if (remainingTaskNames.Count > 0)
{
@ -288,13 +315,18 @@ internal sealed class ActiveQuestComponent
private void DrawDutyActive(bool isMinimized)
{
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen))
ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen, true);
try
{
ImU8String text = new ImU8String(6, 1);
text.AppendLiteral("Duty: ");
text.AppendFormatted(Shorten(_seasonalDutyController.CurrentDuty.Name));
ImGui.TextUnformatted(text);
}
finally
{
((IDisposable)val)?.Dispose();
}
IList<string> remainingTaskNames = _seasonalDutyController.GetRemainingTaskNames();
if (remainingTaskNames.Count > 0)
{
@ -314,9 +346,14 @@ internal sealed class ActiveQuestComponent
private void DrawQuestNames(QuestController.QuestProgress currentQuest, QuestController.ECurrentQuestType? currentQuestType)
{
//IL_0709: Unknown result type (might be due to invalid IL or missing references)
//IL_070e: Unknown result type (might be due to invalid IL or missing references)
//IL_03c9: Unknown result type (might be due to invalid IL or missing references)
//IL_03ce: Unknown result type (might be due to invalid IL or missing references)
if (currentQuestType == QuestController.ECurrentQuestType.Simulated)
{
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed))
ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed, true);
try
{
ImU8String text = new ImU8String(26, 4);
text.AppendLiteral("Simulated Quest: ");
@ -330,10 +367,15 @@ internal sealed class ActiveQuestComponent
ImGui.TextUnformatted(text);
return;
}
finally
{
((IDisposable)val)?.Dispose();
}
}
if (currentQuestType == QuestController.ECurrentQuestType.Gathering)
{
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGold))
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGold, true);
try
{
ImU8String text2 = new ImU8String(20, 4);
text2.AppendLiteral("Gathering: ");
@ -347,6 +389,10 @@ internal sealed class ActiveQuestComponent
ImGui.TextUnformatted(text2);
return;
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
QuestController.QuestProgress startedQuest = _questController.StartedQuest;
if (startedQuest != null)
@ -403,91 +449,98 @@ internal sealed class ActiveQuestComponent
ImGui.TextColored(in col, SeIconChar.Clock.ToIconString());
if (ImGui.IsItemHovered())
{
using ImRaii.IEndObject endObject = ImRaii.Tooltip();
if (endObject)
TooltipDisposable val3 = ImRaii.Tooltip();
try
{
ImGui.Text("Stop Conditions:");
ImGui.Separator();
if (flag)
if (((TooltipDisposable)(ref val3)).Alive)
{
int num2 = _objectTable.LocalPlayer?.Level ?? 0;
ImU8String text4 = new ImU8String(14, 1);
text4.AppendLiteral("Stop at level ");
text4.AppendFormatted(_configuration.Stop.TargetLevel);
ImGui.BulletText(text4);
if (num2 > 0)
ImGui.Text("Stop Conditions:");
ImGui.Separator();
if (flag)
{
int num2 = _objectTable.LocalPlayer?.Level ?? 0;
ImU8String text4 = new ImU8String(14, 1);
text4.AppendLiteral("Stop at level ");
text4.AppendFormatted(_configuration.Stop.TargetLevel);
ImGui.BulletText(text4);
if (num2 > 0)
{
ImGui.SameLine();
if (num2 >= _configuration.Stop.TargetLevel)
{
Vector4 col2 = ImGuiColors.ParsedGreen;
ImU8String text5 = new ImU8String(22, 1);
text5.AppendLiteral("(Current: ");
text5.AppendFormatted(num2);
text5.AppendLiteral(" - Reached!)");
ImGui.TextColored(in col2, text5);
}
else
{
Vector4 col2 = ImGuiColors.ParsedBlue;
ImU8String text6 = new ImU8String(11, 1);
text6.AppendLiteral("(Current: ");
text6.AppendFormatted(num2);
text6.AppendLiteral(")");
ImGui.TextColored(in col2, text6);
}
}
}
if (flag3)
{
if (flag)
{
ImGui.Spacing();
}
int sequence = startedQuest.Sequence;
ImU8String text7 = new ImU8String(23, 1);
text7.AppendLiteral("Stop at quest sequence ");
text7.AppendFormatted(_configuration.Stop.TargetSequence);
ImGui.BulletText(text7);
ImGui.SameLine();
if (num2 >= _configuration.Stop.TargetLevel)
if (sequence >= _configuration.Stop.TargetSequence)
{
Vector4 col2 = ImGuiColors.ParsedGreen;
ImU8String text5 = new ImU8String(22, 1);
text5.AppendLiteral("(Current: ");
text5.AppendFormatted(num2);
text5.AppendLiteral(" - Reached!)");
ImGui.TextColored(in col2, text5);
ImU8String text8 = new ImU8String(22, 1);
text8.AppendLiteral("(Current: ");
text8.AppendFormatted(sequence);
text8.AppendLiteral(" - Reached!)");
ImGui.TextColored(in col2, text8);
}
else
{
Vector4 col2 = ImGuiColors.ParsedBlue;
ImU8String text6 = new ImU8String(11, 1);
text6.AppendLiteral("(Current: ");
text6.AppendFormatted(num2);
text6.AppendLiteral(")");
ImGui.TextColored(in col2, text6);
ImU8String text9 = new ImU8String(11, 1);
text9.AppendLiteral("(Current: ");
text9.AppendFormatted(sequence);
text9.AppendLiteral(")");
ImGui.TextColored(in col2, text9);
}
}
}
if (flag3)
{
if (flag)
if (flag2)
{
ImGui.Spacing();
}
int sequence = startedQuest.Sequence;
ImU8String text7 = new ImU8String(23, 1);
text7.AppendLiteral("Stop at quest sequence ");
text7.AppendFormatted(_configuration.Stop.TargetSequence);
ImGui.BulletText(text7);
ImGui.SameLine();
if (sequence >= _configuration.Stop.TargetSequence)
{
Vector4 col2 = ImGuiColors.ParsedGreen;
ImU8String text8 = new ImU8String(22, 1);
text8.AppendLiteral("(Current: ");
text8.AppendFormatted(sequence);
text8.AppendLiteral(" - Reached!)");
ImGui.TextColored(in col2, text8);
}
else
{
Vector4 col2 = ImGuiColors.ParsedBlue;
ImU8String text9 = new ImU8String(11, 1);
text9.AppendLiteral("(Current: ");
text9.AppendFormatted(sequence);
text9.AppendLiteral(")");
ImGui.TextColored(in col2, text9);
}
}
if (flag2)
{
if (flag || flag3)
{
ImGui.Spacing();
}
ImGui.BulletText("Stop after completing any of these quests:");
ImGui.Indent();
foreach (ElementId item in _configuration.Stop.QuestsToStopAfter)
{
if (_questRegistry.TryGetQuest(item, out Quest quest))
if (flag || flag3)
{
var (color, icon, _) = _uiUtils.GetQuestStyle(item);
_uiUtils.ChecklistItem($"{quest.Info.Name} ({item})", color, icon);
ImGui.Spacing();
}
ImGui.BulletText("Stop after completing any of these quests:");
ImGui.Indent();
foreach (ElementId item in _configuration.Stop.QuestsToStopAfter)
{
if (_questRegistry.TryGetQuest(item, out Quest quest))
{
var (color, icon, _) = _uiUtils.GetQuestStyle(item);
_uiUtils.ChecklistItem($"{quest.Info.Name} ({item})", color, icon);
}
}
ImGui.Unindent();
}
ImGui.Unindent();
}
}
finally
{
((TooltipDisposable)(ref val3)).Dispose();
}
}
}
if (_configuration.Advanced.AdditionalStatusInformation && _questController.IsInterruptible())
@ -496,65 +549,73 @@ internal sealed class ActiveQuestComponent
ImGui.TextColored(ImGuiColors.DalamudYellow, SeIconChar.Hyadelyn.ToIconString());
if (ImGui.IsItemHovered())
{
using ImRaii.IEndObject endObject2 = ImRaii.Tooltip();
if (endObject2)
TooltipDisposable val4 = ImRaii.Tooltip();
try
{
ImGui.Text("This quest sequence starts with a teleport to an Aetheryte.");
ImGui.Text("Certain priority quest (e.g. class quests) may be started/completed by the plugin prior to continuing with this quest.");
ImGui.Separator();
ImGui.Text("Available priority quests:");
List<PriorityQuestInfo> nextPriorityQuestsThatCanBeAccepted = _questFunctions.GetNextPriorityQuestsThatCanBeAccepted();
List<ElementId> list = (from x in nextPriorityQuestsThatCanBeAccepted
where x.IsAvailable
select x.QuestId).ToList();
if (list.Count > 0)
if (((TooltipDisposable)(ref val4)).Alive)
{
foreach (ElementId item2 in list)
ImGui.Text("This quest sequence starts with a teleport to an Aetheryte.");
ImGui.Text("Certain priority quest (e.g. class quests) may be started/completed by the plugin prior to continuing with this quest.");
ImGui.Separator();
ImGui.Text("Available priority quests:");
List<PriorityQuestInfo> nextPriorityQuestsThatCanBeAccepted = _questFunctions.GetNextPriorityQuestsThatCanBeAccepted();
List<ElementId> list = (from x in nextPriorityQuestsThatCanBeAccepted
where x.IsAvailable
select x.QuestId).ToList();
if (list.Count > 0)
{
if (_questRegistry.TryGetQuest(item2, out Quest quest2))
foreach (ElementId item2 in list)
{
ImU8String text10 = new ImU8String(3, 2);
text10.AppendFormatted(quest2.Info.Name);
text10.AppendLiteral(" (");
text10.AppendFormatted(item2);
text10.AppendLiteral(")");
ImGui.BulletText(text10);
if (_questRegistry.TryGetQuest(item2, out Quest quest2))
{
ImU8String text10 = new ImU8String(3, 2);
text10.AppendFormatted(quest2.Info.Name);
text10.AppendLiteral(" (");
text10.AppendFormatted(item2);
text10.AppendLiteral(")");
ImGui.BulletText(text10);
}
}
}
}
else
{
ImGui.BulletText("(none)");
}
if (_configuration.Advanced.AdditionalStatusInformation)
{
List<PriorityQuestInfo> list2 = nextPriorityQuestsThatCanBeAccepted.Where((PriorityQuestInfo x) => !x.IsAvailable).ToList();
if (list2.Count > 0)
else
{
ImGui.Text("Unavailable priority quests:");
foreach (var (elementId2, value) in list2)
ImGui.BulletText("(none)");
}
if (_configuration.Advanced.AdditionalStatusInformation)
{
List<PriorityQuestInfo> list2 = nextPriorityQuestsThatCanBeAccepted.Where((PriorityQuestInfo x) => !x.IsAvailable).ToList();
if (list2.Count > 0)
{
if (_questRegistry.TryGetQuest(elementId2, out Quest quest3))
ImGui.Text("Unavailable priority quests:");
foreach (var (elementId2, value) in list2)
{
ImU8String text12 = new ImU8String(6, 3);
text12.AppendFormatted(quest3.Info.Name);
text12.AppendLiteral(" (");
text12.AppendFormatted(elementId2);
text12.AppendLiteral(") - ");
text12.AppendFormatted(value);
ImGui.BulletText(text12);
if (_questRegistry.TryGetQuest(elementId2, out Quest quest3))
{
ImU8String text12 = new ImU8String(6, 3);
text12.AppendFormatted(quest3.Info.Name);
text12.AppendLiteral(" (");
text12.AppendFormatted(elementId2);
text12.AppendLiteral(") - ");
text12.AppendFormatted(value);
ImGui.BulletText(text12);
}
}
}
}
}
}
finally
{
((TooltipDisposable)(ref val4)).Dispose();
}
}
}
}
QuestController.QuestProgress nextQuest = _questController.NextQuest;
if (nextQuest != null)
{
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow))
ColorDisposable val5 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow, true);
try
{
ImU8String text13 = new ImU8String(21, 4);
text13.AppendLiteral("Next Quest: ");
@ -567,6 +628,10 @@ internal sealed class ActiveQuestComponent
text13.AppendFormatted(nextQuest.Step);
ImGui.TextUnformatted(text13);
}
finally
{
((IDisposable)val5)?.Dispose();
}
}
}
@ -580,8 +645,9 @@ internal sealed class ActiveQuestComponent
return questProgressInfo;
}
Vector4* styleColorVec = ImGui.GetStyleColorVec4(ImGuiCol.TextDisabled);
Vector4 color = ((styleColorVec == null) ? ImGuiColors.ParsedOrange : (*styleColorVec));
using (ImRaii.PushColor(ImGuiCol.Text, color))
Vector4 vector = ((styleColorVec == null) ? ImGuiColors.ParsedOrange : (*styleColorVec));
ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, vector, true);
try
{
ImU8String text = new ImU8String(0, 1);
text.AppendFormatted(questProgressInfo);
@ -608,10 +674,15 @@ internal sealed class ActiveQuestComponent
ImGui.Text(text3);
}
}
finally
{
((IDisposable)val)?.Dispose();
}
}
else if (currentQuest.Quest.Id is QuestId)
{
using (ImRaii.Disabled())
DisabledDisposable val2 = ImRaii.Disabled();
try
{
if (currentQuest.Quest.Id == _questController.NextQuest?.Quest.Id)
{
@ -622,13 +693,18 @@ internal sealed class ActiveQuestComponent
ImGui.TextUnformatted("(Not accepted)");
}
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
return questProgressInfo;
}
private void DrawQuestButtons(QuestController.QuestProgress currentQuest, QuestStep? currentStep, QuestProgressInfo? questProgressInfo, bool isMinimized)
{
using (ImRaii.Disabled(_questController.IsRunning || _fateController.IsRunning || _seasonalDutyController.IsRunning))
DisabledDisposable val = ImRaii.Disabled(_questController.IsRunning || _fateController.IsRunning || _seasonalDutyController.IsRunning);
try
{
if (ImGuiComponents.IconButton(FontAwesomeIcon.Play))
{
@ -647,6 +723,10 @@ internal sealed class ActiveQuestComponent
}
}
}
finally
{
((IDisposable)val)?.Dispose();
}
ImGui.SameLine();
if (ImGuiComponents.IconButton(FontAwesomeIcon.Stop))
{
@ -666,10 +746,12 @@ internal sealed class ActiveQuestComponent
}
bool flag = currentStep == currentQuest.Quest.FindSequence(currentQuest.Sequence)?.Steps.LastOrDefault();
WaitAtEnd.WaitNextStepOrSequence task;
bool condition = currentStep != null && !flag && currentStep.InteractionType == EInteractionType.Instruction && _questController.HasCurrentTaskMatching<WaitAtEnd.WaitNextStepOrSequence>(out task);
using (ImRaii.Disabled(flag))
bool flag2 = currentStep != null && !flag && currentStep.InteractionType == EInteractionType.Instruction && _questController.HasCurrentTaskMatching<WaitAtEnd.WaitNextStepOrSequence>(out task);
val = ImRaii.Disabled(flag);
try
{
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen, condition))
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen, flag2);
try
{
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.ArrowCircleRight, "Skip"))
{
@ -681,6 +763,14 @@ internal sealed class ActiveQuestComponent
ImGui.SetTooltip("Skip the current step of the quest path.");
}
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
finally
{
((IDisposable)val)?.Dispose();
}
if (_commandManager.Commands.ContainsKey("/questinfo"))
{
@ -739,7 +829,8 @@ internal sealed class ActiveQuestComponent
{
return;
}
using (ImRaii.PushId("SimulatedStep"))
IdDisposable val = ImRaii.PushId((ImU8String)"SimulatedStep", true);
try
{
ImU8String text2 = new ImU8String(9, 2);
text2.AppendLiteral("Step: ");
@ -776,6 +867,10 @@ internal sealed class ActiveQuestComponent
_questController.Stop("ClearSim");
}
}
finally
{
((IDisposable)val)?.Dispose();
}
}
private static string Shorten(string text)

View file

@ -171,10 +171,11 @@ internal sealed class EventInfoComponent
{
continue;
}
ImU8String id = new ImU8String(21, 1);
id.AppendLiteral("##EventQuestSelection");
id.AppendFormatted(questId);
using (ImRaii.PushId(id))
ImU8String imU8String = new ImU8String(21, 1);
imU8String.AppendLiteral("##EventQuestSelection");
imU8String.AppendFormatted(questId);
IdDisposable val = ImRaii.PushId(imU8String, true);
try
{
string name = _questData.GetQuestInfo(questId).Name;
if (list.Contains(questId) && _questRegistry.TryGetQuest(questId, out Questionable.Model.Quest quest))
@ -203,6 +204,10 @@ internal sealed class EventInfoComponent
}
}
}
finally
{
((IDisposable)val)?.Dispose();
}
}
}

View file

@ -57,6 +57,9 @@ internal sealed class ManualPriorityComponent
public void Draw()
{
//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
ImGui.TextWrapped("When you have an active Main Scenario Quest, Questionable will prioritise quests in this order:");
ImGui.BulletText("Priority quests: class quests, A Realm Reborn primals and raids");
ImGui.BulletText("Supported quests from your Journal's To-Do list (always visible on-screen quests)");
@ -70,23 +73,34 @@ internal sealed class ManualPriorityComponent
{
ImGui.Text("Priority queue (drag arrow buttons to reorder):");
}
using (ImRaii.IEndObject endObject = ImRaii.Child("ManualPriorityList", new Vector2(-1f, -27f), border: true))
ChildDisposable val = ImRaii.Child((ImU8String)"ManualPriorityList", new Vector2(-1f, -27f), true);
try
{
if (endObject)
if (ChildDisposable.op_Implicit(val))
{
DrawQuestList();
}
}
finally
{
((ChildDisposable)(ref val)).Dispose();
}
List<ElementId> list = ParseClipboardItems();
using (ImRaii.Disabled(list.Count == 0))
DisabledDisposable val2 = ImRaii.Disabled(list.Count == 0);
try
{
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Download, "Import from Clipboard"))
{
ImportFromClipboard(list);
}
}
finally
{
((IDisposable)val2)?.Dispose();
}
ImGui.SameLine();
using (ImRaii.Disabled(_questController.ManualPriorityQuests.Count == 0))
val2 = ImRaii.Disabled(_questController.ManualPriorityQuests.Count == 0);
try
{
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Upload, "Export to Clipboard"))
{
@ -98,18 +112,27 @@ internal sealed class ManualPriorityComponent
_questController.SavePriorityQuests();
}
ImGui.SameLine();
using (ImRaii.Disabled(!ImGui.IsKeyDown(ImGuiKey.ModCtrl)))
DisabledDisposable val3 = ImRaii.Disabled(!ImGui.IsKeyDown(ImGuiKey.ModCtrl));
try
{
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Trash, "Clear All"))
{
_questController.ClearQuestPriority();
}
}
finally
{
((IDisposable)val3)?.Dispose();
}
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
{
ImGui.SetTooltip("Hold CTRL to enable this button.");
}
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
private void DrawQuestList()
@ -131,10 +154,11 @@ internal sealed class ManualPriorityComponent
{
Vector2 item = ImGui.GetCursorScreenPos() + new Vector2(0f, (0f - ImGui.GetStyle().ItemSpacing.Y) / 2f);
Quest quest3 = manualPriorityQuests[i];
ImU8String id = new ImU8String(5, 1);
id.AppendLiteral("Quest");
id.AppendFormatted(quest3.Id);
using (ImRaii.PushId(id))
ImU8String imU8String = new ImU8String(5, 1);
imU8String.AppendLiteral("Quest");
imU8String.AppendFormatted(quest3.Id);
IdDisposable val = ImRaii.PushId(imU8String, true);
try
{
ImGui.AlignTextToFramePadding();
ImU8String text = new ImU8String(1, 1);
@ -160,10 +184,15 @@ internal sealed class ManualPriorityComponent
}
if (manualPriorityQuests.Count > 1)
{
using (ImRaii.PushFont(UiBuilder.IconFont))
FontDisposable val2 = ImRaii.PushFont(UiBuilder.IconFont, true);
try
{
ImGui.SameLine(ImGui.GetContentRegionAvail().X + ImGui.GetStyle().WindowPadding.X - ImGui.CalcTextSize(FontAwesomeIcon.ArrowsUpDown.ToIconString()).X - ImGui.CalcTextSize(FontAwesomeIcon.Times.ToIconString()).X - ImGui.GetStyle().FramePadding.X * 4f - ImGui.GetStyle().ItemSpacing.X);
}
finally
{
((IDisposable)val2)?.Dispose();
}
if (_draggedItem == quest3.Id)
{
ImGuiComponents.IconButton("##Move", FontAwesomeIcon.ArrowsUpDown, ImGui.ColorConvertU32ToFloat4(ImGui.GetColorU32(ImGuiCol.ButtonActive)));
@ -180,16 +209,25 @@ internal sealed class ManualPriorityComponent
}
else
{
using (ImRaii.PushFont(UiBuilder.IconFont))
FontDisposable val2 = ImRaii.PushFont(UiBuilder.IconFont, true);
try
{
ImGui.SameLine(ImGui.GetContentRegionAvail().X + ImGui.GetStyle().WindowPadding.X - ImGui.CalcTextSize(FontAwesomeIcon.Times.ToIconString()).X - ImGui.GetStyle().FramePadding.X * 2f);
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
if (ImGuiComponents.IconButton($"##Remove{i}", FontAwesomeIcon.Times))
{
quest = quest3;
}
}
finally
{
((IDisposable)val)?.Dispose();
}
Vector2 item2 = new Vector2(item.X + x, ImGui.GetCursorScreenPos().Y - ImGui.GetStyle().ItemSpacing.Y + 2f);
list.Add((item, item2));
}

View file

@ -77,25 +77,38 @@ internal sealed class PresetBuilderComponent
public void Draw()
{
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
ImGui.TextWrapped("Quest presets allow you to quickly add related quests to your priority list. These are useful for unlocking content that may be required later.");
ImGui.Spacing();
using (ImRaii.IEndObject endObject = ImRaii.Child("PresetList", new Vector2(-1f, -27f), border: true))
ChildDisposable val = ImRaii.Child((ImU8String)"PresetList", new Vector2(-1f, -27f), true);
try
{
if (endObject)
if (ChildDisposable.op_Implicit(val))
{
DrawPresetGroups();
}
}
finally
{
((ChildDisposable)(ref val)).Dispose();
}
List<ElementId> list = (from questId in GetAllPresetQuests()
where _questController.ManualPriorityQuests.Any((Quest q) => q.Id.Equals(questId))
select questId).ToList();
using (ImRaii.Disabled(list.Count == 0))
DisabledDisposable val2 = ImRaii.Disabled(list.Count == 0);
try
{
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Trash, $"Clear All Preset Quests ({list.Count})"))
{
ClearAllPresetQuests(list);
}
}
finally
{
((IDisposable)val2)?.Dispose();
}
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
{
if (list.Count == 0)
@ -131,7 +144,8 @@ internal sealed class PresetBuilderComponent
QuestPreset value;
if (DrawGroupHeader("Aether Currents", "Unlock aether currents in various expansion zones to enable flying.", orderedEnumerable))
{
using (ImRaii.PushIndent())
IndentDisposable val = ImRaii.PushIndent(1, true);
try
{
foreach (KeyValuePair<string, QuestPreset> item in orderedEnumerable)
{
@ -141,10 +155,15 @@ internal sealed class PresetBuilderComponent
DrawPreset(key2, preset);
}
}
finally
{
((IDisposable)val)?.Dispose();
}
}
if (DrawGroupHeader("City Aethernet", "Unlock aethernet shards in major cities to enable city teleports.", orderedEnumerable2))
{
using (ImRaii.PushIndent())
IndentDisposable val2 = ImRaii.PushIndent(1, true);
try
{
foreach (KeyValuePair<string, QuestPreset> item2 in orderedEnumerable2)
{
@ -154,12 +173,17 @@ internal sealed class PresetBuilderComponent
DrawPreset(key3, preset2);
}
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
if (!orderedEnumerable3.Any() || !DrawGroupHeader("Content Unlocks", "Essential quest series and unlocks that may be required for progression.", orderedEnumerable3))
{
return;
}
using (ImRaii.PushIndent())
IndentDisposable val3 = ImRaii.PushIndent(1, true);
try
{
foreach (KeyValuePair<string, QuestPreset> item3 in orderedEnumerable3)
{
@ -169,6 +193,10 @@ internal sealed class PresetBuilderComponent
DrawPreset(key4, preset3);
}
}
finally
{
((IDisposable)val3)?.Dispose();
}
}
private bool DrawGroupHeader(string groupName, string groupDescription, IEnumerable<KeyValuePair<string, QuestPreset>> presets)
@ -221,7 +249,8 @@ internal sealed class PresetBuilderComponent
private void DrawPreset(string key, QuestPreset preset)
{
using (ImRaii.PushId(key))
IdDisposable val = ImRaii.PushId((ImU8String)key, true);
try
{
List<ElementId> availableQuestsForPreset = GetAvailableQuestsForPreset(preset);
List<ElementId> completedQuestsForPreset = GetCompletedQuestsForPreset(preset);
@ -262,7 +291,8 @@ internal sealed class PresetBuilderComponent
{
return;
}
using (ImRaii.PushIndent())
IndentDisposable val2 = ImRaii.PushIndent(1, true);
try
{
ImGui.TextWrapped(preset.Description);
ImGui.Spacing();
@ -362,6 +392,14 @@ internal sealed class PresetBuilderComponent
_uiUtils.ChecklistItem("No applicable quests found", ImGuiColors.DalamudGrey, FontAwesomeIcon.Minus);
goto IL_03d8;
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
finally
{
((IDisposable)val)?.Dispose();
}
}

View file

@ -62,18 +62,33 @@ internal sealed class QuestSequenceComponent
ImGui.TextColored(new Vector4(0.98f, 0.98f, 1f, 1f), "Quest Sequence Viewer");
ImGui.SameLine(x - 35f);
ImGui.SetCursorPosY(ImGui.GetCursorPosY() - num2 + ImGui.GetStyle().ItemSpacing.Y);
using (ImRaii.PushColor(ImGuiCol.Button, Vector4.Zero))
ColorDisposable val = ImRaii.PushColor(ImGuiCol.Button, Vector4.Zero, true);
try
{
using (ImRaii.PushColor(ImGuiCol.ButtonHovered, new Vector4(0.8f, 0.3f, 0.3f, 0.4f)))
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.ButtonHovered, new Vector4(0.8f, 0.3f, 0.3f, 0.4f), true);
try
{
using (ImRaii.PushColor(ImGuiCol.ButtonActive, new Vector4(0.9f, 0.2f, 0.2f, 0.6f)))
ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.ButtonActive, new Vector4(0.9f, 0.2f, 0.2f, 0.6f), true);
try
{
if (ImGuiComponents.IconButton(FontAwesomeIcon.Times))
{
isOpen = false;
}
}
finally
{
((IDisposable)val3)?.Dispose();
}
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
finally
{
((IDisposable)val)?.Dispose();
}
ImGui.SetCursorPosY(cursorScreenPos.Y + num - ImGui.GetCursorScreenPos().Y + ImGui.GetCursorPosY());
}
@ -131,29 +146,40 @@ internal sealed class QuestSequenceComponent
windowDrawList.AddRect(cursorScreenPos, cursorScreenPos + new Vector2(x, y), ImGui.ColorConvertFloat4ToU32(new Vector4(0.6f, 0.5f, 0.8f, 0.2f)), 4f, ImDrawFlags.None, 1f);
ImGui.SetCursorPosY(ImGui.GetCursorPosY() + ImGui.GetStyle().ItemSpacing.Y * 1.5f);
ImGui.SetCursorPosX(ImGui.GetCursorPosX() + 10f);
using (ImRaii.PushFont(UiBuilder.IconFont))
FontDisposable val = ImRaii.PushFont(UiBuilder.IconFont, true);
try
{
ImGui.TextColored(new Vector4(0.7f, 0.6f, 0.9f, 1f), FontAwesomeIcon.Search.ToIconString());
}
finally
{
((IDisposable)val)?.Dispose();
}
ImGui.SameLine();
float x2 = ImGui.GetStyle().ItemSpacing.X;
float num = 10f;
float num2 = 10f;
float num3 = ImGui.CalcTextSize("Search").X + ImGui.CalcTextSize(FontAwesomeIcon.Search.ToIconString()).X + ImGui.GetStyle().FramePadding.X * 4f + x2;
ImGui.SetNextItemWidth(x - num3 - x2 * 3f - num - num2);
using (ImRaii.PushColor(ImGuiCol.FrameBg, new Vector4(0.08f, 0.06f, 0.12f, 0.8f)))
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.FrameBg, new Vector4(0.08f, 0.06f, 0.12f, 0.8f), true);
try
{
using (ImRaii.PushColor(ImGuiCol.FrameBgHovered, new Vector4(0.12f, 0.1f, 0.18f, 0.9f)))
ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.FrameBgHovered, new Vector4(0.12f, 0.1f, 0.18f, 0.9f), true);
try
{
using (ImRaii.PushColor(ImGuiCol.FrameBgActive, new Vector4(0.15f, 0.13f, 0.22f, 1f)))
ColorDisposable val4 = ImRaii.PushColor(ImGuiCol.FrameBgActive, new Vector4(0.15f, 0.13f, 0.22f, 1f), true);
try
{
bool flag = ImGui.InputTextWithHint("##QuestLookup", "Enter quest ID...", ref _questLookupInput, 10, ImGuiInputTextFlags.EnterReturnsTrue);
ImGui.SameLine();
using (ImRaii.PushColor(ImGuiCol.Button, new Vector4(0.25f, 0.22f, 0.32f, 0.8f)))
ColorDisposable val5 = ImRaii.PushColor(ImGuiCol.Button, new Vector4(0.25f, 0.22f, 0.32f, 0.8f), true);
try
{
using (ImRaii.PushColor(ImGuiCol.ButtonHovered, new Vector4(0.35f, 0.3f, 0.45f, 0.9f)))
ColorDisposable val6 = ImRaii.PushColor(ImGuiCol.ButtonHovered, new Vector4(0.35f, 0.3f, 0.45f, 0.9f), true);
try
{
using (ImRaii.PushColor(ImGuiCol.ButtonActive, new Vector4(0.4f, 0.35f, 0.5f, 1f)))
ColorDisposable val7 = ImRaii.PushColor(ImGuiCol.ButtonActive, new Vector4(0.4f, 0.35f, 0.5f, 1f), true);
try
{
bool flag2 = ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Search, "Search");
if (flag || flag2)
@ -168,10 +194,34 @@ internal sealed class QuestSequenceComponent
}
}
}
finally
{
((IDisposable)val7)?.Dispose();
}
}
finally
{
((IDisposable)val6)?.Dispose();
}
}
finally
{
((IDisposable)val5)?.Dispose();
}
}
finally
{
((IDisposable)val4)?.Dispose();
}
}
finally
{
((IDisposable)val3)?.Dispose();
}
}
finally
{
((IDisposable)val2)?.Dispose();
}
ImGui.SetCursorPosY(ImGui.GetCursorPosY() + ImGui.GetStyle().ItemSpacing.Y * 1.5f);
ImGui.Spacing();
@ -255,11 +305,14 @@ internal sealed class QuestSequenceComponent
ImGui.TextColored(in col, text);
ImGui.SameLine();
ImGui.SetCursorPosX(ImGui.GetCursorPosX() + 8f);
using (ImRaii.PushColor(ImGuiCol.Button, new Vector4(0.18f, 0.16f, 0.22f, 0.8f)))
ColorDisposable val = ImRaii.PushColor(ImGuiCol.Button, new Vector4(0.18f, 0.16f, 0.22f, 0.8f), true);
try
{
using (ImRaii.PushColor(ImGuiCol.ButtonHovered, new Vector4(0.28f, 0.24f, 0.32f, 0.95f)))
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.ButtonHovered, new Vector4(0.28f, 0.24f, 0.32f, 0.95f), true);
try
{
using (ImRaii.PushColor(ImGuiCol.ButtonActive, new Vector4(0.35f, 0.3f, 0.45f, 1f)))
ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.ButtonActive, new Vector4(0.35f, 0.3f, 0.45f, 1f), true);
try
{
if (ImGuiComponents.IconButton(FontAwesomeIcon.Copy))
{
@ -270,7 +323,19 @@ internal sealed class QuestSequenceComponent
ImGui.SetTooltip("Copies filename as QuestID_QuestNameWithSpaces.json");
}
}
finally
{
((IDisposable)val3)?.Dispose();
}
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
finally
{
((IDisposable)val)?.Dispose();
}
if (currentSequence.HasValue)
{
@ -366,95 +431,115 @@ internal sealed class QuestSequenceComponent
private static void DrawSummaryCards(int totalSequences, int maxSeq, bool hasQuestPath, float coverage, Vector4 coverageColor, int implementedCount, int expectedCount)
{
using ImRaii.IEndObject endObject = ImRaii.Table("SummaryCards", 2, ImGuiTableFlags.None);
if (!endObject)
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
TableDisposable val = ImRaii.Table((ImU8String)"SummaryCards", 2, ImGuiTableFlags.None);
try
{
return;
}
ImGui.TableSetupColumn("GameData", ImGuiTableColumnFlags.WidthStretch, 0.4f);
ImGui.TableSetupColumn("QuestPath", ImGuiTableColumnFlags.WidthStretch, 0.6f);
ImGui.TableNextRow();
ImGui.TableNextColumn();
DrawCard(80f, new Vector4(0.6f, 0.85f, 1f, 1f), FontAwesomeIcon.Gamepad, "Expected Sequences", delegate
{
ImGui.Spacing();
ImGui.Indent(10f);
Vector4 col = new Vector4(0.9f, 0.9f, 0.98f, 1f);
ImU8String text = new ImU8String(6, 0);
text.AppendLiteral("Count:");
ImGui.TextColored(in col, text);
ImGui.SameLine();
col = new Vector4(0.7f, 0.9f, 1f, 1f);
ImU8String text2 = new ImU8String(0, 1);
text2.AppendFormatted(totalSequences);
ImGui.TextColored(in col, text2);
ImGui.Spacing();
col = new Vector4(0.9f, 0.9f, 0.98f, 1f);
ImU8String text3 = new ImU8String(6, 0);
text3.AppendLiteral("Range:");
ImGui.TextColored(in col, text3);
ImGui.SameLine();
col = new Vector4(0.7f, 0.9f, 1f, 1f);
ImU8String text4 = new ImU8String(9, 1);
text4.AppendLiteral("0 → ");
text4.AppendFormatted(maxSeq);
text4.AppendLiteral(", 255");
ImGui.TextColored(in col, text4);
ImGui.Unindent(10f);
});
ImGui.TableNextColumn();
DrawCard(80f, new Vector4(0.5f, 1f, 0.6f, 1f), FontAwesomeIcon.Code, "Implementation Status", delegate
{
if (hasQuestPath)
if (!val)
{
return;
}
ImGui.TableSetupColumn("GameData", ImGuiTableColumnFlags.WidthStretch, 0.4f);
ImGui.TableSetupColumn("QuestPath", ImGuiTableColumnFlags.WidthStretch, 0.6f);
ImGui.TableNextRow();
ImGui.TableNextColumn();
DrawCard(80f, new Vector4(0.6f, 0.85f, 1f, 1f), FontAwesomeIcon.Gamepad, "Expected Sequences", delegate
{
ImGui.Spacing();
ImGui.Indent(10f);
ImGui.TextColored(new Vector4(0.9f, 0.9f, 0.98f, 1f), "Progress:");
ImGui.SameLine();
ref Vector4 col = ref coverageColor;
ImU8String text = new ImU8String(0, 1);
text.AppendFormatted(implementedCount);
Vector4 col = new Vector4(0.9f, 0.9f, 0.98f, 1f);
ImU8String text = new ImU8String(6, 0);
text.AppendLiteral("Count:");
ImGui.TextColored(in col, text);
ImGui.SameLine();
ImGui.TextColored(new Vector4(0.7f, 0.7f, 0.8f, 1f), "/");
ImGui.SameLine();
Vector4 col2 = new Vector4(0.9f, 0.9f, 0.98f, 1f);
col = new Vector4(0.7f, 0.9f, 1f, 1f);
ImU8String text2 = new ImU8String(0, 1);
text2.AppendFormatted(expectedCount);
ImGui.TextColored(in col2, text2);
ImGui.SameLine();
ref Vector4 col3 = ref coverageColor;
ImU8String text3 = new ImU8String(3, 1);
text3.AppendLiteral("(");
text3.AppendFormatted(coverage, "F0");
text3.AppendLiteral("%)");
ImGui.TextColored(in col3, text3);
text2.AppendFormatted(totalSequences);
ImGui.TextColored(in col, text2);
ImGui.Spacing();
Vector2 cursorScreenPos = ImGui.GetCursorScreenPos();
float x = ImGui.GetContentRegionAvail().X - 10f;
using (ImRaii.PushColor(ImGuiCol.PlotHistogram, coverageColor))
{
using (ImRaii.PushColor(ImGuiCol.FrameBg, new Vector4(0.08f, 0.06f, 0.12f, 0.8f)))
{
ImGui.ProgressBar(coverage / 100f, new Vector2(x, 16f), "");
}
}
ImGui.GetWindowDrawList().AddRect(cursorScreenPos, cursorScreenPos + new Vector2(x, 16f), ImGui.ColorConvertFloat4ToU32(new Vector4(0.6f, 0.5f, 0.8f, 0.3f)), 2f);
col = new Vector4(0.9f, 0.9f, 0.98f, 1f);
ImU8String text3 = new ImU8String(6, 0);
text3.AppendLiteral("Range:");
ImGui.TextColored(in col, text3);
ImGui.SameLine();
col = new Vector4(0.7f, 0.9f, 1f, 1f);
ImU8String text4 = new ImU8String(9, 1);
text4.AppendLiteral("0 → ");
text4.AppendFormatted(maxSeq);
text4.AppendLiteral(", 255");
ImGui.TextColored(in col, text4);
ImGui.Unindent(10f);
}
else
});
ImGui.TableNextColumn();
DrawCard(80f, new Vector4(0.5f, 1f, 0.6f, 1f), FontAwesomeIcon.Code, "Implementation Status", delegate
{
ImGui.Spacing();
ImGui.Indent(10f);
ImGui.PushFont(UiBuilder.IconFont);
ImGui.TextColored(new Vector4(0.6f, 0.5f, 0.8f, 0.8f), FontAwesomeIcon.Ban.ToIconString());
ImGui.PopFont();
ImGui.SameLine();
ImGui.TextColored(new Vector4(0.6f, 0.5f, 0.8f, 0.8f), "Not Implemented");
ImGui.Spacing();
ImGui.TextColored(new Vector4(0.7f, 0.7f, 0.8f, 1f), "No quest path data available");
ImGui.Unindent(10f);
}
});
if (hasQuestPath)
{
ImGui.Indent(10f);
ImGui.TextColored(new Vector4(0.9f, 0.9f, 0.98f, 1f), "Progress:");
ImGui.SameLine();
ref Vector4 col = ref coverageColor;
ImU8String text = new ImU8String(0, 1);
text.AppendFormatted(implementedCount);
ImGui.TextColored(in col, text);
ImGui.SameLine();
ImGui.TextColored(new Vector4(0.7f, 0.7f, 0.8f, 1f), "/");
ImGui.SameLine();
Vector4 col2 = new Vector4(0.9f, 0.9f, 0.98f, 1f);
ImU8String text2 = new ImU8String(0, 1);
text2.AppendFormatted(expectedCount);
ImGui.TextColored(in col2, text2);
ImGui.SameLine();
ref Vector4 col3 = ref coverageColor;
ImU8String text3 = new ImU8String(3, 1);
text3.AppendLiteral("(");
text3.AppendFormatted(coverage, "F0");
text3.AppendLiteral("%)");
ImGui.TextColored(in col3, text3);
ImGui.Spacing();
Vector2 cursorScreenPos = ImGui.GetCursorScreenPos();
float x = ImGui.GetContentRegionAvail().X - 10f;
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.PlotHistogram, coverageColor, true);
try
{
ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.FrameBg, new Vector4(0.08f, 0.06f, 0.12f, 0.8f), true);
try
{
ImGui.ProgressBar(coverage / 100f, new Vector2(x, 16f), "");
}
finally
{
((IDisposable)val3)?.Dispose();
}
}
finally
{
((IDisposable)val2)?.Dispose();
}
ImGui.GetWindowDrawList().AddRect(cursorScreenPos, cursorScreenPos + new Vector2(x, 16f), ImGui.ColorConvertFloat4ToU32(new Vector4(0.6f, 0.5f, 0.8f, 0.3f)), 2f);
ImGui.Unindent(10f);
}
else
{
ImGui.Spacing();
ImGui.Indent(10f);
ImGui.PushFont(UiBuilder.IconFont);
ImGui.TextColored(new Vector4(0.6f, 0.5f, 0.8f, 0.8f), FontAwesomeIcon.Ban.ToIconString());
ImGui.PopFont();
ImGui.SameLine();
ImGui.TextColored(new Vector4(0.6f, 0.5f, 0.8f, 0.8f), "Not Implemented");
ImGui.Spacing();
ImGui.TextColored(new Vector4(0.7f, 0.7f, 0.8f, 1f), "No quest path data available");
ImGui.Unindent(10f);
}
});
}
finally
{
((TableDisposable)(ref val)).Dispose();
}
}
private static void DrawCard(float height, Vector4 accentColor, FontAwesomeIcon icon, string title, System.Action content)
@ -479,58 +564,100 @@ internal sealed class QuestSequenceComponent
private void DrawSequenceGrid(int maxSeq, byte? currentSequence, HashSet<int> implementedSequences, Dictionary<int, (int StepCount, string? Comment)> sequenceDetails, bool hasEndSequence)
{
//IL_0092: Unknown result type (might be due to invalid IL or missing references)
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
//IL_0100: Unknown result type (might be due to invalid IL or missing references)
//IL_0102: Unknown result type (might be due to invalid IL or missing references)
int val = maxSeq + 2;
float x = ImGui.GetContentRegionAvail().X;
int val2 = Math.Max(4, Math.Min(8, (int)(x / 100f)));
val2 = Math.Min(val2, val);
float y = ImGui.GetContentRegionAvail().Y;
using (ImRaii.PushColor(ImGuiCol.ChildBg, new Vector4(0.08f, 0.06f, 0.12f, 0.6f)))
ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.ChildBg, new Vector4(0.08f, 0.06f, 0.12f, 0.6f), true);
try
{
using (ImRaii.PushColor(ImGuiCol.Border, new Vector4(0.6f, 0.5f, 0.8f, 0.2f)))
ColorDisposable val4 = ImRaii.PushColor(ImGuiCol.Border, new Vector4(0.6f, 0.5f, 0.8f, 0.2f), true);
try
{
using ImRaii.IEndObject endObject = ImRaii.Child("SequenceGrid", new Vector2(-1f, y), border: true, ImGuiWindowFlags.None);
if (!ImRaii.IEndObject.op_True(endObject))
ChildDisposable val5 = ImRaii.Child((ImU8String)"SequenceGrid", new Vector2(-1f, y), true, ImGuiWindowFlags.None);
try
{
return;
}
using (ImRaii.PushColor(ImGuiCol.TableBorderStrong, new Vector4(0.6f, 0.5f, 0.8f, 0.2f)))
{
using (ImRaii.PushColor(ImGuiCol.TableBorderLight, new Vector4(0.6f, 0.5f, 0.8f, 0.15f)))
if (!ChildDisposable.op_Implicit(val5))
{
using ImRaii.IEndObject endObject2 = ImRaii.Table("SequenceGridTable", val2, ImGuiTableFlags.Borders | ImGuiTableFlags.SizingStretchSame);
if (!ImRaii.IEndObject.op_True(endObject2))
return;
}
ColorDisposable val6 = ImRaii.PushColor(ImGuiCol.TableBorderStrong, new Vector4(0.6f, 0.5f, 0.8f, 0.2f), true);
try
{
ColorDisposable val7 = ImRaii.PushColor(ImGuiCol.TableBorderLight, new Vector4(0.6f, 0.5f, 0.8f, 0.15f), true);
try
{
return;
}
int num = 0;
for (int i = 0; i <= maxSeq; i++)
{
if (num % val2 == 0)
TableDisposable val8 = ImRaii.Table((ImU8String)"SequenceGridTable", val2, ImGuiTableFlags.Borders | ImGuiTableFlags.SizingStretchSame);
try
{
ImGui.TableNextRow();
if (!TableDisposable.op_Implicit(val8))
{
return;
}
int num = 0;
for (int i = 0; i <= maxSeq; i++)
{
if (num % val2 == 0)
{
ImGui.TableNextRow();
}
ImGui.TableNextColumn();
DrawSequenceCell(i, currentSequence, implementedSequences, sequenceDetails);
num++;
}
if (num % val2 == 0)
{
ImGui.TableNextRow();
}
ImGui.TableNextColumn();
DrawSequenceCell(255, currentSequence, implementedSequences, sequenceDetails, hasEndSequence);
for (num++; num % val2 != 0; num++)
{
ImGui.TableNextColumn();
}
}
finally
{
((TableDisposable)(ref val8)).Dispose();
}
ImGui.TableNextColumn();
DrawSequenceCell(i, currentSequence, implementedSequences, sequenceDetails);
num++;
}
if (num % val2 == 0)
finally
{
ImGui.TableNextRow();
}
ImGui.TableNextColumn();
DrawSequenceCell(255, currentSequence, implementedSequences, sequenceDetails, hasEndSequence);
for (num++; num % val2 != 0; num++)
{
ImGui.TableNextColumn();
((IDisposable)val7)?.Dispose();
}
}
finally
{
((IDisposable)val6)?.Dispose();
}
}
finally
{
((ChildDisposable)(ref val5)).Dispose();
}
}
finally
{
((IDisposable)val4)?.Dispose();
}
}
finally
{
((IDisposable)val3)?.Dispose();
}
}
private void DrawSequenceCell(int sequenceId, byte? currentSequence, HashSet<int> implementedSequences, Dictionary<int, (int StepCount, string? Comment)> sequenceDetails, bool? forcedImplemented = null)
{
//IL_035b: Unknown result type (might be due to invalid IL or missing references)
//IL_0360: Unknown result type (might be due to invalid IL or missing references)
bool flag = currentSequence.HasValue && sequenceId == currentSequence.Value;
bool flag2 = forcedImplemented ?? implementedSequences.Contains(sequenceId);
bool flag3 = _hoveredSequenceId == sequenceId;
@ -574,15 +701,21 @@ internal sealed class QuestSequenceComponent
if (ImGui.IsItemHovered())
{
_hoveredSequenceId = sequenceId;
using (ImRaii.Tooltip())
TooltipDisposable val = ImRaii.Tooltip();
try
{
using (ImRaii.PushColor(ImGuiCol.Text, new Vector4(0.98f, 0.98f, 1f, 1f)))
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, new Vector4(0.98f, 0.98f, 1f, 1f), true);
try
{
ImU8String text2 = new ImU8String(9, 1);
text2.AppendLiteral("Sequence ");
text2.AppendFormatted(sequenceId);
ImGui.Text(text2);
}
finally
{
((IDisposable)val2)?.Dispose();
}
ImGui.Separator();
if (flag2 && sequenceDetails.TryGetValue(sequenceId, out (int, string) value))
{
@ -627,6 +760,10 @@ internal sealed class QuestSequenceComponent
ImGui.TextColored(new Vector4(1f, 0.85f, 0.5f, 1f), "► Currently Active");
}
}
finally
{
((TooltipDisposable)(ref val)).Dispose();
}
}
else if (_hoveredSequenceId == sequenceId)
{

View file

@ -1,3 +1,4 @@
using System;
using Dalamud.Bindings.ImGui;
using Dalamud.Game.Text;
using Dalamud.Interface;
@ -38,10 +39,19 @@ internal sealed class QuestTooltipComponent
public void Draw(IQuestInfo questInfo)
{
using ImRaii.IEndObject endObject = ImRaii.Tooltip();
if (endObject)
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
TooltipDisposable val = ImRaii.Tooltip();
try
{
DrawInner(questInfo, showItemRewards: true);
if (((TooltipDisposable)(ref val)).Alive)
{
DrawInner(questInfo, showItemRewards: true);
}
}
finally
{
((TooltipDisposable)(ref val)).Dispose();
}
}
@ -143,10 +153,15 @@ internal sealed class QuestTooltipComponent
}
else
{
using (ImRaii.Disabled())
DisabledDisposable val = ImRaii.Disabled();
try
{
_uiUtils.ChecklistItem($"Unknown Quest ({previousQuest.QuestId})", ImGuiColors.DalamudGrey, FontAwesomeIcon.Question);
}
finally
{
((IDisposable)val)?.Dispose();
}
}
}
}

View file

@ -55,20 +55,26 @@ internal sealed class QuestValidationComponent
ImGui.SameLine();
ImGui.Text("(");
ImGui.SameLine();
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed))
ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed, true);
try
{
ImU8String text2 = new ImU8String(7, 1);
text2.AppendFormatted(errorCount);
text2.AppendLiteral(" errors");
ImGui.Text(text2);
}
finally
{
((IDisposable)val)?.Dispose();
}
}
if (num > 0)
{
if (errorCount > 0)
{
ImGui.SameLine();
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudOrange))
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudOrange, true);
try
{
ImU8String text3 = new ImU8String(12, 1);
text3.AppendLiteral(", ");
@ -77,11 +83,16 @@ internal sealed class QuestValidationComponent
ImGui.Text(text3);
return;
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
ImGui.SameLine();
ImGui.Text("(");
ImGui.SameLine();
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudOrange))
ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudOrange, true);
try
{
ImU8String text4 = new ImU8String(10, 1);
text4.AppendFormatted(num);
@ -89,6 +100,10 @@ internal sealed class QuestValidationComponent
ImGui.Text(text4);
return;
}
finally
{
((IDisposable)val3)?.Dispose();
}
}
if (errorCount > 0)
{
@ -99,22 +114,32 @@ internal sealed class QuestValidationComponent
private void DrawValidationTable()
{
using ImRaii.IEndObject endObject = ImRaii.Table("ValidationIssues", 6, ImGuiTableFlags.Borders | ImGuiTableFlags.Sortable | ImGuiTableFlags.RowBg | ImGuiTableFlags.ScrollY);
if (!(!endObject))
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
TableDisposable val = ImRaii.Table((ImU8String)"ValidationIssues", 6, ImGuiTableFlags.Borders | ImGuiTableFlags.Sortable | ImGuiTableFlags.RowBg | ImGuiTableFlags.ScrollY);
try
{
ImGui.TableSetupColumn("ID", ImGuiTableColumnFlags.WidthFixed, 60f);
ImGui.TableSetupColumn("Name", ImGuiTableColumnFlags.WidthFixed, 250f);
ImGui.TableSetupColumn("Seq", ImGuiTableColumnFlags.WidthFixed, 40f);
ImGui.TableSetupColumn("Step", ImGuiTableColumnFlags.WidthFixed, 40f);
ImGui.TableSetupColumn("Issue", ImGuiTableColumnFlags.WidthStretch);
ImGui.TableSetupColumn("Actions", ImGuiTableColumnFlags.WidthFixed, 60f);
ImGui.TableHeadersRow();
IReadOnlyList<ValidationIssue> issues = _questValidator.Issues;
for (int i = 0; i < issues.Count; i++)
if (!(!val))
{
DrawValidationRow(issues[i], i);
ImGui.TableSetupColumn("ID", ImGuiTableColumnFlags.WidthFixed, 60f);
ImGui.TableSetupColumn("Name", ImGuiTableColumnFlags.WidthFixed, 250f);
ImGui.TableSetupColumn("Seq", ImGuiTableColumnFlags.WidthFixed, 40f);
ImGui.TableSetupColumn("Step", ImGuiTableColumnFlags.WidthFixed, 40f);
ImGui.TableSetupColumn("Issue", ImGuiTableColumnFlags.WidthStretch);
ImGui.TableSetupColumn("Actions", ImGuiTableColumnFlags.WidthFixed, 60f);
ImGui.TableHeadersRow();
IReadOnlyList<ValidationIssue> issues = _questValidator.Issues;
for (int i = 0; i < issues.Count; i++)
{
DrawValidationRow(issues[i], i);
}
}
}
finally
{
((TableDisposable)(ref val)).Dispose();
}
}
private void DrawValidationRow(ValidationIssue issue, int index)
@ -136,10 +161,15 @@ internal sealed class QuestValidationComponent
}
else
{
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudGrey2))
ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudGrey2, true);
try
{
ImGui.TextUnformatted("\ufffd");
}
finally
{
((IDisposable)val)?.Dispose();
}
}
}
if (ImGui.TableNextColumn())
@ -150,10 +180,15 @@ internal sealed class QuestValidationComponent
}
else
{
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudGrey2))
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudGrey2, true);
try
{
ImGui.TextUnformatted("\ufffd");
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
}
if (ImGui.TableNextColumn())
@ -168,21 +203,31 @@ internal sealed class QuestValidationComponent
private void DrawIssueCell(ValidationIssue issue, int index)
{
Vector4 color = ((issue.Severity == EIssueSeverity.Error) ? ImGuiColors.DalamudRed : ImGuiColors.DalamudOrange);
Vector4 vector = ((issue.Severity == EIssueSeverity.Error) ? ImGuiColors.DalamudRed : ImGuiColors.DalamudOrange);
FontAwesomeIcon icon = ((issue.Severity == EIssueSeverity.Error) ? FontAwesomeIcon.ExclamationTriangle : FontAwesomeIcon.InfoCircle);
using (_pluginInterface.UiBuilder.IconFontFixedWidthHandle.Push())
{
using (ImRaii.PushColor(ImGuiCol.Text, color))
ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, vector, true);
try
{
ImGui.TextUnformatted(icon.ToIconString());
}
finally
{
((IDisposable)val)?.Dispose();
}
}
ImGui.SameLine();
string issueSummary = GetIssueSummary(issue);
using (ImRaii.PushColor(ImGuiCol.Text, color))
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, vector, true);
try
{
ImGui.TextWrapped(issueSummary);
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
private void DrawActionsCell(ValidationIssue issue, int index)

View file

@ -69,13 +69,18 @@ internal sealed class QuickAccessButtonsComponent
private void DrawRebuildNavmeshButton()
{
bool flag = _commandManager.Commands.ContainsKey("/vnav");
using (ImRaii.Disabled(!flag || !ImGui.IsKeyDown(ImGuiKey.ModCtrl)))
DisabledDisposable val = ImRaii.Disabled(!flag || !ImGui.IsKeyDown(ImGuiKey.ModCtrl));
try
{
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.GlobeEurope, "Rebuild Navmesh"))
{
_commandManager.ProcessCommand("/vnav rebuild");
}
}
finally
{
((IDisposable)val)?.Dispose();
}
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
{
if (!flag)
@ -118,7 +123,8 @@ internal sealed class QuickAccessButtonsComponent
return;
}
int num2 = ((validationErrorCount == 0 || num == 0) ? 1 : 2);
using (ImRaii.PushId("validationissues"))
IdDisposable val = ImRaii.PushId((ImU8String)"validationissues", true);
try
{
FontAwesomeIcon icon = FontAwesomeIcon.ExclamationTriangle;
FontAwesomeIcon icon2 = FontAwesomeIcon.InfoCircle;
@ -170,5 +176,9 @@ internal sealed class QuickAccessButtonsComponent
_questValidationWindow.IsOpenAndUncollapsed = true;
}
}
finally
{
((IDisposable)val)?.Dispose();
}
}
}

View file

@ -87,23 +87,32 @@ internal sealed class SavedPresetsComponent
public void Draw()
{
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
ImGui.TextWrapped("Save your current priority queue as a preset for quick access later. Saved presets are stored in your configuration and persist between sessions.");
ImGui.Spacing();
DrawSaveSection();
ImGui.Spacing();
using (ImRaii.IEndObject endObject = ImRaii.Child("SavedPresetsList", new Vector2(-1f, -27f), border: true))
ChildDisposable val = ImRaii.Child((ImU8String)"SavedPresetsList", new Vector2(-1f, -27f), true);
try
{
if (endObject)
if (ChildDisposable.op_Implicit(val))
{
DrawSavedPresets();
}
}
finally
{
((ChildDisposable)(ref val)).Dispose();
}
DrawBottomButtons();
}
private void DrawSaveSection()
{
int count = _questController.ManualPriorityQuests.Count;
DisabledDisposable val;
if (_showSaveDialog)
{
ImGui.Text("Save Current Priority Queue as Preset:");
@ -113,13 +122,18 @@ internal sealed class SavedPresetsComponent
ImGui.SetNextItemWidth(250f);
ImGui.InputTextWithHint("##PresetDescription", "Description (optional)...", ref _newPresetDescription, 256);
ImGui.SameLine();
using (ImRaii.Disabled(string.IsNullOrWhiteSpace(_newPresetName) || count == 0))
val = ImRaii.Disabled(string.IsNullOrWhiteSpace(_newPresetName) || count == 0);
try
{
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Save, "Save"))
{
SaveCurrentPreset();
}
}
finally
{
((IDisposable)val)?.Dispose();
}
ImGui.SameLine();
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Times, "Cancel"))
{
@ -133,13 +147,18 @@ internal sealed class SavedPresetsComponent
}
return;
}
using (ImRaii.Disabled(count == 0))
val = ImRaii.Disabled(count == 0);
try
{
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Plus, $"Save Current Queue ({count} quests)"))
{
_showSaveDialog = true;
}
}
finally
{
((IDisposable)val)?.Dispose();
}
if (count == 0 && ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
{
ImGui.SetTooltip("Add quests to the priority queue first to save them as a preset.");
@ -173,7 +192,8 @@ internal sealed class SavedPresetsComponent
private void DrawPresetEntry(string key, Configuration.SavedQuestPreset preset)
{
using (ImRaii.PushId(key))
IdDisposable val = ImRaii.PushId((ImU8String)key, true);
try
{
List<ElementId> availableQuests = GetAvailableQuests(preset.QuestIds);
List<ElementId> completedQuests = GetCompletedQuests(preset.QuestIds);
@ -204,8 +224,10 @@ internal sealed class SavedPresetsComponent
if (ImGui.CollapsingHeader(label, flag ? ImGuiTreeNodeFlags.DefaultOpen : ImGuiTreeNodeFlags.None))
{
_expandedPreset = key;
using (ImRaii.PushIndent())
IndentDisposable val2 = ImRaii.PushIndent(1, true);
try
{
DisabledDisposable val3;
if (_renamingPresetKey == key)
{
ImGui.Text("Name:");
@ -216,13 +238,18 @@ internal sealed class SavedPresetsComponent
ImGui.SameLine();
ImGui.SetNextItemWidth(300f);
ImGui.InputTextWithHint("##EditDescription", "Description (optional)...", ref _renamePresetDescription, 256);
using (ImRaii.Disabled(string.IsNullOrWhiteSpace(_renamePresetName)))
val3 = ImRaii.Disabled(string.IsNullOrWhiteSpace(_renamePresetName));
try
{
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Check, "Save Changes"))
{
RenamePreset(key, _renamePresetName, _renamePresetDescription);
}
}
finally
{
((IDisposable)val3)?.Dispose();
}
ImGui.SameLine();
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Times, "Cancel"))
{
@ -246,13 +273,18 @@ internal sealed class SavedPresetsComponent
ImGui.TextColored(in col, text2);
}
ImGui.Spacing();
using (ImRaii.Disabled(availableQuests.Count == 0))
val3 = ImRaii.Disabled(availableQuests.Count == 0);
try
{
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Plus, $"Add Available ({availableQuests.Count})"))
{
AddPresetToPriority(availableQuests);
}
}
finally
{
((IDisposable)val3)?.Dispose();
}
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
{
if (availableQuests.Count == 0)
@ -269,13 +301,18 @@ internal sealed class SavedPresetsComponent
}
}
ImGui.SameLine();
using (ImRaii.Disabled(alreadyPriorityQuests.Count == 0))
val3 = ImRaii.Disabled(alreadyPriorityQuests.Count == 0);
try
{
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Minus, $"Remove from Priority ({alreadyPriorityQuests.Count})"))
{
RemovePresetFromPriority(alreadyPriorityQuests);
}
}
finally
{
((IDisposable)val3)?.Dispose();
}
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
{
if (alreadyPriorityQuests.Count == 0)
@ -300,7 +337,8 @@ internal sealed class SavedPresetsComponent
ImGui.SetTooltip("Export this preset to clipboard for sharing.");
}
ImGui.SameLine();
using (ImRaii.Disabled(_renamingPresetKey != null))
val3 = ImRaii.Disabled(_renamingPresetKey != null);
try
{
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Pen, "Edit"))
{
@ -309,19 +347,28 @@ internal sealed class SavedPresetsComponent
_renamePresetDescription = preset.Description;
}
}
finally
{
((IDisposable)val3)?.Dispose();
}
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
{
ImGui.SetTooltip("Edit preset name and description.");
}
ImGui.SameLine();
int count = _questController.ManualPriorityQuests.Count;
using (ImRaii.Disabled(count == 0))
val3 = ImRaii.Disabled(count == 0);
try
{
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Sync, "Update"))
{
UpdatePresetQuests(key, preset);
}
}
finally
{
((IDisposable)val3)?.Dispose();
}
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
{
if (count == 0)
@ -338,13 +385,18 @@ internal sealed class SavedPresetsComponent
}
}
ImGui.SameLine();
using (ImRaii.Disabled(!ImGui.IsKeyDown(ImGuiKey.ModCtrl)))
val3 = ImRaii.Disabled(!ImGui.IsKeyDown(ImGuiKey.ModCtrl));
try
{
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Trash, "Delete"))
{
_presetToDelete = key;
}
}
finally
{
((IDisposable)val3)?.Dispose();
}
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
{
ImGui.SetTooltip("Hold CTRL to delete this preset.");
@ -378,6 +430,10 @@ internal sealed class SavedPresetsComponent
}
ImGui.Spacing();
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
else if (_expandedPreset == key)
{
@ -390,49 +446,69 @@ internal sealed class SavedPresetsComponent
ImGui.EndTooltip();
}
}
finally
{
((IDisposable)val)?.Dispose();
}
}
private void DrawBottomButtons()
{
PresetExportData presetExportData = ParseClipboardPreset();
List<PresetExportData> list = ParseClipboardAllPresets();
using (ImRaii.Disabled(presetExportData == null))
DisabledDisposable val = ImRaii.Disabled(presetExportData == null);
try
{
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Download, "Import Preset") && presetExportData != null)
{
ImportPresetFromClipboard(presetExportData);
}
}
finally
{
((IDisposable)val)?.Dispose();
}
if (presetExportData == null && ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
{
ImGui.SetTooltip("Copy a valid preset string to clipboard first.");
}
ImGui.SameLine();
using (ImRaii.Disabled(list == null || list.Count == 0))
val = ImRaii.Disabled(list == null || list.Count == 0);
try
{
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.FileImport, "Import All" + ((list != null && list.Count > 0) ? $" ({list.Count})" : "")) && list != null)
{
ImportAllPresetsFromClipboard(list);
}
}
finally
{
((IDisposable)val)?.Dispose();
}
if ((list == null || list.Count == 0) && ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
{
ImGui.SetTooltip("Copy a valid 'all presets' export string to clipboard first.");
}
ImGui.SameLine();
using (ImRaii.Disabled(_configuration.General.SavedPresets.Count == 0))
val = ImRaii.Disabled(_configuration.General.SavedPresets.Count == 0);
try
{
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.FileExport, $"Export All ({_configuration.General.SavedPresets.Count})"))
{
ExportAllPresetsToClipboard();
}
}
finally
{
((IDisposable)val)?.Dispose();
}
if (_configuration.General.SavedPresets.Count == 0 && ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
{
ImGui.SetTooltip("No saved presets to export.");
}
ImGui.SameLine();
using (ImRaii.Disabled(_configuration.General.SavedPresets.Count == 0 || !ImGui.IsKeyDown(ImGuiKey.ModCtrl)))
val = ImRaii.Disabled(_configuration.General.SavedPresets.Count == 0 || !ImGui.IsKeyDown(ImGuiKey.ModCtrl));
try
{
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Trash, "Clear All"))
{
@ -441,6 +517,10 @@ internal sealed class SavedPresetsComponent
_logger.LogInformation("Cleared all saved presets");
}
}
finally
{
((IDisposable)val)?.Dispose();
}
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
{
if (_configuration.General.SavedPresets.Count == 0)

View file

@ -111,17 +111,23 @@ internal sealed class ValidationDetailsRenderer
private void DrawIssueDetails(ValidationIssue issue)
{
Vector4 color = ((issue.Severity == EIssueSeverity.Error) ? ImGuiColors.DalamudRed : ImGuiColors.DalamudOrange);
Vector4 vector = ((issue.Severity == EIssueSeverity.Error) ? ImGuiColors.DalamudRed : ImGuiColors.DalamudOrange);
FontAwesomeIcon icon = ((issue.Severity == EIssueSeverity.Error) ? FontAwesomeIcon.ExclamationTriangle : FontAwesomeIcon.InfoCircle);
using (_pluginInterface.UiBuilder.IconFontFixedWidthHandle.Push())
{
using (ImRaii.PushColor(ImGuiCol.Text, color))
ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, vector, true);
try
{
ImGui.TextUnformatted(icon.ToIconString());
}
finally
{
((IDisposable)val)?.Dispose();
}
}
ImGui.SameLine();
using (ImRaii.PushColor(ImGuiCol.Text, color))
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, vector, true);
try
{
ImU8String text = new ImU8String(2, 2);
text.AppendFormatted(issue.Severity);
@ -129,6 +135,10 @@ internal sealed class ValidationDetailsRenderer
text.AppendFormatted(issue.Type);
ImGui.Text(text);
}
finally
{
((IDisposable)val2)?.Dispose();
}
ImGui.Separator();
if (issue.ElementId != null)
{
@ -194,24 +204,39 @@ internal sealed class ValidationDetailsRenderer
}
else if (text.StartsWith("JSON parsing error", StringComparison.Ordinal))
{
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed))
ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed, true);
try
{
ImGui.TextWrapped(text);
}
finally
{
((IDisposable)val)?.Dispose();
}
}
else if (text.StartsWith("This usually indicates", StringComparison.Ordinal) || text.StartsWith("Please check", StringComparison.Ordinal))
{
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.HealerGreen))
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.HealerGreen, true);
try
{
ImGui.TextWrapped(text);
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
else if (text.StartsWith("\ufffd ", StringComparison.Ordinal))
{
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow))
ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow, true);
try
{
ImGui.TextWrapped(text);
}
finally
{
((IDisposable)val3)?.Dispose();
}
}
else
{
@ -253,8 +278,9 @@ internal sealed class ValidationDetailsRenderer
for (int num = 0; num < list.Count; num++)
{
string value = list[num];
Vector4 color = array2[num % array2.Length];
using (ImRaii.PushColor(ImGuiCol.Text, color))
Vector4 vector = array2[num % array2.Length];
ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, vector, true);
try
{
if (ElementId.TryFromString(value, out ElementId elementId) && elementId != null)
{
@ -285,6 +311,10 @@ internal sealed class ValidationDetailsRenderer
ImGui.TextWrapped(text3);
}
}
finally
{
((IDisposable)val)?.Dispose();
}
}
ImGui.Unindent();
}
@ -318,7 +348,8 @@ internal sealed class ValidationDetailsRenderer
private void DrawJsonValidationError(JsonValidationError error, int index)
{
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow))
ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow, true);
try
{
ImU8String text = new ImU8String(8, 1);
text.AppendLiteral("Error #");
@ -326,16 +357,25 @@ internal sealed class ValidationDetailsRenderer
text.AppendLiteral(":");
ImGui.Text(text);
}
finally
{
((IDisposable)val)?.Dispose();
}
ImGui.Indent(12f);
if (!string.IsNullOrEmpty(error.Path))
{
ImGui.AlignTextToFramePadding();
ImGui.Text("Location:");
ImGui.SameLine();
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedBlue))
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedBlue, true);
try
{
ImGui.TextWrapped(FormatJsonPath(error.Path));
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
if (error.Messages.Count > 0)
{
@ -344,7 +384,8 @@ internal sealed class ValidationDetailsRenderer
foreach (string message in error.Messages)
{
ImGui.Indent(12f);
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed))
ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed, true);
try
{
string text2 = CleanJsonText(message);
if (string.Equals(text2, "validation failed", StringComparison.OrdinalIgnoreCase))
@ -357,13 +398,18 @@ internal sealed class ValidationDetailsRenderer
ImGui.TextWrapped(text3);
ImGui.Unindent(12f);
}
finally
{
((IDisposable)val3)?.Dispose();
}
}
}
List<string> validationSuggestions = GetValidationSuggestions(error);
if (validationSuggestions.Count > 0)
{
ImGui.Spacing();
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.HealerGreen))
ColorDisposable val4 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.HealerGreen, true);
try
{
ImGui.Text("Suggestions:");
foreach (string item in validationSuggestions)
@ -371,19 +417,33 @@ internal sealed class ValidationDetailsRenderer
ImGui.Indent(12f);
using (_pluginInterface.UiBuilder.IconFontFixedWidthHandle.Push())
{
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow))
ColorDisposable val5 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow, true);
try
{
ImGui.Text(FontAwesomeIcon.Lightbulb.ToIconString());
}
finally
{
((IDisposable)val5)?.Dispose();
}
}
ImGui.SameLine();
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.HealerGreen))
ColorDisposable val6 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.HealerGreen, true);
try
{
ImGui.TextWrapped(item);
ImGui.Unindent(12f);
}
finally
{
((IDisposable)val6)?.Dispose();
}
}
}
finally
{
((IDisposable)val4)?.Dispose();
}
}
ImGui.Unindent(12f);
}
@ -395,10 +455,15 @@ internal sealed class ValidationDetailsRenderer
{
if (text.StartsWith("JSON Validation failed:", StringComparison.Ordinal))
{
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed))
ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed, true);
try
{
ImGui.TextWrapped(text);
}
finally
{
((IDisposable)val)?.Dispose();
}
}
else if (text.StartsWith(" - ", StringComparison.Ordinal))
{
@ -413,24 +478,39 @@ internal sealed class ValidationDetailsRenderer
}
ImGui.Text("\ufffd");
ImGui.SameLine();
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedBlue))
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedBlue, true);
try
{
ImGui.Text(FormatJsonPath(path));
}
finally
{
((IDisposable)val2)?.Dispose();
}
ImGui.SameLine();
ImGui.Text(":");
ImGui.SameLine();
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed))
ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed, true);
try
{
ImGui.TextWrapped(text2);
}
finally
{
((IDisposable)val3)?.Dispose();
}
}
else
{
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed))
ColorDisposable val4 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed, true);
try
{
ImGui.TextWrapped(CleanJsonText(text));
}
finally
{
((IDisposable)val4)?.Dispose();
}
}
}
else
@ -541,20 +621,30 @@ internal sealed class ValidationDetailsRenderer
}
else if (text.StartsWith("Error:", StringComparison.Ordinal) || text.StartsWith("Invalid", StringComparison.Ordinal) || text.StartsWith("Missing", StringComparison.Ordinal))
{
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed))
ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed, true);
try
{
ImGui.TextWrapped(text);
}
finally
{
((IDisposable)val)?.Dispose();
}
}
else if (text.Contains(':', StringComparison.Ordinal))
{
int num = text.IndexOf(':', StringComparison.Ordinal);
string text2 = text.Substring(0, num);
string text3 = text.Substring(num + 1).TrimStart();
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedBlue))
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedBlue, true);
try
{
ImGui.Text(text2 + ":");
}
finally
{
((IDisposable)val2)?.Dispose();
}
ImGui.SameLine();
ImGui.TextWrapped(text3);
}