2017-10-03 06:13:40 +00:00
|
|
|
|
using PKHeX.Core;
|
2016-09-02 21:20:39 +00:00
|
|
|
|
|
2017-05-23 04:55:05 +00:00
|
|
|
|
namespace PKHeX.WinForms.Controls
|
2016-09-02 21:20:39 +00:00
|
|
|
|
{
|
2017-05-23 04:55:05 +00:00
|
|
|
|
public partial class PKMEditor
|
2016-09-02 21:20:39 +00:00
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private void PopulateFieldsPK2()
|
2016-09-02 21:20:39 +00:00
|
|
|
|
{
|
2017-10-03 06:13:40 +00:00
|
|
|
|
if (!(pkm is PK2 pk2))
|
2016-09-02 21:20:39 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2017-10-03 06:13:40 +00:00
|
|
|
|
LoadMisc1(pk2);
|
|
|
|
|
LoadMisc2(pk2);
|
2016-09-04 01:57:54 +00:00
|
|
|
|
|
2019-09-19 02:58:23 +00:00
|
|
|
|
TID_Trainer.LoadIDValues(pk2);
|
2016-09-04 01:57:54 +00:00
|
|
|
|
TB_MetLevel.Text = pk2.Met_Level.ToString();
|
|
|
|
|
CB_MetLocation.SelectedValue = pk2.Met_Location;
|
|
|
|
|
CB_MetTimeOfDay.SelectedIndex = pk2.Met_TimeOfDay;
|
2016-09-02 21:20:39 +00:00
|
|
|
|
|
2017-10-03 06:13:40 +00:00
|
|
|
|
// Attempt to detect language
|
2019-09-19 02:58:23 +00:00
|
|
|
|
CB_Language.SelectedValue = pk2.GuessedLanguage();
|
2016-09-02 21:20:39 +00:00
|
|
|
|
|
2017-10-03 06:13:40 +00:00
|
|
|
|
LoadPartyStats(pk2);
|
2017-06-18 01:37:19 +00:00
|
|
|
|
UpdateStats();
|
2016-09-02 21:20:39 +00:00
|
|
|
|
}
|
2017-10-03 06:13:40 +00:00
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private PKM PreparePK2()
|
2016-09-02 21:20:39 +00:00
|
|
|
|
{
|
2017-10-03 06:13:40 +00:00
|
|
|
|
if (!(pkm is PK2 pk2))
|
2016-09-02 21:20:39 +00:00
|
|
|
|
return null;
|
|
|
|
|
|
2017-10-03 06:13:40 +00:00
|
|
|
|
SaveMisc1(pk2);
|
|
|
|
|
SaveMisc2(pk2);
|
|
|
|
|
|
2016-09-04 01:57:54 +00:00
|
|
|
|
pk2.Met_Level = Util.ToInt32(TB_MetLevel.Text);
|
2017-06-18 01:37:19 +00:00
|
|
|
|
pk2.Met_Location = WinFormsUtil.GetIndex(CB_MetLocation);
|
2016-09-04 01:57:54 +00:00
|
|
|
|
pk2.Met_TimeOfDay = CB_MetTimeOfDay.SelectedIndex;
|
2016-09-02 21:20:39 +00:00
|
|
|
|
|
2017-10-03 06:13:40 +00:00
|
|
|
|
SavePartyStats(pk2);
|
2016-09-02 21:20:39 +00:00
|
|
|
|
pk2.FixMoves();
|
|
|
|
|
return pk2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|