Skip to content

Commit

Permalink
Add show all combos link.
Browse files Browse the repository at this point in the history
  • Loading branch information
acaly committed Apr 11, 2021
1 parent b7f6179 commit 3737cc6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Models/InMemoryGuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public void AddUser(string id, int attemptsToday, string cloneFrom)
var cloneFromIndex = _memberIndexMap[cloneFrom];
foreach (var zv in _zhouVariants)
{
if (zv is null) continue;
zv.UserData[index] = zv.UserData[cloneFromIndex];
}
}
Expand All @@ -63,6 +64,7 @@ public void DeleteUser(string id)
_members[index] = null;
foreach (var zv in _zhouVariants)
{
if (zv is null) continue;
zv.UserData[index] = default;
}
}
Expand Down
2 changes: 2 additions & 0 deletions Models/InitCharacterData.csv
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ InternalID,Name,Rarity,HasWeapon,Range
1011,璃乃,3,0,700
1012,初音,3,0,755
1013,七七香,2,0,740
1014,香澄,3,0,730
1015,美里,2,0,735
1016,铃奈,2,0,705
1017,香织,2,0,145
Expand Down Expand Up @@ -47,6 +48,7 @@ InternalID,Name,Rarity,HasWeapon,Range
1052,莉玛,1,0,105
1053,莫妮卡,3,0,410
1054,纺希,2,0,195
1055,步美,1,0,510
1056,流夏,3,0,158
1057,吉塔,3,0,245
1058,贪吃佩可,1,1,155
Expand Down
4 changes: 2 additions & 2 deletions Pages/Home/Combos.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@
{
var group = Model.UserCombo[i];
var containsSelected = group.group.Combos.Any(c => c.Index == c.User.SelectedComboIndex);
if (group.totalValue == 0 && group.currentValue == 0)
if (group.totalValue == 0 && group.currentValue == 0 &&!Model.ShowAll)
{
<div class="row align-bottom py-2 border-bottom">
<div class="col-xl-10 col-lg-9 col-8">
@(Model.UserCombo.Count - i) 组,共 @(Model.TotalUserCombs - totalDisplayedCombos) 个套餐未显示。
<a asp-route-showAll="true">@(Model.UserCombo.Count - i) 组,共 @(Model.TotalUserCombs - totalDisplayedCombos) 个套餐未显示。</a>
</div>
<div class="col-xl-2 col-lg-3 col-4">
</div>
Expand Down
5 changes: 4 additions & 1 deletion Pages/Home/Combos.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public CombosModel(InMemoryStorageContext context, SignInManager<PcrIdentityUser

public List<Character> AllCharacters { get; private set; }

public bool ShowAll { get; private set; }

[BindProperty]
[Display(Name = "选择已用角色(不含助战)")]
public string UsedCharacterString { get; set; }
Expand Down Expand Up @@ -133,8 +135,9 @@ private async Task GetAllCharacters(PcrIdentityUser user)
AllCharacters.Sort((c1, c2) => Math.Sign(c1.Range - c2.Range));
}

public async Task<IActionResult> OnGetAsync()
public async Task<IActionResult> OnGetAsync(bool showAll = false)
{
ShowAll = showAll;
if (!_signInManager.IsSignedIn(User))
{
return Redirect("/");
Expand Down

0 comments on commit 3737cc6

Please sign in to comment.