|
4 | 4 | @inject ResourceManager resourceManager |
5 | 5 |
|
6 | 6 | <div class="cadence-panel d-flex flex-column h-100"> |
7 | | - <div class="cadence-controls p-2 border-bottom"> |
8 | | - <input type="text" class="form-control form-control-sm" |
| 7 | + <div class="cadence-controls p-2 border-bottom d-flex align-items-center gap-3"> |
| 8 | + <input type="text" class="form-control form-control-sm flex-grow-1" |
9 | 9 | placeholder="Search abilities (e.g. J-Str)..." |
10 | 10 | data-testid="cadence-ability-search" |
11 | 11 | @bind="_abilitySearchTerm" @bind:event="oninput" /> |
| 12 | + |
| 13 | + <div class="form-check form-switch text-nowrap"> |
| 14 | + <input class="form-check-input" type="checkbox" id="hideDoneAbilities" @bind="_hideLearnedAbilities" /> |
| 15 | + <label class="form-check-label small ms-1" for="hideDoneAbilities">Hide Done Abilities</label> |
| 16 | + </div> |
| 17 | + <div class="form-check form-switch text-nowrap"> |
| 18 | + <input class="form-check-input" type="checkbox" id="hideDoneCadences" @bind="_hideLearnedCadences" /> |
| 19 | + <label class="form-check-label small ms-1" for="hideDoneCadences">Hide Done Cadences</label> |
| 20 | + </div> |
12 | 21 | </div> |
13 | 22 |
|
14 | 23 | <div class="flex-grow-1 overflow-auto mt-2"> |
|
29 | 38 | CompletedCount="@stats.Completed" |
30 | 39 | TotalCount="@stats.Total" |
31 | 40 | OnToggle="@(() => resourceManager.MarkCadenceAsSeen(cadence))"> |
32 | | - <CadenceTree CadenceData="cadence" /> |
| 41 | + <CadenceTree CadenceData="cadence" HideLearned="@_hideLearnedAbilities" /> |
33 | 42 | </CadenceDragExpander> |
34 | 43 | } |
35 | 44 | } |
|
53 | 62 | public EventCallback<Cadence> OnUnequip { get; set; } |
54 | 63 |
|
55 | 64 | private string _abilitySearchTerm = ""; |
| 65 | + private bool _hideLearnedAbilities; |
| 66 | + private bool _hideLearnedCadences; |
| 67 | + |
| 68 | + private IEnumerable<Cadence>? FilteredCadences |
| 69 | + { |
| 70 | + get |
| 71 | + { |
| 72 | + if (UnlockedCadences == null) return null; |
| 73 | + var list = UnlockedCadences; |
| 74 | + |
| 75 | + if (!string.IsNullOrWhiteSpace(_abilitySearchTerm)) |
| 76 | + { |
| 77 | + list = list.Where(c => c.Name.Contains(_abilitySearchTerm, StringComparison.OrdinalIgnoreCase) || |
| 78 | + c.Abilities.Any(a => a.Ability.Name.Contains(_abilitySearchTerm, StringComparison.OrdinalIgnoreCase))); |
| 79 | + } |
| 80 | + |
| 81 | + if (_hideLearnedCadences) |
| 82 | + { |
| 83 | + list = list.Where(c => { |
| 84 | + var stats = GetCompletionStats(c); |
| 85 | + return stats.Total == 0 || stats.Completed < stats.Total; |
| 86 | + }); |
| 87 | + } |
56 | 88 |
|
57 | | - private IEnumerable<Cadence>? FilteredCadences => UnlockedCadences; |
58 | | - // We don't filter out the cadences themselves, just highlight them in CadenceDragExpander if the ability matches. |
59 | | - // Actually, usually search filters the list. But the requirement says "Highlight Cadences containing specific searched abilities". |
60 | | - // I'll keep the full list but highlight. |
| 89 | + return list; |
| 90 | + } |
| 91 | + } |
61 | 92 |
|
62 | 93 | private async Task HandleUnequip(object cadenceObj) |
63 | 94 | { |
|
0 commit comments