Moved import code, image layering.

Image layering will now display shinies and contents of eggs.
Import code moved to Code Generator.
This commit is contained in:
Kurt 2014-07-28 15:28:06 -07:00
parent 691ad75730
commit 3bf2516851
9 changed files with 172 additions and 497 deletions

View file

@ -45,6 +45,8 @@
this.B_Copy = new System.Windows.Forms.Button();
this.B_Diff = new System.Windows.Forms.Button();
this.CHK_Break = new System.Windows.Forms.CheckBox();
this.B_Paste = new System.Windows.Forms.Button();
this.B_Import = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// RTB_Code
@ -53,7 +55,7 @@
this.RTB_Code.Location = new System.Drawing.Point(8, 52);
this.RTB_Code.Name = "RTB_Code";
this.RTB_Code.ReadOnly = true;
this.RTB_Code.Size = new System.Drawing.Size(160, 191);
this.RTB_Code.Size = new System.Drawing.Size(160, 190);
this.RTB_Code.TabIndex = 0;
this.RTB_Code.Text = "01234567 01234567 ";
//
@ -253,11 +255,33 @@
this.CHK_Break.Text = "Line Break for Simple Mode";
this.CHK_Break.UseVisualStyleBackColor = true;
//
// B_Paste
//
this.B_Paste.Location = new System.Drawing.Point(8, 249);
this.B_Paste.Name = "B_Paste";
this.B_Paste.Size = new System.Drawing.Size(69, 23);
this.B_Paste.TabIndex = 20;
this.B_Paste.Text = "Paste";
this.B_Paste.UseVisualStyleBackColor = true;
this.B_Paste.Click += new System.EventHandler(this.B_Paste_Click);
//
// B_Import
//
this.B_Import.Location = new System.Drawing.Point(99, 249);
this.B_Import.Name = "B_Import";
this.B_Import.Size = new System.Drawing.Size(69, 23);
this.B_Import.TabIndex = 21;
this.B_Import.Text = "Import";
this.B_Import.UseVisualStyleBackColor = true;
this.B_Import.Click += new System.EventHandler(this.B_Import_Click);
//
// CodeGenerator
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(176, 249);
this.ClientSize = new System.Drawing.Size(176, 282);
this.Controls.Add(this.B_Import);
this.Controls.Add(this.B_Paste);
this.Controls.Add(this.CHK_Break);
this.Controls.Add(this.B_Diff);
this.Controls.Add(this.B_Copy);
@ -304,5 +328,7 @@
private System.Windows.Forms.Button B_Copy;
private System.Windows.Forms.Button B_Diff;
private System.Windows.Forms.CheckBox CHK_Break;
private System.Windows.Forms.Button B_Paste;
private System.Windows.Forms.Button B_Import;
}
}

View file

@ -312,5 +312,61 @@ namespace PKHeX
MessageBox.Show("Too many differences. Export your save instead.", "Alert");
}
}
// Import
public byte[] returnArray { get; set; }
private void B_Paste_Click(object sender, EventArgs e)
{
RTB_Code.Text = Clipboard.GetText();
}
private void B_Import_Click(object sender, EventArgs e)
{
// Gotta read in the textbox.
if (RTB_Code.Text.Length < 1) return;
byte[] data = new Byte[0];
// Get Actual Lines
for (int i = 0; i < RTB_Code.Lines.Count(); i++)
{
if (RTB_Code.Lines[i].Length > 0)
{
if (RTB_Code.Lines[i].Length <= 2 * 8 && RTB_Code.Lines[i].Length > 2 * 8 + 2)
{
MessageBox.Show("Invalid code pasted (Type)", "Error"); return;
}
else
{
try
{
// Grab Line Data
string line = RTB_Code.Lines[i];
string[] rip = Regex.Split(line, " ");
Array.Resize(ref data, data.Length + 4);
Array.Copy(BitConverter.GetBytes(UInt32.Parse(rip[1], NumberStyles.HexNumber)), 0, data, data.Length - 4, 4);
}
catch
{
MessageBox.Show("Invalid code pasted (Content)", "Error"); return;
}
}
}
}
// Go over the data
if ((data.Length == 232 - 4) || (data.Length == 260 - 4))
{
Array.Resize(ref data, data.Length + 4);
Array.Copy(data, 0, data, 4, data.Length);
data[0] = data[1] = data[2] = data[3] = 0;
}
if ((data.Length == 232) || (data.Length == 260))
{
this.returnArray = data;
this.Close();
}
else
{
MessageBox.Show("Invalid code pasted (Length)", "Error"); return;
}
}
}
}

