2017-10-03 06:13:40 +00:00
|
|
|
|
using PKHeX.Core;
|
2016-07-09 23:17:55 +00:00
|
|
|
|
|
2017-05-23 04:55:05 +00:00
|
|
|
|
namespace PKHeX.WinForms.Controls
|
2016-07-09 23:17:55 +00:00
|
|
|
|
{
|
2017-05-23 04:55:05 +00:00
|
|
|
|
public partial class PKMEditor
|
2016-07-09 23:17:55 +00:00
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private void PopulateFieldsPK3()
|
2016-07-09 23:17:55 +00:00
|
|
|
|
{
|
2017-10-03 06:13:40 +00:00
|
|
|
|
if (!(pkm is PK3 pk3))
|
2016-07-09 23:17:55 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2017-10-03 06:13:40 +00:00
|
|
|
|
LoadMisc1(pk3);
|
|
|
|
|
LoadMisc2(pk3);
|
|
|
|
|
LoadMisc3(pk3);
|
|
|
|
|
|
2017-04-14 23:24:41 +00:00
|
|
|
|
CB_Ability.SelectedIndex = pk3.AbilityBit && CB_Ability.Items.Count > 1 ? 1 : 0;
|
2016-07-09 23:17:55 +00:00
|
|
|
|
|
2017-10-03 06:13:40 +00:00
|
|
|
|
LoadPartyStats(pk3);
|
2017-06-18 01:37:19 +00:00
|
|
|
|
UpdateStats();
|
2017-10-03 06:13:40 +00:00
|
|
|
|
}
|
|
|
|
|
private void PopulateFieldsCK3()
|
|
|
|
|
{
|
|
|
|
|
if (!(pkm is CK3 ck3))
|
|
|
|
|
return;
|
2016-07-09 23:17:55 +00:00
|
|
|
|
|
2017-10-03 06:13:40 +00:00
|
|
|
|
LoadMisc1(ck3);
|
|
|
|
|
LoadMisc2(ck3);
|
|
|
|
|
LoadMisc3(ck3);
|
|
|
|
|
|
|
|
|
|
int abil = ck3.AbilityNumber >> 1;
|
2017-10-29 17:41:12 +00:00
|
|
|
|
CB_Ability.SelectedIndex = abil >= CB_Ability.Items.Count ? 0 : abil;
|
2017-10-03 06:13:40 +00:00
|
|
|
|
LoadShadow3(ck3);
|
|
|
|
|
|
|
|
|
|
LoadPartyStats(ck3);
|
|
|
|
|
UpdateStats();
|
2016-07-09 23:17:55 +00:00
|
|
|
|
}
|
2017-10-03 06:13:40 +00:00
|
|
|
|
private void PopulateFieldsXK3()
|
|
|
|
|
{
|
|
|
|
|
if (!(pkm is XK3 xk3))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
LoadMisc1(xk3);
|
|
|
|
|
LoadMisc2(xk3);
|
|
|
|
|
LoadMisc3(xk3);
|
|
|
|
|
|
|
|
|
|
int abil = xk3.AbilityNumber >> 1;
|
2017-10-29 17:41:12 +00:00
|
|
|
|
CB_Ability.SelectedIndex = abil >= CB_Ability.Items.Count ? 0 : abil;
|
2017-10-03 06:13:40 +00:00
|
|
|
|
LoadShadow3(xk3);
|
|
|
|
|
|
|
|
|
|
LoadPartyStats(xk3);
|
|
|
|
|
UpdateStats();
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private PKM PreparePK3()
|
2016-07-09 23:17:55 +00:00
|
|
|
|
{
|
2017-10-03 06:13:40 +00:00
|
|
|
|
if (!(pkm is PK3 pk3))
|
2016-07-09 23:17:55 +00:00
|
|
|
|
return null;
|
|
|
|
|
|
2017-10-03 06:13:40 +00:00
|
|
|
|
SaveMisc1(pk3);
|
|
|
|
|
SaveMisc2(pk3);
|
|
|
|
|
SaveMisc3(pk3);
|
|
|
|
|
|
|
|
|
|
pk3.AbilityNumber = 1 << CB_Ability.SelectedIndex;
|
2016-07-09 23:17:55 +00:00
|
|
|
|
|
2017-10-03 06:13:40 +00:00
|
|
|
|
SavePartyStats(pk3);
|
|
|
|
|
pk3.FixMoves();
|
2016-07-09 23:17:55 +00:00
|
|
|
|
pk3.RefreshChecksum();
|
|
|
|
|
return pk3;
|
|
|
|
|
}
|
2017-10-03 06:13:40 +00:00
|
|
|
|
private PKM PrepareCK3()
|
|
|
|
|
{
|
|
|
|
|
if (!(pkm is CK3 ck3))
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
|
|
SaveMisc1(ck3);
|
|
|
|
|
SaveMisc2(ck3);
|
|
|
|
|
SaveMisc3(ck3);
|
|
|
|
|
|
|
|
|
|
ck3.AbilityNumber = 1 << CB_Ability.SelectedIndex; // to match gen6+
|
|
|
|
|
SaveShadow3(ck3);
|
|
|
|
|
|
|
|
|
|
SavePartyStats(ck3);
|
|
|
|
|
ck3.FixMoves();
|
|
|
|
|
ck3.RefreshChecksum();
|
|
|
|
|
return ck3;
|
|
|
|
|
}
|
|
|
|
|
private PKM PrepareXK3()
|
|
|
|
|
{
|
|
|
|
|
if (!(pkm is XK3 xk3))
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
|
|
SaveMisc1(xk3);
|
|
|
|
|
SaveMisc2(xk3);
|
|
|
|
|
SaveMisc3(xk3);
|
|
|
|
|
|
|
|
|
|
xk3.AbilityNumber = 1 << CB_Ability.SelectedIndex; // to match gen6+
|
|
|
|
|
SaveShadow3(xk3);
|
|
|
|
|
|
|
|
|
|
SavePartyStats(xk3);
|
|
|
|
|
xk3.FixMoves();
|
|
|
|
|
xk3.RefreshChecksum();
|
|
|
|
|
return xk3;
|
|
|
|
|
}
|
2016-07-09 23:17:55 +00:00
|
|
|
|
}
|
|
|
|
|
}
|