BuildList: added Filter for equipped builds
This commit is contained in:
parent
5078475e2f
commit
ba7cf120d0
2 changed files with 17 additions and 2 deletions
|
@ -26,7 +26,11 @@
|
|||
</select>
|
||||
<label style="margin-left: 10px; margin-right: 4px;">Alacrity:</label><input type="checkbox" checked="@_filterAlac" @onchange="args => AlacStatusChanged(args)" />
|
||||
<label style="margin-left: 10px; margin-right: 4px;">Quickness:</label><input type="checkbox" checked="@_filterQuick" @onchange="args => QuickStatusChanged(args)" />
|
||||
<label style="margin-left: 10px; margin-right: 4px;">Might:</label><input type="checkbox" checked="@_filterMight" @onchange="args => MightStatusChanged(args)" />
|
||||
<label style="margin-left: 10px; margin-right: 4px;">Might:</label><input type="checkbox" checked="@_filterMight" @onchange="args => MightStatusChanged(args)" />
|
||||
@if (_account != null)
|
||||
{
|
||||
<label style="margin-left: 10px; margin-right: 4px;">Equipped:</label><input type="checkbox" checked="@_filterEquipped" @onchange="args => EquippedStatusChanged(args)" />
|
||||
}
|
||||
</label>
|
||||
<table class="roletable">
|
||||
<tr>
|
||||
|
@ -161,6 +165,7 @@
|
|||
private bool _filterAlac = false;
|
||||
private bool _filterQuick = false;
|
||||
private bool _filterMight = false;
|
||||
private bool _filterEquipped = false;
|
||||
private DamageType? _filterDamageType;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
|
@ -233,6 +238,12 @@
|
|||
ApplyFilter();
|
||||
}
|
||||
|
||||
private void EquippedStatusChanged(ChangeEventArgs args)
|
||||
{
|
||||
_filterEquipped = bool.Parse(args.Value.ToString());
|
||||
ApplyFilter();
|
||||
}
|
||||
|
||||
private void ApplyFilter()
|
||||
{
|
||||
_buildsToShow = _builds;
|
||||
|
@ -256,5 +267,9 @@
|
|||
{
|
||||
_buildsToShow = _buildsToShow.Where(b => b.DamageType == _filterDamageType).ToList();
|
||||
}
|
||||
if(_filterEquipped && _account != null)
|
||||
{
|
||||
_buildsToShow = _buildsToShow.Where(b => _account.EquippedBuilds.Where(e => e.GuildWars2BuildId == b.GuildWars2BuildId).Any()).ToList();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -13,6 +13,6 @@
|
|||
<p style="text-align: center"><img src="GuildIcon512.svg" alt="guild icon"></p>
|
||||
</tr>
|
||||
<tr>
|
||||
<a style="text-align: center" class="nav-link" href="https://discord.gg/VFG3XEBCPj">[LIEB] Discord </a>
|
||||
<a style="text-align: center; width: inherit;" class="nav-link" href="https://discord.gg/VFG3XEBCPj">[LIEB] Discord </a>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue