Add alcremie formArg gui

Closes #2538
Standardize nomenclature as FormArgument, add interface for those
exposing the property.
This commit is contained in:
Kurt 2019-11-29 10:44:52 -08:00
parent bc9be36123
commit 3c4e668d9a
14 changed files with 161 additions and 109 deletions

View File

@ -5,7 +5,7 @@
namespace PKHeX.Core
{
/// <summary> Generation 7 <see cref="PKM"/> format used for <see cref="GameVersion.GG"/>. </summary>
public sealed class PB7 : G6PKM, IHyperTrain, IAwakened, IScaledSize, IFavorite
public sealed class PB7 : G6PKM, IHyperTrain, IAwakened, IScaledSize, IFavorite, IFormArgument
{
public static readonly ushort[] Unused =
{
@ -129,7 +129,7 @@ public override uint PID
public byte _0x39 { get => Data[0x39]; set => Data[0x39] = value; }
public int HeightScalar { get => Data[0x3A]; set => Data[0x3A] = (byte)value; }
public int WeightScalar { get => Data[0x3B]; set => Data[0x3B] = (byte)value; }
public uint FormDuration { get => BitConverter.ToUInt32(Data, 0x3C); set => BitConverter.GetBytes(value).CopyTo(Data, 0x3C); }
public uint FormArgument { get => BitConverter.ToUInt32(Data, 0x3C); set => BitConverter.GetBytes(value).CopyTo(Data, 0x3C); }
#endregion
#region Block B
public override string Nickname

View File

@ -4,7 +4,7 @@
namespace PKHeX.Core
{
/// <summary> Generation 6 <see cref="PKM"/> format. </summary>
public sealed class PK6 : G6PKM, IRibbonSetEvent3, IRibbonSetEvent4, IRibbonSetCommon3, IRibbonSetCommon4, IRibbonSetCommon6, IContestStats, IGeoTrack, ISuperTrain
public sealed class PK6 : G6PKM, IRibbonSetEvent3, IRibbonSetEvent4, IRibbonSetCommon3, IRibbonSetCommon4, IRibbonSetCommon6, IContestStats, IGeoTrack, ISuperTrain, IFormArgument
{
private static readonly ushort[] Unused =
{
@ -216,7 +216,7 @@ public override uint PID
public bool DistSuperTrain6 { get => (DistByte & (1 << 5)) == 1 << 5; set => DistByte = (byte)((DistByte & ~(1 << 5)) | (value ? 1 << 5 : 0)); }
public bool Dist7 { get => (DistByte & (1 << 6)) == 1 << 6; set => DistByte = (byte)((DistByte & ~(1 << 6)) | (value ? 1 << 6 : 0)); }
public bool Dist8 { get => (DistByte & (1 << 7)) == 1 << 7; set => DistByte = (byte)((DistByte & ~(1 << 7)) | (value ? 1 << 7 : 0)); }
public uint FormDuration { get => BitConverter.ToUInt32(Data, 0x3C); set => BitConverter.GetBytes(value).CopyTo(Data, 0x3C); }
public uint FormArgument { get => BitConverter.ToUInt32(Data, 0x3C); set => BitConverter.GetBytes(value).CopyTo(Data, 0x3C); }
#endregion
#region Block B
public override string Nickname { get => GetString(0x40, 24); set => SetString(value, 12).CopyTo(Data, 0x40); }

View File

@ -4,7 +4,7 @@
namespace PKHeX.Core
{
/// <summary> Generation 7 <see cref="PKM"/> format. </summary>
public sealed class PK7 : G6PKM, IRibbonSetEvent3, IRibbonSetEvent4, IRibbonSetCommon3, IRibbonSetCommon4, IRibbonSetCommon6, IRibbonSetCommon7, IContestStats, IHyperTrain, IGeoTrack, ISuperTrain
public sealed class PK7 : G6PKM, IRibbonSetEvent3, IRibbonSetEvent4, IRibbonSetCommon3, IRibbonSetCommon4, IRibbonSetCommon6, IRibbonSetCommon7, IContestStats, IHyperTrain, IGeoTrack, ISuperTrain, IFormArgument
{
private static readonly ushort[] Unused =
{
@ -226,7 +226,7 @@ public override uint PID
public bool DistSuperTrain6 { get => (DistByte & (1 << 5)) == 1 << 5; set => DistByte = (byte)((DistByte & ~(1 << 5)) | (value ? 1 << 5 : 0)); }
public bool Dist7 { get => (DistByte & (1 << 6)) == 1 << 6; set => DistByte = (byte)((DistByte & ~(1 << 6)) | (value ? 1 << 6 : 0)); }
public bool Dist8 { get => (DistByte & (1 << 7)) == 1 << 7; set => DistByte = (byte)((DistByte & ~(1 << 7)) | (value ? 1 << 7 : 0)); }
public uint FormDuration { get => BitConverter.ToUInt32(Data, 0x3C); set => BitConverter.GetBytes(value).CopyTo(Data, 0x3C); }
public uint FormArgument { get => BitConverter.ToUInt32(Data, 0x3C); set => BitConverter.GetBytes(value).CopyTo(Data, 0x3C); }
#endregion
#region Block B
public override string Nickname

View File

@ -6,7 +6,7 @@ namespace PKHeX.Core
/// <summary> Generation 8 <see cref="PKM"/> format. </summary>
public sealed class PK8 : PKM,
IRibbonSetEvent3, IRibbonSetEvent4, IRibbonSetCommon3, IRibbonSetCommon4, IRibbonSetCommon6, IRibbonSetCommon7, IRibbonSetCommon8, IRibbonSetMark8,
IContestStats, IHyperTrain, IScaledSize, IGigantamax, IFavorite, IDynamaxLevel, IRibbonIndex, IHandlerLanguage
IContestStats, IHyperTrain, IScaledSize, IGigantamax, IFavorite, IDynamaxLevel, IRibbonIndex, IHandlerLanguage, IFormArgument
{
private static readonly ushort[] Unused =
{
@ -486,7 +486,7 @@ public void SetFromArrayC1(int index, byte value)
public override int ConsoleRegion { get => Data[0xE1]; set => Data[0xE1] = (byte)value; }
public override int Language { get => Data[0xE2]; set => Data[0xE2] = (byte)value; }
public int UnkE3 { get => Data[0xE3]; set => Data[0xE3] = (byte)value; }
public uint FormDuration { get => BitConverter.ToUInt32(Data, 0xE4); set => BitConverter.GetBytes(value).CopyTo(Data, 0xE4); }
public uint FormArgument { get => BitConverter.ToUInt32(Data, 0xE4); set => BitConverter.GetBytes(value).CopyTo(Data, 0xE4); }
public sbyte AffixedRibbon { get => (sbyte)Data[0xE8]; set => Data[0xE8] = (byte)value; } // selected ribbon
public byte GetFromArrayC2(int index)

View File

@ -0,0 +1,18 @@
namespace PKHeX.Core
{
/// <summary>
/// Alternate form data has an associated value.
/// </summary>
/// <remarks>
/// <see cref="Species.Furfrou"/> How long (days) the form can last before reverting to AltForm-0 (5 days max)
/// <see cref="Species.Hoopa"/>: How long (days) the form can last before reverting to AltForm-0 (3 days max)
/// <see cref="Species.Alcremie"/>: Topping (Strawberry, Star, etc); [0,7]
/// </remarks>
public interface IFormArgument
{
/// <summary>
/// Argument for the associated <see cref="PKM.AltForm"/>
/// </summary>
uint FormArgument { get; set; }
}
}

View File

@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using static PKHeX.Core.Species;
namespace PKHeX.Core
@ -954,5 +955,19 @@ public static string[] GetAlcremieFormList(IReadOnlyList<string> forms)
return result;
}
public static string[] GetFormArgumentStrings(int species, int form, int generation)
{
if (generation < 8)
return EMPTY;
return species switch
{
(int) Furfrou when form != 0 => new[] {"0", "1", "2", "3", "4", "5"},
(int) Hoopa when form == 1 => new[] {"0", "1", "2", "3"},
(int) Alcremie => Enum.GetNames(typeof(AlcremieDecoration)),
_ => EMPTY
};
}
}
}

View File

@ -132,10 +132,10 @@ private void AddCountAcquired(PKM pkm)
protected override void SetPartyValues(PKM pkm, bool isParty)
{
base.SetPartyValues(pkm, isParty);
((PK6)pkm).FormDuration = GetFormDuration(pkm, isParty);
((PK6)pkm).FormArgument = GetFormArgument(pkm, isParty);
}
private static uint GetFormDuration(PKM pkm, bool isParty)
private static uint GetFormArgument(PKM pkm, bool isParty)
{
if (!isParty || pkm.AltForm == 0)
return 0;

View File

@ -207,10 +207,10 @@ private void AddCountAcquired(PKM pkm)
protected override void SetPartyValues(PKM pkm, bool isParty)
{
base.SetPartyValues(pkm, isParty);
((PK7)pkm).FormDuration = GetFormDuration(pkm, isParty);
((PK7)pkm).FormArgument = GetFormArgument(pkm, isParty);
}
private static uint GetFormDuration(PKM pkm, bool isParty)
private static uint GetFormArgument(PKM pkm, bool isParty)
{
if (!isParty || pkm.AltForm == 0)
return 0;

View File

@ -112,18 +112,6 @@ private void AddCountAcquired(PKM pkm)
{
}
private static uint GetFormDuration(PKM pkm, bool isParty)
{
if (!isParty || pkm.AltForm == 0)
return 0;
return pkm.Species switch
{
(int)Species.Furfrou => 5u, // Furfrou
(int)Species.Hoopa => 3u, // Hoopa
_ => 0u
};
}
protected override void SetDex(PKM pkm) => Zukan.SetDex(pkm);
public override bool GetCaught(int species) => Zukan.GetCaught(species);
public override bool GetSeen(int species) => Zukan.GetSeen(species);

View File

@ -84,13 +84,13 @@ private void Initialize()
protected override void SetPartyValues(PKM pkm, bool isParty)
{
base.SetPartyValues(pkm, isParty);
((PK8)pkm).FormDuration = GetFormDuration((PK8)pkm, isParty);
((PK8)pkm).FormArgument = GetFormArgument((PK8)pkm, isParty);
}
private static uint GetFormDuration(PK8 pkm, bool isParty)
private static uint GetFormArgument(PK8 pkm, bool isParty)
{
if (pkm.Species == (int) Species.Alcremie)
return pkm.FormDuration & 7;
return pkm.FormArgument & 7;
if (!isParty || pkm.AltForm == 0)
return 0;

View File

@ -271,7 +271,7 @@ public override void SetDex(PKM pkm)
if (species == (int)Species.Alcremie)
{
form *= 7;
form += (int)((PK8)pkm).FormDuration; // alteration byte
form += (int)((PK8)pkm).FormArgument; // alteration byte
}
else if (species == (int) Species.Eternatus && pkm.AltForm == 1)
{

View File

@ -171,6 +171,9 @@ private void LoadMisc2(PKM pk)
CHK_IsEgg.Checked = pk.IsEgg;
CB_HeldItem.SelectedValue = pk.HeldItem;
CB_Form.SelectedIndex = CB_Form.Items.Count > pk.AltForm ? pk.AltForm : CB_Form.Items.Count - 1;
if (pk is IFormArgument f)
CB_FormArgument.SelectedIndex = (int)f.FormArgument;
TB_Friendship.Text = pk.CurrentFriendship.ToString();
Label_HatchCounter.Visible = CHK_IsEgg.Checked && Entity.Format > 1;
@ -183,6 +186,8 @@ private void SaveMisc2(PKM pk)
pk.IsEgg = CHK_IsEgg.Checked;
pk.HeldItem = WinFormsUtil.GetIndex(CB_HeldItem);
pk.AltForm = (MT_Form.Enabled ? Convert.ToInt32(MT_Form.Text) : CB_Form.Enabled ? CB_Form.SelectedIndex : 0) & 0x1F;
if (Entity is IFormArgument f)
f.FormArgument = (uint)Math.Max(0, CB_FormArgument.SelectedIndex);
pk.CurrentFriendship = Util.ToInt32(TB_Friendship.Text);
}

View File

@ -116,12 +116,9 @@ private void InitializeComponent()
this.CHK_Shadow = new System.Windows.Forms.CheckBox();
this.FLP_ShinyLeaf = new System.Windows.Forms.FlowLayoutPanel();
this.L_ShinyLeaf = new System.Windows.Forms.Label();
this.ShinyLeaf = new PKHeX.WinForms.Controls.ShinyLeaf();
this.FLP_CatchRate = new System.Windows.Forms.FlowLayoutPanel();
this.L_CatchRate = new System.Windows.Forms.Label();
this.CR_PK1 = new PKHeX.WinForms.Controls.CatchRate();
this.FLP_SizeCP = new System.Windows.Forms.FlowLayoutPanel();
this.SizeCP = new PKHeX.WinForms.Controls.SizeCP();
this.Tab_Met = new System.Windows.Forms.TabPage();
this.CHK_AsEgg = new System.Windows.Forms.CheckBox();
this.GB_EggConditions = new System.Windows.Forms.GroupBox();
@ -157,8 +154,6 @@ private void InitializeComponent()
this.L_MetTimeOfDay = new System.Windows.Forms.Label();
this.CB_MetTimeOfDay = new System.Windows.Forms.ComboBox();
this.Tab_Stats = new System.Windows.Forms.TabPage();
this.Stats = new PKHeX.WinForms.Controls.StatEditor();
this.Contest = new PKHeX.WinForms.Controls.ContestStat();
this.Tab_Attacks = new System.Windows.Forms.TabPage();
this.B_Records = new System.Windows.Forms.Button();
this.PB_WarnMove4 = new System.Windows.Forms.PictureBox();
@ -216,7 +211,6 @@ private void InitializeComponent()
this.TB_ExtraByte = new System.Windows.Forms.MaskedTextBox();
this.CB_ExtraBytes = new System.Windows.Forms.ComboBox();
this.GB_OT = new System.Windows.Forms.GroupBox();
this.TID_Trainer = new PKHeX.WinForms.Controls.TrainerID();
this.Label_OTGender = new System.Windows.Forms.Label();
this.TB_OT = new System.Windows.Forms.TextBox();
this.Label_OT = new System.Windows.Forms.Label();
@ -224,6 +218,13 @@ private void InitializeComponent()
this.SpeciesIDTip = new System.Windows.Forms.ToolTip(this.components);
this.NatureTip = new System.Windows.Forms.ToolTip(this.components);
this.Tip3 = new System.Windows.Forms.ToolTip(this.components);
this.CB_FormArgument = new System.Windows.Forms.ComboBox();
this.ShinyLeaf = new PKHeX.WinForms.Controls.ShinyLeaf();
this.CR_PK1 = new PKHeX.WinForms.Controls.CatchRate();
this.SizeCP = new PKHeX.WinForms.Controls.SizeCP();
this.Stats = new PKHeX.WinForms.Controls.StatEditor();
this.Contest = new PKHeX.WinForms.Controls.ContestStat();
this.TID_Trainer = new PKHeX.WinForms.Controls.TrainerID();
this.tabMain.SuspendLayout();
this.Tab_Main.SuspendLayout();
this.FLP_Main.SuspendLayout();
@ -317,7 +318,7 @@ private void InitializeComponent()
this.tabMain.Location = new System.Drawing.Point(0, 0);
this.tabMain.Name = "tabMain";
this.tabMain.SelectedIndex = 0;
this.tabMain.Size = new System.Drawing.Size(280, 565);
this.tabMain.Size = new System.Drawing.Size(315, 565);
this.tabMain.TabIndex = 1;
//
// Tab_Main
@ -326,16 +327,13 @@ private void InitializeComponent()
this.Tab_Main.Controls.Add(this.FLP_Main);
this.Tab_Main.Location = new System.Drawing.Point(4, 22);
this.Tab_Main.Name = "Tab_Main";
this.Tab_Main.Padding = new System.Windows.Forms.Padding(3);
this.Tab_Main.Size = new System.Drawing.Size(272, 539);
this.Tab_Main.Size = new System.Drawing.Size(307, 539);
this.Tab_Main.TabIndex = 0;
this.Tab_Main.Text = "Main";
this.Tab_Main.UseVisualStyleBackColor = true;
//
// FLP_Main
//
this.FLP_Main.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.FLP_Main.Controls.Add(this.FLP_PID);
this.FLP_Main.Controls.Add(this.FLP_Species);
this.FLP_Main.Controls.Add(this.FLP_Nickname);
@ -357,9 +355,11 @@ private void InitializeComponent()
this.FLP_Main.Controls.Add(this.FLP_ShinyLeaf);
this.FLP_Main.Controls.Add(this.FLP_CatchRate);
this.FLP_Main.Controls.Add(this.FLP_SizeCP);
this.FLP_Main.Location = new System.Drawing.Point(0, 2);
this.FLP_Main.Dock = System.Windows.Forms.DockStyle.Fill;
this.FLP_Main.Location = new System.Drawing.Point(0, 0);
this.FLP_Main.Margin = new System.Windows.Forms.Padding(0);
this.FLP_Main.Name = "FLP_Main";
this.FLP_Main.Size = new System.Drawing.Size(272, 536);
this.FLP_Main.Size = new System.Drawing.Size(307, 539);
this.FLP_Main.TabIndex = 103;
//
// FLP_PID
@ -430,7 +430,7 @@ private void InitializeComponent()
this.Label_IsShiny2.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.Label_IsShiny2.Image = global::PKHeX.WinForms.Properties.Resources.rare_icon_2;
this.Label_IsShiny2.InitialImage = global::PKHeX.WinForms.Properties.Resources.rare_icon_2;
this.Label_IsShiny2.Location = new System.Drawing.Point(36, 2);
this.Label_IsShiny2.Location = new System.Drawing.Point(14, 2);
this.Label_IsShiny2.Margin = new System.Windows.Forms.Padding(0, 2, 2, 0);
this.Label_IsShiny2.Name = "Label_IsShiny2";
this.Label_IsShiny2.Size = new System.Drawing.Size(20, 20);
@ -771,7 +771,7 @@ private void InitializeComponent()
this.FLP_FriendshipForm.Location = new System.Drawing.Point(0, 149);
this.FLP_FriendshipForm.Margin = new System.Windows.Forms.Padding(0);
this.FLP_FriendshipForm.Name = "FLP_FriendshipForm";
this.FLP_FriendshipForm.Size = new System.Drawing.Size(272, 21);
this.FLP_FriendshipForm.Size = new System.Drawing.Size(307, 21);
this.FLP_FriendshipForm.TabIndex = 6;
//
// FLP_FriendshipFormLeft
@ -814,10 +814,11 @@ private void InitializeComponent()
this.FLP_FriendshipFormRight.Controls.Add(this.Label_Form);
this.FLP_FriendshipFormRight.Controls.Add(this.CB_Form);
this.FLP_FriendshipFormRight.Controls.Add(this.MT_Form);
this.FLP_FriendshipFormRight.Controls.Add(this.CB_FormArgument);
this.FLP_FriendshipFormRight.Location = new System.Drawing.Point(110, 0);
this.FLP_FriendshipFormRight.Margin = new System.Windows.Forms.Padding(0);
this.FLP_FriendshipFormRight.Name = "FLP_FriendshipFormRight";
this.FLP_FriendshipFormRight.Size = new System.Drawing.Size(162, 21);
this.FLP_FriendshipFormRight.Size = new System.Drawing.Size(197, 21);
this.FLP_FriendshipFormRight.TabIndex = 104;
//
// TB_Friendship
@ -1376,14 +1377,6 @@ private void InitializeComponent()
this.L_ShinyLeaf.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.L_ShinyLeaf.Click += new System.EventHandler(this.ClickShinyLeaf);
//
// ShinyLeaf
//
this.ShinyLeaf.Location = new System.Drawing.Point(110, 0);
this.ShinyLeaf.Margin = new System.Windows.Forms.Padding(0);
this.ShinyLeaf.Name = "ShinyLeaf";
this.ShinyLeaf.Size = new System.Drawing.Size(140, 56);
this.ShinyLeaf.TabIndex = 116;
//
// FLP_CatchRate
//
this.FLP_CatchRate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
@ -1405,14 +1398,6 @@ private void InitializeComponent()
this.L_CatchRate.Text = "Catch Rate:";
this.L_CatchRate.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// CR_PK1
//
this.CR_PK1.Location = new System.Drawing.Point(110, 0);
this.CR_PK1.Margin = new System.Windows.Forms.Padding(0);
this.CR_PK1.Name = "CR_PK1";
this.CR_PK1.Size = new System.Drawing.Size(162, 25);
this.CR_PK1.TabIndex = 10;
//
// FLP_SizeCP
//
this.FLP_SizeCP.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
@ -1423,15 +1408,6 @@ private void InitializeComponent()
this.FLP_SizeCP.Size = new System.Drawing.Size(272, 72);
this.FLP_SizeCP.TabIndex = 117;
//
// SizeCP
//
this.SizeCP.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.SizeCP.Location = new System.Drawing.Point(50, 0);
this.SizeCP.Margin = new System.Windows.Forms.Padding(50, 0, 0, 0);
this.SizeCP.Name = "SizeCP";
this.SizeCP.Size = new System.Drawing.Size(204, 68);
this.SizeCP.TabIndex = 0;
//
// Tab_Met
//
this.Tab_Met.AllowDrop = true;
@ -1441,7 +1417,7 @@ private void InitializeComponent()
this.Tab_Met.Location = new System.Drawing.Point(4, 22);
this.Tab_Met.Name = "Tab_Met";
this.Tab_Met.Padding = new System.Windows.Forms.Padding(3);
this.Tab_Met.Size = new System.Drawing.Size(192, 74);
this.Tab_Met.Size = new System.Drawing.Size(307, 539);
this.Tab_Met.TabIndex = 1;
this.Tab_Met.Text = "Met";
this.Tab_Met.UseVisualStyleBackColor = true;
@ -1832,38 +1808,11 @@ private void InitializeComponent()
this.Tab_Stats.Location = new System.Drawing.Point(4, 22);
this.Tab_Stats.Name = "Tab_Stats";
this.Tab_Stats.Padding = new System.Windows.Forms.Padding(3);
this.Tab_Stats.Size = new System.Drawing.Size(272, 539);
this.Tab_Stats.Size = new System.Drawing.Size(307, 539);
this.Tab_Stats.TabIndex = 2;
this.Tab_Stats.Text = "Stats";
this.Tab_Stats.UseVisualStyleBackColor = true;
//
// Stats
//
this.Stats.EVsFishy = System.Drawing.Color.LightYellow;
this.Stats.EVsInvalid = System.Drawing.Color.Red;
this.Stats.EVsMaxed = System.Drawing.Color.Honeydew;
this.Stats.Location = new System.Drawing.Point(0, 0);
this.Stats.Name = "Stats";
this.Stats.Size = new System.Drawing.Size(270, 264);
this.Stats.StatDecreased = System.Drawing.Color.Blue;
this.Stats.StatHyperTrained = System.Drawing.Color.LightGreen;
this.Stats.StatIncreased = System.Drawing.Color.Red;
this.Stats.TabIndex = 118;
//
// Contest
//
this.Contest.CNT_Beauty = 0;
this.Contest.CNT_Cool = 0;
this.Contest.CNT_Cute = 0;
this.Contest.CNT_Sheen = 0;
this.Contest.CNT_Smart = 0;
this.Contest.CNT_Tough = 0;
this.Contest.Location = new System.Drawing.Point(21, 265);
this.Contest.Margin = new System.Windows.Forms.Padding(0);
this.Contest.Name = "Contest";
this.Contest.Size = new System.Drawing.Size(230, 50);
this.Contest.TabIndex = 117;
//
// Tab_Attacks
//
this.Tab_Attacks.AllowDrop = true;
@ -1877,7 +1826,7 @@ private void InitializeComponent()
this.Tab_Attacks.Location = new System.Drawing.Point(4, 22);
this.Tab_Attacks.Name = "Tab_Attacks";
this.Tab_Attacks.Padding = new System.Windows.Forms.Padding(3);
this.Tab_Attacks.Size = new System.Drawing.Size(272, 539);
this.Tab_Attacks.Size = new System.Drawing.Size(307, 539);
this.Tab_Attacks.TabIndex = 3;
this.Tab_Attacks.Text = "Attacks";
this.Tab_Attacks.UseVisualStyleBackColor = true;
@ -2275,7 +2224,7 @@ private void InitializeComponent()
this.Tab_OTMisc.Location = new System.Drawing.Point(4, 22);
this.Tab_OTMisc.Name = "Tab_OTMisc";
this.Tab_OTMisc.Padding = new System.Windows.Forms.Padding(3);
this.Tab_OTMisc.Size = new System.Drawing.Size(192, 74);
this.Tab_OTMisc.Size = new System.Drawing.Size(307, 539);
this.Tab_OTMisc.TabIndex = 4;
this.Tab_OTMisc.Text = "OT/Misc";
this.Tab_OTMisc.UseVisualStyleBackColor = true;
@ -2605,13 +2554,6 @@ private void InitializeComponent()
this.GB_OT.TabStop = false;
this.GB_OT.Text = "Trainer Information";
//
// TID_Trainer
//
this.TID_Trainer.Location = new System.Drawing.Point(13, 18);
this.TID_Trainer.Name = "TID_Trainer";
this.TID_Trainer.Size = new System.Drawing.Size(178, 27);
this.TID_Trainer.TabIndex = 57;
//
// Label_OTGender
//
this.Label_OTGender.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
@ -2652,12 +2594,82 @@ private void InitializeComponent()
this.Label_EncryptionConstant.Text = "Encryption Constant:";
this.Label_EncryptionConstant.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// CB_Form2
//
this.CB_FormArgument.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.CB_FormArgument.DropDownWidth = 90;
this.CB_FormArgument.FormattingEnabled = true;
this.CB_FormArgument.Location = new System.Drawing.Point(145, 0);
this.CB_FormArgument.Margin = new System.Windows.Forms.Padding(0);
this.CB_FormArgument.Name = "CB_FormArgument";
this.CB_FormArgument.Size = new System.Drawing.Size(52, 21);
this.CB_FormArgument.TabIndex = 19;
//
// ShinyLeaf
//
this.ShinyLeaf.Location = new System.Drawing.Point(110, 0);
this.ShinyLeaf.Margin = new System.Windows.Forms.Padding(0);
this.ShinyLeaf.Name = "ShinyLeaf";
this.ShinyLeaf.Size = new System.Drawing.Size(140, 56);
this.ShinyLeaf.TabIndex = 116;
//
// CR_PK1
//
this.CR_PK1.Location = new System.Drawing.Point(110, 0);
this.CR_PK1.Margin = new System.Windows.Forms.Padding(0);
this.CR_PK1.Name = "CR_PK1";
this.CR_PK1.Size = new System.Drawing.Size(162, 25);
this.CR_PK1.TabIndex = 10;
//
// SizeCP
//
this.SizeCP.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.SizeCP.Location = new System.Drawing.Point(50, 0);
this.SizeCP.Margin = new System.Windows.Forms.Padding(50, 0, 0, 0);
this.SizeCP.Name = "SizeCP";
this.SizeCP.Size = new System.Drawing.Size(204, 68);
this.SizeCP.TabIndex = 0;
//
// Stats
//
this.Stats.EVsFishy = System.Drawing.Color.LightYellow;
this.Stats.EVsInvalid = System.Drawing.Color.Red;
this.Stats.EVsMaxed = System.Drawing.Color.Honeydew;
this.Stats.Location = new System.Drawing.Point(0, 0);
this.Stats.Name = "Stats";
this.Stats.Size = new System.Drawing.Size(270, 264);
this.Stats.StatDecreased = System.Drawing.Color.Blue;
this.Stats.StatHyperTrained = System.Drawing.Color.LightGreen;
this.Stats.StatIncreased = System.Drawing.Color.Red;
this.Stats.TabIndex = 118;
//
// Contest
//
this.Contest.CNT_Beauty = 0;
this.Contest.CNT_Cool = 0;
this.Contest.CNT_Cute = 0;
this.Contest.CNT_Sheen = 0;
this.Contest.CNT_Smart = 0;
this.Contest.CNT_Tough = 0;
this.Contest.Location = new System.Drawing.Point(21, 265);
this.Contest.Margin = new System.Windows.Forms.Padding(0);
this.Contest.Name = "Contest";
this.Contest.Size = new System.Drawing.Size(230, 50);
this.Contest.TabIndex = 117;
//
// TID_Trainer
//
this.TID_Trainer.Location = new System.Drawing.Point(13, 18);
this.TID_Trainer.Name = "TID_Trainer";
this.TID_Trainer.Size = new System.Drawing.Size(178, 27);
this.TID_Trainer.TabIndex = 57;
//
// PKMEditor
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
this.Controls.Add(this.tabMain);
this.Name = "PKMEditor";
this.Size = new System.Drawing.Size(280, 565);
this.Size = new System.Drawing.Size(315, 565);
this.tabMain.ResumeLayout(false);
this.Tab_Main.ResumeLayout(false);
this.FLP_Main.ResumeLayout(false);
@ -2959,5 +2971,6 @@ private void InitializeComponent()
private System.Windows.Forms.PictureBox PB_Origin;
private System.Windows.Forms.ComboBox CB_HTLanguage;
private System.Windows.Forms.Button B_Records;
private System.Windows.Forms.ComboBox CB_FormArgument;
}
}

View File

@ -915,6 +915,7 @@ private void UpdateForm(object sender, EventArgs e)
UpdateGender();
}
RefreshFormArguments();
if (ChangingFields)
return;
ChangingFields = true;
@ -924,6 +925,18 @@ private void UpdateForm(object sender, EventArgs e)
UpdateSprite();
}
private void RefreshFormArguments()
{
int index = CB_FormArgument.SelectedIndex;
var items = FormConverter.GetFormArgumentStrings(Entity.Species, Entity.AltForm, Entity.Format);
CB_FormArgument.Items.Clear();
CB_FormArgument.Items.AddRange(items);
CB_FormArgument.Visible = !string.IsNullOrWhiteSpace(items[0]);
if (ChangingFields)
return;
CB_FormArgument.SelectedIndex = index < items.Length ? index : 0;
}
private void UpdateHaXForm(object sender, EventArgs e)
{
if (ChangingFields)