diff --git a/Pkmds.Web/Components/EditForms/Tabs/MainTab.razor b/Pkmds.Web/Components/EditForms/Tabs/MainTab.razor index f3e65c8a..4ea9d983 100644 --- a/Pkmds.Web/Components/EditForms/Tabs/MainTab.razor +++ b/Pkmds.Web/Components/EditForms/Tabs/MainTab.razor @@ -92,17 +92,30 @@ } + + - + + + @{ + var levelProgress = Experience.GetEXPToLevelUpPercentage(Pokemon.CurrentLevel, Pokemon.EXP, Pokemon.PersonalInfo.EXPGrowth); + + } @if (saveGeneration >= 3) { diff --git a/Pkmds.Web/Components/EditForms/Tabs/MainTab.razor.cs b/Pkmds.Web/Components/EditForms/Tabs/MainTab.razor.cs index 640572ba..27b53680 100644 --- a/Pkmds.Web/Components/EditForms/Tabs/MainTab.razor.cs +++ b/Pkmds.Web/Components/EditForms/Tabs/MainTab.razor.cs @@ -124,4 +124,17 @@ private void SetPokemonPid(string newPidHex) } private readonly PatternMask hexMask = new("########") { MaskChars = [new('#', "[0-9a-fA-F]")] }; + + // ReSharper disable once InconsistentNaming + private double GetEXPToLevelUp() + { + if (Pokemon is not { CurrentLevel: var level and < 100, EXP: var exp, PersonalInfo.EXPGrowth: var growth }) + { + return 0; + } + + var table = Experience.GetTable(growth); + var next = Experience.GetEXP(++level, table); + return next - exp; + } }