mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-15 00:37:11 +00:00
Merge pull request #1191 from pokecal/master
add FRLG TrainerCard PokemonIcons
This commit is contained in:
commit
92cb651ef4
2 changed files with 120 additions and 3 deletions
|
@ -93,14 +93,21 @@
|
|||
this.BTN_SymbolT = new System.Windows.Forms.Button();
|
||||
this.BTN_SymbolA = new System.Windows.Forms.Button();
|
||||
this.CHK_ActivatePass = new System.Windows.Forms.CheckBox();
|
||||
this.GB_TCM = new System.Windows.Forms.GroupBox();
|
||||
this.CB_TCM1 = new System.Windows.Forms.ComboBox();
|
||||
this.CB_TCM2 = new System.Windows.Forms.ComboBox();
|
||||
this.CB_TCM3 = new System.Windows.Forms.ComboBox();
|
||||
this.CB_TCM4 = new System.Windows.Forms.ComboBox();
|
||||
this.CB_TCM5 = new System.Windows.Forms.ComboBox();
|
||||
this.CB_TCM6 = new System.Windows.Forms.ComboBox();
|
||||
this.tabControl1.SuspendLayout();
|
||||
this.TAB_Main.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.NUD_Coins)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.NUD_BP)).BeginInit();
|
||||
this.TAB_Joyful.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.NUD_Coins)).BeginInit();
|
||||
this.TAB_Ferry.SuspendLayout();
|
||||
this.GB_Reachable.SuspendLayout();
|
||||
this.GB_InitialEvent.SuspendLayout();
|
||||
this.GB_Reachable.SuspendLayout();
|
||||
this.TAB_BF.SuspendLayout();
|
||||
this.GB_Streaks.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.NUD_Stat3)).BeginInit();
|
||||
|
@ -109,6 +116,7 @@
|
|||
((System.ComponentModel.ISupportInitialize)(this.NUD_Stat0)).BeginInit();
|
||||
this.GB_FrontierPass.SuspendLayout();
|
||||
this.GB_Icons.SuspendLayout();
|
||||
this.GB_TCM.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// B_Save
|
||||
|
@ -150,6 +158,7 @@
|
|||
//
|
||||
// TAB_Main
|
||||
//
|
||||
this.TAB_Main.Controls.Add(this.GB_TCM);
|
||||
this.TAB_Main.Controls.Add(this.NUD_Coins);
|
||||
this.TAB_Main.Controls.Add(this.L_Coins);
|
||||
this.TAB_Main.Controls.Add(this.TB_OTName);
|
||||
|
@ -854,6 +863,75 @@
|
|||
this.CHK_ActivatePass.Text = "Activated";
|
||||
this.CHK_ActivatePass.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// GB_TCM
|
||||
//
|
||||
this.GB_TCM.Controls.Add(this.CB_TCM6);
|
||||
this.GB_TCM.Controls.Add(this.CB_TCM5);
|
||||
this.GB_TCM.Controls.Add(this.CB_TCM4);
|
||||
this.GB_TCM.Controls.Add(this.CB_TCM3);
|
||||
this.GB_TCM.Controls.Add(this.CB_TCM2);
|
||||
this.GB_TCM.Controls.Add(this.CB_TCM1);
|
||||
this.GB_TCM.Location = new System.Drawing.Point(6, 123);
|
||||
this.GB_TCM.Name = "GB_TCM";
|
||||
this.GB_TCM.Size = new System.Drawing.Size(249, 74);
|
||||
this.GB_TCM.TabIndex = 36;
|
||||
this.GB_TCM.TabStop = false;
|
||||
this.GB_TCM.Text = "TrainerCard Pokemon Icons";
|
||||
//
|
||||
// CB_TCM1
|
||||
//
|
||||
this.CB_TCM1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.CB_TCM1.FormattingEnabled = true;
|
||||
this.CB_TCM1.Location = new System.Drawing.Point(6, 18);
|
||||
this.CB_TCM1.Name = "CB_TCM1";
|
||||
this.CB_TCM1.Size = new System.Drawing.Size(75, 20);
|
||||
this.CB_TCM1.TabIndex = 0;
|
||||
//
|
||||
// CB_TCM2
|
||||
//
|
||||
this.CB_TCM2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.CB_TCM2.FormattingEnabled = true;
|
||||
this.CB_TCM2.Location = new System.Drawing.Point(87, 18);
|
||||
this.CB_TCM2.Name = "CB_TCM2";
|
||||
this.CB_TCM2.Size = new System.Drawing.Size(75, 20);
|
||||
this.CB_TCM2.TabIndex = 1;
|
||||
//
|
||||
// CB_TCM3
|
||||
//
|
||||
this.CB_TCM3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.CB_TCM3.FormattingEnabled = true;
|
||||
this.CB_TCM3.Location = new System.Drawing.Point(168, 18);
|
||||
this.CB_TCM3.Name = "CB_TCM3";
|
||||
this.CB_TCM3.Size = new System.Drawing.Size(75, 20);
|
||||
this.CB_TCM3.TabIndex = 2;
|
||||
//
|
||||
// CB_TCM4
|
||||
//
|
||||
this.CB_TCM4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.CB_TCM4.FormattingEnabled = true;
|
||||
this.CB_TCM4.Location = new System.Drawing.Point(6, 46);
|
||||
this.CB_TCM4.Name = "CB_TCM4";
|
||||
this.CB_TCM4.Size = new System.Drawing.Size(75, 20);
|
||||
this.CB_TCM4.TabIndex = 3;
|
||||
//
|
||||
// CB_TCM5
|
||||
//
|
||||
this.CB_TCM5.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.CB_TCM5.FormattingEnabled = true;
|
||||
this.CB_TCM5.Location = new System.Drawing.Point(87, 46);
|
||||
this.CB_TCM5.Name = "CB_TCM5";
|
||||
this.CB_TCM5.Size = new System.Drawing.Size(75, 20);
|
||||
this.CB_TCM5.TabIndex = 4;
|
||||
//
|
||||
// CB_TCM6
|
||||
//
|
||||
this.CB_TCM6.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.CB_TCM6.FormattingEnabled = true;
|
||||
this.CB_TCM6.Location = new System.Drawing.Point(168, 46);
|
||||
this.CB_TCM6.Name = "CB_TCM6";
|
||||
this.CB_TCM6.Size = new System.Drawing.Size(75, 20);
|
||||
this.CB_TCM6.TabIndex = 5;
|
||||
//
|
||||
// SAV_Misc3
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
|
@ -890,6 +968,7 @@
|
|||
this.GB_FrontierPass.ResumeLayout(false);
|
||||
this.GB_FrontierPass.PerformLayout();
|
||||
this.GB_Icons.ResumeLayout(false);
|
||||
this.GB_TCM.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
@ -959,5 +1038,12 @@
|
|||
private System.Windows.Forms.Label L_Stat1;
|
||||
private System.Windows.Forms.Label L_Stat0;
|
||||
private System.Windows.Forms.CheckBox CHK_Continue;
|
||||
private System.Windows.Forms.GroupBox GB_TCM;
|
||||
private System.Windows.Forms.ComboBox CB_TCM6;
|
||||
private System.Windows.Forms.ComboBox CB_TCM5;
|
||||
private System.Windows.Forms.ComboBox CB_TCM4;
|
||||
private System.Windows.Forms.ComboBox CB_TCM3;
|
||||
private System.Windows.Forms.ComboBox CB_TCM2;
|
||||
private System.Windows.Forms.ComboBox CB_TCM1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,9 +33,34 @@ namespace PKHeX.WinForms
|
|||
}
|
||||
|
||||
if (SAV.FRLG)
|
||||
{
|
||||
TB_OTName.Text = PKX.getString3(SAV.Data, SAV.getBlockOffset(4) + 0xBCC, 8, SAV.Japanese);
|
||||
ComboBox[] cba = new[] { CB_TCM1, CB_TCM2, CB_TCM3, CB_TCM4, CB_TCM5, CB_TCM6 };
|
||||
int[] HoennListMixed = new[] {
|
||||
277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,
|
||||
304,305,309,310,392,393,394,311,312,306,307,364,365,366,301,302,303,370,371,372,335,336,350,320,315,316,
|
||||
322,355,382,383,384,356,357,337,338,353,354,386,387,363,367,368,330,331,313,314,
|
||||
339,340,321,351,352,308,332,333,334,344,345,358,359,380,379,348,349,323,324,
|
||||
326,327,318,319,388,389,390,391,328,329,385,317,377,378,361,362,369,411,376,360,
|
||||
346,347,341,342,343,373,374,375,381,325,395,396,397,398,399,400,
|
||||
401,402,403,407,408,404,405,406,409,410
|
||||
};
|
||||
var speciesList = GameInfo.SpeciesDataSource.Where(v => v.Value <= SAV.MaxSpeciesID).Select(v => new ComboItem {
|
||||
Text = v.Text,
|
||||
Value = v.Value < 252 ? v.Value : HoennListMixed[v.Value - 252],
|
||||
}).ToList();
|
||||
int ofsTCM = SAV.getBlockOffset(2) + 0x106;
|
||||
for (int i = 0; i < cba.Length; i++)
|
||||
{
|
||||
cba[i].Items.Clear();
|
||||
cba[i].DisplayMember = "Text";
|
||||
cba[i].ValueMember = "Value";
|
||||
cba[i].DataSource = new BindingSource(speciesList, null);
|
||||
cba[i].SelectedValue = (int)BitConverter.ToUInt16(SAV.Data, ofsTCM + (i << 1));
|
||||
}
|
||||
}
|
||||
else
|
||||
TB_OTName.Visible = L_TrainerName.Visible = false;
|
||||
TB_OTName.Visible = L_TrainerName.Visible = GB_TCM.Visible = false;
|
||||
|
||||
NUD_BP.Value = Math.Min(NUD_BP.Maximum, SAV.BP);
|
||||
NUD_Coins.Value = Math.Min(NUD_Coins.Maximum, SAV.Coin);
|
||||
|
@ -49,7 +74,13 @@ namespace PKHeX.WinForms
|
|||
if (tabControl1.Controls.Contains(TAB_BF))
|
||||
saveBF();
|
||||
if (SAV.FRLG)
|
||||
{
|
||||
SAV.setData(SAV.setString(TB_OTName.Text, TB_OTName.MaxLength), SAV.getBlockOffset(4) + 0xBCC);
|
||||
ComboBox[] cba = new[] { CB_TCM1, CB_TCM2, CB_TCM3, CB_TCM4, CB_TCM5, CB_TCM6 };
|
||||
int ofsTCM = SAV.getBlockOffset(2) + 0x106;
|
||||
for (int i = 0; i < cba.Length; i++)
|
||||
BitConverter.GetBytes((ushort)(int)cba[i].SelectedValue).CopyTo(SAV.Data, ofsTCM + (i << 1));
|
||||
}
|
||||
|
||||
SAV.BP = (ushort)NUD_BP.Value;
|
||||
SAV.Coin = (ushort)NUD_Coins.Value;
|
||||
|
|
Loading…
Reference in a new issue