Add gen4 pokedex editor

Fixes the setDex implementation for gen4
why u have to be so weird gen4
hgss has 0x1C extra form flags in the first form array... unused?
This commit is contained in:
Kurt 2017-03-06 22:43:46 -08:00
parent 3aa772bf22
commit 4874c174d8
6 changed files with 1317 additions and 96 deletions

View file

@ -3983,9 +3983,12 @@ namespace PKHeX.WinForms
if (SAV.GameCube)
return;
new SAV_SimplePokedex().ShowDialog(); break;
case 4:
if (SAV is SAV4BR)
return;
new SAV_Pokedex4().ShowDialog(); break;
case 5:
new SAV_Pokedex5().ShowDialog();
break;
new SAV_Pokedex5().ShowDialog(); break;
case 6:
if (SAV.ORAS)
new SAV_PokedexORAS().ShowDialog();

View file

@ -252,6 +252,12 @@
<Compile Include="Subforms\PKM Editors\Text.Designer.cs">
<DependentUpon>Text.cs</DependentUpon>
</Compile>
<Compile Include="Subforms\Save Editors\Gen4\SAV_Pokedex4.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Subforms\Save Editors\Gen4\SAV_Pokedex4.Designer.cs">
<DependentUpon>SAV_Pokedex4.cs</DependentUpon>
</Compile>
<Compile Include="Subforms\Save Editors\Gen5\CGearBackground.cs" />
<Compile Include="Subforms\Save Editors\Gen5\SAV_CGearSkin.cs">
<SubType>Form</SubType>
@ -477,6 +483,9 @@
<EmbeddedResource Include="Subforms\PKM Editors\Text.resx">
<DependentUpon>Text.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Subforms\Save Editors\Gen4\SAV_Pokedex4.resx">
<DependentUpon>SAV_Pokedex4.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Subforms\Save Editors\Gen5\SAV_CGearSkin.resx">
<DependentUpon>SAV_CGearSkin.cs</DependentUpon>
</EmbeddedResource>

View file

@ -0,0 +1,507 @@
namespace PKHeX.WinForms
{
partial class SAV_Pokedex4
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SAV_Pokedex4));
this.B_Cancel = new System.Windows.Forms.Button();
this.LB_Species = new System.Windows.Forms.ListBox();
this.CHK_Caught = new System.Windows.Forms.CheckBox();
this.CHK_L6 = new System.Windows.Forms.CheckBox();
this.CHK_L5 = new System.Windows.Forms.CheckBox();
this.CHK_L4 = new System.Windows.Forms.CheckBox();
this.CHK_L3 = new System.Windows.Forms.CheckBox();
this.CHK_L2 = new System.Windows.Forms.CheckBox();
this.CHK_L1 = new System.Windows.Forms.CheckBox();
this.L_goto = new System.Windows.Forms.Label();
this.CB_Species = new System.Windows.Forms.ComboBox();
this.B_GiveAll = new System.Windows.Forms.Button();
this.B_Save = new System.Windows.Forms.Button();
this.B_Modify = new System.Windows.Forms.Button();
this.GB_Language = new System.Windows.Forms.GroupBox();
this.modifyMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.mnuSeenNone = new System.Windows.Forms.ToolStripMenuItem();
this.mnuSeenAll = new System.Windows.Forms.ToolStripMenuItem();
this.mnuCaughtNone = new System.Windows.Forms.ToolStripMenuItem();
this.mnuCaughtAll = new System.Windows.Forms.ToolStripMenuItem();
this.mnuComplete = new System.Windows.Forms.ToolStripMenuItem();
this.CHK_Seen = new System.Windows.Forms.CheckBox();
this.LB_Gender = new System.Windows.Forms.ListBox();
this.B_GUp = new System.Windows.Forms.Button();
this.B_GDown = new System.Windows.Forms.Button();
this.B_GRight = new System.Windows.Forms.Button();
this.B_GLeft = new System.Windows.Forms.Button();
this.LB_NGender = new System.Windows.Forms.ListBox();
this.LB_NForm = new System.Windows.Forms.ListBox();
this.B_FRight = new System.Windows.Forms.Button();
this.B_FLeft = new System.Windows.Forms.Button();
this.B_FDown = new System.Windows.Forms.Button();
this.B_FUp = new System.Windows.Forms.Button();
this.LB_Form = new System.Windows.Forms.ListBox();
this.L_Seen = new System.Windows.Forms.Label();
this.L_NotSeen = new System.Windows.Forms.Label();
this.GB_Language.SuspendLayout();
this.modifyMenu.SuspendLayout();
this.SuspendLayout();
//
// B_Cancel
//
this.B_Cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.B_Cancel.Location = new System.Drawing.Point(233, 247);
this.B_Cancel.Name = "B_Cancel";
this.B_Cancel.Size = new System.Drawing.Size(80, 23);
this.B_Cancel.TabIndex = 0;
this.B_Cancel.Text = "Cancel";
this.B_Cancel.UseVisualStyleBackColor = true;
this.B_Cancel.Click += new System.EventHandler(this.B_Cancel_Click);
//
// LB_Species
//
this.LB_Species.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.LB_Species.FormattingEnabled = true;
this.LB_Species.Location = new System.Drawing.Point(12, 40);
this.LB_Species.Name = "LB_Species";
this.LB_Species.Size = new System.Drawing.Size(130, 225);
this.LB_Species.TabIndex = 2;
this.LB_Species.SelectedIndexChanged += new System.EventHandler(this.changeLBSpecies);
//
// CHK_Caught
//
this.CHK_Caught.AutoSize = true;
this.CHK_Caught.Location = new System.Drawing.Point(338, 15);
this.CHK_Caught.Name = "CHK_Caught";
this.CHK_Caught.Size = new System.Drawing.Size(60, 17);
this.CHK_Caught.TabIndex = 3;
this.CHK_Caught.Text = "Caught";
this.CHK_Caught.UseVisualStyleBackColor = true;
//
// CHK_L6
//
this.CHK_L6.AutoSize = true;
this.CHK_L6.Location = new System.Drawing.Point(171, 33);
this.CHK_L6.Name = "CHK_L6";
this.CHK_L6.Size = new System.Drawing.Size(64, 17);
this.CHK_L6.TabIndex = 18;
this.CHK_L6.Text = "Spanish";
this.CHK_L6.UseVisualStyleBackColor = true;
//
// CHK_L5
//
this.CHK_L5.AutoSize = true;
this.CHK_L5.Location = new System.Drawing.Point(93, 33);
this.CHK_L5.Name = "CHK_L5";
this.CHK_L5.Size = new System.Drawing.Size(63, 17);
this.CHK_L5.TabIndex = 17;
this.CHK_L5.Text = "German";
this.CHK_L5.UseVisualStyleBackColor = true;
//
// CHK_L4
//
this.CHK_L4.AutoSize = true;
this.CHK_L4.Location = new System.Drawing.Point(18, 33);
this.CHK_L4.Name = "CHK_L4";
this.CHK_L4.Size = new System.Drawing.Size(54, 17);
this.CHK_L4.TabIndex = 16;
this.CHK_L4.Text = "Italian";
this.CHK_L4.UseVisualStyleBackColor = true;
//
// CHK_L3
//
this.CHK_L3.AutoSize = true;
this.CHK_L3.Location = new System.Drawing.Point(171, 16);
this.CHK_L3.Name = "CHK_L3";
this.CHK_L3.Size = new System.Drawing.Size(59, 17);
this.CHK_L3.TabIndex = 15;
this.CHK_L3.Text = "French";
this.CHK_L3.UseVisualStyleBackColor = true;
//
// CHK_L2
//
this.CHK_L2.AutoSize = true;
this.CHK_L2.Location = new System.Drawing.Point(93, 16);
this.CHK_L2.Name = "CHK_L2";
this.CHK_L2.Size = new System.Drawing.Size(60, 17);
this.CHK_L2.TabIndex = 14;
this.CHK_L2.Text = "English";
this.CHK_L2.UseVisualStyleBackColor = true;
//
// CHK_L1
//
this.CHK_L1.AutoSize = true;
this.CHK_L1.Location = new System.Drawing.Point(18, 16);
this.CHK_L1.Name = "CHK_L1";
this.CHK_L1.Size = new System.Drawing.Size(72, 17);
this.CHK_L1.TabIndex = 13;
this.CHK_L1.Text = "Japanese";
this.CHK_L1.UseVisualStyleBackColor = true;
//
// L_goto
//
this.L_goto.AutoSize = true;
this.L_goto.Location = new System.Drawing.Point(12, 16);
this.L_goto.Name = "L_goto";
this.L_goto.Size = new System.Drawing.Size(31, 13);
this.L_goto.TabIndex = 20;
this.L_goto.Text = "goto:";
//
// CB_Species
//
this.CB_Species.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
this.CB_Species.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems;
this.CB_Species.DropDownWidth = 95;
this.CB_Species.FormattingEnabled = true;
this.CB_Species.Items.AddRange(new object[] {
"0"});
this.CB_Species.Location = new System.Drawing.Point(50, 13);
this.CB_Species.Name = "CB_Species";
this.CB_Species.Size = new System.Drawing.Size(92, 21);
this.CB_Species.TabIndex = 21;
this.CB_Species.SelectedIndexChanged += new System.EventHandler(this.changeCBSpecies);
this.CB_Species.SelectedValueChanged += new System.EventHandler(this.changeCBSpecies);
this.CB_Species.KeyDown += new System.Windows.Forms.KeyEventHandler(this.removedropCB);
//
// B_GiveAll
//
this.B_GiveAll.Location = new System.Drawing.Point(149, 11);
this.B_GiveAll.Name = "B_GiveAll";
this.B_GiveAll.Size = new System.Drawing.Size(60, 23);
this.B_GiveAll.TabIndex = 23;
this.B_GiveAll.Text = "Check All";
this.B_GiveAll.UseVisualStyleBackColor = true;
this.B_GiveAll.Click += new System.EventHandler(this.B_GiveAll_Click);
//
// B_Save
//
this.B_Save.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.B_Save.Location = new System.Drawing.Point(319, 247);
this.B_Save.Name = "B_Save";
this.B_Save.Size = new System.Drawing.Size(80, 23);
this.B_Save.TabIndex = 24;
this.B_Save.Text = "Save";
this.B_Save.UseVisualStyleBackColor = true;
this.B_Save.Click += new System.EventHandler(this.B_Save_Click);
//
// B_Modify
//
this.B_Modify.Location = new System.Drawing.Point(215, 11);
this.B_Modify.Name = "B_Modify";
this.B_Modify.Size = new System.Drawing.Size(60, 23);
this.B_Modify.TabIndex = 25;
this.B_Modify.Text = "Modify...";
this.B_Modify.UseVisualStyleBackColor = true;
this.B_Modify.Click += new System.EventHandler(this.B_Modify_Click);
//
// GB_Language
//
this.GB_Language.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.GB_Language.Controls.Add(this.CHK_L6);
this.GB_Language.Controls.Add(this.CHK_L5);
this.GB_Language.Controls.Add(this.CHK_L4);
this.GB_Language.Controls.Add(this.CHK_L3);
this.GB_Language.Controls.Add(this.CHK_L2);
this.GB_Language.Controls.Add(this.CHK_L1);
this.GB_Language.Location = new System.Drawing.Point(148, 187);
this.GB_Language.Name = "GB_Language";
this.GB_Language.Size = new System.Drawing.Size(250, 55);
this.GB_Language.TabIndex = 26;
this.GB_Language.TabStop = false;
this.GB_Language.Text = "Languages";
//
// modifyMenu
//
this.modifyMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.mnuSeenNone,
this.mnuSeenAll,
this.mnuCaughtNone,
this.mnuCaughtAll,
this.mnuComplete});
this.modifyMenu.Name = "modifyMenu";
this.modifyMenu.Size = new System.Drawing.Size(149, 114);
//
// mnuSeenNone
//
this.mnuSeenNone.Name = "mnuSeenNone";
this.mnuSeenNone.Size = new System.Drawing.Size(148, 22);
this.mnuSeenNone.Text = "Seen none";
this.mnuSeenNone.Click += new System.EventHandler(this.modifyAll);
//
// mnuSeenAll
//
this.mnuSeenAll.Name = "mnuSeenAll";
this.mnuSeenAll.Size = new System.Drawing.Size(148, 22);
this.mnuSeenAll.Text = "Seen all";
this.mnuSeenAll.Click += new System.EventHandler(this.modifyAll);
//
// mnuCaughtNone
//
this.mnuCaughtNone.Name = "mnuCaughtNone";
this.mnuCaughtNone.Size = new System.Drawing.Size(148, 22);
this.mnuCaughtNone.Text = "Caught none";
this.mnuCaughtNone.Click += new System.EventHandler(this.modifyAll);
//
// mnuCaughtAll
//
this.mnuCaughtAll.Name = "mnuCaughtAll";
this.mnuCaughtAll.Size = new System.Drawing.Size(148, 22);
this.mnuCaughtAll.Text = "Caught all";
this.mnuCaughtAll.Click += new System.EventHandler(this.modifyAll);
//
// mnuComplete
//
this.mnuComplete.Name = "mnuComplete";
this.mnuComplete.Size = new System.Drawing.Size(148, 22);
this.mnuComplete.Text = "Complete Dex";
this.mnuComplete.Click += new System.EventHandler(this.modifyAll);
//
// CHK_Seen
//
this.CHK_Seen.AutoSize = true;
this.CHK_Seen.Location = new System.Drawing.Point(281, 15);
this.CHK_Seen.Name = "CHK_Seen";
this.CHK_Seen.Size = new System.Drawing.Size(51, 17);
this.CHK_Seen.TabIndex = 44;
this.CHK_Seen.Text = "Seen";
this.CHK_Seen.UseVisualStyleBackColor = true;
this.CHK_Seen.CheckedChanged += new System.EventHandler(this.CHK_Seen_CheckedChanged);
//
// LB_Gender
//
this.LB_Gender.FormattingEnabled = true;
this.LB_Gender.Location = new System.Drawing.Point(166, 53);
this.LB_Gender.Name = "LB_Gender";
this.LB_Gender.Size = new System.Drawing.Size(100, 43);
this.LB_Gender.TabIndex = 45;
//
// B_GUp
//
this.B_GUp.Location = new System.Drawing.Point(146, 53);
this.B_GUp.Name = "B_GUp";
this.B_GUp.Size = new System.Drawing.Size(20, 20);
this.B_GUp.TabIndex = 46;
this.B_GUp.Text = "↑";
this.B_GUp.UseVisualStyleBackColor = true;
this.B_GUp.Click += new System.EventHandler(this.moveGender);
//
// B_GDown
//
this.B_GDown.Location = new System.Drawing.Point(146, 76);
this.B_GDown.Name = "B_GDown";
this.B_GDown.Size = new System.Drawing.Size(20, 20);
this.B_GDown.TabIndex = 47;
this.B_GDown.Text = "↓";
this.B_GDown.UseVisualStyleBackColor = true;
this.B_GDown.Click += new System.EventHandler(this.moveGender);
//
// B_GRight
//
this.B_GRight.Location = new System.Drawing.Point(272, 76);
this.B_GRight.Name = "B_GRight";
this.B_GRight.Size = new System.Drawing.Size(20, 20);
this.B_GRight.TabIndex = 49;
this.B_GRight.Text = ">";
this.B_GRight.UseVisualStyleBackColor = true;
this.B_GRight.Click += new System.EventHandler(this.toggleSeen);
//
// B_GLeft
//
this.B_GLeft.Location = new System.Drawing.Point(272, 53);
this.B_GLeft.Name = "B_GLeft";
this.B_GLeft.Size = new System.Drawing.Size(20, 20);
this.B_GLeft.TabIndex = 48;
this.B_GLeft.Text = "<";
this.B_GLeft.UseVisualStyleBackColor = true;
this.B_GLeft.Click += new System.EventHandler(this.toggleSeen);
//
// LB_NGender
//
this.LB_NGender.FormattingEnabled = true;
this.LB_NGender.Location = new System.Drawing.Point(298, 53);
this.LB_NGender.Name = "LB_NGender";
this.LB_NGender.Size = new System.Drawing.Size(100, 43);
this.LB_NGender.TabIndex = 50;
//
// LB_NForm
//
this.LB_NForm.FormattingEnabled = true;
this.LB_NForm.Location = new System.Drawing.Point(298, 103);
this.LB_NForm.Name = "LB_NForm";
this.LB_NForm.Size = new System.Drawing.Size(100, 82);
this.LB_NForm.TabIndex = 56;
//
// B_FRight
//
this.B_FRight.Location = new System.Drawing.Point(272, 126);
this.B_FRight.Name = "B_FRight";
this.B_FRight.Size = new System.Drawing.Size(20, 20);
this.B_FRight.TabIndex = 55;
this.B_FRight.Text = ">";
this.B_FRight.UseVisualStyleBackColor = true;
this.B_FRight.Click += new System.EventHandler(this.toggleForm);
//
// B_FLeft
//
this.B_FLeft.Location = new System.Drawing.Point(272, 103);
this.B_FLeft.Name = "B_FLeft";
this.B_FLeft.Size = new System.Drawing.Size(20, 20);
this.B_FLeft.TabIndex = 54;
this.B_FLeft.Text = "<";
this.B_FLeft.UseVisualStyleBackColor = true;
this.B_FLeft.Click += new System.EventHandler(this.toggleForm);
//
// B_FDown
//
this.B_FDown.Location = new System.Drawing.Point(146, 126);
this.B_FDown.Name = "B_FDown";
this.B_FDown.Size = new System.Drawing.Size(20, 20);
this.B_FDown.TabIndex = 53;
this.B_FDown.Text = "↓";
this.B_FDown.UseVisualStyleBackColor = true;
this.B_FDown.Click += new System.EventHandler(this.moveForm);
//
// B_FUp
//
this.B_FUp.Location = new System.Drawing.Point(146, 103);
this.B_FUp.Name = "B_FUp";
this.B_FUp.Size = new System.Drawing.Size(20, 20);
this.B_FUp.TabIndex = 52;
this.B_FUp.Text = "↑";
this.B_FUp.UseVisualStyleBackColor = true;
this.B_FUp.Click += new System.EventHandler(this.moveForm);
//
// LB_Form
//
this.LB_Form.FormattingEnabled = true;
this.LB_Form.Location = new System.Drawing.Point(166, 103);
this.LB_Form.Name = "LB_Form";
this.LB_Form.Size = new System.Drawing.Size(100, 82);
this.LB_Form.TabIndex = 51;
//
// L_Seen
//
this.L_Seen.AutoSize = true;
this.L_Seen.Location = new System.Drawing.Point(163, 37);
this.L_Seen.Name = "L_Seen";
this.L_Seen.Size = new System.Drawing.Size(32, 13);
this.L_Seen.TabIndex = 57;
this.L_Seen.Text = "Seen";
//
// L_NotSeen
//
this.L_NotSeen.AutoSize = true;
this.L_NotSeen.Location = new System.Drawing.Point(295, 37);
this.L_NotSeen.Name = "L_NotSeen";
this.L_NotSeen.Size = new System.Drawing.Size(52, 13);
this.L_NotSeen.TabIndex = 58;
this.L_NotSeen.Text = "Not Seen";
//
// SAV_Pokedex4
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(406, 277);
this.Controls.Add(this.L_NotSeen);
this.Controls.Add(this.L_Seen);
this.Controls.Add(this.LB_NForm);
this.Controls.Add(this.B_FRight);
this.Controls.Add(this.B_FLeft);
this.Controls.Add(this.B_FDown);
this.Controls.Add(this.B_FUp);
this.Controls.Add(this.LB_Form);
this.Controls.Add(this.LB_NGender);
this.Controls.Add(this.B_GRight);
this.Controls.Add(this.B_GLeft);
this.Controls.Add(this.B_GDown);
this.Controls.Add(this.B_GUp);
this.Controls.Add(this.LB_Gender);
this.Controls.Add(this.CHK_Seen);
this.Controls.Add(this.CHK_Caught);
this.Controls.Add(this.GB_Language);
this.Controls.Add(this.B_Modify);
this.Controls.Add(this.B_Save);
this.Controls.Add(this.B_GiveAll);
this.Controls.Add(this.CB_Species);
this.Controls.Add(this.L_goto);
this.Controls.Add(this.LB_Species);
this.Controls.Add(this.B_Cancel);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "SAV_Pokedex4";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Pokédex Editor";
this.GB_Language.ResumeLayout(false);
this.GB_Language.PerformLayout();
this.modifyMenu.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button B_Cancel;
private System.Windows.Forms.ListBox LB_Species;
private System.Windows.Forms.CheckBox CHK_Caught;
private System.Windows.Forms.CheckBox CHK_L6;
private System.Windows.Forms.CheckBox CHK_L5;
private System.Windows.Forms.CheckBox CHK_L4;
private System.Windows.Forms.CheckBox CHK_L3;
private System.Windows.Forms.CheckBox CHK_L2;
private System.Windows.Forms.CheckBox CHK_L1;
private System.Windows.Forms.Label L_goto;
private System.Windows.Forms.ComboBox CB_Species;
private System.Windows.Forms.Button B_GiveAll;
private System.Windows.Forms.Button B_Save;
private System.Windows.Forms.Button B_Modify;
private System.Windows.Forms.GroupBox GB_Language;
private System.Windows.Forms.ContextMenuStrip modifyMenu;
private System.Windows.Forms.ToolStripMenuItem mnuSeenNone;
private System.Windows.Forms.ToolStripMenuItem mnuSeenAll;
private System.Windows.Forms.ToolStripMenuItem mnuCaughtNone;
private System.Windows.Forms.ToolStripMenuItem mnuCaughtAll;
private System.Windows.Forms.ToolStripMenuItem mnuComplete;
private System.Windows.Forms.CheckBox CHK_Seen;
private System.Windows.Forms.ListBox LB_Gender;
private System.Windows.Forms.Button B_GUp;
private System.Windows.Forms.Button B_GDown;
private System.Windows.Forms.Button B_GRight;
private System.Windows.Forms.Button B_GLeft;
private System.Windows.Forms.ListBox LB_NGender;
private System.Windows.Forms.ListBox LB_NForm;
private System.Windows.Forms.Button B_FRight;
private System.Windows.Forms.Button B_FLeft;
private System.Windows.Forms.Button B_FDown;
private System.Windows.Forms.Button B_FUp;
private System.Windows.Forms.ListBox LB_Form;
private System.Windows.Forms.Label L_Seen;
private System.Windows.Forms.Label L_NotSeen;
}
}