View file

@ -1,93 +0,0 @@
namespace PKHeX
{
partial class CodeImportPKM
{
/// <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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CodeImportPKM));
this.RTB_Code = new System.Windows.Forms.RichTextBox();
this.button1 = new System.Windows.Forms.Button();
this.B_Paste = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// RTB_Code
//
this.RTB_Code.Location = new System.Drawing.Point(8, 38);
this.RTB_Code.Name = "RTB_Code";
this.RTB_Code.ReadOnly = true;
this.RTB_Code.Size = new System.Drawing.Size(149, 168);
this.RTB_Code.TabIndex = 0;
this.RTB_Code.Text = "";
this.RTB_Code.WordWrap = false;
//
// button1
//
this.button1.Location = new System.Drawing.Point(87, 7);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(70, 25);
this.button1.TabIndex = 1;
this.button1.Text = "Import";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.B_Import_Click);
//
// B_Paste
//
this.B_Paste.Location = new System.Drawing.Point(8, 7);
this.B_Paste.Name = "B_Paste";
this.B_Paste.Size = new System.Drawing.Size(70, 25);
this.B_Paste.TabIndex = 2;
this.B_Paste.Text = "Paste";
this.B_Paste.UseVisualStyleBackColor = true;
this.B_Paste.Click += new System.EventHandler(this.B_Paste_Click);
//
// CodeImportPKM
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(164, 212);
this.Controls.Add(this.B_Paste);
this.Controls.Add(this.button1);
this.Controls.Add(this.RTB_Code);
this.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "CodeImportPKM";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Code Import";
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.RichTextBox RTB_Code;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button B_Paste;
}
}

View file

@ -1,76 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Globalization;
using System.Text.RegularExpressions;
namespace PKHeX
{
public partial class CodeImportPKM : Form
{
public CodeImportPKM()
{
InitializeComponent();
this.returnArray = null;
}
public byte[] returnArray { get; set; }
private void B_Paste_Click(object sender, EventArgs e)
{
RTB_Code.Text = Clipboard.GetText();
}
private void B_Import_Click(object sender, EventArgs e)
{
// Gotta read in the textbox.
if (RTB_Code.Text.Length < 1) return;
byte[] data = new Byte[0];
// Get Actual Lines
for (int i = 0; i < RTB_Code.Lines.Count(); i++)
{
if (RTB_Code.Lines[i].Length > 0)
{
if (RTB_Code.Lines[i].Length <= 2 * 8 && RTB_Code.Lines[i].Length > 2 * 8 + 2)
{
MessageBox.Show("Invalid code pasted (Type)", "Error"); return;
}
else
{
try
{
// Grab Line Data
string line = RTB_Code.Lines[i];
string[] rip = Regex.Split(line, " ");
Array.Resize(ref data, data.Length + 4);
Array.Copy(BitConverter.GetBytes(UInt32.Parse(rip[1], NumberStyles.HexNumber)), 0, data, data.Length - 4, 4);
}
catch
{
MessageBox.Show("Invalid code pasted (Content)", "Error"); return;
}
}
}
}
// Go over the data
if ((data.Length == 232 - 4) || (data.Length == 260 - 4))
{
Array.Resize(ref data, data.Length + 4);
Array.Copy(data, 0, data, 4, data.Length);
data[0] = data[1] = data[2] = data[3] = 0;
}
if ((data.Length == 232) || (data.Length == 260))
{
this.returnArray = data;
this.Close();
}
else
{
MessageBox.Show("Invalid code pasted (Length)", "Error"); return;
}
}
}
}

View file

@ -1,216 +0,0 @@
<?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>
<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/AgIC/15eXv9tbG3/BQUF/4yMjP//////7+/w/vHy8//l5ub8jY2NQC4uLD5LS0f7UFBL/09P
Sv5YWVP/FBUS/29wcP///////////5SUlP8PDw//U1NO/1BQS/5PT0r/S0tH/DIyMEAAAAs+AAAM+wAA
Dv8AAA/+AwMS/wAAAP+UlJX///////////+3t7n/AAAA/wAAD/8BAQ/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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////8AAAD+AAAAfAAAADwAAAA8AAAAPAAAADwAAAA8AA
AAPAAAADwAAAA8AAAAPAAAADwAAAA8AAAAPAAAADwAAAA8AAAAPAAAADwAAAA8AAAAPAAAADwAAAA8AA
AAPAAAADwAAAA8AAAAPAAAAD4AAAB/gAAB//////
</value>
</data>
</root>

