Add filter to exclude event rewards

This commit is contained in:
Liza 2025-01-03 01:11:25 +01:00
parent 58185d418c
commit 0a35ea3eaa
Signed by: liza
GPG Key ID: 2C41B84815CF6445

View File

@ -1,5 +1,6 @@
using System; using System;
using System.Linq; using System.Linq;
using Dalamud.Game.Text;
using Dalamud.Interface.Utility.Raii; using Dalamud.Interface.Utility.Raii;
using ImGuiNET; using ImGuiNET;
using Questionable.Data; using Questionable.Data;
@ -14,6 +15,8 @@ internal sealed class QuestRewardComponent
private readonly QuestTooltipComponent _questTooltipComponent; private readonly QuestTooltipComponent _questTooltipComponent;
private readonly UiUtils _uiUtils; private readonly UiUtils _uiUtils;
private bool _showEventRewards;
public QuestRewardComponent( public QuestRewardComponent(
QuestData questData, QuestData questData,
QuestTooltipComponent questTooltipComponent, QuestTooltipComponent questTooltipComponent,
@ -30,7 +33,10 @@ internal sealed class QuestRewardComponent
if (!tab) if (!tab)
return; return;
ImGui.BulletText("Only untradeable items are listed (you can e.g. sell your Wind-up Airship from the enovy quest)."); ImGui.Checkbox("Show rewards from seasonal event quests", ref _showEventRewards);
ImGui.Spacing();
ImGui.BulletText("Only untradeable items are listed (e.g. the Wind-up Airship can be sold on the market board).");
DrawGroup("Mounts", EItemRewardType.Mount); DrawGroup("Mounts", EItemRewardType.Mount);
DrawGroup("Minions", EItemRewardType.Minion); DrawGroup("Minions", EItemRewardType.Minion);
@ -47,9 +53,17 @@ internal sealed class QuestRewardComponent
foreach (var item in _questData.RedeemableItems.Where(x => x.Type == type) foreach (var item in _questData.RedeemableItems.Where(x => x.Type == type)
.OrderBy(x => x.Name, StringComparer.CurrentCultureIgnoreCase)) .OrderBy(x => x.Name, StringComparer.CurrentCultureIgnoreCase))
{ {
if (_uiUtils.ChecklistItem(item.Name, item.IsUnlocked())) if (_questData.TryGetQuestInfo(item.ElementId, out var questInfo))
{ {
if (_questData.TryGetQuestInfo(item.ElementId, out var questInfo)) bool isEventQuest = questInfo is QuestInfo { IsSeasonalEvent: true };
if (!_showEventRewards && isEventQuest)
continue;
string name = item.Name;
if (isEventQuest)
name += $" {SeIconChar.Clock.ToIconString()}";
if (_uiUtils.ChecklistItem(name, item.IsUnlocked()))
{ {
using var tooltip = ImRaii.Tooltip(); using var tooltip = ImRaii.Tooltip();
if (!tooltip) if (!tooltip)