muffin v7.5.1

This commit is contained in:
alydev 2026-05-01 08:59:48 +10:00
parent a6481e7b9a
commit 965a736f84
59 changed files with 4112 additions and 5059 deletions

View file

@ -65,39 +65,28 @@ 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;
}
TooltipDisposable val = ImRaii.Tooltip();
try
using ImRaii.TooltipDisposable tooltipDisposable = ImRaii.Tooltip();
if (tooltipDisposable.Alive)
{
if (((TooltipDisposable)(ref val)).Alive)
ushort[] requiredPrimalInstances = RequiredPrimalInstances;
foreach (ushort instanceId in requiredPrimalInstances)
{
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);
}
(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]);
@ -106,24 +95,17 @@ internal sealed class ARealmRebornComponent
{
return;
}
TooltipDisposable val = ImRaii.Tooltip();
try
using ImRaii.TooltipDisposable tooltipDisposable = ImRaii.Tooltip();
if (!tooltipDisposable.Alive)
{
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);
}
return;
}
finally
foreach (QuestId crystalTowerQuest in QuestData.CrystalTowerQuests)
{
((TooltipDisposable)(ref val)).Dispose();
(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);
}
}
}

View file

@ -90,8 +90,6 @@ 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);
@ -118,27 +116,17 @@ internal sealed class ActiveQuestComponent
string currentTaskState = _questController.CurrentTaskState;
if (currentTaskState != null)
{
ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudOrange, true);
try
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudOrange))
{
ImGui.TextUnformatted(currentTaskState);
}
finally
{
((IDisposable)val)?.Dispose();
}
}
else
{
DisabledDisposable val2 = ImRaii.Disabled();
try
using (ImRaii.Disabled())
{
ImGui.TextUnformatted(_questController.DebugState ?? string.Empty);
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
}
try
@ -147,8 +135,7 @@ internal sealed class ActiveQuestComponent
QuestStep questStep = questSequence?.FindStep(questProgress.Step);
if (!isMinimized)
{
ColorDisposable val3 = new ColorDisposable();
try
using (ImRaii.ColorDisposable colorDisposable = new ImRaii.ColorDisposable())
{
bool flag;
if (questStep != null)
@ -165,14 +152,10 @@ internal sealed class ActiveQuestComponent
IL_017e:
if (flag)
{
val3.Push(ImGuiCol.Text, ImGuiColors.DalamudOrange, true);
colorDisposable.Push(ImGuiCol.Text, ImGuiColors.DalamudOrange);
}
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);
@ -208,8 +191,7 @@ internal sealed class ActiveQuestComponent
text2.AppendFormatted((item2 == 1) ? string.Empty : "s");
text2.AppendLiteral(" - Leveling mode will start automatically");
ImGui.TextColored(in col, text2);
DisabledDisposable val4 = ImRaii.Disabled(_questController.IsRunning || _fateController.IsRunning || _seasonalDutyController.IsRunning || !_autoDutyIpc.IsStopped());
try
using (ImRaii.Disabled(_questController.IsRunning || _fateController.IsRunning || _seasonalDutyController.IsRunning || !_autoDutyIpc.IsStopped()))
{
if (ImGuiComponents.IconButton(FontAwesomeIcon.Play))
{
@ -224,10 +206,6 @@ internal sealed class ActiveQuestComponent
}
}
}
finally
{
((IDisposable)val4)?.Dispose();
}
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
{
if (!_autoDutyIpc.IsStopped())
@ -284,18 +262,13 @@ internal sealed class ActiveQuestComponent
private void DrawFateActive(bool isMinimized)
{
ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGold, true);
try
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGold))
{
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)
{
@ -315,18 +288,13 @@ internal sealed class ActiveQuestComponent
private void DrawDutyActive(bool isMinimized)
{
ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen, true);
try
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen))
{
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)
{
@ -346,14 +314,9 @@ 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)
{
ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed, true);
try
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed))
{
ImU8String text = new ImU8String(26, 4);
text.AppendLiteral("Simulated Quest: ");
@ -367,15 +330,10 @@ internal sealed class ActiveQuestComponent
ImGui.TextUnformatted(text);
return;
}
finally
{
((IDisposable)val)?.Dispose();
}
}
if (currentQuestType == QuestController.ECurrentQuestType.Gathering)
{
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGold, true);
try
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGold))
{
ImU8String text2 = new ImU8String(20, 4);
text2.AppendLiteral("Gathering: ");
@ -389,10 +347,6 @@ internal sealed class ActiveQuestComponent
ImGui.TextUnformatted(text2);
return;
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
QuestController.QuestProgress startedQuest = _questController.StartedQuest;
if (startedQuest != null)
@ -449,97 +403,90 @@ internal sealed class ActiveQuestComponent
ImGui.TextColored(in col, SeIconChar.Clock.ToIconString());
if (ImGui.IsItemHovered())
{
TooltipDisposable val3 = ImRaii.Tooltip();
try
using ImRaii.TooltipDisposable tooltipDisposable = ImRaii.Tooltip();
if (tooltipDisposable.Alive)
{
if (((TooltipDisposable)(ref val3)).Alive)
ImGui.Text("Stop Conditions:");
ImGui.Separator();
if (flag)
{
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)
{
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 (sequence >= _configuration.Stop.TargetSequence)
if (num2 >= _configuration.Stop.TargetLevel)
{
Vector4 col2 = ImGuiColors.ParsedGreen;
ImU8String text8 = new ImU8String(22, 1);
text8.AppendLiteral("(Current: ");
text8.AppendFormatted(sequence);
text8.AppendLiteral(" - Reached!)");
ImGui.TextColored(in col2, text8);
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 text9 = new ImU8String(11, 1);
text9.AppendLiteral("(Current: ");
text9.AppendFormatted(sequence);
text9.AppendLiteral(")");
ImGui.TextColored(in col2, text9);
ImU8String text6 = new ImU8String(11, 1);
text6.AppendLiteral("(Current: ");
text6.AppendFormatted(num2);
text6.AppendLiteral(")");
ImGui.TextColored(in col2, text6);
}
}
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))
{
var (color, icon, _) = _uiUtils.GetQuestStyle(item);
_uiUtils.ChecklistItem($"{quest.Info.Name} ({item})", color, icon);
}
}
ImGui.Unindent();
}
}
}
finally
{
((TooltipDisposable)(ref val3)).Dispose();
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 (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))
{
var (color, icon, _) = _uiUtils.GetQuestStyle(item);
_uiUtils.ChecklistItem($"{quest.Info.Name} ({item})", color, icon);
}
}
ImGui.Unindent();
}
}
}
}
@ -549,73 +496,65 @@ internal sealed class ActiveQuestComponent
ImGui.TextColored(ImGuiColors.DalamudYellow, SeIconChar.Hyadelyn.ToIconString());
if (ImGui.IsItemHovered())
{
TooltipDisposable val4 = ImRaii.Tooltip();
try
using ImRaii.TooltipDisposable tooltipDisposable2 = ImRaii.Tooltip();
if (tooltipDisposable2.Alive)
{
if (((TooltipDisposable)(ref val4)).Alive)
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)
{
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)
foreach (ElementId item2 in list)
{
foreach (ElementId item2 in list)
if (_questRegistry.TryGetQuest(item2, out Quest quest2))
{
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);
}
ImU8String text10 = new ImU8String(3, 2);
text10.AppendFormatted(quest2.Info.Name);
text10.AppendLiteral(" (");
text10.AppendFormatted(item2);
text10.AppendLiteral(")");
ImGui.BulletText(text10);
}
}
else
}
else
{
ImGui.BulletText("(none)");
}
if (_configuration.Advanced.AdditionalStatusInformation)
{
List<PriorityQuestInfo> list2 = nextPriorityQuestsThatCanBeAccepted.Where((PriorityQuestInfo x) => !x.IsAvailable).ToList();
if (list2.Count > 0)
{
ImGui.BulletText("(none)");
}
if (_configuration.Advanced.AdditionalStatusInformation)
{
List<PriorityQuestInfo> list2 = nextPriorityQuestsThatCanBeAccepted.Where((PriorityQuestInfo x) => !x.IsAvailable).ToList();
if (list2.Count > 0)
ImGui.Text("Unavailable priority quests:");
foreach (var (elementId2, value) in list2)
{
ImGui.Text("Unavailable priority quests:");
foreach (var (elementId2, value) in list2)
if (_questRegistry.TryGetQuest(elementId2, out Quest quest3))
{
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);
}
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)
{
ColorDisposable val5 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow, true);
try
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow))
{
ImU8String text13 = new ImU8String(21, 4);
text13.AppendLiteral("Next Quest: ");
@ -628,10 +567,6 @@ internal sealed class ActiveQuestComponent
text13.AppendFormatted(nextQuest.Step);
ImGui.TextUnformatted(text13);
}
finally
{
((IDisposable)val5)?.Dispose();
}
}
}
@ -645,9 +580,8 @@ internal sealed class ActiveQuestComponent
return questProgressInfo;
}
Vector4* styleColorVec = ImGui.GetStyleColorVec4(ImGuiCol.TextDisabled);
Vector4 vector = ((styleColorVec == null) ? ImGuiColors.ParsedOrange : (*styleColorVec));
ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, vector, true);
try
Vector4 color = ((styleColorVec == null) ? ImGuiColors.ParsedOrange : (*styleColorVec));
using (ImRaii.PushColor(ImGuiCol.Text, color))
{
ImU8String text = new ImU8String(0, 1);
text.AppendFormatted(questProgressInfo);
@ -674,15 +608,10 @@ internal sealed class ActiveQuestComponent
ImGui.Text(text3);
}
}
finally
{
((IDisposable)val)?.Dispose();
}
}
else if (currentQuest.Quest.Id is QuestId)
{
DisabledDisposable val2 = ImRaii.Disabled();
try
using (ImRaii.Disabled())
{
if (currentQuest.Quest.Id == _questController.NextQuest?.Quest.Id)
{
@ -693,18 +622,13 @@ 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)
{
DisabledDisposable val = ImRaii.Disabled(_questController.IsRunning || _fateController.IsRunning || _seasonalDutyController.IsRunning);
try
using (ImRaii.Disabled(_questController.IsRunning || _fateController.IsRunning || _seasonalDutyController.IsRunning))
{
if (ImGuiComponents.IconButton(FontAwesomeIcon.Play))
{
@ -723,10 +647,6 @@ internal sealed class ActiveQuestComponent
}
}
}
finally
{
((IDisposable)val)?.Dispose();
}
ImGui.SameLine();
if (ImGuiComponents.IconButton(FontAwesomeIcon.Stop))
{
@ -746,12 +666,10 @@ internal sealed class ActiveQuestComponent
}
bool flag = currentStep == currentQuest.Quest.FindSequence(currentQuest.Sequence)?.Steps.LastOrDefault();
WaitAtEnd.WaitNextStepOrSequence task;
bool flag2 = currentStep != null && !flag && currentStep.InteractionType == EInteractionType.Instruction && _questController.HasCurrentTaskMatching<WaitAtEnd.WaitNextStepOrSequence>(out task);
val = ImRaii.Disabled(flag);
try
bool condition = currentStep != null && !flag && currentStep.InteractionType == EInteractionType.Instruction && _questController.HasCurrentTaskMatching<WaitAtEnd.WaitNextStepOrSequence>(out task);
using (ImRaii.Disabled(flag))
{
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen, flag2);
try
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen, condition))
{
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.ArrowCircleRight, "Skip"))
{
@ -763,14 +681,6 @@ 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"))
{
@ -829,8 +739,7 @@ internal sealed class ActiveQuestComponent
{
return;
}
IdDisposable val = ImRaii.PushId((ImU8String)"SimulatedStep", true);
try
using (ImRaii.PushId("SimulatedStep"))
{
ImU8String text2 = new ImU8String(9, 2);
text2.AppendLiteral("Step: ");
@ -867,10 +776,6 @@ internal sealed class ActiveQuestComponent
_questController.Stop("ClearSim");
}
}
finally
{
((IDisposable)val)?.Dispose();
}
}
private static string Shorten(string text)