View file

@ -77,12 +77,6 @@
<Compile Include="CodeGenerator.Designer.cs">
<DependentUpon>CodeGenerator.cs</DependentUpon>
</Compile>
<Compile Include="CodeImportPKM.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="CodeImportPKM.Designer.cs">
<DependentUpon>CodeImportPKM.cs</DependentUpon>
</Compile>
<Compile Include="f1-Main.cs">
<SubType>Form</SubType>
</Compile>
@ -187,12 +181,10 @@
<Compile Include="SplashScreen.Designer.cs">
<DependentUpon>SplashScreen.cs</DependentUpon>
</Compile>
<Compile Include="Util.cs" />
<EmbeddedResource Include="CodeGenerator.resx">
<DependentUpon>CodeGenerator.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="CodeImportPKM.resx">
<DependentUpon>CodeImportPKM.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="f1-Main.resx">
<DependentUpon>f1-Main.cs</DependentUpon>
<SubType>Designer</SubType>

30
Util.cs Normal file
View file

@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
namespace PKHeX
{
public partial class Util
{
public static Image layerImage(Image baseLayer, Image overLayer, int x, int y, double trans)
{
Bitmap overlayImage = (Bitmap)overLayer;
Bitmap newImage = (Bitmap)baseLayer;
for (int i = 0; i < (overlayImage.Width * overlayImage.Height); i++)
{
Color newColor = overlayImage.GetPixel(i % (overlayImage.Width), i / (overlayImage.Width));
newColor = Color.FromArgb((int)((double)(newColor.A) * trans), newColor.R, newColor.G, newColor.B); // Apply transparency change
if (newColor != Color.FromArgb(0, 0, 0, 0))
{
newImage.SetPixel(
i % (overlayImage.Width) + x,
i / (overlayImage.Width) + y,
newColor);
}
}
return newImage;
}
}
}

33
f1-Main.Designer.cs generated
View file

@ -323,7 +323,6 @@
this.GB_SAVtools = new System.Windows.Forms.GroupBox();
this.L_SAVINDEX = new System.Windows.Forms.Label();
this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
this.B_ImportCode = new System.Windows.Forms.Button();
this.tabMain.SuspendLayout();
this.Tab_Main.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.Label_IsShiny)).BeginInit();
@ -3518,7 +3517,6 @@
//
// Tab_Tools
//
this.Tab_Tools.Controls.Add(this.B_ImportCode);
this.Tab_Tools.Controls.Add(this.B_BoxIO);
this.Tab_Tools.Controls.Add(this.B_JPEG);
this.Tab_Tools.Controls.Add(this.B_OUTHallofFame);
@ -3534,9 +3532,9 @@
//
// B_BoxIO
//
this.B_BoxIO.Location = new System.Drawing.Point(3, 3);
this.B_BoxIO.Location = new System.Drawing.Point(178, 20);
this.B_BoxIO.Name = "B_BoxIO";
this.B_BoxIO.Size = new System.Drawing.Size(75, 46);
this.B_BoxIO.Size = new System.Drawing.Size(75, 45);
this.B_BoxIO.TabIndex = 6;
this.B_BoxIO.Text = "Open/Save Box Content";
this.B_BoxIO.UseVisualStyleBackColor = true;
@ -3545,9 +3543,9 @@
// B_JPEG
//
this.B_JPEG.Enabled = false;
this.B_JPEG.Location = new System.Drawing.Point(89, 3);
this.B_JPEG.Location = new System.Drawing.Point(102, 20);
this.B_JPEG.Name = "B_JPEG";
this.B_JPEG.Size = new System.Drawing.Size(75, 46);
this.B_JPEG.Size = new System.Drawing.Size(75, 45);
this.B_JPEG.TabIndex = 5;
this.B_JPEG.Text = "Save PGL .JPEG";
this.B_JPEG.UseVisualStyleBackColor = true;
@ -3556,7 +3554,7 @@
// B_OUTHallofFame
//
this.B_OUTHallofFame.Enabled = false;
this.B_OUTHallofFame.Location = new System.Drawing.Point(173, 3);
this.B_OUTHallofFame.Location = new System.Drawing.Point(12, 20);
this.B_OUTHallofFame.Name = "B_OUTHallofFame";
this.B_OUTHallofFame.Size = new System.Drawing.Size(75, 23);
this.B_OUTHallofFame.TabIndex = 4;
@ -3567,10 +3565,10 @@
// RTB_T
//
this.RTB_T.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.RTB_T.Location = new System.Drawing.Point(1, 78);
this.RTB_T.Location = new System.Drawing.Point(1, 68);
this.RTB_T.Name = "RTB_T";
this.RTB_T.ReadOnly = true;
this.RTB_T.Size = new System.Drawing.Size(255, 120);
this.RTB_T.Size = new System.Drawing.Size(255, 130);
this.RTB_T.TabIndex = 1;
this.RTB_T.Text = "";
this.RTB_T.WordWrap = false;
@ -3578,7 +3576,7 @@
// B_OUTPasserby
//
this.B_OUTPasserby.Enabled = false;
this.B_OUTPasserby.Location = new System.Drawing.Point(173, 26);
this.B_OUTPasserby.Location = new System.Drawing.Point(12, 42);
this.B_OUTPasserby.Name = "B_OUTPasserby";
this.B_OUTPasserby.Size = new System.Drawing.Size(75, 23);
this.B_OUTPasserby.TabIndex = 0;
@ -3616,7 +3614,7 @@
this.B_SwitchSAV.Enabled = false;
this.B_SwitchSAV.Location = new System.Drawing.Point(102, 20);
this.B_SwitchSAV.Name = "B_SwitchSAV";
this.B_SwitchSAV.Size = new System.Drawing.Size(70, 45);
this.B_SwitchSAV.Size = new System.Drawing.Size(75, 45);
this.B_SwitchSAV.TabIndex = 6;
this.B_SwitchSAV.Text = "Switch SAV";
this.B_SwitchSAV.UseVisualStyleBackColor = true;
@ -3658,7 +3656,7 @@
this.B_ExportSAV.Enabled = false;
this.B_ExportSAV.Location = new System.Drawing.Point(178, 20);
this.B_ExportSAV.Name = "B_ExportSAV";
this.B_ExportSAV.Size = new System.Drawing.Size(70, 45);
this.B_ExportSAV.Size = new System.Drawing.Size(75, 45);
this.B_ExportSAV.TabIndex = 4;
this.B_ExportSAV.Text = "Export SAV";
this.B_ExportSAV.UseVisualStyleBackColor = true;
@ -3797,16 +3795,6 @@
this.notifyIcon1.Text = "notifyIcon1";
this.notifyIcon1.Visible = true;
//
// B_ImportCode
//
this.B_ImportCode.Location = new System.Drawing.Point(3, 51);
this.B_ImportCode.Name = "B_ImportCode";
this.B_ImportCode.Size = new System.Drawing.Size(161, 23);
this.B_ImportCode.TabIndex = 7;
this.B_ImportCode.Text = "Import PK6 from Code";
this.B_ImportCode.UseVisualStyleBackColor = true;
this.B_ImportCode.Click += new System.EventHandler(this.B_ImportCode_Click);
//
// Form1
//
this.AllowDrop = true;
@ -4226,7 +4214,6 @@
private System.Windows.Forms.ToolStripMenuItem codeGeneratorToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem reportToolStripMenuItem;
private System.Windows.Forms.NotifyIcon notifyIcon1;
private System.Windows.Forms.Button B_ImportCode;
}
}

View file

