muffin v6.21

This commit is contained in:
alydev 2025-10-12 13:34:40 +10:00
parent 2b6632ec76
commit 637eb39d24
5 changed files with 3506 additions and 2828 deletions

1
.gitignore vendored
View file

@ -1 +1,2 @@
AssemblyInfo.cs
Solution.sln

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Numerics;
namespace Questionable.Model;
@ -40,4 +41,32 @@ public static class ExpansionData
}
return expansionVersion.ToString();
}
public static string ToAbbreviation(this EExpansionVersion expansionVersion)
{
return expansionVersion switch
{
EExpansionVersion.ARealmReborn => "ARR",
EExpansionVersion.Heavensward => "HW",
EExpansionVersion.Stormblood => "SB",
EExpansionVersion.Shadowbringers => "ShB",
EExpansionVersion.Endwalker => "EW",
EExpansionVersion.Dawntrail => "DT",
_ => "?",
};
}
public static Vector4 GetExpansionColor(this EExpansionVersion expansionVersion)
{
return expansionVersion switch
{
EExpansionVersion.ARealmReborn => new Vector4(0.7f, 0.7f, 0.7f, 1f),
EExpansionVersion.Heavensward => new Vector4(0.4f, 0.6f, 0.9f, 1f),
EExpansionVersion.Stormblood => new Vector4(0.9f, 0.3f, 0.3f, 1f),
EExpansionVersion.Shadowbringers => new Vector4(0.5f, 0.4f, 0.7f, 1f),
EExpansionVersion.Endwalker => new Vector4(0.8f, 0.8f, 0.4f, 1f),
EExpansionVersion.Dawntrail => new Vector4(0.3f, 0.8f, 0.5f, 1f),
_ => new Vector4(0.5f, 0.5f, 0.5f, 1f),
};
}
}

View file