View file

@ -0,0 +1,418 @@
using System;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using PKHeX.Core;
namespace PKHeX.WinForms
{
public partial class SAV_Pokedex4 : Form
{
public SAV_Pokedex4()
{
InitializeComponent();
CL = new[] { CHK_L1, CHK_L2, CHK_L3, CHK_L4, CHK_L5, CHK_L6, };
WinFormsUtil.TranslateInterface(this, Main.curlanguage);
editing = true;
// Clear Listbox and ComboBox
LB_Species.Items.Clear();
CB_Species.Items.Clear();
// Fill List
CB_Species.DisplayMember = "Text";
CB_Species.ValueMember = "Value";
CB_Species.DataSource = new BindingSource(GameInfo.SpeciesDataSource.Skip(1).Where(id => id.Value <= SAV.MaxSpeciesID).ToList(), null);
for (int i = 1; i < SAV.MaxSpeciesID + 1; i++)
LB_Species.Items.Add(i.ToString("000") + " - " + GameInfo.Strings.specieslist[i]);
editing = false;
LB_Species.SelectedIndex = 0;
}
private readonly SAV4 SAV = new SAV4(Main.SAV.Data);
private readonly CheckBox[] CL;
private bool editing;
private int species = -1;
private const int brSize = 0x40;
private const int LangCount = 6; // No Korean
private void changeCBSpecies(object sender, EventArgs e)
{
if (editing) return;
setEntry();
editing = true;
species = (int)CB_Species.SelectedValue;
LB_Species.SelectedIndex = species - 1; // Since we don't allow index0 in combobox, everything is shifted by 1
LB_Species.TopIndex = LB_Species.SelectedIndex;
getEntry();
editing = false;
}
private void changeLBSpecies(object sender, EventArgs e)
{
if (editing) return;
setEntry();
editing = true;
species = LB_Species.SelectedIndex + 1;
CB_Species.SelectedValue = species;
getEntry();
editing = false;
}
private void removedropCB(object sender, KeyEventArgs e)
{
((ComboBox)sender).DroppedDown = false;
}
private const string GENDERLESS = "Genderless";
private const string MALE = "Male";
private const string FEMALE = "Female";
private void getEntry()
{
// Load Bools for the data
int bit = species - 1;
byte mask = (byte) (1 << (bit & 7));
int ofs = SAV.PokeDex + (bit >> 3) + 0x4;
if (!SAV.DP)
{
int FormOffset1 = SAV.PokeDex + 4 + brSize*4 + 4;
int PokeDexLanguageFlags = FormOffset1 + (SAV.HGSS ? 0x3C : 0x20);
int l_ofs = PokeDexLanguageFlags + species;
for (int i = 0; i < LangCount; i++)
CL[i].Checked = (SAV.Data[l_ofs] & (byte) (1 << i)) != 0;
}
bool bit2 = (SAV.Data[ofs + brSize*2] & mask) != 0;
bool bit3 = (SAV.Data[ofs + brSize*3] & mask) != 0;
CHK_Seen.Checked = (SAV.Data[ofs + brSize*1] & mask) != 0;
CHK_Caught.Checked = (SAV.Data[ofs + brSize*0] & mask) != 0;
// Genders
LB_Gender.Items.Clear();
LB_NGender.Items.Clear();
var active = CHK_Seen.Checked ? LB_Gender : LB_NGender;
var inactive = LB_NGender;
var other = bit2 ^ bit3 ? active : inactive;
switch (SAV.Personal[species].Gender)
{
case 255: // Genderless
active.Items.Add(GENDERLESS);
break;
case 0:
active.Items.Add(MALE);
break;
case 254:
active.Items.Add(FEMALE);
break;
default:
active.Items.Add(bit2 ? FEMALE : MALE);
other.Items.Add(bit2 ? MALE : FEMALE);
break;
}
// Forms
LB_Form.Items.Clear();
LB_NForm.Items.Clear();
var forms = SAV.getForms(species);
if (forms == null)
return;
string[] formNames = PKX.getFormList(species, GameInfo.Strings.types, GameInfo.Strings.forms,
Main.gendersymbols, 4);
var seen = forms.Where(z => z != 0xFF).Select((v, i) => formNames[forms[i]]).ToArray();
var not = formNames.Where(z => !seen.Contains(z)).ToArray();
LB_Form.Items.AddRange(seen);
LB_NForm.Items.AddRange(not);
}
private void setEntry()
{
if (species < 0)
return;
int bit = species - 1;
byte mask = (byte)(1 << (bit & 7));
int ofs = SAV.PokeDex + (bit >> 3) + 0x4;
// Check if already Seen
if (!CHK_Seen.Checked || LB_Gender.Items.Count == 0)
{
SAV.Data[ofs + brSize*0] &= (byte) ~mask;
SAV.Data[ofs + brSize*1] &= (byte) ~mask;
SAV.Data[ofs + brSize*2] &= (byte) ~mask;
SAV.Data[ofs + brSize*3] &= (byte) ~mask;
}
else // Is Seen
{
// Set the Species Owned Flag
if (CHK_Caught.Checked)
SAV.Data[ofs + brSize*0] |= mask;
else
SAV.Data[ofs + brSize*0] &= (byte) ~mask;
SAV.Data[ofs + brSize*1] |= mask;
switch ((string) LB_Gender.Items[0])
{
case GENDERLESS:
SAV.Data[ofs + brSize*2] &= (byte) ~mask;
SAV.Data[ofs + brSize*3] &= (byte) ~mask;
break;
case FEMALE:
SAV.Data[ofs + brSize*2] |= mask; // set
if (LB_Gender.Items.Count != 1) // Male present
SAV.Data[ofs + brSize*3] &= (byte) ~mask; // unset
else
SAV.Data[ofs + brSize*3] |= mask; // set
break;
case MALE:
SAV.Data[ofs + brSize*2] &= (byte) ~mask; // unset
if (LB_Gender.Items.Count != 1) // Female present
SAV.Data[ofs + brSize*3] |= mask; // set
else
SAV.Data[ofs + brSize*3] &= (byte) ~mask; // unset
break;
default:
throw new ArgumentException("Invalid Gender???");
}
}
if (!SAV.DP)
{
int FormOffset1 = SAV.PokeDex + 4 + 4*brSize + 4;
int PokeDexLanguageFlags = FormOffset1 + (SAV.HGSS ? 0x3C : 0x20);
for (int i = 0; i < LangCount; i++)
{
if (CL[i].Checked)
SAV.Data[PokeDexLanguageFlags + species] |= (byte) (1 << i);
else
SAV.Data[PokeDexLanguageFlags + species] &= (byte) ~(1 << i);
}
}
var forms = SAV.getForms(species);
string[] formNames = PKX.getFormList(species, GameInfo.Strings.types, GameInfo.Strings.forms, Main.gendersymbols, 4);
if (forms != null)
{
int[] arr = new int[LB_Form.Items.Count];
for (int i = 0; i < LB_Form.Items.Count; i++)
arr[i] = Array.IndexOf(formNames, (string)LB_Form.Items[i]);
SAV.setForms(species, arr);
}
editing = false;
}
private void B_Cancel_Click(object sender, EventArgs e)
{
Close();
}
private void B_Save_Click(object sender, EventArgs e)
{
setEntry();
// Return back to the parent savefile
Array.Copy(SAV.Data, Main.SAV.Data, SAV.Data.Length);
Main.SAV.Edited = true;
Close();
}
private void B_GiveAll_Click(object sender, EventArgs e)
{
if (GB_Language.Enabled)
{
CHK_L1.Checked =
CHK_L2.Checked =
CHK_L3.Checked =
CHK_L4.Checked =
CHK_L5.Checked =
CHK_L6.Checked = ModifierKeys != Keys.Control;
}
CHK_Caught.Checked = CHK_Seen.Checked = ModifierKeys != Keys.Control;
if (ModifierKeys == Keys.Control)
seenNone();
else
seenAll();
}
private void B_Modify_Click(object sender, EventArgs e)
{
Button btn = (Button)sender;
modifyMenu.Show(btn.PointToScreen(new Point(0, btn.Height)));
}
private void seenNone()
{
LB_NGender.Items.AddRange(LB_Gender.Items);
LB_Gender.Items.Clear();
LB_NForm.Items.AddRange(LB_Form.Items);
LB_Form.Items.Clear();
CHK_Seen.Checked = false;
}
private void seenAll()
{
LB_Gender.Items.AddRange(LB_NGender.Items);
LB_NGender.Items.Clear();
LB_Form.Items.AddRange(LB_NForm.Items);
LB_NForm.Items.Clear();
CHK_Seen.Checked = true;
}
private void modifyAll(object sender, EventArgs e)
{
int lang = SAV.Language;
if (lang > 5 || lang < 0) // KOR or Invalid
lang = 0;
bool seenA = sender == mnuSeenAll || sender == mnuCaughtAll || sender == mnuComplete;
bool seenN = sender == mnuSeenNone;
bool caughtA = sender == mnuCaughtAll || sender == mnuComplete;
bool caughtN = sender == mnuCaughtNone || sender == mnuSeenNone;
for (int i = 0; i < LB_Species.Items.Count; i++)
{
LB_Species.SelectedIndex = i;
if (seenN) // move all to none
seenNone();
else if (seenA) // move all to seen
seenAll();
if (caughtA)
{
CHK_Caught.Checked = true;
for (int j = 0; j < CL.Length; j++) // set SAV language (and others if Complete)
CL[j].Checked = sender == mnuComplete || (mnuCaughtNone != sender && j == lang);
}
else if (caughtN)
CHK_Caught.Checked = false;
else if (!CHK_Seen.Checked)
foreach (CheckBox t in CL)
t.Checked = false;
}
setEntry();
getEntry();
}
private void CHK_Seen_CheckedChanged(object sender, EventArgs e)
{
if (!editing)
{
if (!CHK_Seen.Checked) // move all to none
{
CHK_Caught.Checked = false;
seenNone();
}
else
{
LB_NGender.SelectedIndex = 0;
toggleSeen(B_GLeft, e);
}
}
LB_Gender.Enabled = LB_NGender.Enabled = LB_Form.Enabled = LB_NForm.Enabled = CHK_Seen.Checked;
CHK_Caught.Enabled = CHK_Seen.Checked;
}
private void toggleSeen(object sender, EventArgs e)
{
if (editing)
return;
var lb = sender == B_GLeft ? LB_NGender : LB_Gender;
if (lb == null || lb.SelectedIndex < 0)
{
WinFormsUtil.Alert("No Gender selected.");
return;
}
var item = lb.SelectedItem;
lb.Items.RemoveAt(lb.SelectedIndex);
var dest = lb == LB_Gender ? LB_NGender : LB_Gender;
dest.Items.Add(item);
dest.SelectedIndex = dest.Items.Count - 1;
}
private void moveGender(object sender, EventArgs e)
{
if (editing)
return;
var lb = LB_Gender;
if (lb == null || lb.SelectedIndex < 0)
{
WinFormsUtil.Alert("No Gender selected.");
return;
}
int index = lb.SelectedIndex;
int delta = sender == B_GUp ? -1 : 1;
if (index == 0 && lb.Items.Count == 1)
return;
int newIndex = index + delta;
if (newIndex < 0)
return;
if (newIndex >= lb.Items.Count)
return;
var item = lb.SelectedItem;
lb.Items.Remove(item);
lb.Items.Insert(newIndex, item);
lb.SelectedIndex = newIndex;
}
private void toggleForm(object sender, EventArgs e)
{
if (editing)
return;
var lb = sender == B_FLeft ? LB_NForm : LB_Form;
if (lb == null || lb.SelectedIndex < 0)
{
WinFormsUtil.Alert("No Form selected.");
return;
}
var item = lb.SelectedItem;
lb.Items.RemoveAt(lb.SelectedIndex);
var dest = lb == LB_Form ? LB_NForm : LB_Form;
dest.Items.Add(item);
dest.SelectedIndex = dest.Items.Count - 1;
}
private void moveForm(object sender, EventArgs e)
{
if (editing)
return;
var lb = LB_Form;
if (lb == null || lb.SelectedIndex < 0)
{
WinFormsUtil.Alert("No Form selected.");
return;
}
int index = lb.SelectedIndex;
int delta = sender == B_FUp ? -1 : 1;
if (index == 0 && lb.Items.Count == 1)
return;
int newIndex = index + delta;
if (newIndex < 0)
return;
if (newIndex >= lb.Items.Count)
return;
var item = lb.SelectedItem;
lb.Items.Remove(item);
lb.Items.Insert(newIndex, item);
lb.SelectedIndex = newIndex;
}
}
}