View file

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

View file

@ -57,9 +57,6 @@ 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)");
@ -73,34 +70,23 @@ internal sealed class ManualPriorityComponent
{
ImGui.Text("Priority queue (drag arrow buttons to reorder):");
}
ChildDisposable val = ImRaii.Child((ImU8String)"ManualPriorityList", new Vector2(-1f, -27f), true);
try
using (ImRaii.ChildDisposable childDisposable = ImRaii.Child("ManualPriorityList", new Vector2(-1f, -27f), border: true))
{
if (ChildDisposable.op_Implicit(val))
if ((bool)childDisposable)
{
DrawQuestList();
}
}
finally
{
((ChildDisposable)(ref val)).Dispose();
}
List<ElementId> list = ParseClipboardItems();
DisabledDisposable val2 = ImRaii.Disabled(list.Count == 0);
try
using (ImRaii.Disabled(list.Count == 0))
{
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Download, "Import from Clipboard"))
{
ImportFromClipboard(list);
}
}
finally
{
((IDisposable)val2)?.Dispose();
}
ImGui.SameLine();
val2 = ImRaii.Disabled(_questController.ManualPriorityQuests.Count == 0);
try
using (ImRaii.Disabled(_questController.ManualPriorityQuests.Count == 0))
{
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Upload, "Export to Clipboard"))
{
@ -112,27 +98,18 @@ internal sealed class ManualPriorityComponent
_questController.SavePriorityQuests();
}
ImGui.SameLine();
DisabledDisposable val3 = ImRaii.Disabled(!ImGui.IsKeyDown(ImGuiKey.ModCtrl));
try
using (ImRaii.Disabled(!ImGui.IsKeyDown(ImGuiKey.ModCtrl)))
{
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()
@ -154,11 +131,10 @@ internal sealed class ManualPriorityComponent
{
Vector2 item = ImGui.GetCursorScreenPos() + new Vector2(0f, (0f - ImGui.GetStyle().ItemSpacing.Y) / 2f);
Quest quest3 = manualPriorityQuests[i];
ImU8String imU8String = new ImU8String(5, 1);
imU8String.AppendLiteral("Quest");
imU8String.AppendFormatted(quest3.Id);
IdDisposable val = ImRaii.PushId(imU8String, true);
try
ImU8String id = new ImU8String(5, 1);
id.AppendLiteral("Quest");
id.AppendFormatted(quest3.Id);
using (ImRaii.PushId(id))
{
ImGui.AlignTextToFramePadding();
ImU8String text = new ImU8String(1, 1);
@ -184,15 +160,10 @@ internal sealed class ManualPriorityComponent
}
if (manualPriorityQuests.Count > 1)
{
FontDisposable val2 = ImRaii.PushFont(UiBuilder.IconFont, true);
try
using (ImRaii.PushFont(UiBuilder.IconFont))
{
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)));
@ -209,25 +180,16 @@ internal sealed class ManualPriorityComponent
}
else
{
FontDisposable val2 = ImRaii.PushFont(UiBuilder.IconFont, true);
try
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);
}
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,38 +77,25 @@ 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();
ChildDisposable val = ImRaii.Child((ImU8String)"PresetList", new Vector2(-1f, -27f), true);
try
using (ImRaii.ChildDisposable childDisposable = ImRaii.Child("PresetList", new Vector2(-1f, -27f), border: true))
{
if (ChildDisposable.op_Implicit(val))
if ((bool)childDisposable)
{
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();
DisabledDisposable val2 = ImRaii.Disabled(list.Count == 0);
try
using (ImRaii.Disabled(list.Count == 0))
{
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)
@ -144,8 +131,7 @@ internal sealed class PresetBuilderComponent
QuestPreset value;
if (DrawGroupHeader("Aether Currents", "Unlock aether currents in various expansion zones to enable flying.", orderedEnumerable))
{
IndentDisposable val = ImRaii.PushIndent(1, true);
try
using (ImRaii.PushIndent())
{
foreach (KeyValuePair<string, QuestPreset> item in orderedEnumerable)
{
@ -155,15 +141,10 @@ 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))
{
IndentDisposable val2 = ImRaii.PushIndent(1, true);
try
using (ImRaii.PushIndent())
{
foreach (KeyValuePair<string, QuestPreset> item2 in orderedEnumerable2)
{
@ -173,17 +154,12 @@ 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;
}
IndentDisposable val3 = ImRaii.PushIndent(1, true);
try
using (ImRaii.PushIndent())
{
foreach (KeyValuePair<string, QuestPreset> item3 in orderedEnumerable3)
{
@ -193,10 +169,6 @@ internal sealed class PresetBuilderComponent
DrawPreset(key4, preset3);
}
}
finally
{
((IDisposable)val3)?.Dispose();
}
}
private bool DrawGroupHeader(string groupName, string groupDescription, IEnumerable<KeyValuePair<string, QuestPreset>> presets)
@ -249,8 +221,7 @@ internal sealed class PresetBuilderComponent
private void DrawPreset(string key, QuestPreset preset)
{
IdDisposable val = ImRaii.PushId((ImU8String)key, true);
try
using (ImRaii.PushId(key))
{
List<ElementId> availableQuestsForPreset = GetAvailableQuestsForPreset(preset);
List<ElementId> completedQuestsForPreset = GetCompletedQuestsForPreset(preset);
@ -291,8 +262,7 @@ internal sealed class PresetBuilderComponent
{
return;
}
IndentDisposable val2 = ImRaii.PushIndent(1, true);
try
using (ImRaii.PushIndent())
{
ImGui.TextWrapped(preset.Description);
ImGui.Spacing();
@ -392,14 +362,6 @@ 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,33 +62,18 @@ 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);
ColorDisposable val = ImRaii.PushColor(ImGuiCol.Button, Vector4.Zero, true);
try
using (ImRaii.PushColor(ImGuiCol.Button, Vector4.Zero))
{
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.ButtonHovered, new Vector4(0.8f, 0.3f, 0.3f, 0.4f), true);
try
using (ImRaii.PushColor(ImGuiCol.ButtonHovered, new Vector4(0.8f, 0.3f, 0.3f, 0.4f)))
{
ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.ButtonActive, new Vector4(0.9f, 0.2f, 0.2f, 0.6f), true);
try
using (ImRaii.PushColor(ImGuiCol.ButtonActive, new Vector4(0.9f, 0.2f, 0.2f, 0.6f)))
{
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());
}
@ -146,40 +131,29 @@ 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);
FontDisposable val = ImRaii.PushFont(UiBuilder.IconFont, true);
try
using (ImRaii.PushFont(UiBuilder.IconFont))
{
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);
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.FrameBg, new Vector4(0.08f, 0.06f, 0.12f, 0.8f), true);
try
using (ImRaii.PushColor(ImGuiCol.FrameBg, new Vector4(0.08f, 0.06f, 0.12f, 0.8f)))
{
ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.FrameBgHovered, new Vector4(0.12f, 0.1f, 0.18f, 0.9f), true);
try
using (ImRaii.PushColor(ImGuiCol.FrameBgHovered, new Vector4(0.12f, 0.1f, 0.18f, 0.9f)))
{
ColorDisposable val4 = ImRaii.PushColor(ImGuiCol.FrameBgActive, new Vector4(0.15f, 0.13f, 0.22f, 1f), true);
try
using (ImRaii.PushColor(ImGuiCol.FrameBgActive, new Vector4(0.15f, 0.13f, 0.22f, 1f)))
{
bool flag = ImGui.InputTextWithHint("##QuestLookup", "Enter quest ID...", ref _questLookupInput, 10, ImGuiInputTextFlags.EnterReturnsTrue);
ImGui.SameLine();
ColorDisposable val5 = ImRaii.PushColor(ImGuiCol.Button, new Vector4(0.25f, 0.22f, 0.32f, 0.8f), true);
try
using (ImRaii.PushColor(ImGuiCol.Button, new Vector4(0.25f, 0.22f, 0.32f, 0.8f)))
{
ColorDisposable val6 = ImRaii.PushColor(ImGuiCol.ButtonHovered, new Vector4(0.35f, 0.3f, 0.45f, 0.9f), true);
try
using (ImRaii.PushColor(ImGuiCol.ButtonHovered, new Vector4(0.35f, 0.3f, 0.45f, 0.9f)))
{
ColorDisposable val7 = ImRaii.PushColor(ImGuiCol.ButtonActive, new Vector4(0.4f, 0.35f, 0.5f, 1f), true);
try
using (ImRaii.PushColor(ImGuiCol.ButtonActive, new Vector4(0.4f, 0.35f, 0.5f, 1f)))
{
bool flag2 = ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Search, "Search");
if (flag || flag2)
@ -194,34 +168,10 @@ 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();
@ -305,14 +255,11 @@ internal sealed class QuestSequenceComponent
ImGui.TextColored(in col, text);
ImGui.SameLine();
ImGui.SetCursorPosX(ImGui.GetCursorPosX() + 8f);
ColorDisposable val = ImRaii.PushColor(ImGuiCol.Button, new Vector4(0.18f, 0.16f, 0.22f, 0.8f), true);
try
using (ImRaii.PushColor(ImGuiCol.Button, new Vector4(0.18f, 0.16f, 0.22f, 0.8f)))
{
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.ButtonHovered, new Vector4(0.28f, 0.24f, 0.32f, 0.95f), true);
try
using (ImRaii.PushColor(ImGuiCol.ButtonHovered, new Vector4(0.28f, 0.24f, 0.32f, 0.95f)))
{
ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.ButtonActive, new Vector4(0.35f, 0.3f, 0.45f, 1f), true);
try
using (ImRaii.PushColor(ImGuiCol.ButtonActive, new Vector4(0.35f, 0.3f, 0.45f, 1f)))
{
if (ImGuiComponents.IconButton(FontAwesomeIcon.Copy))
{
@ -323,19 +270,7 @@ 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)
{
@ -431,115 +366,95 @@ internal sealed class QuestSequenceComponent
private static void DrawSummaryCards(int totalSequences, int maxSeq, bool hasQuestPath, float coverage, Vector4 coverageColor, int implementedCount, int expectedCount)
{
//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
using ImRaii.TableDisposable tableDisposable = ImRaii.Table("SummaryCards", 2, ImGuiTableFlags.None);
if (!tableDisposable)
{
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);
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)
{
return;
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;
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);
ImGui.Unindent(10f);
}
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
else
{
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.PushFont(UiBuilder.IconFont);
ImGui.TextColored(new Vector4(0.6f, 0.5f, 0.8f, 0.8f), FontAwesomeIcon.Ban.ToIconString());
ImGui.PopFont();
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.TextColored(new Vector4(0.6f, 0.5f, 0.8f, 0.8f), "Not Implemented");
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.TextColored(new Vector4(0.7f, 0.7f, 0.8f, 1f), "No quest path data available");
ImGui.Unindent(10f);
});
ImGui.TableNextColumn();
DrawCard(80f, new Vector4(0.5f, 1f, 0.6f, 1f), FontAwesomeIcon.Code, "Implementation Status", delegate
{
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)
@ -564,100 +479,58 @@ 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;
ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.ChildBg, new Vector4(0.08f, 0.06f, 0.12f, 0.6f), true);
try
using (ImRaii.PushColor(ImGuiCol.ChildBg, new Vector4(0.08f, 0.06f, 0.12f, 0.6f)))
{
ColorDisposable val4 = ImRaii.PushColor(ImGuiCol.Border, new Vector4(0.6f, 0.5f, 0.8f, 0.2f), true);
try
using (ImRaii.PushColor(ImGuiCol.Border, new Vector4(0.6f, 0.5f, 0.8f, 0.2f)))
{
ChildDisposable val5 = ImRaii.Child((ImU8String)"SequenceGrid", new Vector2(-1f, y), true, ImGuiWindowFlags.None);
try
using ImRaii.ChildDisposable childDisposable = ImRaii.Child("SequenceGrid", new Vector2(-1f, y), border: true, ImGuiWindowFlags.None);
if (!(bool)childDisposable)
{
if (!ChildDisposable.op_Implicit(val5))
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)))
{
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
using ImRaii.TableDisposable tableDisposable = ImRaii.Table("SequenceGridTable", val2, ImGuiTableFlags.Borders | ImGuiTableFlags.SizingStretchSame);
if (!(bool)tableDisposable)
{
TableDisposable val8 = ImRaii.Table((ImU8String)"SequenceGridTable", val2, ImGuiTableFlags.Borders | ImGuiTableFlags.SizingStretchSame);
try
{
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();
}
return;
}
finally
int num = 0;
for (int i = 0; i <= maxSeq; i++)
{
((IDisposable)val7)?.Dispose();
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
{
((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;
@ -701,21 +574,15 @@ internal sealed class QuestSequenceComponent
if (ImGui.IsItemHovered())
{
_hoveredSequenceId = sequenceId;
TooltipDisposable val = ImRaii.Tooltip();
try
using (ImRaii.Tooltip())
{
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, new Vector4(0.98f, 0.98f, 1f, 1f), true);
try
using (ImRaii.PushColor(ImGuiCol.Text, new Vector4(0.98f, 0.98f, 1f, 1f)))
{
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))
{
@ -760,10 +627,6 @@ 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,4 +1,3 @@
using System;
using Dalamud.Bindings.ImGui;
using Dalamud.Game.Text;
using Dalamud.Interface;
@ -39,19 +38,10 @@ internal sealed class QuestTooltipComponent
public void Draw(IQuestInfo questInfo)
{
//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
using ImRaii.TooltipDisposable tooltipDisposable = ImRaii.Tooltip();
if (tooltipDisposable.Alive)
{
if (((TooltipDisposable)(ref val)).Alive)
{
DrawInner(questInfo, showItemRewards: true);
}
}
finally
{
((TooltipDisposable)(ref val)).Dispose();
DrawInner(questInfo, showItemRewards: true);
}
}
@ -153,15 +143,10 @@ internal sealed class QuestTooltipComponent
}
else
{
DisabledDisposable val = ImRaii.Disabled();
try
using (ImRaii.Disabled())
{
_uiUtils.ChecklistItem($"Unknown Quest ({previousQuest.QuestId})", ImGuiColors.DalamudGrey, FontAwesomeIcon.Question);
}
finally
{
((IDisposable)val)?.Dispose();
}
}
}
}

View file

@ -55,26 +55,20 @@ internal sealed class QuestValidationComponent
ImGui.SameLine();
ImGui.Text("(");
ImGui.SameLine();
ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed, true);
try
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed))
{
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();
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudOrange, true);
try
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudOrange))
{
ImU8String text3 = new ImU8String(12, 1);
text3.AppendLiteral(", ");
@ -83,16 +77,11 @@ internal sealed class QuestValidationComponent
ImGui.Text(text3);
return;
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
ImGui.SameLine();
ImGui.Text("(");
ImGui.SameLine();
ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudOrange, true);
try
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudOrange))
{
ImU8String text4 = new ImU8String(10, 1);
text4.AppendFormatted(num);
@ -100,10 +89,6 @@ internal sealed class QuestValidationComponent
ImGui.Text(text4);
return;
}
finally
{
((IDisposable)val3)?.Dispose();
}
}
if (errorCount > 0)
{
@ -114,32 +99,22 @@ internal sealed class QuestValidationComponent
private void DrawValidationTable()
{
//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
using ImRaii.TableDisposable tableDisposable = ImRaii.Table("ValidationIssues", 6, ImGuiTableFlags.Borders | ImGuiTableFlags.Sortable | ImGuiTableFlags.RowBg | ImGuiTableFlags.ScrollY);
if (!(!tableDisposable))
{
if (!(!val))
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++)
{
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);
}
DrawValidationRow(issues[i], i);
}
}
finally
{
((TableDisposable)(ref val)).Dispose();
}
}
private void DrawValidationRow(ValidationIssue issue, int index)
@ -161,15 +136,10 @@ internal sealed class QuestValidationComponent
}
else
{
ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudGrey2, true);
try
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudGrey2))
{
ImGui.TextUnformatted("\ufffd");
}
finally
{
((IDisposable)val)?.Dispose();
}
}
}
if (ImGui.TableNextColumn())
@ -180,15 +150,10 @@ internal sealed class QuestValidationComponent
}
else
{
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudGrey2, true);
try
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudGrey2))
{
ImGui.TextUnformatted("\ufffd");
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
}
if (ImGui.TableNextColumn())
@ -203,31 +168,21 @@ internal sealed class QuestValidationComponent
private void DrawIssueCell(ValidationIssue issue, int index)
{
Vector4 vector = ((issue.Severity == EIssueSeverity.Error) ? ImGuiColors.DalamudRed : ImGuiColors.DalamudOrange);
Vector4 color = ((issue.Severity == EIssueSeverity.Error) ? ImGuiColors.DalamudRed : ImGuiColors.DalamudOrange);
FontAwesomeIcon icon = ((issue.Severity == EIssueSeverity.Error) ? FontAwesomeIcon.ExclamationTriangle : FontAwesomeIcon.InfoCircle);
using (_pluginInterface.UiBuilder.IconFontFixedWidthHandle.Push())
{
ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, vector, true);
try
using (ImRaii.PushColor(ImGuiCol.Text, color))
{
ImGui.TextUnformatted(icon.ToIconString());
}
finally
{
((IDisposable)val)?.Dispose();
}
}
ImGui.SameLine();
string issueSummary = GetIssueSummary(issue);
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, vector, true);
try
using (ImRaii.PushColor(ImGuiCol.Text, color))
{
ImGui.TextWrapped(issueSummary);
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
private void DrawActionsCell(ValidationIssue issue, int index)

View file

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

View file

@ -87,32 +87,23 @@ 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();
ChildDisposable val = ImRaii.Child((ImU8String)"SavedPresetsList", new Vector2(-1f, -27f), true);
try
using (ImRaii.ChildDisposable childDisposable = ImRaii.Child("SavedPresetsList", new Vector2(-1f, -27f), border: true))
{
if (ChildDisposable.op_Implicit(val))
if ((bool)childDisposable)
{
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:");
@ -122,18 +113,13 @@ internal sealed class SavedPresetsComponent
ImGui.SetNextItemWidth(250f);
ImGui.InputTextWithHint("##PresetDescription", "Description (optional)...", ref _newPresetDescription, 256);
ImGui.SameLine();
val = ImRaii.Disabled(string.IsNullOrWhiteSpace(_newPresetName) || count == 0);
try
using (ImRaii.Disabled(string.IsNullOrWhiteSpace(_newPresetName) || count == 0))
{
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Save, "Save"))
{
SaveCurrentPreset();
}
}
finally
{
((IDisposable)val)?.Dispose();
}
ImGui.SameLine();
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Times, "Cancel"))
{
@ -147,18 +133,13 @@ internal sealed class SavedPresetsComponent
}
return;
}
val = ImRaii.Disabled(count == 0);
try
using (ImRaii.Disabled(count == 0))
{
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.");
@ -192,8 +173,7 @@ internal sealed class SavedPresetsComponent
private void DrawPresetEntry(string key, Configuration.SavedQuestPreset preset)
{
IdDisposable val = ImRaii.PushId((ImU8String)key, true);
try
using (ImRaii.PushId(key))
{
List<ElementId> availableQuests = GetAvailableQuests(preset.QuestIds);
List<ElementId> completedQuests = GetCompletedQuests(preset.QuestIds);
@ -224,10 +204,8 @@ internal sealed class SavedPresetsComponent
if (ImGui.CollapsingHeader(label, flag ? ImGuiTreeNodeFlags.DefaultOpen : ImGuiTreeNodeFlags.None))
{
_expandedPreset = key;
IndentDisposable val2 = ImRaii.PushIndent(1, true);
try
using (ImRaii.PushIndent())
{
DisabledDisposable val3;
if (_renamingPresetKey == key)
{
ImGui.Text("Name:");
@ -238,18 +216,13 @@ internal sealed class SavedPresetsComponent
ImGui.SameLine();
ImGui.SetNextItemWidth(300f);
ImGui.InputTextWithHint("##EditDescription", "Description (optional)...", ref _renamePresetDescription, 256);
val3 = ImRaii.Disabled(string.IsNullOrWhiteSpace(_renamePresetName));
try
using (ImRaii.Disabled(string.IsNullOrWhiteSpace(_renamePresetName)))
{
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Check, "Save Changes"))
{
RenamePreset(key, _renamePresetName, _renamePresetDescription);
}
}
finally
{
((IDisposable)val3)?.Dispose();
}
ImGui.SameLine();
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Times, "Cancel"))
{
@ -273,18 +246,13 @@ internal sealed class SavedPresetsComponent
ImGui.TextColored(in col, text2);
}
ImGui.Spacing();
val3 = ImRaii.Disabled(availableQuests.Count == 0);
try
using (ImRaii.Disabled(availableQuests.Count == 0))
{
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Plus, $"Add Available ({availableQuests.Count})"))
{
AddPresetToPriority(availableQuests);
}
}
finally
{
((IDisposable)val3)?.Dispose();
}
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
{
if (availableQuests.Count == 0)
@ -301,18 +269,13 @@ internal sealed class SavedPresetsComponent
}
}
ImGui.SameLine();
val3 = ImRaii.Disabled(alreadyPriorityQuests.Count == 0);
try
using (ImRaii.Disabled(alreadyPriorityQuests.Count == 0))
{
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)
@ -337,8 +300,7 @@ internal sealed class SavedPresetsComponent
ImGui.SetTooltip("Export this preset to clipboard for sharing.");
}
ImGui.SameLine();
val3 = ImRaii.Disabled(_renamingPresetKey != null);
try
using (ImRaii.Disabled(_renamingPresetKey != null))
{
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Pen, "Edit"))
{
@ -347,28 +309,19 @@ 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;
val3 = ImRaii.Disabled(count == 0);
try
using (ImRaii.Disabled(count == 0))
{
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Sync, "Update"))
{
UpdatePresetQuests(key, preset);
}
}
finally
{
((IDisposable)val3)?.Dispose();
}
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
{
if (count == 0)
@ -385,18 +338,13 @@ internal sealed class SavedPresetsComponent
}
}
ImGui.SameLine();
val3 = ImRaii.Disabled(!ImGui.IsKeyDown(ImGuiKey.ModCtrl));
try
using (ImRaii.Disabled(!ImGui.IsKeyDown(ImGuiKey.ModCtrl)))
{
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.");
@ -430,10 +378,6 @@ internal sealed class SavedPresetsComponent
}
ImGui.Spacing();
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
else if (_expandedPreset == key)
{
@ -446,69 +390,49 @@ internal sealed class SavedPresetsComponent
ImGui.EndTooltip();
}
}
finally
{
((IDisposable)val)?.Dispose();
}
}
private void DrawBottomButtons()
{
PresetExportData presetExportData = ParseClipboardPreset();
List<PresetExportData> list = ParseClipboardAllPresets();
DisabledDisposable val = ImRaii.Disabled(presetExportData == null);
try
using (ImRaii.Disabled(presetExportData == null))
{
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();
val = ImRaii.Disabled(list == null || list.Count == 0);
try
using (ImRaii.Disabled(list == null || list.Count == 0))
{
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();
val = ImRaii.Disabled(_configuration.General.SavedPresets.Count == 0);
try
using (ImRaii.Disabled(_configuration.General.SavedPresets.Count == 0))
{
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();
val = ImRaii.Disabled(_configuration.General.SavedPresets.Count == 0 || !ImGui.IsKeyDown(ImGuiKey.ModCtrl));
try
using (ImRaii.Disabled(_configuration.General.SavedPresets.Count == 0 || !ImGui.IsKeyDown(ImGuiKey.ModCtrl)))
{
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Trash, "Clear All"))
{
@ -517,10 +441,6 @@ 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,23 +111,17 @@ internal sealed class ValidationDetailsRenderer
private void DrawIssueDetails(ValidationIssue issue)
{
Vector4 vector = ((issue.Severity == EIssueSeverity.Error) ? ImGuiColors.DalamudRed : ImGuiColors.DalamudOrange);
Vector4 color = ((issue.Severity == EIssueSeverity.Error) ? ImGuiColors.DalamudRed : ImGuiColors.DalamudOrange);
FontAwesomeIcon icon = ((issue.Severity == EIssueSeverity.Error) ? FontAwesomeIcon.ExclamationTriangle : FontAwesomeIcon.InfoCircle);
using (_pluginInterface.UiBuilder.IconFontFixedWidthHandle.Push())
{
ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, vector, true);
try
using (ImRaii.PushColor(ImGuiCol.Text, color))
{
ImGui.TextUnformatted(icon.ToIconString());
}
finally
{
((IDisposable)val)?.Dispose();
}
}
ImGui.SameLine();
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, vector, true);
try
using (ImRaii.PushColor(ImGuiCol.Text, color))
{
ImU8String text = new ImU8String(2, 2);
text.AppendFormatted(issue.Severity);
@ -135,10 +129,6 @@ internal sealed class ValidationDetailsRenderer
text.AppendFormatted(issue.Type);
ImGui.Text(text);
}
finally
{
((IDisposable)val2)?.Dispose();
}
ImGui.Separator();
if (issue.ElementId != null)
{
@ -204,39 +194,24 @@ internal sealed class ValidationDetailsRenderer
}
else if (text.StartsWith("JSON parsing error", StringComparison.Ordinal))
{
ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed, true);
try
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed))
{
ImGui.TextWrapped(text);
}
finally
{
((IDisposable)val)?.Dispose();
}
}
else if (text.StartsWith("This usually indicates", StringComparison.Ordinal) || text.StartsWith("Please check", StringComparison.Ordinal))
{
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.HealerGreen, true);
try
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.HealerGreen))
{
ImGui.TextWrapped(text);
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
else if (text.StartsWith("\ufffd ", StringComparison.Ordinal))
{
ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow, true);
try
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow))
{
ImGui.TextWrapped(text);
}
finally
{
((IDisposable)val3)?.Dispose();
}
}
else
{
@ -278,9 +253,8 @@ internal sealed class ValidationDetailsRenderer
for (int num = 0; num < list.Count; num++)
{
string value = list[num];
Vector4 vector = array2[num % array2.Length];
ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, vector, true);
try
Vector4 color = array2[num % array2.Length];
using (ImRaii.PushColor(ImGuiCol.Text, color))
{
if (ElementId.TryFromString(value, out ElementId elementId) && elementId != null)
{
@ -311,10 +285,6 @@ internal sealed class ValidationDetailsRenderer
ImGui.TextWrapped(text3);
}
}
finally
{
((IDisposable)val)?.Dispose();
}
}
ImGui.Unindent();
}
@ -348,8 +318,7 @@ internal sealed class ValidationDetailsRenderer
private void DrawJsonValidationError(JsonValidationError error, int index)
{
ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow, true);
try
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow))
{
ImU8String text = new ImU8String(8, 1);
text.AppendLiteral("Error #");
@ -357,25 +326,16 @@ 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();
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedBlue, true);
try
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedBlue))
{
ImGui.TextWrapped(FormatJsonPath(error.Path));
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
if (error.Messages.Count > 0)
{
@ -384,8 +344,7 @@ internal sealed class ValidationDetailsRenderer
foreach (string message in error.Messages)
{
ImGui.Indent(12f);
ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed, true);
try
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed))
{
string text2 = CleanJsonText(message);
if (string.Equals(text2, "validation failed", StringComparison.OrdinalIgnoreCase))
@ -398,18 +357,13 @@ 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();
ColorDisposable val4 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.HealerGreen, true);
try
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.HealerGreen))
{
ImGui.Text("Suggestions:");
foreach (string item in validationSuggestions)
@ -417,33 +371,19 @@ internal sealed class ValidationDetailsRenderer
ImGui.Indent(12f);
using (_pluginInterface.UiBuilder.IconFontFixedWidthHandle.Push())
{
ColorDisposable val5 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow, true);
try
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow))
{
ImGui.Text(FontAwesomeIcon.Lightbulb.ToIconString());
}
finally
{
((IDisposable)val5)?.Dispose();
}
}
ImGui.SameLine();
ColorDisposable val6 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.HealerGreen, true);
try
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.HealerGreen))
{
ImGui.TextWrapped(item);
ImGui.Unindent(12f);
}
finally
{
((IDisposable)val6)?.Dispose();
}
}
}
finally
{
((IDisposable)val4)?.Dispose();
}
}
ImGui.Unindent(12f);
}
@ -455,15 +395,10 @@ internal sealed class ValidationDetailsRenderer
{
if (text.StartsWith("JSON Validation failed:", StringComparison.Ordinal))
{
ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed, true);
try
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed))
{
ImGui.TextWrapped(text);
}
finally
{
((IDisposable)val)?.Dispose();
}
}
else if (text.StartsWith(" - ", StringComparison.Ordinal))
{
@ -478,39 +413,24 @@ internal sealed class ValidationDetailsRenderer
}
ImGui.Text("\ufffd");
ImGui.SameLine();
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedBlue, true);
try
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedBlue))
{
ImGui.Text(FormatJsonPath(path));
}
finally
{
((IDisposable)val2)?.Dispose();
}
ImGui.SameLine();
ImGui.Text(":");
ImGui.SameLine();
ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed, true);
try
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed))
{
ImGui.TextWrapped(text2);
}
finally
{
((IDisposable)val3)?.Dispose();
}
}
else
{
ColorDisposable val4 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed, true);
try
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed))
{
ImGui.TextWrapped(CleanJsonText(text));
}
finally
{
((IDisposable)val4)?.Dispose();
}
}
}
else
@ -621,30 +541,20 @@ internal sealed class ValidationDetailsRenderer
}
else if (text.StartsWith("Error:", StringComparison.Ordinal) || text.StartsWith("Invalid", StringComparison.Ordinal) || text.StartsWith("Missing", StringComparison.Ordinal))
{
ColorDisposable val = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed, true);
try
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed))
{
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();
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedBlue, true);
try
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedBlue))
{
ImGui.Text(text2 + ":");
}
finally
{
((IDisposable)val2)?.Dispose();
}
ImGui.SameLine();
ImGui.TextWrapped(text3);
}