muffin v6.35 with old pdb

This commit is contained in:
alydev 2025-10-29 06:52:53 +10:00
parent ac85599236
commit b5d2cc6708
31 changed files with 958 additions and 958 deletions

View file

@ -175,16 +175,16 @@ internal sealed class ActiveQuestComponent
{
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed))
{
ImU8String text = new ImU8String(26, 4);
text.AppendLiteral("Simulated Quest: ");
text.AppendFormatted(Shorten(currentQuest.Quest.Info.Name));
text.AppendLiteral(" (");
text.AppendFormatted(currentQuest.Quest.Id);
text.AppendLiteral(") / ");
text.AppendFormatted(currentQuest.Sequence);
text.AppendLiteral(" / ");
text.AppendFormatted(currentQuest.Step);
ImGui.TextUnformatted(text);
ImU8String hover = new ImU8String(26, 4);
hover.AppendLiteral("Simulated Quest: ");
hover.AppendFormatted(Shorten(currentQuest.Quest.Info.Name));
hover.AppendLiteral(" (");
hover.AppendFormatted(currentQuest.Quest.Id);
hover.AppendLiteral(") / ");
hover.AppendFormatted(currentQuest.Sequence);
hover.AppendLiteral(" / ");
hover.AppendFormatted(currentQuest.Step);
ImGui.TextUnformatted(hover);
return;
}
}
@ -192,16 +192,16 @@ internal sealed class ActiveQuestComponent
{
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGold))
{
ImU8String text = new ImU8String(20, 4);
text.AppendLiteral("Gathering: ");
text.AppendFormatted(Shorten(currentQuest.Quest.Info.Name));
text.AppendLiteral(" (");
text.AppendFormatted(currentQuest.Quest.Id);
text.AppendLiteral(") / ");
text.AppendFormatted(currentQuest.Sequence);
text.AppendLiteral(" / ");
text.AppendFormatted(currentQuest.Step);
ImGui.TextUnformatted(text);
ImU8String hover = new ImU8String(20, 4);
hover.AppendLiteral("Gathering: ");
hover.AppendFormatted(Shorten(currentQuest.Quest.Info.Name));
hover.AppendLiteral(" (");
hover.AppendFormatted(currentQuest.Quest.Id);
hover.AppendLiteral(") / ");
hover.AppendFormatted(currentQuest.Sequence);
hover.AppendLiteral(" / ");
hover.AppendFormatted(currentQuest.Step);
ImGui.TextUnformatted(hover);
return;
}
}
@ -219,25 +219,25 @@ internal sealed class ActiveQuestComponent
ImGui.SetTooltip("This quest is loaded from your 'pluginConfigs\\Questionable\\Quests' directory.\nThis gets loaded even if Questionable ships with a newer/different version of the quest.");
}
}
ImU8String text = new ImU8String(16, 4);
text.AppendLiteral("Quest: ");
text.AppendFormatted(Shorten(startedQuest.Quest.Info.Name));
text.AppendLiteral(" (");
text.AppendFormatted(startedQuest.Quest.Id);
text.AppendLiteral(") / ");
text.AppendFormatted(startedQuest.Sequence);
text.AppendLiteral(" / ");
text.AppendFormatted(startedQuest.Step);
ImGui.TextUnformatted(text);
ImU8String hover = new ImU8String(16, 4);
hover.AppendLiteral("Quest: ");
hover.AppendFormatted(Shorten(startedQuest.Quest.Info.Name));
hover.AppendLiteral(" (");
hover.AppendFormatted(startedQuest.Quest.Id);
hover.AppendLiteral(") / ");
hover.AppendFormatted(startedQuest.Sequence);
hover.AppendLiteral(" / ");
hover.AppendFormatted(startedQuest.Step);
ImGui.TextUnformatted(hover);
if (startedQuest.Quest.Root.Disabled)
{
ImGui.SameLine();
ImGui.TextColored(ImGuiColors.DalamudRed, "Disabled");
}
bool flag = _configuration.Stop.Enabled && _configuration.Stop.LevelToStopAfter;
bool flag2 = _configuration.Stop.Enabled && _configuration.Stop.QuestsToStopAfter.Any((ElementId x) => !_questFunctions.IsQuestComplete(x) && !_questFunctions.IsQuestUnobtainable(x));
bool flag3 = _configuration.Stop.Enabled && _configuration.Stop.SequenceToStopAfter;
if (flag || flag2 || flag3)
bool instanceId = _configuration.Stop.Enabled && _configuration.Stop.QuestsToStopAfter.Any((ElementId x) => !_questFunctions.IsQuestComplete(x) && !_questFunctions.IsQuestUnobtainable(x));
bool color = _configuration.Stop.Enabled && _configuration.Stop.SequenceToStopAfter;
if (flag || instanceId || color)
{
ImGui.SameLine();
Vector4 col = ImGuiColors.ParsedPurple;
@ -253,7 +253,7 @@ internal sealed class ActiveQuestComponent
col = ImGuiColors.ParsedBlue;
}
}
if (flag3)
if (color)
{
col = ((startedQuest.Sequence < _configuration.Stop.TargetSequence) ? ImGuiColors.ParsedBlue : ImGuiColors.ParsedGreen);
}
@ -268,67 +268,67 @@ internal sealed class ActiveQuestComponent
if (flag)
{
int num2 = _clientState.LocalPlayer?.Level ?? 0;
text = new ImU8String(14, 1);
text.AppendLiteral("Stop at level ");
text.AppendFormatted(_configuration.Stop.TargetLevel);
ImGui.BulletText(text);
hover = new ImU8String(14, 1);
hover.AppendLiteral("Stop at level ");
hover.AppendFormatted(_configuration.Stop.TargetLevel);
ImGui.BulletText(hover);
if (num2 > 0)
{
ImGui.SameLine();
if (num2 >= _configuration.Stop.TargetLevel)
{
Vector4 col2 = ImGuiColors.ParsedGreen;
text = new ImU8String(22, 1);
text.AppendLiteral("(Current: ");
text.AppendFormatted(num2);
text.AppendLiteral(" - Reached!)");
ImGui.TextColored(in col2, text);
Vector4 icon = ImGuiColors.ParsedGreen;
hover = new ImU8String(22, 1);
hover.AppendLiteral("(Current: ");
hover.AppendFormatted(num2);
hover.AppendLiteral(" - Reached!)");
ImGui.TextColored(in icon, hover);
}
else
{
Vector4 col2 = ImGuiColors.ParsedBlue;
text = new ImU8String(11, 1);
text.AppendLiteral("(Current: ");
text.AppendFormatted(num2);
text.AppendLiteral(")");
ImGui.TextColored(in col2, text);
Vector4 icon = ImGuiColors.ParsedBlue;
hover = new ImU8String(11, 1);
hover.AppendLiteral("(Current: ");
hover.AppendFormatted(num2);
hover.AppendLiteral(")");
ImGui.TextColored(in icon, hover);
}
}
}
if (flag3)
if (color)
{
if (flag)
{
ImGui.Spacing();
}
int sequence = startedQuest.Sequence;
text = new ImU8String(23, 1);
text.AppendLiteral("Stop at quest sequence ");
text.AppendFormatted(_configuration.Stop.TargetSequence);
ImGui.BulletText(text);
hover = new ImU8String(23, 1);
hover.AppendLiteral("Stop at quest sequence ");
hover.AppendFormatted(_configuration.Stop.TargetSequence);
ImGui.BulletText(hover);
ImGui.SameLine();
if (sequence >= _configuration.Stop.TargetSequence)
{
Vector4 col2 = ImGuiColors.ParsedGreen;
text = new ImU8String(22, 1);
text.AppendLiteral("(Current: ");
text.AppendFormatted(sequence);
text.AppendLiteral(" - Reached!)");
ImGui.TextColored(in col2, text);
Vector4 icon = ImGuiColors.ParsedGreen;
hover = new ImU8String(22, 1);
hover.AppendLiteral("(Current: ");
hover.AppendFormatted(sequence);
hover.AppendLiteral(" - Reached!)");
ImGui.TextColored(in icon, hover);
}
else
{
Vector4 col2 = ImGuiColors.ParsedBlue;
text = new ImU8String(11, 1);
text.AppendLiteral("(Current: ");
text.AppendFormatted(sequence);
text.AppendLiteral(")");
ImGui.TextColored(in col2, text);
Vector4 icon = ImGuiColors.ParsedBlue;
hover = new ImU8String(11, 1);
hover.AppendLiteral("(Current: ");
hover.AppendFormatted(sequence);
hover.AppendLiteral(")");
ImGui.TextColored(in icon, hover);
}
}
if (flag2)
if (instanceId)
{
if (flag || flag3)
if (flag || color)
{
ImGui.Spacing();
}
@ -338,8 +338,8 @@ internal sealed class ActiveQuestComponent
{
if (_questRegistry.TryGetQuest(item, out Quest quest))
{
var (color, icon, _) = _uiUtils.GetQuestStyle(item);
_uiUtils.ChecklistItem($"{quest.Info.Name} ({item})", color, icon);
var (color2, icon2, _) = _uiUtils.GetQuestStyle(item);
_uiUtils.ChecklistItem($"{quest.Info.Name} ({item})", color2, icon2);
}
}
ImGui.Unindent();
@ -370,12 +370,12 @@ internal sealed class ActiveQuestComponent
{
if (_questRegistry.TryGetQuest(item2, out Quest quest2))
{
text = new ImU8String(3, 2);
text.AppendFormatted(quest2.Info.Name);
text.AppendLiteral(" (");
text.AppendFormatted(item2);
text.AppendLiteral(")");
ImGui.BulletText(text);
hover = new ImU8String(3, 2);
hover.AppendFormatted(quest2.Info.Name);
hover.AppendLiteral(" (");
hover.AppendFormatted(item2);
hover.AppendLiteral(")");
ImGui.BulletText(hover);
}
}
}
@ -393,13 +393,13 @@ internal sealed class ActiveQuestComponent
{
if (_questRegistry.TryGetQuest(elementId2, out Quest quest3))
{
text = new ImU8String(6, 3);
text.AppendFormatted(quest3.Info.Name);
text.AppendLiteral(" (");
text.AppendFormatted(elementId2);
text.AppendLiteral(") - ");
text.AppendFormatted(value);
ImGui.BulletText(text);
hover = new ImU8String(6, 3);
hover.AppendFormatted(quest3.Info.Name);
hover.AppendLiteral(" (");
hover.AppendFormatted(elementId2);
hover.AppendLiteral(") - ");
hover.AppendFormatted(value);
ImGui.BulletText(hover);
}
}
}
@ -413,41 +413,41 @@ internal sealed class ActiveQuestComponent
{
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow))
{
ImU8String text = new ImU8String(21, 4);
text.AppendLiteral("Next Quest: ");
text.AppendFormatted(Shorten(nextQuest.Quest.Info.Name));
text.AppendLiteral(" (");
text.AppendFormatted(nextQuest.Quest.Id);
text.AppendLiteral(") / ");
text.AppendFormatted(nextQuest.Sequence);
text.AppendLiteral(" / ");
text.AppendFormatted(nextQuest.Step);
ImGui.TextUnformatted(text);
ImU8String hover = new ImU8String(21, 4);
hover.AppendLiteral("Next Quest: ");
hover.AppendFormatted(Shorten(nextQuest.Quest.Info.Name));
hover.AppendLiteral(" (");
hover.AppendFormatted(nextQuest.Quest.Id);
hover.AppendLiteral(") / ");
hover.AppendFormatted(nextQuest.Sequence);
hover.AppendLiteral(" / ");
hover.AppendFormatted(nextQuest.Step);
ImGui.TextUnformatted(hover);
}
}
}
private unsafe QuestProgressInfo? DrawQuestWork(QuestController.QuestProgress currentQuest, bool isMinimized)
{
QuestProgressInfo questProgressInfo = _questFunctions.GetQuestProgressInfo(currentQuest.Quest.Id);
if (questProgressInfo != null)
QuestProgressInfo complete = _questFunctions.GetQuestProgressInfo(currentQuest.Quest.Id);
if (complete != null)
{
if (isMinimized)
{
return questProgressInfo;
return complete;
}
Vector4* styleColorVec = ImGui.GetStyleColorVec4(ImGuiCol.TextDisabled);
Vector4 color = ((styleColorVec == null) ? ImGuiColors.ParsedOrange : (*styleColorVec));
using (ImRaii.PushColor(ImGuiCol.Text, color))
Vector4 hover = ((styleColorVec == null) ? ImGuiColors.ParsedOrange : (*styleColorVec));
using (ImRaii.PushColor(ImGuiCol.Text, hover))
{
ImU8String text = new ImU8String(0, 1);
text.AppendFormatted(questProgressInfo);
text.AppendFormatted(complete);
ImGui.Text(text);
if (ImGui.IsItemClicked())
{
string text2 = MultipleWhitespaceRegex().Replace(questProgressInfo.ToString(), " ");
ImGui.SetClipboardText(text2);
_chatGui.Print("Copied '" + text2 + "' to clipboard");
string questId = MultipleWhitespaceRegex().Replace(complete.ToString(), " ");
ImGui.SetClipboardText(questId);
_chatGui.Print("Copied '" + questId + "' to clipboard");
}
if (ImGui.IsItemHovered())
{
@ -461,7 +461,7 @@ internal sealed class ActiveQuestComponent
ImGui.SameLine();
text = new ImU8String(2, 1);
text.AppendLiteral("/ ");
text.AppendFormatted(questProgressInfo.ClassJob);
text.AppendFormatted(complete.ClassJob);
ImGui.Text(text);
}
}
@ -480,7 +480,7 @@ internal sealed class ActiveQuestComponent
}
}
}
return questProgressInfo;
return complete;
}
private void DrawQuestButtons(QuestController.QuestProgress currentQuest, QuestStep? currentStep, QuestProgressInfo? questProgressInfo, bool isMinimized)