View file

@ -0,0 +1,219 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="modifyMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAIAEBAAAAEAIABoBAAAJgAAACAgAAABACAAqBAAAI4EAAAoAAAAEAAAACAAAAABACAAAAAAAAAE
AAAAAAAAAAAAAAAAAAAAAAAAIyMjAQAAAAALCwsPJiYmJysrKycqKionKSkpJykpKScpKSknKioqJyoq
KicrKysnJycnJw0ODQ8AAAAAJiYmAQAAAABpaWlHq6ur17+/v+6+vr7svr6+7b6+vu2+vr7tvr6+7b6+
vu2+vr7tvr6+7L+/v+6rq6vXampqSAAAAAAoKSgXvr++3eLi4v/g4OD94eHh/+Hh4f/i4uL/4uLi/+Li
4v/i4uL/4eHh/+Dh4P/g4OD94uLi/7+/v90sLCwXfn5+PNna2frg4OD/39/f/uHh4f7h4eH+39/f/uDg
4P7g4OD+39/f/uHh4f7h4OH+39/f/t/g3//a2tr6g4ODPoOCgz7X19f64+Pj/+Li4v7k5OT/4+Tj//Ly
8v/19fX/9PT0//T09P/k5OT/5OTk/+Pj4/7j4+P/19jX+4qLikCDhIM+2tra++Xl5f/k5eT+5OTk//Lz
8v+urq7/RUVF/z4+Pv+Zmpn/8fHx/+Xm5f/k5eT+5eXl/9ra2vyLi4tAhYWFPuXm5vvx8vP/7+/w/v//
//+sra3/AgI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yCws
p8gsLKfILCynyCwsp8gsLKfILCynyCwsp8gsLKfILCynyCwsp8gsLKfILCynyDExqcU2NpenLi54Shsb
ewMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////8AAAD+AAAAfAAAADwAAAA8AAAAPAAAADwAAAA8AA
AAPAAAADwAAAA8AAAAPAAAADwAAAA8AAAAPAAAADwAAAA8AAAAPAAAADwAAAA8AAAAPAAAADwAAAA8AA
AAPAAAADwAAAA8AAAAPAAAAD4AAAB/gAAB//////
</value>
</data>
</root>

