Add xy trainer nickname

Closes #283
This commit is contained in:
Kurt 2017-02-07 16:25:13 -08:00
parent 9897599420
commit 2f5b5790db
3 changed files with 41 additions and 9 deletions

View file

@ -202,6 +202,8 @@ namespace PKHeX.WinForms
this.Tab_Multiplayer = new System.Windows.Forms.TabPage();
this.Tab_Maison = new System.Windows.Forms.TabPage();
this.Tab_Appearance = new System.Windows.Forms.TabPage();
this.TB_TRNick = new System.Windows.Forms.TextBox();
this.L_TRNick = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.PB_Badge8)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.PB_Badge6)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.PB_Badge4)).BeginInit();
@ -416,7 +418,6 @@ namespace PKHeX.WinForms
//
// PB_Badge8
//
this.PB_Badge8.Image = Core.Properties.Resources.badge_8;
this.PB_Badge8.Location = new System.Drawing.Point(248, 63);
this.PB_Badge8.Name = "PB_Badge8";
this.PB_Badge8.Size = new System.Drawing.Size(50, 50);
@ -427,7 +428,6 @@ namespace PKHeX.WinForms
//
// PB_Badge6
//
this.PB_Badge6.Image = Core.Properties.Resources.badge_6;
this.PB_Badge6.Location = new System.Drawing.Point(142, 63);
this.PB_Badge6.Name = "PB_Badge6";
this.PB_Badge6.Size = new System.Drawing.Size(50, 50);
@ -438,7 +438,6 @@ namespace PKHeX.WinForms
//
// PB_Badge4
//
this.PB_Badge4.Image = Core.Properties.Resources.badge_4;
this.PB_Badge4.Location = new System.Drawing.Point(248, 10);
this.PB_Badge4.Name = "PB_Badge4";
this.PB_Badge4.Size = new System.Drawing.Size(50, 50);
@ -449,7 +448,6 @@ namespace PKHeX.WinForms
//
// PB_Badge2
//
this.PB_Badge2.Image = Core.Properties.Resources.badge_2;
this.PB_Badge2.Location = new System.Drawing.Point(142, 10);
this.PB_Badge2.Name = "PB_Badge2";
this.PB_Badge2.Size = new System.Drawing.Size(50, 50);
@ -460,7 +458,6 @@ namespace PKHeX.WinForms
//
// PB_Badge7
//
this.PB_Badge7.Image = Core.Properties.Resources.badge_7;
this.PB_Badge7.Location = new System.Drawing.Point(195, 63);
this.PB_Badge7.Name = "PB_Badge7";
this.PB_Badge7.Size = new System.Drawing.Size(50, 50);
@ -471,7 +468,6 @@ namespace PKHeX.WinForms
//
// PB_Badge5
//
this.PB_Badge5.Image = Core.Properties.Resources.badge_5;
this.PB_Badge5.Location = new System.Drawing.Point(89, 63);
this.PB_Badge5.Name = "PB_Badge5";
this.PB_Badge5.Size = new System.Drawing.Size(50, 50);
@ -482,7 +478,6 @@ namespace PKHeX.WinForms
//
// PB_Badge3
//
this.PB_Badge3.Image = Core.Properties.Resources.badge_3;
this.PB_Badge3.Location = new System.Drawing.Point(195, 10);
this.PB_Badge3.Name = "PB_Badge3";
this.PB_Badge3.Size = new System.Drawing.Size(50, 50);
@ -493,7 +488,6 @@ namespace PKHeX.WinForms
//
// PB_Badge1
//
this.PB_Badge1.Image = Core.Properties.Resources.badge_1;
this.PB_Badge1.Location = new System.Drawing.Point(89, 10);
this.PB_Badge1.Name = "PB_Badge1";
this.PB_Badge1.Size = new System.Drawing.Size(50, 50);
@ -2102,6 +2096,8 @@ namespace PKHeX.WinForms
//
// Tab_Appearance
//
this.Tab_Appearance.Controls.Add(this.L_TRNick);
this.Tab_Appearance.Controls.Add(this.TB_TRNick);
this.Tab_Appearance.Controls.Add(this.CB_Skin);
this.Tab_Appearance.Controls.Add(this.CB_Hair);
this.Tab_Appearance.Controls.Add(this.MT_Hat);
@ -2151,6 +2147,26 @@ namespace PKHeX.WinForms
this.Tab_Appearance.Text = "Appearance";
this.Tab_Appearance.UseVisualStyleBackColor = true;
//
// TB_TRNick
//
this.TB_TRNick.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.TB_TRNick.Location = new System.Drawing.Point(202, 230);
this.TB_TRNick.MaxLength = 12;
this.TB_TRNick.Name = "TB_TRNick";
this.TB_TRNick.Size = new System.Drawing.Size(93, 20);
this.TB_TRNick.TabIndex = 73;
this.TB_TRNick.Text = "WWWWWWWWWWWW";
this.TB_TRNick.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// L_TRNick
//
this.L_TRNick.Location = new System.Drawing.Point(68, 230);
this.L_TRNick.Name = "L_TRNick";
this.L_TRNick.Size = new System.Drawing.Size(128, 20);
this.L_TRNick.TabIndex = 74;
this.L_TRNick.Text = "Trainer Nickname:";
this.L_TRNick.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// SAV_Trainer
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -2379,5 +2395,7 @@ namespace PKHeX.WinForms
private System.Windows.Forms.Label L_Fame;
private System.Windows.Forms.DateTimePicker CAL_HoFDate;
private System.Windows.Forms.DateTimePicker CAL_HoFTime;
private System.Windows.Forms.Label L_TRNick;
private System.Windows.Forms.TextBox TB_TRNick;
}
}

