private Witcher3ProgressStatus.AvailCond FormConditions() { Witcher3ProgressStatus.AvailCond Conditions = 0; if (showAccessibleOnly) { Conditions = Conditions | Witcher3ProgressStatus.AvailCond.Accessible; } if (showTreasure) { Conditions = Conditions | Witcher3ProgressStatus.AvailCond.Treasure; } if (showRaces) { Conditions = Conditions | Witcher3ProgressStatus.AvailCond.Races; } if (showEvents) { Conditions = Conditions | Witcher3ProgressStatus.AvailCond.Events; } return(Conditions); }
private void UpdateQuests() { Witcher3ProgressStatus.AvailCond Conditions = FormConditions(); List <Quest> addedItems = progressStatus.GetAvailable(Conditions); foreach (Quest q in addedItems) { _currentQuests.Add(new QuestViewModel(q)); } List <Quest> removedItems = progressStatus.CullNewlyUnavailable(Conditions); if (removedItems.Count != 0) { foreach (Quest q in removedItems) { QuestViewModel goner = _currentQuests.Where(item => item.correspondingQuest == q).First(); _currentQuests.Remove(goner); } } //Update checked status from underlying quests foreach (QuestViewModel q in _currentQuests) { q.Recheck(); } _currentQuests.Sort(); //even if none were added, we need to sort done objects to the top, etc. if (_currentSelection != null && _currentSelection.IsSelected == false) { //sorting resets IsSelected field, so reset it. skipnextrecenter = true; _currentSelection.IsSelected = true; } if (manualMode) { SeekNextUndone(); } }