From abcd541266c4a755dcfc1638f81cbaaaa2c8531f Mon Sep 17 00:00:00 2001 From: Kurt Date: Sat, 15 Apr 2017 14:38:43 -0700 Subject: [PATCH] Add party stat calc to report window --- PKHeX.WinForms/Subforms/frmReport.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/PKHeX.WinForms/Subforms/frmReport.cs b/PKHeX.WinForms/Subforms/frmReport.cs index 3925e4b06..d698f787e 100644 --- a/PKHeX.WinForms/Subforms/frmReport.cs +++ b/PKHeX.WinForms/Subforms/frmReport.cs @@ -17,6 +17,7 @@ namespace PKHeX.WinForms public class Preview { private readonly PKM pkm; + private readonly ushort[] Stats; public string Position => pkm.Identifier; public Image Sprite => pkm.Sprite(); public string Nickname => pkm.Nickname; @@ -31,6 +32,12 @@ namespace PKHeX.WinForms public string Move3 => get(GameInfo.Strings.movelist, pkm.Move3); public string Move4 => get(GameInfo.Strings.movelist, pkm.Move4); public string HeldItem => get(GameInfo.Strings.itemlist, pkm.HeldItem); + public string HP => Stats[0].ToString(); + public string ATK => Stats[1].ToString(); + public string DEF => Stats[2].ToString(); + public string SPA => Stats[4].ToString(); + public string SPD => Stats[5].ToString(); + public string SPE => Stats[3].ToString(); public string MetLoc => pkm.getLocation(eggmet: false); public string EggLoc => pkm.getLocation(eggmet: true); public string Ball => get(GameInfo.Strings.balllist, pkm.Ball); @@ -109,7 +116,12 @@ namespace PKHeX.WinForms public int Encounter => pkm.EncounterType; #endregion - public Preview(PKM p) { pkm = p; } + + public Preview(PKM p) + { + pkm = p; + Stats = pkm.getStats(pkm.PersonalInfo); + } private static string get(IReadOnlyList arr, int val) => arr?.Count > val ? arr[val] : null; }