@ -7895,8 +7895,11 @@ namespace PKHeX
int gender = (dslotdata[0x1D] >> 1) & 0x3;
string file;
if (isegg == 1)
{ file = "egg"; }
if (species == 0)
file = "_0";
// if (isegg == 1)
// { file = "egg"; }
else
{
file = "_" + species.ToString();
@ -7909,10 +7912,32 @@ namespace PKHeX
file = file = "_" + species.ToString() + "f";
}
}
if (species == 0)
file = "_0";
Image baseImage = (Image)Properties.Resources.ResourceManager.GetObject(file);
if (isegg == 1)
{
file = "_0"; // Start with a partially transparent species
baseImage = PKHeX.Util.layerImage((Image)Properties.Resources.ResourceManager.GetObject(file), baseImage, 0, 0, 0.2);
file = "egg"; // Add the egg layer over-top.
baseImage = PKHeX.Util.layerImage(baseImage, (Image)Properties.Resources.ResourceManager.GetObject(file), 0, 0, 1);
}
pb.Image = (Image)Properties.Resources.ResourceManager.GetObject(file);
uint PID = BitConverter.ToUInt32(dslotdata, 0x18);
uint UID = (PID >> 16);
uint LID = (PID & 0xFFFF);
uint PSV = UID ^ LID;
uint TSV = (uint)(BitConverter.ToUInt16(dslotdata,0x0C) ^ BitConverter.ToUInt16(dslotdata,0x0E));
uint XOR = TSV ^ PSV;
int gamevers = dslotdata[0xDF];
if (species != 0 && (((XOR < 8) && (gamevers < 24)) || ((XOR < 16) && (gamevers >= 24))))
{ // Is Shiny
// Redraw our image
baseImage = PKHeX.Util.layerImage(baseImage, Properties.Resources.rare_icon, 0, 0, 0.33);
}
pb.Image = baseImage;
pb.BackColor = Color.Transparent;
}
private void getSlotColor(int slot, Color color)
{
@ -8269,29 +8294,6 @@ namespace PKHeX
SAV_HallOfFame halloffame = new PKHeX.SAV_HallOfFame(this);
halloffame.ShowDialog();
}
private void B_ImportCode_Click(object sender, EventArgs e)
{
// Open Import Code Menu
CodeImportPKM textcode = new PKHeX.CodeImportPKM();
textcode.ShowDialog();
byte[] data = textcode.returnArray;
if (data != null)
{
byte[] decdata = decryptArray(data);
Array.Copy(decdata, buff, 232);
try
{
populatefields(buff);
}
catch
{
Array.Copy(new Byte[232], buff, 232);
populatefields(buff);
MessageBox.Show("Imported code did not decrypt properly. Verify that what you imported was correct.", "Error");
}
}
}
private void B_SwitchSAV_Click(object sender, EventArgs e)
{
DialogResult switchsav = MessageBox.Show("Current Savefile is Save" + ((savindex + 1)).ToString() + ". Would you like to switch to Save" + ((savindex + 1) % 2 + 1).ToString() + "?", "Prompt", MessageBoxButtons.YesNo);
@ -8445,63 +8447,30 @@ namespace PKHeX
{
// Open Code Generator
CodeGenerator CodeGen = new PKHeX.CodeGenerator(this);
CodeGen.Show();
CodeGen.ShowDialog();
byte[] data = CodeGen.returnArray;
if (data != null)
{
byte[] decdata = decryptArray(data);
Array.Copy(decdata, buff, 232);
try
{
populatefields(buff);
}
catch
{
Array.Copy(new Byte[232], buff, 232);
populatefields(buff);
MessageBox.Show("Imported code did not decrypt properly. Verify that what you imported was correct.", "Error");
}
}
}
private void reportToolStripMenuItem_Click(object sender, EventArgs e)
{
frmReport ReportForm = new frmReport(this);
ReportForm.PopulateData(savefile);
ReportForm.ShowDialog();
}
// pk2pk Transfer Tool
private int getg3species(int g3index)
{
int[] newindex = new int[]
{
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,
59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,77,79,80,81,82,83,84,85,86,
87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,
111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,
132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,
153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,
174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,
195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,
216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,
237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,
258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,290,291,292,
276,277,285,286,327,278,279,283,284,320,321,300,301,352,343,344,299,324,302,339,340,
370,341,342,349,350,318,319,328,329,330,296,297,309,310,322,323,363,364,365,331,332,
361,362,337,338,298,325,326,311,312,303,307,308,333,334,360,355,356,315,287,288,289,
316,317,357,293,294,295,366,367,368,359,353,354,336,335,369,304,305,306,351,313,314,
345,346,347,348,280,281,282,371,372,373,374,375,376,377,378,379,382,383,384,380,381,
385,386,358,
};
int[] oldindex = new int[]
{
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,
59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,
87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,
111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,
132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,
153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,
174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,
195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,
216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,
237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,277,278,279,280,281,282,
283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,
304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,
325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,
346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,
367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,
388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,
409,410,411,
};
return newindex[Array.IndexOf(oldindex, g3index)];
}
}
#region Structs & Classes
public class cbItem