@ -261,18 +261,59 @@ internal sealed class QuestJournalComponent
_questRegistry.TryGetQuest(questInfo.QuestId, out Quest quest);
ImGui.TableNextRow();
ImGui.TableNextColumn();
DrawQuestName(questInfo, out var expansionHovered);
DrawQuestTooltipAndContextMenu(questInfo, quest, expansionHovered);
ImGui.TableNextColumn();
DrawQuestSupportStatus(questInfo, quest);
ImGui.TableNextColumn();
DrawQuestCompletionStatus(questInfo);
}
private static void DrawQuestName(IQuestInfo questInfo, out bool expansionHovered)
{
expansionHovered = false;
if (questInfo.Expansion != (EExpansionVersion)255)
{
ImGui.PushFont(UiBuilder.MonoFont);
ImGui.PushStyleColor(ImGuiCol.Text, questInfo.Expansion.GetExpansionColor());
ImGui.TextUnformatted(questInfo.Expansion.ToAbbreviation().PadRight(3));
ImGui.PopStyleColor();
ImGui.PopFont();
if (ImGui.IsItemHovered())
{
expansionHovered = true;
}
ImGui.SameLine();
}
ImU8String id = new ImU8String(3, 2);
id.AppendFormatted(questInfo.Name);
id.AppendLiteral(" (");
id.AppendFormatted(questInfo.QuestId);
id.AppendLiteral(")");
ImGui.TreeNodeEx(id, ImGuiTreeNodeFlags.NoTreePushOnOpen | ImGuiTreeNodeFlags.Leaf | ImGuiTreeNodeFlags.SpanFullWidth);
if (ImGui.IsItemHovered())
}
private void DrawQuestTooltipAndContextMenu(IQuestInfo questInfo, Quest? quest, bool expansionHovered)
{
if ((ImGui.IsItemHovered() || expansionHovered) && questInfo.Expansion != (EExpansionVersion)255)
{
ImGui.BeginTooltip();
ImGui.PushStyleColor(ImGuiCol.Text, questInfo.Expansion.GetExpansionColor());
ImGui.TextUnformatted(questInfo.Expansion.ToFriendlyString());
ImGui.PopStyleColor();
ImGui.Separator();
_questTooltipComponent.Draw(questInfo);
ImGui.EndTooltip();
}
else if (ImGui.IsItemHovered() && questInfo.Expansion == (EExpansionVersion)255)
{
_questTooltipComponent.Draw(questInfo);
}
_questJournalUtils.ShowContextMenu(questInfo, quest, "QuestJournalComponent");
ImGui.TableNextColumn();
}
private void DrawQuestSupportStatus(IQuestInfo questInfo, Quest? quest)
{
float num;
using (_pluginInterface.UiBuilder.IconFontFixedWidthHandle.Push())
{
@ -282,9 +323,8 @@ internal sealed class QuestJournalComponent
if (_questFunctions.IsQuestRemoved(questInfo.QuestId))
{
_uiUtils.ChecklistItem(string.Empty, ImGuiColors.DalamudGrey, FontAwesomeIcon.Minus);
return;
}
else
{
if (quest != null)
{
QuestRoot root = quest.Root;
@ -303,26 +343,38 @@ internal sealed class QuestJournalComponent
{
_uiUtils.ChecklistItem(string.Empty, complete: true);
}
goto IL_0210;
return;
}
}
_uiUtils.ChecklistItem(string.Empty, complete: false);
}
goto IL_0210;
IL_0210:
ImGui.TableNextColumn();
private void DrawQuestCompletionStatus(IQuestInfo questInfo)
{
if (_questFunctions.IsQuestAccepted(questInfo.QuestId))
{
_uiUtils.ChecklistItem("Active", ImGuiColors.DalamudYellow, FontAwesomeIcon.PersonWalkingArrowRight);
}
else if (_questFunctions.IsQuestComplete(questInfo.QuestId))
{
DrawCompletedQuestStatus(questInfo);
}
else
{
DrawIncompleteQuestStatus(questInfo);
}
}
private void DrawCompletedQuestStatus(IQuestInfo questInfo)
{
if (!questInfo.IsRepeatable)
{
_uiUtils.ChecklistItem("Complete", ImGuiColors.ParsedGreen, FontAwesomeIcon.Check);
return;
}
if (_questFunctions.IsQuestComplete(questInfo.QuestId))
{
if (questInfo.IsRepeatable)
{
bool num2 = _questFunctions.IsQuestLocked(questInfo.QuestId);
bool num = _questFunctions.IsQuestLocked(questInfo.QuestId);
bool flag = _questFunctions.IsReadyToAcceptQuest(questInfo.QuestId);
if (!num2 && flag)
if (!num && flag)
{
_uiUtils.ChecklistItem("Available", ImGuiColors.ParsedBlue, FontAwesomeIcon.Running);
}
@ -331,31 +383,18 @@ internal sealed class QuestJournalComponent
_uiUtils.ChecklistItem("Complete", ImGuiColors.ParsedGreen, FontAwesomeIcon.Check);
}
}
else
private void DrawIncompleteQuestStatus(IQuestInfo questInfo)
{
_uiUtils.ChecklistItem("Complete", ImGuiColors.ParsedGreen, FontAwesomeIcon.Check);
}
return;
}
bool flag2 = false;
bool flag3 = _questFunctions.IsQuestUnobtainable(questInfo.QuestId);
bool flag4 = _questFunctions.IsQuestLocked(questInfo.QuestId);
bool flag5 = _questFunctions.IsReadyToAcceptQuest(questInfo.QuestId);
DateTime? seasonalQuestExpiry = questInfo.SeasonalQuestExpiry;
if (seasonalQuestExpiry.HasValue)
{
DateTime valueOrDefault = seasonalQuestExpiry.GetValueOrDefault();
DateTime dateTime = ((valueOrDefault.Kind == DateTimeKind.Utc) ? valueOrDefault : valueOrDefault.ToUniversalTime());
if (DateTime.UtcNow > dateTime)
{
flag2 = true;
}
}
if (flag2 || flag3)
bool num = IsQuestExpired(questInfo);
bool flag = _questFunctions.IsQuestUnobtainable(questInfo.QuestId);
bool flag2 = _questFunctions.IsQuestLocked(questInfo.QuestId);
bool flag3 = _questFunctions.IsReadyToAcceptQuest(questInfo.QuestId);
if (num || flag)
{
_uiUtils.ChecklistItem("Unobtainable", ImGuiColors.DalamudGrey, FontAwesomeIcon.Minus);
}
else if (flag4 || !flag5 || !_questRegistry.IsKnownQuest(questInfo.QuestId))
else if (flag2 || !flag3 || !_questRegistry.IsKnownQuest(questInfo.QuestId))
{
_uiUtils.ChecklistItem("Locked", ImGuiColors.DalamudRed, FontAwesomeIcon.Times);
}
@ -365,6 +404,18 @@ internal sealed class QuestJournalComponent
}
}
private static bool IsQuestExpired(IQuestInfo questInfo)
{
DateTime? seasonalQuestExpiry = questInfo.SeasonalQuestExpiry;
if (seasonalQuestExpiry.HasValue)
{
DateTime valueOrDefault = seasonalQuestExpiry.GetValueOrDefault();
DateTime dateTime = ((valueOrDefault.Kind == DateTimeKind.Utc) ? valueOrDefault : valueOrDefault.ToUniversalTime());
return DateTime.UtcNow > dateTime;
}
return false;
}
private static void DrawCount(int count, int total)
{
string text = 9999.ToString(CultureInfo.CurrentCulture);

View file

@ -2,15 +2,15 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuestPaths", "QuestPaths\QuestPaths.csproj", "{67FBC0A0-7E33-4060-A7F7-004405CEA1DC}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuestPaths", "QuestPaths\QuestPaths.csproj", "{74B3F365-43FA-43AE-AC66-E0A171815784}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GatheringPaths", "GatheringPaths\GatheringPaths.csproj", "{9206394B-067C-4D9F-A8CD-0DA7B58AB460}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GatheringPaths", "GatheringPaths\GatheringPaths.csproj", "{75F0DE6A-30EB-4FB6-8AE8-97B753FC3D21}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Questionable", "Questionable\Questionable.csproj", "{3DFF6333-BF7E-4B93-ADA4-7F2111AB12FE}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Questionable", "Questionable\Questionable.csproj", "{718160D1-C8F2-4ADC-9949-2C7D2461A0E9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Questionable.Model", "Questionable.Model\Questionable.Model.csproj", "{5D14B235-EAE5-4D9A-BEDE-7612D73FD7E7}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Questionable.Model", "Questionable.Model\Questionable.Model.csproj", "{9A1B5222-7D9D-43F5-A313-93FAC3B4D619}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LLib", "LLib\LLib.csproj", "{F3111698-3780-499D-AF9B-EA62D8EA54C3}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LLib", "LLib\LLib.csproj", "{A1431C66-6098-4FD1-85DF-A6F7734EEEAB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -20,46 +20,46 @@ Global
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{67FBC0A0-7E33-4060-A7F7-004405CEA1DC}.Debug|AnyCPU.ActiveCfg = Debug|AnyCPU
{67FBC0A0-7E33-4060-A7F7-004405CEA1DC}.Debug|AnyCPU.Build.0 = Debug|AnyCPU
{67FBC0A0-7E33-4060-A7F7-004405CEA1DC}.Debug|x64.ActiveCfg = Debug|AnyCPU
{67FBC0A0-7E33-4060-A7F7-004405CEA1DC}.Debug|x64.Build.0 = Debug|AnyCPU
{67FBC0A0-7E33-4060-A7F7-004405CEA1DC}.Release|AnyCPU.ActiveCfg = Release|AnyCPU
{67FBC0A0-7E33-4060-A7F7-004405CEA1DC}.Release|AnyCPU.Build.0 = Release|AnyCPU
{67FBC0A0-7E33-4060-A7F7-004405CEA1DC}.Release|x64.ActiveCfg = Release|AnyCPU
{67FBC0A0-7E33-4060-A7F7-004405CEA1DC}.Release|x64.Build.0 = Release|AnyCPU
{9206394B-067C-4D9F-A8CD-0DA7B58AB460}.Debug|AnyCPU.ActiveCfg = Debug|AnyCPU
{9206394B-067C-4D9F-A8CD-0DA7B58AB460}.Debug|AnyCPU.Build.0 = Debug|AnyCPU
{9206394B-067C-4D9F-A8CD-0DA7B58AB460}.Debug|x64.ActiveCfg = Debug|AnyCPU
{9206394B-067C-4D9F-A8CD-0DA7B58AB460}.Debug|x64.Build.0 = Debug|AnyCPU
{9206394B-067C-4D9F-A8CD-0DA7B58AB460}.Release|AnyCPU.ActiveCfg = Release|AnyCPU
{9206394B-067C-4D9F-A8CD-0DA7B58AB460}.Release|AnyCPU.Build.0 = Release|AnyCPU
{9206394B-067C-4D9F-A8CD-0DA7B58AB460}.Release|x64.ActiveCfg = Release|AnyCPU
{9206394B-067C-4D9F-A8CD-0DA7B58AB460}.Release|x64.Build.0 = Release|AnyCPU
{3DFF6333-BF7E-4B93-ADA4-7F2111AB12FE}.Debug|AnyCPU.ActiveCfg = Debug|x64
{3DFF6333-BF7E-4B93-ADA4-7F2111AB12FE}.Debug|AnyCPU.Build.0 = Debug|x64
{3DFF6333-BF7E-4B93-ADA4-7F2111AB12FE}.Debug|x64.ActiveCfg = Debug|x64
{3DFF6333-BF7E-4B93-ADA4-7F2111AB12FE}.Debug|x64.Build.0 = Debug|x64
{3DFF6333-BF7E-4B93-ADA4-7F2111AB12FE}.Release|AnyCPU.ActiveCfg = Release|x64
{3DFF6333-BF7E-4B93-ADA4-7F2111AB12FE}.Release|AnyCPU.Build.0 = Release|x64
{3DFF6333-BF7E-4B93-ADA4-7F2111AB12FE}.Release|x64.ActiveCfg = Release|x64
{3DFF6333-BF7E-4B93-ADA4-7F2111AB12FE}.Release|x64.Build.0 = Release|x64
{5D14B235-EAE5-4D9A-BEDE-7612D73FD7E7}.Debug|AnyCPU.ActiveCfg = Debug|AnyCPU
{5D14B235-EAE5-4D9A-BEDE-7612D73FD7E7}.Debug|AnyCPU.Build.0 = Debug|AnyCPU
{5D14B235-EAE5-4D9A-BEDE-7612D73FD7E7}.Debug|x64.ActiveCfg = Debug|AnyCPU
{5D14B235-EAE5-4D9A-BEDE-7612D73FD7E7}.Debug|x64.Build.0 = Debug|AnyCPU
{5D14B235-EAE5-4D9A-BEDE-7612D73FD7E7}.Release|AnyCPU.ActiveCfg = Release|AnyCPU
{5D14B235-EAE5-4D9A-BEDE-7612D73FD7E7}.Release|AnyCPU.Build.0 = Release|AnyCPU
{5D14B235-EAE5-4D9A-BEDE-7612D73FD7E7}.Release|x64.ActiveCfg = Release|AnyCPU
{5D14B235-EAE5-4D9A-BEDE-7612D73FD7E7}.Release|x64.Build.0 = Release|AnyCPU
{F3111698-3780-499D-AF9B-EA62D8EA54C3}.Debug|AnyCPU.ActiveCfg = Debug|x64
{F3111698-3780-499D-AF9B-EA62D8EA54C3}.Debug|AnyCPU.Build.0 = Debug|x64
{F3111698-3780-499D-AF9B-EA62D8EA54C3}.Debug|x64.ActiveCfg = Debug|x64
{F3111698-3780-499D-AF9B-EA62D8EA54C3}.Debug|x64.Build.0 = Debug|x64
{F3111698-3780-499D-AF9B-EA62D8EA54C3}.Release|AnyCPU.ActiveCfg = Release|x64
{F3111698-3780-499D-AF9B-EA62D8EA54C3}.Release|AnyCPU.Build.0 = Release|x64
{F3111698-3780-499D-AF9B-EA62D8EA54C3}.Release|x64.ActiveCfg = Release|x64
{F3111698-3780-499D-AF9B-EA62D8EA54C3}.Release|x64.Build.0 = Release|x64
{74B3F365-43FA-43AE-AC66-E0A171815784}.Debug|AnyCPU.ActiveCfg = Debug|AnyCPU
{74B3F365-43FA-43AE-AC66-E0A171815784}.Debug|AnyCPU.Build.0 = Debug|AnyCPU
{74B3F365-43FA-43AE-AC66-E0A171815784}.Debug|x64.ActiveCfg = Debug|AnyCPU
{74B3F365-43FA-43AE-AC66-E0A171815784}.Debug|x64.Build.0 = Debug|AnyCPU
{74B3F365-43FA-43AE-AC66-E0A171815784}.Release|AnyCPU.ActiveCfg = Release|AnyCPU
{74B3F365-43FA-43AE-AC66-E0A171815784}.Release|AnyCPU.Build.0 = Release|AnyCPU
{74B3F365-43FA-43AE-AC66-E0A171815784}.Release|x64.ActiveCfg = Release|AnyCPU
{74B3F365-43FA-43AE-AC66-E0A171815784}.Release|x64.Build.0 = Release|AnyCPU
{75F0DE6A-30EB-4FB6-8AE8-97B753FC3D21}.Debug|AnyCPU.ActiveCfg = Debug|AnyCPU
{75F0DE6A-30EB-4FB6-8AE8-97B753FC3D21}.Debug|AnyCPU.Build.0 = Debug|AnyCPU
{75F0DE6A-30EB-4FB6-8AE8-97B753FC3D21}.Debug|x64.ActiveCfg = Debug|AnyCPU
{75F0DE6A-30EB-4FB6-8AE8-97B753FC3D21}.Debug|x64.Build.0 = Debug|AnyCPU
{75F0DE6A-30EB-4FB6-8AE8-97B753FC3D21}.Release|AnyCPU.ActiveCfg = Release|AnyCPU
{75F0DE6A-30EB-4FB6-8AE8-97B753FC3D21}.Release|AnyCPU.Build.0 = Release|AnyCPU
{75F0DE6A-30EB-4FB6-8AE8-97B753FC3D21}.Release|x64.ActiveCfg = Release|AnyCPU
{75F0DE6A-30EB-4FB6-8AE8-97B753FC3D21}.Release|x64.Build.0 = Release|AnyCPU
{718160D1-C8F2-4ADC-9949-2C7D2461A0E9}.Debug|AnyCPU.ActiveCfg = Debug|x64
{718160D1-C8F2-4ADC-9949-2C7D2461A0E9}.Debug|AnyCPU.Build.0 = Debug|x64
{718160D1-C8F2-4ADC-9949-2C7D2461A0E9}.Debug|x64.ActiveCfg = Debug|x64
{718160D1-C8F2-4ADC-9949-2C7D2461A0E9}.Debug|x64.Build.0 = Debug|x64
{718160D1-C8F2-4ADC-9949-2C7D2461A0E9}.Release|AnyCPU.ActiveCfg = Release|x64
{718160D1-C8F2-4ADC-9949-2C7D2461A0E9}.Release|AnyCPU.Build.0 = Release|x64
{718160D1-C8F2-4ADC-9949-2C7D2461A0E9}.Release|x64.ActiveCfg = Release|x64
{718160D1-C8F2-4ADC-9949-2C7D2461A0E9}.Release|x64.Build.0 = Release|x64
{9A1B5222-7D9D-43F5-A313-93FAC3B4D619}.Debug|AnyCPU.ActiveCfg = Debug|AnyCPU
{9A1B5222-7D9D-43F5-A313-93FAC3B4D619}.Debug|AnyCPU.Build.0 = Debug|AnyCPU
{9A1B5222-7D9D-43F5-A313-93FAC3B4D619}.Debug|x64.ActiveCfg = Debug|AnyCPU
{9A1B5222-7D9D-43F5-A313-93FAC3B4D619}.Debug|x64.Build.0 = Debug|AnyCPU
{9A1B5222-7D9D-43F5-A313-93FAC3B4D619}.Release|AnyCPU.ActiveCfg = Release|AnyCPU
{9A1B5222-7D9D-43F5-A313-93FAC3B4D619}.Release|AnyCPU.Build.0 = Release|AnyCPU
{9A1B5222-7D9D-43F5-A313-93FAC3B4D619}.Release|x64.ActiveCfg = Release|AnyCPU
{9A1B5222-7D9D-43F5-A313-93FAC3B4D619}.Release|x64.Build.0 = Release|AnyCPU
{A1431C66-6098-4FD1-85DF-A6F7734EEEAB}.Debug|AnyCPU.ActiveCfg = Debug|x64
{A1431C66-6098-4FD1-85DF-A6F7734EEEAB}.Debug|AnyCPU.Build.0 = Debug|x64
{A1431C66-6098-4FD1-85DF-A6F7734EEEAB}.Debug|x64.ActiveCfg = Debug|x64
{A1431C66-6098-4FD1-85DF-A6F7734EEEAB}.Debug|x64.Build.0 = Debug|x64
{A1431C66-6098-4FD1-85DF-A6F7734EEEAB}.Release|AnyCPU.ActiveCfg = Release|x64
{A1431C66-6098-4FD1-85DF-A6F7734EEEAB}.Release|AnyCPU.Build.0 = Release|x64
{A1431C66-6098-4FD1-85DF-A6F7734EEEAB}.Release|x64.ActiveCfg = Release|x64
{A1431C66-6098-4FD1-85DF-A6F7734EEEAB}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE