Merge pull request #916 from pokecal/master

add Vivillon FormValue
This commit is contained in:
Kaphotics 2017-03-02 12:21:45 -08:00 committed by GitHub
commit e29f7ebd5a
3 changed files with 39 additions and 0 deletions

View File

@ -176,6 +176,8 @@ private void InitializeComponent()
this.B_Fashion = new System.Windows.Forms.Button();
this.TB_PlazaName = new System.Windows.Forms.TextBox();
this.L_PlazaName = new System.Windows.Forms.Label();
this.L_Vivillon = new System.Windows.Forms.Label();
this.CB_Vivillon = new System.Windows.Forms.ComboBox();
this.TC_Editor.SuspendLayout();
this.Tab_Overview.SuspendLayout();
this.GB_Stats.SuspendLayout();
@ -815,6 +817,8 @@ private void InitializeComponent()
//
// Tab_Overview
//
this.Tab_Overview.Controls.Add(this.CB_Vivillon);
this.Tab_Overview.Controls.Add(this.L_Vivillon);
this.Tab_Overview.Controls.Add(this.B_GenTID);
this.Tab_Overview.Controls.Add(this.L_G7TID);
this.Tab_Overview.Controls.Add(this.MT_G7TID);
@ -1791,6 +1795,24 @@ private void InitializeComponent()
this.L_PlazaName.Text = "Festival Plaza Name:";
this.L_PlazaName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// L_Vivillon
//
this.L_Vivillon.Location = new System.Drawing.Point(-1, 101);
this.L_Vivillon.Name = "L_Vivillon";
this.L_Vivillon.Size = new System.Drawing.Size(80, 12);
this.L_Vivillon.TabIndex = 64;
this.L_Vivillon.Text = "Vivillon:";
this.L_Vivillon.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// CB_Vivillon
//
this.CB_Vivillon.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.CB_Vivillon.FormattingEnabled = true;
this.CB_Vivillon.Location = new System.Drawing.Point(85, 98);
this.CB_Vivillon.Name = "CB_Vivillon";
this.CB_Vivillon.Size = new System.Drawing.Size(93, 20);
this.CB_Vivillon.TabIndex = 65;
//
// SAV_Trainer7
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -1996,5 +2018,7 @@ private void InitializeComponent()
private System.Windows.Forms.MaskedTextBox MT_G7TID;
private System.Windows.Forms.TextBox TB_PlazaName;
private System.Windows.Forms.Label L_PlazaName;
private System.Windows.Forms.Label L_Vivillon;
private System.Windows.Forms.ComboBox CB_Vivillon;
}
}

View File

@ -97,6 +97,11 @@ private void getComboBoxes()
CB_SkinColor.Items.Add($"{Main.gendersymbols[0]} - {c}"); // M
CB_SkinColor.Items.Add($"{Main.gendersymbols[1]} - {c}"); // F
}
L_Vivillon.Text = GameInfo.Strings.specieslist[666] + ":";
CB_Vivillon.DisplayMember = "Text";
CB_Vivillon.ValueMember = "Value";
CB_Vivillon.DataSource = PKX.getFormList(666, GameInfo.Strings.types, GameInfo.Strings.forms, Main.gendersymbols).ToList();
}
private void getTextBoxes()
{
@ -183,6 +188,8 @@ private void getTextBoxes()
CB_SkinColor.SelectedIndex = SAV.DressUpSkinColor;
TB_PlazaName.Text = SAV.FestivalPlazaName;
CB_Vivillon.SelectedIndex = (SAV.Vivillon < CB_Vivillon.Items.Count) ? SAV.Vivillon : -1;
}
private void save()
{
@ -265,6 +272,9 @@ private void save()
SAV.DressUpSkinColor = CB_SkinColor.SelectedIndex;
SAV.FestivalPlazaName = TB_PlazaName.Text;
// Vivillon
if (CB_Vivillon.SelectedIndex >= 0) SAV.Vivillon = CB_Vivillon.SelectedIndex;
}
private void clickOT(object sender, MouseEventArgs e)

View File

@ -495,6 +495,11 @@ public uint BP
BitConverter.GetBytes(value).CopyTo(Data, Misc + 0x11C);
}
}
public int Vivillon
{
get { return Data[Misc + 0x130] & 0x1F; }
set { Data[Misc + 0x130] = (byte)((Data[Misc + 0x130] & ~0x1F) | (value & 0x1F)); }
}
public uint UsedFestaCoins
{
get { return BitConverter.ToUInt32(Data, 0x69C98); }