Added easy mode checkbox
This commit is contained in:
parent
14ea6e5c06
commit
8b9bb3698a
1 changed files with 28 additions and 1 deletions
|
@ -14,7 +14,7 @@
|
||||||
<MudSelectItem T="int" Value="@i" />
|
<MudSelectItem T="int" Value="@i" />
|
||||||
}
|
}
|
||||||
</MudSelect>
|
</MudSelect>
|
||||||
<MudContainer Class="justify-center d-flex pb-16 pt-4">
|
<MudContainer Class="justify-center d-flex pt-4">
|
||||||
<MudButton Variant="Variant.Filled" OnClick=StartLearning Color="Color.Primary">@((!continueDataExists) ? "Start learning!" : "Start new!")</MudButton>
|
<MudButton Variant="Variant.Filled" OnClick=StartLearning Color="Color.Primary">@((!continueDataExists) ? "Start learning!" : "Start new!")</MudButton>
|
||||||
<MudStack Spacing="0" Class="pa-0 pl-2 ma-0">
|
<MudStack Spacing="0" Class="pa-0 pl-2 ma-0">
|
||||||
@if (continueDataExists)
|
@if (continueDataExists)
|
||||||
|
@ -35,6 +35,10 @@
|
||||||
</MudContainer>
|
</MudContainer>
|
||||||
|
|
||||||
<MudContainer Class="justify-center d-flex">
|
<MudContainer Class="justify-center d-flex">
|
||||||
|
<MudCheckBox @bind-Checked="@IsEasyMode" Label="Easy mode" Color="Color.Primary"></MudCheckBox>
|
||||||
|
</MudContainer>
|
||||||
|
|
||||||
|
<MudContainer Class="pt-16 justify-center d-flex">
|
||||||
@if (Charecters != null)
|
@if (Charecters != null)
|
||||||
{
|
{
|
||||||
<MudPaper Class="overflow-scroll rounded-0" Style="height: 50vh;" Elevation="1">
|
<MudPaper Class="overflow-scroll rounded-0" Style="height: 50vh;" Elevation="1">
|
||||||
|
@ -86,6 +90,19 @@
|
||||||
bool continueDataExists = false;
|
bool continueDataExists = false;
|
||||||
int continueCharectersLeft = -1;
|
int continueCharectersLeft = -1;
|
||||||
|
|
||||||
|
private bool isEasyMode;
|
||||||
|
|
||||||
|
public bool IsEasyMode
|
||||||
|
{
|
||||||
|
get { return isEasyMode; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
isEasyMode = value;
|
||||||
|
SetEasyMode();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected async override Task OnInitializedAsync()
|
protected async override Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
|
@ -134,6 +151,11 @@
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async void SetEasyMode()
|
||||||
|
{
|
||||||
|
await localStorage.SetItemAsync("EasyMode", isEasyMode);
|
||||||
|
}
|
||||||
|
|
||||||
async Task LoadAllChunksIntoLocalStorage()
|
async Task LoadAllChunksIntoLocalStorage()
|
||||||
{
|
{
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
|
@ -190,5 +212,10 @@
|
||||||
{
|
{
|
||||||
continueCharectersLeft = await localStorage.GetItemAsync<int>("ContinueCharectersLeft");
|
continueCharectersLeft = await localStorage.GetItemAsync<int>("ContinueCharectersLeft");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (await localStorage.ContainKeyAsync("EasyMode"))
|
||||||
|
{
|
||||||
|
isEasyMode = await localStorage.GetItemAsync<bool>("EasyMode");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue