muffin v7.4.1

This commit is contained in:
alydev 2025-12-20 04:56:36 +10:00
parent a4175abacd
commit 7ae14cf8b8
24 changed files with 2673 additions and 722 deletions

View file

@ -96,8 +96,6 @@ internal sealed class QuestJournalComponent
private readonly ILogger<QuestJournalComponent> _logger;
private const uint SeasonalJournalCategoryRowId = 96u;
private List<FilteredSection> _filteredSections = new List<FilteredSection>();
private bool _lastHideSeasonalGlobally;
@ -458,14 +456,14 @@ internal sealed class QuestJournalComponent
private FilteredSection FilterSection(JournalData.Section section, FilterConfiguration filter)
{
IEnumerable<JournalData.Category> enumerable;
if (!_configuration.General.HideSeasonalEventsFromJournalProgress)
if (!_configuration.General.HideSeasonalEventsFromJournalProgress || !_journalData.SeasonalEventsCategoryId.HasValue)
{
IEnumerable<JournalData.Category> categories = section.Categories;
enumerable = categories;
}
else
{
enumerable = section.Categories.Where((JournalData.Category c) => c.Id != 96);
enumerable = section.Categories.Where((JournalData.Category c) => c.Id != _journalData.SeasonalEventsCategoryId.Value);
}
IEnumerable<JournalData.Category> source = enumerable;
return new FilteredSection(Categories: ((!IsCategorySectionGenreMatch(filter, section.Name)) ? source.Select((JournalData.Category category) => FilterCategory(category, filter, section)) : source.Select((JournalData.Category x) => FilterCategory(x, filter.WithoutName(), section))).Where((FilteredCategory x) => x.Genres.Count > 0).ToList(), Section: section);
@ -481,7 +479,7 @@ internal sealed class QuestJournalComponent
{
bool hideSeasonalEventsFromJournalProgress = _configuration.General.HideSeasonalEventsFromJournalProgress;
IEnumerable<IQuestInfo> source = ((!IsCategorySectionGenreMatch(filter, genre.Name)) ? genre.Quests.Where((IQuestInfo x) => IsQuestMatch(filter, x)) : genre.Quests.Where((IQuestInfo x) => IsQuestMatch(filter.WithoutName(), x)));
if (hideSeasonalEventsFromJournalProgress && genre.CategoryId == 96)
if (hideSeasonalEventsFromJournalProgress && _journalData.SeasonalEventsCategoryId.HasValue && genre.CategoryId == _journalData.SeasonalEventsCategoryId.Value)
{
source = source.Where((IQuestInfo q) => !IsSeasonal(q));
}
@ -497,7 +495,7 @@ internal sealed class QuestJournalComponent
_logger.LogInformation("Refreshing journal counts. HideSeasonalEventsFromJournalProgress={Hide}", hideSeasonalEventsFromJournalProgress);
foreach (JournalData.Genre genre in _journalData.Genres)
{
List<IQuestInfo> source = ((hideSeasonalEventsFromJournalProgress && genre.CategoryId == 96) ? genre.Quests.Where((IQuestInfo q) => !IsSeasonal(q)).ToList() : genre.Quests.ToList());
List<IQuestInfo> source = ((hideSeasonalEventsFromJournalProgress && _journalData.SeasonalEventsCategoryId.HasValue && genre.CategoryId == _journalData.SeasonalEventsCategoryId.Value) ? genre.Quests.Where((IQuestInfo q) => !IsSeasonal(q)).ToList() : genre.Quests.ToList());
Quest quest;
int available = source.Count((IQuestInfo x) => _questRegistry.TryGetQuest(x.QuestId, out quest) && !quest.Root.Disabled && !_questFunctions.IsQuestRemoved(x.QuestId));
int total = source.Count((IQuestInfo x) => !_questFunctions.IsQuestRemoved(x.QuestId));
@ -507,7 +505,7 @@ internal sealed class QuestJournalComponent
}
foreach (JournalData.Category category in _journalData.Categories)
{
if (!hideSeasonalEventsFromJournalProgress || category.Id != 96)
if (!hideSeasonalEventsFromJournalProgress || !_journalData.SeasonalEventsCategoryId.HasValue || category.Id != _journalData.SeasonalEventsCategoryId.Value)
{
List<JournalCounts> source2 = _genre_counts_or_default(category);
int available2 = source2.Sum((JournalCounts x) => x.Available);