View file

@ -13,7 +13,12 @@ namespace PKHeX.WinForms
{
InitializeComponent();
if (Main.unicode)
try { TB_OTName.Font = FontUtil.getPKXFont(11); }
try
{
TB_OTName.Font = FontUtil.getPKXFont(11);
if (Main.SAV.XY)
TB_TRNick.Font = TB_OTName.Font;
}
catch (Exception e) { WinFormsUtil.Alert("Font loading failed...", e.ToString()); }
WinFormsUtil.TranslateInterface(this, Main.curlanguage);
@ -448,6 +453,8 @@ namespace PKHeX.WinForms
MT_1403D.Text = SAV.Data[SAV.TrainerCard + 0x3D].ToString();
MT_1403E.Text = SAV.Data[SAV.TrainerCard + 0x3E].ToString();
MT_1403F.Text = SAV.Data[SAV.TrainerCard + 0x3F].ToString();
TB_TRNick.Text = SAV.OT_Nick;
}
CB_Vivillon.SelectedIndex = SAV.Vivillon;
@ -540,6 +547,8 @@ namespace PKHeX.WinForms
SAV.Data[SAV.TrainerCard + 0x3D] = byte.Parse(MT_1403D.Text);
SAV.Data[SAV.TrainerCard + 0x3E] = byte.Parse(MT_1403E.Text);
SAV.Data[SAV.TrainerCard + 0x3F] = byte.Parse(MT_1403F.Text);
SAV.OT_Nick = TB_TRNick.Text;
}
// Vivillon

View file

@ -398,6 +398,11 @@ namespace PKHeX.Core
get { return Util.TrimFromZero(Encoding.Unicode.GetString(Data, TrainerCard + 0x48, 0x1A)); }
set { Encoding.Unicode.GetBytes(value.PadRight(13, '\0')).CopyTo(Data, TrainerCard + 0x48); }
}
public string OT_Nick
{
get { return Util.TrimFromZero(Encoding.Unicode.GetString(Data, TrainerCard + 0x62, 0x1A)); }
set { Encoding.Unicode.GetBytes(value.PadRight(value.Length + 1, '\0')).CopyTo(Data, TrainerCard + 0x62); }
}
public string Saying1
{
get { return Util.TrimFromZero(Encoding.Unicode.GetString(Data, TrainerCard + 0x7C + 0x22 * 0, 0x22)); }