diff --git a/CCharLearn/CCharLearn.csproj b/CCharLearn/CCharLearn.csproj index 51b2277..d86e022 100644 --- a/CCharLearn/CCharLearn.csproj +++ b/CCharLearn/CCharLearn.csproj @@ -16,6 +16,7 @@ + diff --git a/CCharLearn/Pages/Learn.razor b/CCharLearn/Pages/Learn.razor index dd00ad2..628ac5e 100644 --- a/CCharLearn/Pages/Learn.razor +++ b/CCharLearn/Pages/Learn.razor @@ -1,6 +1,7 @@ @page "/Learn" @using System.Text; @using CCharLearn.ExtensionMethods; +@using UnidecodeSharpFork; @inject NavigationManager navigator @inject Blazored.LocalStorage.ILocalStorageService localStorage @@ -24,7 +25,7 @@ } - + @*True if debug, false for not debug. (TODO: Use an extensíonMethod: https://stackoverflow.com/questions/4696175/preprocessor-directives-in-razor)*@ @if (true) @@ -74,16 +75,23 @@ - @if (!Answers.Any(x => x == null)) - { - Submit - } + + @if (!Answers.Any(x => x == null)) + { + Submit + } + @if (isEasyMode) + { + • Easy mode enabled + } + @code { bool isSavedLocally = false; + bool isEasyMode = false; bool selectedCorrect = false; @@ -121,6 +129,10 @@ protected override async Task OnInitializedAsync() { Program.UpdateUiEvent += OnUiUpdate; + if (await localStorage.ContainKeyAsync("EasyMode")) + { + isEasyMode = await localStorage.GetItemAsync("EasyMode"); + } bool continueLast = await localStorage.ContainKeyAsync("ContinueLearning") @@ -136,6 +148,9 @@ await LoadCharectersFromChunk(); } + if (isEasyMode) + DontSkipTheseCChar.ForEach(x => x.cchar.pinyin = x.cchar.pinyin.Unidecode()); + Program.CCharsLeft = DontSkipTheseCChar.Count; Program.InvokeUiUpdate();