View file

@ -271,7 +271,6 @@ namespace PKHeX.Core
private int WondercardFlags = int.MinValue;
private int AdventureInfo = int.MinValue;
public override bool HasPokeDex => false;
// Inventory
private ushort[] LegalItems, LegalKeyItems, LegalTMHMs, LegalMedicine, LegalBerries, LegalBalls, LegalBattleItems, LegalMailItems;
@ -758,89 +757,75 @@ namespace PKHeX.Core
const int brSize = 0x40;
int bit = pkm.Species - 1;
byte mask = (byte) (1 << (bit&7));
int ofs = PokeDex + (bit>>3) + 0x4;
byte mask = (byte) (1 << (bit & 7));
int ofs = PokeDex + (bit >> 3) + 0x4;
/* 4 BitRegions with 0x40*8 bits
* Region 0: Caught (Captured/Owned) flags
* Region 1: Seen flags
* Region 2/3: Toggle for gender display
* 4 possible states: 00, 01, 10, 11
* 00 - 1Seen: Male Only
* 01 - 2Seen: Male First, Female Second
* 10 - 2Seen: Female First, Male Second
* 11 - 1Seen: Female Only
* (bit1 ^ bit2) + 1 = forms in dex
* bit2 = male/female shown first toggle
*/
// Set the Species Owned Flag
Data[ofs + brSize*0] |= mask;
// Check if already Seen
int gr = pkm.PersonalInfo.Gender;
if (gr != 0 && gr < 254) // Not genderless or fixed gender
if ((Data[ofs + brSize*1] & mask) == 0) // Not seen
{
bool m = (Data[ofs + brSize*1] & mask) != 0;
bool f = (Data[ofs + brSize*2] & mask) != 0;
if (!(m || f)) // not yet seen
int gr = pkm.PersonalInfo.Gender;
switch (gr)
{
// Set OTHER gender seen bit so it appears second
int gender = pkm.Gender & 1;
gender ^= 1; // other gender
Data[ofs + brSize*(1 + gender)] |= mask;
case 255: // Genderless
case 0: // Male Only
Data[ofs + brSize*1] &= mask;
Data[ofs + brSize*2] &= mask;
break;
case 254: // Female Only
Data[ofs + brSize*1] |= mask;
Data[ofs + brSize*2] |= mask;
break;
default: // Male or Female
bool m = (Data[ofs + brSize*1] & mask) != 0;
bool f = (Data[ofs + brSize*2] & mask) != 0;
if (!(m || f)) // Add both forms (not a single form == 00 or 11).
{
int gender = pkm.Gender & 1;
gender ^= 1; // Set OTHER gender seen bit so it appears second
Data[ofs + brSize * (1 + gender)] |= mask;
}
break;
}
}
int FormOffset1 = PokeDex + 0x108;
int PokeDexLanguageFlags = FormOffset1 + 0x20;
// Formes : Castform & Cherrim do not have entries (Battle Only formes)
// Lowest sub-value of formevalue is displayed, else is order of formes displayed.
// Deoxys forms 1-2 are stored in the last byte of the first bitRegion.
// Deoxys forms 3-4 are stored in the last byte of the second bitRegion.
if (pkm.Species == 386)
int FormOffset1 = PokeDex + 4 + brSize*4 + 4;
var forms = getForms(pkm.Species);
if (forms != null)
{
uint val = (uint)(Data[PokeDex + 0x4 + 1*brSize - 1] | Data[PokeDex + 0x4 + 2*brSize - 1] << 8);
int[] forms = getDexFormValues(val, 4, 4);
checkInsertForm(ref forms, pkm.AltForm);
uint newval = setDexFormValues(forms, 4, 4);
Data[PokeDex + 0x4 + 1*brSize - 1] = (byte)(newval & 0xFF);
Data[PokeDex + 0x4 + 2*brSize - 1] = (byte)((newval>>8) & 0xFF);
}
// After the BitRegions is 0x20 bytes for the rest of the formes.
// Standard Forme Bytes (DP)
// [Shellos-Gastrodon-Burmy-Wormadam],[Unown*0x1C]
if (pkm.Species == 422) // Shellos
{
int[] forms = getDexFormValues(Data[FormOffset1 + 0], 2, 2);
checkInsertForm(ref forms, pkm.AltForm);
uint newval = setDexFormValues(forms, 2, 2);
Data[FormOffset1 + 0] = (byte)newval;
}
if (pkm.Species == 423) // Gastrodon
{
int[] forms = getDexFormValues(Data[FormOffset1 + 1], 2, 2);
checkInsertForm(ref forms, pkm.AltForm);
uint newval = setDexFormValues(forms, 2, 2);
Data[FormOffset1 + 1] = (byte)newval;
}
if (pkm.Species == 412) // Burmy
{
int[] forms = getDexFormValues(Data[FormOffset1 + 2], 2, 3);
checkInsertForm(ref forms, pkm.AltForm);
uint newval = setDexFormValues(forms, 2, 3);
Data[FormOffset1 + 2] = (byte)newval;
}
if (pkm.Species == 413) // Wormadam
{
int[] forms = getDexFormValues(Data[FormOffset1 + 3], 2, 3);
checkInsertForm(ref forms, pkm.AltForm);
uint newval = setDexFormValues(forms, 2, 3);
Data[FormOffset1 + 3] = (byte)newval;
}
if (pkm.Species == 201) // Unown
{
for (int i = 0; i < 0x1C; i++)
if (pkm.Species == 201) // Unown
{
byte val = Data[FormOffset1 + 4 + i];
if (val == pkm.AltForm)
break; // already set
if (val != 0xFF)
continue; // keep searching
for (int i = 0; i < 0x1C; i++)
{
byte val = Data[FormOffset1 + 4 + i];
if (val == pkm.AltForm)
break; // already set
if (val != 0xFF)
continue; // keep searching
Data[FormOffset1 + 4 + i] = (byte)pkm.AltForm;
break; // form now set
Data[FormOffset1 + 4 + i] = (byte)pkm.AltForm;
break; // form now set
}
}
else
{
checkInsertForm(ref forms, pkm.AltForm);
setForms(pkm.Species, forms);
}
}
@ -852,38 +837,118 @@ namespace PKHeX.Core
int lang = pkm.Language - 1;
if (lang > 5) lang = 0; // no KOR
if (lang < 0) lang = 1;
int PokeDexLanguageFlags = FormOffset1 + (HGSS ? 0x3C : 0x20);
Data[PokeDexLanguageFlags + pkm.Species] |= (byte) (1 << lang);
}
int FormOffset2 = PokeDexLanguageFlags + 0x210;
// PtHGSS added more forms.
// [Rotom*4-highest bits unused],[Shaymin],[Giratina],[Pichu-HGSS ONLY]
if (pkm.Species == 479) // Rotom
public int[] getForms(int species)
{
const int brSize = 0x40;
if (species == 386)
{
int[] forms = getDexFormValues(BitConverter.ToUInt32(Data, FormOffset2), 3, 6);
checkInsertForm(ref forms, pkm.AltForm);
uint newval = setDexFormValues(forms, 3, 6);
BitConverter.GetBytes(newval).CopyTo(Data, FormOffset2);
uint val = (uint) (Data[PokeDex + 0x4 + 1*brSize - 1] | Data[PokeDex + 0x4 + 2*brSize - 1] << 8);
return getDexFormValues(val, 4, 4);
}
if (pkm.Species == 492) // Shaymin
int FormOffset1 = PokeDex + 4 + 4*brSize + 4;
switch (species)
{
int[] forms = getDexFormValues(Data[FormOffset2 + 4], 2, 2);
uint newval = setDexFormValues(forms, 2, 2);
Data[FormOffset1 + 3] = (byte)newval;
case 422: // Shellos
return getDexFormValues(Data[FormOffset1 + 0], 2, 2);
case 423: // Gastrodon
return getDexFormValues(Data[FormOffset1 + 1], 2, 2);
case 412: // Burmy
return getDexFormValues(Data[FormOffset1 + 2], 2, 3);
case 413: // Wormadam
return getDexFormValues(Data[FormOffset1 + 3], 2, 3);
case 201: // Unown
return getData(FormOffset1 + 4, 0x1C).Select(i => (int)i).ToArray();
}
if (pkm.Species == 487) // Giratina
if (!DP)
return null;
int PokeDexLanguageFlags = FormOffset1 + (HGSS ? 0x3C : 0x20);
int FormOffset2 = PokeDexLanguageFlags + 0x1F4;
switch (species)
{
int[] forms = getDexFormValues(Data[FormOffset2 + 5], 2, 2);
uint newval = setDexFormValues(forms, 2, 2);
Data[FormOffset1 + 3] = (byte)newval;
case 479: // Rotom
return getDexFormValues(BitConverter.ToUInt32(Data, FormOffset2), 3, 6);
case 492: // Shaymin
return getDexFormValues(Data[FormOffset2 + 4], 2, 2);
case 487: // Giratina
return getDexFormValues(Data[FormOffset2 + 5], 2, 2);
case 172:
if (!HGSS)
return null;
return getDexFormValues(Data[FormOffset2 + 6], 2, 3);
}
if (pkm.Species == 172 && HGSS) // Pichu
return null;
}
public void setForms(int spec, int[] forms)
{
const int brSize = 0x40;
switch (spec)
{
int[] forms = getDexFormValues(Data[FormOffset2 + 6], 2, 3);
uint newval = setDexFormValues(forms, 2, 3);
Data[FormOffset1 + 3] = (byte)newval;
case 386: // Deoxys
uint newval = setDexFormValues(forms, 4, 4);
Data[PokeDex + 0x4 + 1*brSize - 1] = (byte) (newval & 0xFF);
Data[PokeDex + 0x4 + 2*brSize - 1] = (byte) ((newval >> 8) & 0xFF);
break;
}
int FormOffset1 = PokeDex + 4 + 4*brSize + 4;
if (HGSS)
FormOffset1 += 0x1C;
switch (spec)
{
case 422: // Shellos
Data[FormOffset1 + 0] = (byte)setDexFormValues(forms, 2, 2);
return;
case 423: // Gastrodon
Data[FormOffset1 + 1] = (byte)setDexFormValues(forms, 2, 2);
return;
case 412: // Burmy
Data[FormOffset1 + 2] = (byte)setDexFormValues(forms, 2, 3);
return;
case 413: // Wormadam
Data[FormOffset1 + 3] = (byte)setDexFormValues(forms, 2, 3);
return;
case 201: // Unown
int ofs = FormOffset1 + 4;
int len = forms.Length;
Array.Resize(ref forms, 0x1C);
for (int i = len; i < forms.Length; i++)
forms[i] = 0xFF;
Array.Copy(forms.Select(b => (byte)b).ToArray(), 0, Data, ofs, forms.Length);
return;
}
if (DP)
return;
int PokeDexLanguageFlags = FormOffset1 + (HGSS ? 0x3C : 0x20);
int FormOffset2 = PokeDexLanguageFlags + 0x1F4;
switch (spec)
{
case 479: // Rotom
BitConverter.GetBytes(setDexFormValues(forms, 3, 6)).CopyTo(Data, FormOffset2);
return;
case 492: // Shaymin
Data[FormOffset2 + 4] = (byte)setDexFormValues(forms, 2, 2);
return;
case 487: // Giratina
Data[FormOffset2 + 5] = (byte)setDexFormValues(forms, 2, 2);
return;
case 172: // Pichu
if (!HGSS)
return;
Data[FormOffset2 + 6] = (byte)setDexFormValues(forms, 2, 3);
return;
}
}
private int[] getDexFormValues(uint Value, int BitsPerForm, int readCt)
private static int[] getDexFormValues(uint Value, int BitsPerForm, int readCt)
{
int[] Forms = new int[readCt];
int n1 = 0xFF >> (8 - BitsPerForm);
@ -897,7 +962,7 @@ namespace PKHeX.Core
}
return Forms;
}
private uint setDexFormValues(int[] Forms, int BitsPerForm, int readCt)
private static uint setDexFormValues(int[] Forms, int BitsPerForm, int readCt)
{
int n1 = 0xFF >> (8 - BitsPerForm);
uint Value = 0xFFFFFFFF << (Forms.Length*BitsPerForm);
@ -911,7 +976,7 @@ namespace PKHeX.Core
}
return Value;
}
private bool checkInsertForm(ref int[] Forms, int FormNum)
private static bool checkInsertForm(ref int[] Forms, int FormNum)
{
if (Forms.Any(num => num == FormNum))
{