View file

@ -75,12 +75,12 @@ internal sealed class CreationUtilsComponent
}
if (_configuration.Advanced.AdditionalStatusInformation)
{
QuestReference currentQuest = _questFunctions.GetCurrentQuest();
QuestReference time = _questFunctions.GetCurrentQuest();
ImU8String text = new ImU8String(18, 2);
text.AppendLiteral("Current Quest: ");
text.AppendFormatted(currentQuest.CurrentQuest);
text.AppendFormatted(time.CurrentQuest);
text.AppendLiteral(" → ");
text.AppendFormatted(currentQuest.Sequence);
text.AppendFormatted(time.Sequence);
ImGui.Text(text);
}
if (_targetManager.Target != null)
@ -94,13 +94,13 @@ internal sealed class CreationUtilsComponent
{
DrawCopyButton();
}
ulong hoveredItem = _gameGui.HoveredItem;
if (hoveredItem != 0L)
ulong startableQuests = _gameGui.HoveredItem;
if (startableQuests != 0L)
{
ImGui.Separator();
ImU8String text = new ImU8String(14, 1);
text.AppendLiteral("Hovered Item: ");
text.AppendFormatted(hoveredItem);
text.AppendFormatted(startableQuests);
ImGui.Text(text);
}
}

View file

@ -76,7 +76,7 @@ internal sealed class EventInfoComponent
public void Draw()
{
UpdateCacheIfNeeded();
foreach (IGrouping<string, IQuestInfo> item in _cachedActiveSeasonalQuests.GroupBy(delegate(IQuestInfo q)
foreach (IGrouping<string, IQuestInfo> tooltipText in _cachedActiveSeasonalQuests.GroupBy(delegate(IQuestInfo q)
{
if (q.QuestId is UnlockLinkId)
{
@ -89,11 +89,11 @@ internal sealed class EventInfoComponent
return q.JournalGenre.HasValue ? GetJournalGenreName(q.JournalGenre.Value) : q.Name;
}))
{
if (item.All((IQuestInfo q) => _questFunctions.IsQuestComplete(q.QuestId)))
if (tooltipText.All((IQuestInfo q) => _questFunctions.IsQuestComplete(q.QuestId)))
{
continue;
}
DateTime endsAtUtc = item.Select(delegate(IQuestInfo q)
DateTime quest = tooltipText.Select(delegate(IQuestInfo q)
{
DateTime? dateTime = (q as QuestInfo)?.SeasonalQuestExpiry ?? ((q is UnlockLinkQuestInfo unlockLinkQuestInfo) ? unlockLinkQuestInfo.QuestExpiry : ((DateTime?)null));
if (dateTime.HasValue)
@ -103,12 +103,12 @@ internal sealed class EventInfoComponent
}
return DateTime.MaxValue;
}).DefaultIfEmpty(DateTime.MaxValue).Min();
List<string> list = (from q in item
List<string> list = (from q in tooltipText
select (q as UnlockLinkQuestInfo)?.Patch into p
where !string.IsNullOrEmpty(p)
select p).Distinct().ToList();
string patch = ((list.Count == 1) ? list[0] : null);
EventQuest eventQuest = new EventQuest(item.Key, item.Select((IQuestInfo q) => q.QuestId).ToList(), endsAtUtc, patch);
EventQuest eventQuest = new EventQuest(tooltipText.Key, tooltipText.Select((IQuestInfo q) => q.QuestId).ToList(), quest, patch);
DrawEventQuest(eventQuest);
}
}
@ -117,10 +117,10 @@ internal sealed class EventInfoComponent
{
try
{
JournalGenre row = _dataManager.GetExcelSheet<JournalGenre>().GetRow(journalGenreId);
if (!row.Equals(default(JournalGenre)))
JournalGenre actualQuestInfo = _dataManager.GetExcelSheet<JournalGenre>().GetRow(journalGenreId);
if (!actualQuestInfo.Equals(default(JournalGenre)))
{
return row.Name.ExtractText();
return actualQuestInfo.Name.ExtractText();
}
}
catch (Exception exception)
@ -132,10 +132,10 @@ internal sealed class EventInfoComponent
private void DrawEventQuest(EventQuest eventQuest)
{
string text = eventQuest.Name;
string name = eventQuest.Name;
if (!string.IsNullOrEmpty(eventQuest.Patch))
{
text = text + " [" + eventQuest.Patch + "]";
name = name + " [" + eventQuest.Patch + "]";
}
if (eventQuest.EndsAtUtc != DateTime.MaxValue)
{
@ -145,21 +145,21 @@ internal sealed class EventInfoComponent
timeSpan = TimeSpan.Zero;
}
string value = FormatRemainingDays(timeSpan);
string text2 = FormatRemainingFull(timeSpan);
ImU8String text3 = new ImU8String(3, 2);
text3.AppendFormatted(text);
text3.AppendLiteral(" (");
text3.AppendFormatted(value);
text3.AppendLiteral(")");
ImGui.Text(text3);
string text = FormatRemainingFull(timeSpan);
ImU8String text2 = new ImU8String(3, 2);
text2.AppendFormatted(name);
text2.AppendLiteral(" (");
text2.AppendFormatted(value);
text2.AppendLiteral(")");
ImGui.Text(text2);
if (ImGui.IsItemHovered())
{
ImGui.SetTooltip(text2);
ImGui.SetTooltip(text);
}
}
else
{
ImGui.Text(text);
ImGui.Text(name);
}
List<ElementId> list = eventQuest.QuestIds.Where((ElementId x) => _questRegistry.IsKnownQuest(x) && _questFunctions.IsReadyToAcceptQuest(x) && x != _questController.StartedQuest?.Quest.Id && x != _questController.NextQuest?.Quest.Id).ToList();
foreach (ElementId questId in eventQuest.QuestIds)
@ -168,12 +168,12 @@ internal sealed class EventInfoComponent
{
continue;
}
ImU8String text3 = new ImU8String(21, 1);
text3.AppendLiteral("##EventQuestSelection");
text3.AppendFormatted(questId);
using (ImRaii.PushId(text3))
ImU8String text2 = new ImU8String(21, 1);
text2.AppendLiteral("##EventQuestSelection");
text2.AppendFormatted(questId);
using (ImRaii.PushId(text2))
{
string name = _questData.GetQuestInfo(questId).Name;
string name2 = _questData.GetQuestInfo(questId).Name;
if (list.Contains(questId) && _questRegistry.TryGetQuest(questId, out Questionable.Model.Quest quest))
{
if (ImGuiComponents.IconButton(FontAwesomeIcon.Play))
@ -184,7 +184,7 @@ internal sealed class EventInfoComponent
bool num = ImGui.IsItemHovered();
ImGui.SameLine();
ImGui.AlignTextToFramePadding();
ImGui.Text(name);
ImGui.Text(name2);
if (num | ImGui.IsItemHovered())
{
_questTooltipComponent.Draw(quest.Info);
@ -194,7 +194,7 @@ internal sealed class EventInfoComponent
{
ImGui.SetCursorPosX(ImGui.GetCursorPosX());
(Vector4, FontAwesomeIcon, string) questStyle = _uiUtils.GetQuestStyle(questId);
if (_uiUtils.ChecklistItem(name, questStyle.Item1, questStyle.Item2, ImGui.GetStyle().FramePadding.X))
if (_uiUtils.ChecklistItem(name2, questStyle.Item1, questStyle.Item2, ImGui.GetStyle().FramePadding.X))
{
_questTooltipComponent.Draw(_questData.GetQuestInfo(questId));
}
@ -424,14 +424,14 @@ internal sealed class EventInfoComponent
private static string FormatRemainingFull(TimeSpan remaining)
{
int num = (int)Math.Ceiling(Math.Max(0.0, remaining.TotalSeconds));
int num2 = num / 86400;
int value = num % 86400 / 3600;
int value2 = num % 3600 / 60;
int value3 = num % 60;
if (num2 < 1)
int errorCount = num / 86400;
int infoCount = num % 86400 / 3600;
int partsToRender = num % 3600 / 60;
int id = num % 60;
if (errorCount < 1)
{
return $"Ends in {value:D2}d {value2:D2}m {value3:D2}s";
return $"Ends in {infoCount:D2}d {partsToRender:D2}m {id:D2}s";
}
return $"Ends in {num2}d {value:D2}h {value2:D2}m {value3:D2}s";
return $"Ends in {errorCount}d {infoCount:D2}h {partsToRender:D2}m {id:D2}s";
}
}

View file

@ -117,11 +117,11 @@ internal sealed class PresetBuilderComponent
where x.Key.StartsWith("aether_currents_", StringComparison.Ordinal)
orderby x.Value.DisplayOrder
select x;
IOrderedEnumerable<KeyValuePair<string, QuestPreset>> orderedEnumerable2 = from x in _availablePresets
IOrderedEnumerable<KeyValuePair<string, QuestPreset>> filteredTerritories = from x in _availablePresets
where x.Key.StartsWith("aethernet_", StringComparison.Ordinal)
orderby x.Value.DisplayOrder
select x;
IOrderedEnumerable<KeyValuePair<string, QuestPreset>> orderedEnumerable3 = from x in _availablePresets
IOrderedEnumerable<KeyValuePair<string, QuestPreset>> orderedEnumerable2 = from x in _availablePresets
where !x.Key.StartsWith("aether_currents_", StringComparison.Ordinal) && !x.Key.StartsWith("aethernet_", StringComparison.Ordinal)
orderby x.Value.DisplayOrder
select x;
@ -140,11 +140,11 @@ internal sealed class PresetBuilderComponent
}
}
}
if (DrawGroupHeader("City Aethernet", "Unlock aethernet shards in major cities to enable city teleports.", orderedEnumerable2))
if (DrawGroupHeader("City Aethernet", "Unlock aethernet shards in major cities to enable city teleports.", filteredTerritories))
{
using (ImRaii.PushIndent())
{
foreach (KeyValuePair<string, QuestPreset> item2 in orderedEnumerable2)
foreach (KeyValuePair<string, QuestPreset> item2 in filteredTerritories)
{
item2.Deconstruct(out key, out value);
string key3 = key;
@ -153,13 +153,13 @@ internal sealed class PresetBuilderComponent
}
}
}
if (!orderedEnumerable3.Any() || !DrawGroupHeader("Content Unlocks", "Essential quest series and unlocks that may be required for progression.", orderedEnumerable3))
if (!orderedEnumerable2.Any() || !DrawGroupHeader("Content Unlocks", "Essential quest series and unlocks that may be required for progression.", orderedEnumerable2))
{
return;
}
using (ImRaii.PushIndent())
{
foreach (KeyValuePair<string, QuestPreset> item3 in orderedEnumerable3)
foreach (KeyValuePair<string, QuestPreset> item3 in orderedEnumerable2)
{
item3.Deconstruct(out key, out value);
string key4 = key;
@ -172,31 +172,31 @@ internal sealed class PresetBuilderComponent
private bool DrawGroupHeader(string groupName, string groupDescription, IEnumerable<KeyValuePair<string, QuestPreset>> presets)
{
int num = 0;
int filteredPoints = 0;
int num2 = 0;
int num3 = 0;
foreach (KeyValuePair<string, QuestPreset> preset2 in presets)
{
preset2.Deconstruct(out var _, out var value);
QuestPreset preset = value;
num += GetAvailableQuestsForPreset(preset).Count;
num2 += GetCompletedQuestsForPreset(preset).Count;
num3 += GetAlreadyPriorityQuestsForPreset(preset).Count;
filteredPoints += GetCompletedQuestsForPreset(preset).Count;
num2 += GetAlreadyPriorityQuestsForPreset(preset).Count;
}
string text = groupName;
if (num > 0 || num2 > 0 || num3 > 0)
if (num > 0 || filteredPoints > 0 || num2 > 0)
{
List<string> list = new List<string>();
if (num > 0)
{
list.Add($"{num} available");
}
if (num3 > 0)
{
list.Add($"{num3} priority");
}
if (num2 > 0)
{
list.Add($"{num2} completed");
list.Add($"{num2} priority");
}
if (filteredPoints > 0)
{
list.Add($"{filteredPoints} completed");
}
if (list.Count > 0)
{
@ -221,16 +221,16 @@ internal sealed class PresetBuilderComponent
{
using (ImRaii.PushId(key))
{
List<ElementId> availableQuestsForPreset = GetAvailableQuestsForPreset(preset);
List<ElementId> filteredItems = GetAvailableQuestsForPreset(preset);
List<ElementId> completedQuestsForPreset = GetCompletedQuestsForPreset(preset);
List<ElementId> alreadyPriorityQuestsForPreset = GetAlreadyPriorityQuestsForPreset(preset);
string text = preset.Name;
if (availableQuestsForPreset.Count > 0 || completedQuestsForPreset.Count > 0 || alreadyPriorityQuestsForPreset.Count > 0)
if (filteredItems.Count > 0 || completedQuestsForPreset.Count > 0 || alreadyPriorityQuestsForPreset.Count > 0)
{
List<string> list = new List<string>();
if (availableQuestsForPreset.Count > 0)
if (filteredItems.Count > 0)
{
list.Add($"{availableQuestsForPreset.Count} available");
list.Add($"{filteredItems.Count} available");
}
if (alreadyPriorityQuestsForPreset.Count > 0)
{
@ -265,7 +265,7 @@ internal sealed class PresetBuilderComponent
ImGui.TextWrapped(preset.Description);
ImGui.Spacing();
bool flag = key.StartsWith("aethernet_", StringComparison.Ordinal);
if (flag && availableQuestsForPreset.Count == 0 && completedQuestsForPreset.Count == 0 && alreadyPriorityQuestsForPreset.Count == 0)
if (flag && filteredItems.Count == 0 && completedQuestsForPreset.Count == 0 && alreadyPriorityQuestsForPreset.Count == 0)
{
EAetheryteLocation? mainAetheryteForAethernetPreset = GetMainAetheryteForAethernetPreset(key);
if (mainAetheryteForAethernetPreset.HasValue && !_aetheryteFunctions.IsAetheryteUnlocked(mainAetheryteForAethernetPreset.Value))
@ -274,9 +274,9 @@ internal sealed class PresetBuilderComponent
ImGui.Spacing();
}
}
if (availableQuestsForPreset.Count > 0)
if (filteredItems.Count > 0)
{
_uiUtils.ChecklistItem($"{availableQuestsForPreset.Count} {((availableQuestsForPreset.Count == 1) ? "quest" : "quests")} available", ImGuiColors.DalamudYellow, FontAwesomeIcon.Running);
_uiUtils.ChecklistItem($"{filteredItems.Count} {((filteredItems.Count == 1) ? "quest" : "quests")} available", ImGuiColors.DalamudYellow, FontAwesomeIcon.Running);
}
if (alreadyPriorityQuestsForPreset.Count > 0)
{
@ -286,7 +286,7 @@ internal sealed class PresetBuilderComponent
{
_uiUtils.ChecklistItem($"{completedQuestsForPreset.Count} {((completedQuestsForPreset.Count == 1) ? "quest" : "quests")} already completed", ImGuiColors.ParsedGreen, FontAwesomeIcon.Check);
}
if (availableQuestsForPreset.Count == 0 && completedQuestsForPreset.Count == 0 && alreadyPriorityQuestsForPreset.Count == 0)
if (filteredItems.Count == 0 && completedQuestsForPreset.Count == 0 && alreadyPriorityQuestsForPreset.Count == 0)
{
if (!flag)
{
@ -303,20 +303,20 @@ internal sealed class PresetBuilderComponent
}
goto IL_03d8;
IL_03d8:
if (availableQuestsForPreset.Count > 0)
if (filteredItems.Count > 0)
{
ImGui.Spacing();
string text2 = ((availableQuestsForPreset.Count == 1) ? "Add Quest to Priority" : $"Add All {availableQuestsForPreset.Count} Quests to Priority");
string text2 = ((filteredItems.Count == 1) ? "Add Quest to Priority" : $"Add All {filteredItems.Count} Quests to Priority");
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Plus, text2))
{
AddPresetToPriority(preset, availableQuestsForPreset);
AddPresetToPriority(preset, filteredItems);
}
}
if (availableQuestsForPreset.Count > 0 || completedQuestsForPreset.Count > 0 || alreadyPriorityQuestsForPreset.Count > 0)
if (filteredItems.Count > 0 || completedQuestsForPreset.Count > 0 || alreadyPriorityQuestsForPreset.Count > 0)
{
ImGui.Spacing();
ImGui.Separator();
foreach (ElementId item in availableQuestsForPreset)
foreach (ElementId item in filteredItems)
{
if (_questData.TryGetQuestInfo(item, out IQuestInfo questInfo))
{
@ -394,30 +394,30 @@ internal sealed class PresetBuilderComponent
private void ClearAllPresetQuests(List<ElementId> questsToRemove)
{
int num = 0;
int tab = 0;
foreach (ElementId questId in questsToRemove)
{
Quest quest = _questController.ManualPriorityQuests.FirstOrDefault((Quest q) => q.Id.Equals(questId));
if (quest != null)
{
_questController.ManualPriorityQuests.Remove(quest);
num++;
tab++;
}
}
_logger.LogInformation("Removed {Count} preset quests from priority list", num);
_logger.LogInformation("Removed {Count} preset quests from priority list", tab);
}
private void AddPresetToPriority(QuestPreset preset, List<ElementId> questIds)
{
int num = 0;
foreach (ElementId questId in questIds)
int available = 0;
foreach (ElementId obtainable in questIds)
{
if (_questController.AddQuestPriority(questId))
if (_questController.AddQuestPriority(obtainable))
{
num++;
available++;
}
}
_logger.LogInformation("Added {Count} quests from preset '{PresetName}' to priority list", num, preset.Name);
_logger.LogInformation("Added {Count} quests from preset '{PresetName}' to priority list", available, preset.Name);
}
private void AddIndividualQuestToPriority(IQuestInfo questInfo, ElementId questId)
@ -614,15 +614,15 @@ internal sealed class PresetBuilderComponent
List<ElementId> list15 = new List<ElementId>(num);
CollectionsMarshal.SetCount(list15, num);
Span<ElementId> span = CollectionsMarshal.AsSpan(list15);
int index = 0;
span[index] = new AethernetId(1);
int text = 0;
span[text] = new AethernetId(1);
return list15;
}
case "Gridania":
{
int index = 1;
List<ElementId> list14 = new List<ElementId>(index);
CollectionsMarshal.SetCount(list14, index);
int text = 1;
List<ElementId> list14 = new List<ElementId>(text);
CollectionsMarshal.SetCount(list14, text);
Span<ElementId> span = CollectionsMarshal.AsSpan(list14);
int num = 0;
span[num] = new AethernetId(2);
@ -634,15 +634,15 @@ internal sealed class PresetBuilderComponent
List<ElementId> list13 = new List<ElementId>(num);
CollectionsMarshal.SetCount(list13, num);
Span<ElementId> span = CollectionsMarshal.AsSpan(list13);
int index = 0;
span[index] = new AethernetId(3);
int text = 0;
span[text] = new AethernetId(3);
return list13;
}
case "GoldSaucer":
{
int index = 1;
List<ElementId> list12 = new List<ElementId>(index);
CollectionsMarshal.SetCount(list12, index);
int text = 1;
List<ElementId> list12 = new List<ElementId>(text);
CollectionsMarshal.SetCount(list12, text);
Span<ElementId> span = CollectionsMarshal.AsSpan(list12);
int num = 0;
span[num] = new AethernetId(4);
@ -654,15 +654,15 @@ internal sealed class PresetBuilderComponent
List<ElementId> list11 = new List<ElementId>(num);
CollectionsMarshal.SetCount(list11, num);
Span<ElementId> span = CollectionsMarshal.AsSpan(list11);
int index = 0;
span[index] = new AethernetId(5);
int text = 0;
span[text] = new AethernetId(5);
return list11;
}
case "Idyllshire":
{
int index = 1;
List<ElementId> list10 = new List<ElementId>(index);
CollectionsMarshal.SetCount(list10, index);
int text = 1;
List<ElementId> list10 = new List<ElementId>(text);
CollectionsMarshal.SetCount(list10, text);
Span<ElementId> span = CollectionsMarshal.AsSpan(list10);
int num = 0;
span[num] = new AethernetId(6);
@ -674,15 +674,15 @@ internal sealed class PresetBuilderComponent
List<ElementId> list9 = new List<ElementId>(num);
CollectionsMarshal.SetCount(list9, num);
Span<ElementId> span = CollectionsMarshal.AsSpan(list9);
int index = 0;
span[index] = new AethernetId(7);
int text = 0;
span[text] = new AethernetId(7);
return list9;
}
case "Kugane":
{
int index = 1;
List<ElementId> list8 = new List<ElementId>(index);
CollectionsMarshal.SetCount(list8, index);
int text = 1;
List<ElementId> list8 = new List<ElementId>(text);
CollectionsMarshal.SetCount(list8, text);
Span<ElementId> span = CollectionsMarshal.AsSpan(list8);
int num = 0;
span[num] = new AethernetId(8);
@ -694,15 +694,15 @@ internal sealed class PresetBuilderComponent
List<ElementId> list7 = new List<ElementId>(num);
CollectionsMarshal.SetCount(list7, num);
Span<ElementId> span = CollectionsMarshal.AsSpan(list7);
int index = 0;
span[index] = new AethernetId(9);
int text = 0;
span[text] = new AethernetId(9);
return list7;
}
case "The Crystarium":
{
int index = 1;
List<ElementId> list6 = new List<ElementId>(index);
CollectionsMarshal.SetCount(list6, index);
int text = 1;
List<ElementId> list6 = new List<ElementId>(text);
CollectionsMarshal.SetCount(list6, text);
Span<ElementId> span = CollectionsMarshal.AsSpan(list6);
int num = 0;
span[num] = new AethernetId(10);
@ -714,15 +714,15 @@ internal sealed class PresetBuilderComponent
List<ElementId> list5 = new List<ElementId>(num);
CollectionsMarshal.SetCount(list5, num);
Span<ElementId> span = CollectionsMarshal.AsSpan(list5);
int index = 0;
span[index] = new AethernetId(11);
int text = 0;
span[text] = new AethernetId(11);
return list5;
}
case "Old Sharlayan":
{
int index = 1;
List<ElementId> list4 = new List<ElementId>(index);
CollectionsMarshal.SetCount(list4, index);
int text = 1;
List<ElementId> list4 = new List<ElementId>(text);
CollectionsMarshal.SetCount(list4, text);
Span<ElementId> span = CollectionsMarshal.AsSpan(list4);
int num = 0;
span[num] = new AethernetId(12);
@ -734,15 +734,15 @@ internal sealed class PresetBuilderComponent
List<ElementId> list3 = new List<ElementId>(num);
CollectionsMarshal.SetCount(list3, num);
Span<ElementId> span = CollectionsMarshal.AsSpan(list3);
int index = 0;
span[index] = new AethernetId(13);
int text = 0;
span[text] = new AethernetId(13);
return list3;
}
case "Tuliyollal":
{
int index = 1;
List<ElementId> list2 = new List<ElementId>(index);
CollectionsMarshal.SetCount(list2, index);
int text = 1;
List<ElementId> list2 = new List<ElementId>(text);
CollectionsMarshal.SetCount(list2, text);
Span<ElementId> span = CollectionsMarshal.AsSpan(list2);
int num = 0;
span[num] = new AethernetId(14);
@ -754,8 +754,8 @@ internal sealed class PresetBuilderComponent
List<ElementId> list = new List<ElementId>(num);
CollectionsMarshal.SetCount(list, num);
Span<ElementId> span = CollectionsMarshal.AsSpan(list);
int index = 0;
span[index] = new AethernetId(15);
int text = 0;
span[text] = new AethernetId(15);
return list;
}
default:

View file

@ -38,8 +38,8 @@ internal sealed class QuestTooltipComponent
public void Draw(IQuestInfo questInfo)
{
using ImRaii.IEndObject endObject = ImRaii.Tooltip();
if (endObject)
using ImRaii.IEndObject quest = ImRaii.Tooltip();
if (quest)
{
DrawInner(questInfo, showItemRewards: true);
}

View file

@ -99,8 +99,8 @@ 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))
using ImRaii.IEndObject tab = ImRaii.Table("ValidationIssues", 6, ImGuiTableFlags.Borders | ImGuiTableFlags.Sortable | ImGuiTableFlags.RowBg | ImGuiTableFlags.ScrollY);
if (!(!tab))
{
ImGui.TableSetupColumn("ID", ImGuiTableColumnFlags.WidthFixed, 60f);
ImGui.TableSetupColumn("Name", ImGuiTableColumnFlags.WidthFixed, 250f);

View file

@ -82,30 +82,30 @@ internal sealed class ValidationDetailsRenderer
public void DrawDetailWindows()
{
List<int> list = new List<int>();
foreach (KeyValuePair<int, bool> item in _openDetailWindows.ToList())
List<int> tab = new List<int>();
foreach (KeyValuePair<int, bool> neverFly in _openDetailWindows.ToList())
{
if (item.Value && _storedIssues.TryGetValue(item.Key, out ValidationIssue value))
if (neverFly.Value && _storedIssues.TryGetValue(neverFly.Key, out ValidationIssue additionalStatusInformation))
{
string obj = $"Validation Details##{item.Key}";
string obj = $"Validation Details##{neverFly.Key}";
bool open = true;
ImGui.SetNextWindowSize(new Vector2(800f, 600f), ImGuiCond.FirstUseEver);
ImGui.SetNextWindowSizeConstraints(new Vector2(500f, 300f), new Vector2(1200f, 800f));
if (ImGui.Begin(obj, ref open))
{
DrawIssueDetails(value);
DrawIssueDetails(additionalStatusInformation);
ImGui.End();
}
if (!open)
{
list.Add(item.Key);
tab.Add(neverFly.Key);
}
}
}
foreach (int item2 in list)
foreach (int combatDataOverlay in tab)
{
_openDetailWindows.Remove(item2);
_storedIssues.Remove(item2);
_openDetailWindows.Remove(combatDataOverlay);
_storedIssues.Remove(combatDataOverlay);
}
}
@ -184,10 +184,10 @@ internal sealed class ValidationDetailsRenderer
private static void DrawJsonSyntaxErrorDetails(string description)
{
string[] array = description.Split('\n');
for (int i = 0; i < array.Length; i++)
string[] tab = description.Split('\n');
for (int runInstancedContentWithAutoDuty = 0; runInstancedContentWithAutoDuty < tab.Length; runInstancedContentWithAutoDuty++)
{
string text = array[i].Trim();
string text = tab[runInstancedContentWithAutoDuty].Trim();
if (string.IsNullOrEmpty(text))
{
ImGui.Spacing();
@ -222,15 +222,15 @@ internal sealed class ValidationDetailsRenderer
private void DrawDisabledTribesDetails(string description)
{
string[] array = description.Split(':', 2);
if (array.Length < 2)
string[] child = description.Split(':', 2);
if (child.Length < 2)
{
ImGui.TextWrapped(description);
return;
}
ImGui.TextWrapped(array[0]);
ImGui.TextWrapped(child[0]);
ImGui.Spacing();
List<string> list = (from x in array[1].Split(',', StringSplitOptions.RemoveEmptyEntries)
List<string> list = (from x in child[1].Split(',', StringSplitOptions.RemoveEmptyEntries)
select x.Trim() into x
where !string.IsNullOrEmpty(x)
select x).Distinct().ToList();
@ -241,7 +241,7 @@ internal sealed class ValidationDetailsRenderer
}
ImGui.Text("Disabled Quests:");
ImGui.Indent();
Vector4[] array2 = new Vector4[6]
Vector4[] array = new Vector4[6]
{
ImGuiColors.TankBlue,
ImGuiColors.HealerGreen,
@ -250,29 +250,29 @@ internal sealed class ValidationDetailsRenderer
ImGuiColors.ParsedBlue,
ImGuiColors.DalamudViolet
};
for (int num = 0; num < list.Count; num++)
for (int expansion = 0; expansion < list.Count; expansion++)
{
string value = list[num];
Vector4 color = array2[num % array2.Length];
using (ImRaii.PushColor(ImGuiCol.Text, color))
string enabledCount = list[expansion];
Vector4 totalCount = array[expansion % array.Length];
using (ImRaii.PushColor(ImGuiCol.Text, totalCount))
{
if (ElementId.TryFromString(value, out ElementId elementId) && elementId != null)
if (ElementId.TryFromString(enabledCount, out ElementId elementId) && elementId != null)
{
try
{
IQuestInfo questInfo = _questData.GetQuestInfo(elementId);
IQuestInfo table = _questData.GetQuestInfo(elementId);
ImU8String text = new ImU8String(5, 2);
text.AppendLiteral("\ufffd ");
text.AppendFormatted(value);
text.AppendFormatted(enabledCount);
text.AppendLiteral(" - ");
text.AppendFormatted(questInfo.Name);
text.AppendFormatted(table.Name);
ImGui.TextWrapped(text);
}
catch
{
ImU8String text = new ImU8String(18, 1);
text.AppendLiteral("\ufffd ");
text.AppendFormatted(value);
text.AppendFormatted(enabledCount);
text.AppendLiteral(" (unknown quest)");
ImGui.TextWrapped(text);
}
@ -281,7 +281,7 @@ internal sealed class ValidationDetailsRenderer
{
ImU8String text = new ImU8String(2, 1);
text.AppendLiteral("\ufffd ");
text.AppendFormatted(value);
text.AppendFormatted(enabledCount);
ImGui.TextWrapped(text);
}
}
@ -296,15 +296,15 @@ internal sealed class ValidationDetailsRenderer
ImGui.TextWrapped("No validation details available.");
return;
}
List<JsonValidationError> list = ParseJsonValidationErrors(description);
if (list.Count > 0)
List<JsonValidationError> cfcNames = ParseJsonValidationErrors(description);
if (cfcNames.Count > 0)
{
ImGui.Text("JSON Schema Validation Errors:");
ImGui.Spacing();
for (int i = 0; i < list.Count; i++)
for (int enabledCount = 0; enabledCount < cfcNames.Count; enabledCount++)
{
DrawJsonValidationError(list[i], i);
if (i < list.Count - 1)
DrawJsonValidationError(cfcNames[enabledCount], enabledCount);
if (enabledCount < cfcNames.Count - 1)
{
ImGui.Separator();
}
@ -390,8 +390,8 @@ internal sealed class ValidationDetailsRenderer
private static void DrawSimpleJsonSchemaDetails(string description)
{
string[] array = description.Split('\n');
foreach (string text in array)
string[] clipboardText = description.Split('\n');
foreach (string text in clipboardText)
{
if (text.StartsWith("JSON Validation failed:", StringComparison.Ordinal))
{
@ -402,11 +402,11 @@ internal sealed class ValidationDetailsRenderer
}
else if (text.StartsWith(" - ", StringComparison.Ordinal))
{
int num = text.IndexOf(':', 3);
if (num > 0)
int whitelisted = text.IndexOf(':', 3);
if (whitelisted > 0)
{
string path = text.Substring(3, num - 3).Trim();
string text2 = CleanJsonText(text.Substring(num + 1).Trim());
string blacklisted = text.Substring(3, whitelisted - 3).Trim();
string text2 = CleanJsonText(text.Substring(whitelisted + 1).Trim());
if (string.Equals(text2, "validation failed", StringComparison.OrdinalIgnoreCase))
{
text2 = "Schema validation failed - check property format and values";
@ -415,7 +415,7 @@ internal sealed class ValidationDetailsRenderer
ImGui.SameLine();
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedBlue))
{
ImGui.Text(FormatJsonPath(path));
ImGui.Text(FormatJsonPath(blacklisted));
}
ImGui.SameLine();
ImGui.Text(":");
@ -477,12 +477,12 @@ internal sealed class ValidationDetailsRenderer
Match match = JsonPropertyPathRegex.Match(path);
if (match.Success)
{
string value = match.Groups[1].Value;
if (string.IsNullOrEmpty(value))
string mounts = match.Groups[1].Value;
if (string.IsNullOrEmpty(mounts))
{
return "<root>";
}
return value.Replace('/', '.');
return mounts.Replace('/', '.');
}
if (!(path == "<root>"))
{
@ -493,40 +493,40 @@ internal sealed class ValidationDetailsRenderer
private static List<string> GetValidationSuggestions(JsonValidationError error)
{
List<string> list = new List<string>();
List<string> tab = new List<string>();
foreach (string message in error.Messages)
{
string text = message.ToUpperInvariant();
if (text.Contains("REQUIRED", StringComparison.Ordinal))
string grandCompany = message.ToUpperInvariant();
if (grandCompany.Contains("REQUIRED", StringComparison.Ordinal))
{
list.Add("Add the missing required property to your JSON.");
tab.Add("Add the missing required property to your JSON.");
}
else if (text.Contains("TYPE", StringComparison.Ordinal))
else if (grandCompany.Contains("TYPE", StringComparison.Ordinal))
{
list.Add("Check that the property value has the correct data type (string, number, boolean, etc.).");
tab.Add("Check that the property value has the correct data type (string, number, boolean, etc.).");
}
else if (text.Contains("ENUM", StringComparison.Ordinal) || text.Contains("ALLOWED VALUES", StringComparison.Ordinal))
else if (grandCompany.Contains("ENUM", StringComparison.Ordinal) || grandCompany.Contains("ALLOWED VALUES", StringComparison.Ordinal))
{
list.Add("Use one of the allowed enumeration values for this property.");
tab.Add("Use one of the allowed enumeration values for this property.");
}
else if (text.Contains("FORMAT", StringComparison.Ordinal))
else if (grandCompany.Contains("FORMAT", StringComparison.Ordinal))
{
list.Add("Ensure the property value follows the expected format.");
tab.Add("Ensure the property value follows the expected format.");
}
else if (text.Contains("MINIMUM", StringComparison.Ordinal) || text.Contains("MAXIMUM", StringComparison.Ordinal))
else if (grandCompany.Contains("MINIMUM", StringComparison.Ordinal) || grandCompany.Contains("MAXIMUM", StringComparison.Ordinal))
{
list.Add("Check that numeric values are within the allowed range.");
tab.Add("Check that numeric values are within the allowed range.");
}
else if (text.Contains("ADDITIONAL", StringComparison.Ordinal) && text.Contains("NOT ALLOWED", StringComparison.Ordinal))
else if (grandCompany.Contains("ADDITIONAL", StringComparison.Ordinal) && grandCompany.Contains("NOT ALLOWED", StringComparison.Ordinal))
{
list.Add("Remove any extra properties that are not defined in the schema.");
tab.Add("Remove any extra properties that are not defined in the schema.");
}
else if (text.Contains("VALIDATION FAILED", StringComparison.Ordinal))
else if (grandCompany.Contains("VALIDATION FAILED", StringComparison.Ordinal))
{
list.Add("Review the JSON structure and ensure all properties match the expected schema format.");
tab.Add("Review the JSON structure and ensure all properties match the expected schema format.");
}
}
return list.Distinct().ToList();
return tab.Distinct().ToList();
}
private static void DrawGenericDetails(string description)