reworked boon management for guild wars 2 builds
This commit is contained in:
parent
4a95958658
commit
3d7d409646
3 changed files with 31 additions and 17 deletions
|
@ -24,26 +24,26 @@
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<label>
|
<label>
|
||||||
Might:
|
<InputCheckbox @bind-Value="_hasMight" />
|
||||||
<InputNumber @bind-Value="_build.Might" />
|
Might
|
||||||
</label>
|
</label>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<label>
|
<label>
|
||||||
Quickness:
|
<InputCheckbox @bind-Value="_hasHeal" />
|
||||||
<InputNumber @bind-Value="_build.Quickness" />
|
Heal
|
||||||
</label>
|
</label>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<label>
|
<label>
|
||||||
Alacrity:
|
<InputCheckbox @bind-Value="_hasQuickness" />
|
||||||
<InputNumber @bind-Value="_build.Alacrity" />
|
Quickness
|
||||||
</label>
|
</label>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<label>
|
<label>
|
||||||
Heal:
|
<InputCheckbox @bind-Value="_hasAlacrity" />
|
||||||
<InputNumber @bind-Value="_build.Heal" />
|
Alacrity
|
||||||
</label>
|
</label>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
@ -83,12 +83,21 @@
|
||||||
public string buildId { get; set; }
|
public string buildId { get; set; }
|
||||||
|
|
||||||
public GuildWars2Build _build;
|
public GuildWars2Build _build;
|
||||||
|
|
||||||
|
private bool _hasMight;
|
||||||
|
private bool _hasHeal;
|
||||||
|
private bool _hasQuickness;
|
||||||
|
private bool _hasAlacrity;
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
if(!string.IsNullOrEmpty(buildId) && int.TryParse(buildId, out int parsedId))
|
if(!string.IsNullOrEmpty(buildId) && int.TryParse(buildId, out int parsedId))
|
||||||
{
|
{
|
||||||
_build = GuildWars2BuildService.GetBuild(parsedId);
|
_build = GuildWars2BuildService.GetBuild(parsedId);
|
||||||
|
_hasMight = _build.Might > 0;
|
||||||
|
_hasHeal = _build.Heal > 0;
|
||||||
|
_hasQuickness = _build.Quickness > 0;
|
||||||
|
_hasAlacrity = _build.Alacrity > 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -108,6 +117,11 @@
|
||||||
|
|
||||||
private async Task HandleValidSubmit()
|
private async Task HandleValidSubmit()
|
||||||
{
|
{
|
||||||
|
_build.Might = _hasMight ? (short)5 : (short)0;
|
||||||
|
_build.Heal = _hasHeal ? (short)5 : (short)0;
|
||||||
|
_build.Quickness = _hasQuickness ? (short)5 : (short)0;
|
||||||
|
_build.Alacrity = _hasAlacrity ? (short)5 : (short)0;
|
||||||
|
|
||||||
await GuildWars2BuildService.AddOrEditBuild(_build);
|
await GuildWars2BuildService.AddOrEditBuild(_build);
|
||||||
NavigationManager.NavigateTo("buildoverview");
|
NavigationManager.NavigateTo("buildoverview");
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,10 +35,10 @@
|
||||||
</td>
|
</td>
|
||||||
<td>@build.Class.ToString()</td>
|
<td>@build.Class.ToString()</td>
|
||||||
<td>@build.EliteSpecialization.ToString()</td>
|
<td>@build.EliteSpecialization.ToString()</td>
|
||||||
<td>@build.Might.ToString()</td>
|
<td><input type="checkbox" checked="@(build.Might > 0)" disabled="disabled" /></td>
|
||||||
<td>@build.Heal.ToString()</td>
|
<td><input type="checkbox" checked="@(build.Heal > 0)" disabled="disabled" /></td>
|
||||||
<td>@build.Quickness.ToString()</td>
|
<td><input type="checkbox" checked="@(build.Quickness > 0)" disabled="disabled" /></td>
|
||||||
<td>@build.Alacrity.ToString()</td>
|
<td><input type="checkbox" checked="@(build.Alacrity > 0)" disabled="disabled" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -70,10 +70,10 @@
|
||||||
<td>@build.BuildName</td>
|
<td>@build.BuildName</td>
|
||||||
<td>@build.Class.ToString()</td>
|
<td>@build.Class.ToString()</td>
|
||||||
<td>@build.EliteSpecialization.ToString()</td>
|
<td>@build.EliteSpecialization.ToString()</td>
|
||||||
<td><input type="checkbox" checked="@(build.Might > 0)" disabled="true" /></td>
|
<td><input type="checkbox" checked="@(build.Might > 0)" disabled="disabled" /></td>
|
||||||
<td><input type="checkbox" checked="@(build.Heal > 0)" disabled="true" /></td>
|
<td><input type="checkbox" checked="@(build.Heal > 0)" disabled="disabled" /></td>
|
||||||
<td><input type="checkbox" checked="@(build.Quickness > 0)" disabled="true" /></td>
|
<td><input type="checkbox" checked="@(build.Quickness > 0)" disabled="disabled" /></td>
|
||||||
<td><input type="checkbox" checked="@(build.Alacrity > 0)" disabled="true" /></td>
|
<td><input type="checkbox" checked="@(build.Alacrity > 0)" disabled="disabled" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
</table>
|
</table>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue