Merge pull request #6 from kwsch/master

Update
This commit is contained in:
ajtudela
2016-09-10 16:06:11 +02:00
committed by GitHub
39 changed files with 5559 additions and 1833 deletions

View File

@@ -840,6 +840,9 @@ public static partial class Legal
};
internal static readonly int[] Ban_Gen3Ball =
{
387, 390, 393, //1 - Turtwig, Chimchar, Piplup
388, 391, 394, //2
389, 392, 395, //3
495, 498, 501, //1 - Snivy, Tepig, Oshawott
496, 499, 502, //2
497, 500, 503, //3
@@ -850,6 +853,9 @@ public static partial class Legal
152, 155, 158, //1 - Chikorita, Cyndaquil, Totodile
153, 156, 159, //2
154, 157, 160, //3
387, 390, 393, //1 - Turtwig, Chimchar, Piplup
388, 391, 394, //2
389, 392, 395, //3
495, 498, 501, //1 - Snivy, Tepig, Oshawott
496, 499, 502, //2
497, 500, 503, //3

28
PKHeX/Legality/Tables1.cs Normal file
View File

@@ -0,0 +1,28 @@
using System.Linq;
namespace PKHeX
{
public static partial class Legal
{
// PKHeX Valid Array Storage
internal static readonly ushort[] Pouch_Items_RBY = Enumerable.Range(0, 7) // 0-6
.Concat(Enumerable.Range(10, 11)) // 10-20
.Concat(Enumerable.Range(29, 15)) // 29-43
.Concat(Enumerable.Range(45, 5)) // 45-49
.Concat(Enumerable.Range(51, 8)) // 51-58
.Concat(Enumerable.Range(60, 24)) // 60-83
.Concat(Enumerable.Range(196, 54)) // 196-249
.Select(i => (ushort)i).ToArray();
internal static readonly int[] MovePP_RBY =
{
0,
35, 25, 10, 15, 20, 20, 15, 15, 15, 35, 30, 05, 10, 30, 30, 35, 35, 20, 15, 20, 20, 10, 20, 30, 05, 25, 15, 15, 15, 25, 20, 05, 35, 15, 20, 20, 20, 15, 30, 35, 20, 20, 30, 25, 40, 20, 15, 20, 20, 20,
30, 25, 15, 30, 25, 05, 15, 10, 05, 20, 20, 20, 05, 35, 20, 25, 20, 20, 20, 15, 20, 10, 10, 40, 25, 10, 35, 30, 15, 20, 40, 10, 15, 30, 15, 20, 10, 15, 10, 05, 10, 10, 25, 10, 20, 40, 30, 30, 20, 20,
15, 10, 40, 15, 20, 30, 20, 20, 10, 40, 40, 30, 30, 30, 20, 30, 10, 10, 20, 05, 10, 30, 20, 20, 20, 05, 15, 10, 20, 15, 15, 35, 20, 15, 10, 20, 30, 15, 40, 20, 15, 10, 05, 10, 30, 10, 15, 20, 15, 40,
40, 10, 05, 15, 10, 10, 10, 15, 30, 30, 10, 10, 20, 10, 10, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,
00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00,
00, 00, 00, 00, 00, 00
};
}
}

35
PKHeX/Legality/Tables2.cs Normal file
View File

@@ -0,0 +1,35 @@
using System.Linq;
namespace PKHeX
{
public static partial class Legal
{
// PKHeX Valid Array Storage
internal static readonly ushort[] Pouch_Items_GSC = {
3, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 46, 47, 48, 49, 51, 52, 53, 57, 60, 62, 63, 64, 65, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 91, 92, 93, 94, 95, 96, 97, 98, 99, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 117, 118, 119, 121, 122, 123, 124, 125, 126, 131, 132, 138, 139, 140, 143, 144, 146, 150, 151, 152, 156, 158, 163, 168, 169, 170, 172, 173, 174, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189
};
internal static readonly ushort[] Pouch_Ball_GSC = {
1, 2, 4, 5, 157, 159, 160, 161, 164, 165, 166, 167
};
internal static readonly ushort[] Pouch_Key_GS = {
7, 54, 55, 58, 59, 61, 66, 67, 68 , 69, 71, 127, 128, 130, 133, 134, 175, 178
};
internal static readonly ushort[] Pouch_Key_C = Pouch_Key_GS.Concat(new ushort[]{70, 115, 116, 129}).ToArray();
internal static readonly ushort[] Pouch_TMHM_GSC = {
191, 192, 193, 194, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 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
};
internal static readonly ushort[] HeldItems_GSC = new ushort[1].Concat(Pouch_Items_GSC).Concat(Pouch_Ball_GSC).Concat(Pouch_TMHM_GSC).ToArray();
internal static readonly int[] MovePP_GSC =
{
00,
35, 25, 10, 15, 20, 20, 15, 15, 15, 35, 30, 05, 10, 30, 30, 35, 35, 20, 15, 20, 20, 10, 20, 30, 05, 25, 15, 15, 15, 25, 20, 05, 35, 15, 20, 20, 20, 15, 30, 35, 20, 20, 30, 25, 40, 20, 15, 20, 20, 20,
30, 25, 15, 30, 25, 05, 15, 10, 05, 20, 20, 20, 05, 35, 20, 25, 20, 20, 20, 15, 20, 10, 10, 40, 25, 10, 35, 30, 15, 20, 40, 10, 15, 30, 15, 20, 10, 15, 10, 05, 10, 10, 25, 10, 20, 40, 30, 30, 20, 20,
15, 10, 40, 15, 20, 30, 20, 20, 10, 40, 40, 30, 30, 30, 20, 30, 10, 10, 20, 05, 10, 30, 20, 20, 20, 05, 15, 10, 20, 15, 15, 35, 20, 15, 10, 20, 30, 15, 40, 20, 15, 10, 05, 10, 30, 10, 15, 20, 15, 40,
40, 10, 05, 15, 10, 10, 10, 15, 30, 30, 10, 10, 20, 10, 01, 01, 10, 10, 10, 05, 15, 25, 15, 10, 15, 30, 05, 40, 15, 10, 25, 10, 30, 10, 20, 10, 10, 10, 10, 10, 20, 05, 40, 05, 05, 15, 05, 10, 05, 15,
10, 05, 10, 20, 20, 40, 15, 10, 20, 20, 25, 05, 15, 10, 05, 20, 15, 20, 25, 20, 05, 30, 05, 10, 20, 40, 05, 20, 40, 20, 15, 35, 10, 05, 05, 05, 15, 05, 20, 05, 05, 15, 20, 10, 05, 05, 15, 15, 15, 15,
10, 00, 00, 00, 00
};
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -66,8 +66,7 @@ public Main()
};
relearnPB = new[] { PB_WarnRelearn1, PB_WarnRelearn2, PB_WarnRelearn3, PB_WarnRelearn4 };
movePB = new[] { PB_WarnMove1, PB_WarnMove2, PB_WarnMove3, PB_WarnMove4 };
defaultControlWhite = CB_Species.BackColor;
defaultControlText = Label_Species.ForeColor;
Label_Species.ResetForeColor();
// Set up Language Selection
foreach (var cbItem in main_langlist)
@@ -162,7 +161,6 @@ public Main()
#region Important Variables
public static PKM pkm = new PK6(); // Tab Pokemon Data Storage
public static SaveFile SAV = new SAV6 { Game = (int)GameVersion.AS, OT = "PKHeX", TID = 12345, SID = 54321, Language = 2, Country = 49, SubRegion = 7, ConsoleRegion = 1 }; // Save File
public static Color defaultControlWhite, defaultControlText;
public static string eggname = "";
public static string curlanguage = "en";
@@ -208,7 +206,7 @@ public Main()
public static string WorkingDirectory => Environment.CurrentDirectory;
public static string DatabasePath => Path.Combine(WorkingDirectory, "db");
private static string WC6DatabasePath => Path.Combine(WorkingDirectory, "wc6");
public static string WC6DatabasePath => Path.Combine(WorkingDirectory, "wc6");
private static string BackupPath => Path.Combine(WorkingDirectory, "bak");
private static string ThreadPath => @"https://projectpokemon.org/forums/showthread.php?36986";
private static string VersionPath => @"https://raw.githubusercontent.com/kwsch/PKHeX/master/PKHeX/Resources/text/version.txt";
@@ -327,6 +325,15 @@ private void mainMenuDatabase(object sender, EventArgs e)
Util.Alert("PKHeX's database was not found.",
$"Please dump all boxes from a save file, then ensure the '{DatabasePath}' folder exists.");
}
private void mainMenuMysteryDM(object sender, EventArgs e)
{
var z = Application.OpenForms.Cast<Form>().FirstOrDefault(form => form.GetType() == typeof(SAV_MysteryGiftDB)) as SAV_MysteryGiftDB;
if (z != null)
{ Util.CenterToForm(z, this); z.BringToFront(); return; }
new SAV_MysteryGiftDB(this).Show();
}
private void mainMenuUnicode(object sender, EventArgs e)
{
unicode = Menu_Unicode.Checked;
@@ -781,6 +788,8 @@ private void openSAV(byte[] input, string path)
private void loadSAV(SaveFile sav, string path)
{
PKM pk = preparePKM();
// clean fields
populateFields(SAV.BlankPKM);
SAV = sav;
if (path != null) // Actual save file
@@ -789,7 +798,7 @@ private void loadSAV(SaveFile sav, string path)
SAV.FileName = Path.GetExtension(path) == ".bak"
? Path.GetFileName(path).Split(new[] { " [" }, StringSplitOptions.None)[0]
: Path.GetFileName(path);
Text = "PKHeX - " + $"SAV{SAV.Generation}: {Path.GetFileNameWithoutExtension(Util.CleanFileName(SAV.BAKName))}"; // more descriptive
Text = $"PKH{(HaX ? "a" : "e")}X - " + $"SAV{SAV.Generation}: {Path.GetFileNameWithoutExtension(Util.CleanFileName(SAV.BAKName))}"; // more descriptive
// If backup folder exists, save a backup.
string backupName = Path.Combine(BackupPath, Util.CleanFileName(SAV.BAKName));
@@ -802,7 +811,7 @@ private void loadSAV(SaveFile sav, string path)
{
SAV.FilePath = null;
SAV.FileName = "Blank Save File";
Text = "PKHeX - " + $"SAV{SAV.Generation}: {SAV.FileName} [{SAV.OT} ({SAV.Version})]";
Text = $"PKH{(HaX ? "a" : "e")}X - " + $"SAV{SAV.Generation}: {SAV.FileName} [{SAV.OT} ({SAV.Version})]";
GB_SAVtools.Visible = false;
}
@@ -856,8 +865,7 @@ private void loadSAV(SaveFile sav, string path)
byte[] extraBytes = new byte[1];
Tip1.RemoveAll(); Tip2.RemoveAll(); Tip3.RemoveAll(); // TSV/PSV
CB_Country.Visible = CB_SubRegion.Visible = CB_3DSReg.Visible =
Label_Country.Visible = Label_SubRegion.Visible = Label_3DSRegion.Visible = SAV.Generation >= 6;
FLP_Country.Visible = FLP_SubRegion.Visible = FLP_3DSRegion.Visible = SAV.Generation >= 6;
Label_EncryptionConstant.Visible = BTN_RerollEC.Visible = TB_EC.Visible = SAV.Generation >= 6;
GB_nOT.Visible = GB_RelearnMoves.Visible = BTN_Medals.Visible = BTN_History.Visible = SAV.Generation >= 6;
PB_Legal.Visible = PB_WarnMove1.Visible = PB_WarnMove2.Visible = PB_WarnMove3.Visible = PB_WarnMove4.Visible = SAV.Generation >= 6;
@@ -865,106 +873,93 @@ private void loadSAV(SaveFile sav, string path)
PB_MarkPentagon.Visible = SAV.Generation == 6;
TB_GameSync.Visible = TB_Secure1.Visible = TB_Secure2.Visible = L_GameSync.Visible = L_Secure1.Visible = L_Secure2.Visible = SAV.Exportable && SAV.Generation == 6;
CB_Form.Visible = Label_Form.Visible = CHK_AsEgg.Visible = GB_EggConditions.Visible =
Label_MetDate.Visible = CAL_MetDate.Visible = PB_Mark5.Visible = PB_Mark6.Visible = SAV.Generation >= 4;
FLP_NSparkle.Visible = L_NSparkle.Visible = CHK_NSparkle.Visible = SAV.Generation == 5;
CB_Form.Visible = Label_Form.Visible = CHK_AsEgg.Visible = GB_EggConditions.Visible = PB_Mark5.Visible = PB_Mark6.Visible = SAV.Generation >= 4;
BTN_Ribbons.Visible = SAV.Generation >= 3;
DEV_Ability.Enabled = DEV_Ability.Visible = SAV.Generation > 3 && HaX;
TB_AbilityNumber.Visible = SAV.Generation >= 6 && DEV_Ability.Enabled;
CB_Ability.Visible = !DEV_Ability.Enabled && SAV.Generation >= 3;
FLP_Nature.Visible = SAV.Generation >= 3;
FLP_Ability.Visible = SAV.Generation >= 3;
FLP_Language.Visible = SAV.Generation >= 3;
GB_ExtraBytes.Visible = GB_ExtraBytes.Enabled = SAV.Generation >= 3;
GB_Markings.Visible = SAV.Generation >= 3;
BTN_Ribbons.Visible = SAV.Generation >= 3;
CB_HPType.Enabled = CB_Form.Enabled = SAV.Generation >= 3;
BTN_RerollPID.Visible = Label_PID.Visible = TB_PID.Visible = Label_SID.Visible = TB_SID.Visible = SAV.Generation >= 3;
GB_ExtraBytes.Visible = SAV.Generation > 2;
GB_Markings.Visible = SAV.Generation > 2;
FLP_FriendshipForm.Visible = SAV.Generation >= 2;
FLP_HeldItem.Visible = SAV.Generation >= 2;
CHK_IsEgg.Visible = Label_Gender.Visible = SAV.Generation >= 2;
FLP_PKRS.Visible = FLP_EggPKRSRight.Visible = SAV.Generation >= 2;
Label_OTGender.Visible = SAV.Generation >= 2;
Label_HeldItem.Visible = CB_HeldItem.Visible = SAV.Generation > 1;
Label_Total.Visible = TB_IVTotal.Visible = TB_EVTotal.Visible = L_Potential.Visible = SAV.Generation > 2;
Label_HiddenPowerPrefix.Visible = CB_HPType.Visible = SAV.Generation > 1;
CB_HPType.Enabled = CB_Form.Enabled = SAV.Generation > 2;
Label_CharacteristicPrefix.Visible = L_Characteristic.Visible = SAV.Generation > 2;
Label_ContestStats.Visible = Label_Cool.Visible = Label_Tough.Visible = Label_Smart.Visible =
Label_Sheen.Visible = Label_Beauty.Visible = Label_Cute.Visible = TB_Cool.Visible = TB_Tough.Visible =
TB_Smart.Visible = TB_Sheen.Visible = TB_Beauty.Visible = TB_Cute.Visible = Label_Nature.Visible =
CB_Nature.Visible = Label_Language.Visible = CB_Language.Visible = Label_Ability.Visible =
BTN_RerollPID.Visible = Label_PID.Visible = TB_PID.Visible = Label_SID.Visible = TB_SID.Visible = SAV.Generation >= 3;
if (SAV.Generation == 1)
Label_IsShiny.Visible = false;
// HaX override, needs to be after DEV_Ability enabled assignment.
TB_AbilityNumber.Visible = SAV.Generation >= 6 && DEV_Ability.Enabled;
Label_Friendship.Visible = Label_HatchCounter.Visible = TB_Friendship.Visible = SAV.Generation >= 2;
// Met Tab
CHK_Fateful.Visible = Label_OriginGame.Visible = Label_Ball.Visible =
CB_Ball.Visible = CB_GameOrigin.Visible = SAV.Generation > 2;
Label_MetLocation.Visible = CB_MetLocation.Visible = Label_MetLevel.Visible = TB_MetLevel.Visible = Label_OTGender.Visible =
SAV.Generation > 1;
FLP_MetDate.Visible = SAV.Generation >= 4;
FLP_Fateful.Visible = FLP_Ball.Visible = FLP_OriginGame.Visible = SAV.Generation >= 3;
FLP_MetLocation.Visible = FLP_MetLevel.Visible = SAV.Generation >= 2;
FLP_TimeOfDay.Visible = SAV.Generation == 2;
L_MetTimeOfDay.Visible = CB_MetTimeOfDay.Visible = SAV.Generation == 2;
// Stats
FLP_StatsTotal.Visible = SAV.Generation >= 3;
FLP_Characteristic.Visible = SAV.Generation >= 3;
FLP_HPType.Visible = SAV.Generation >= 2;
if (SAV.Generation == 2)
{
var met_list = getLocationList(SAV.Version, SAV.Generation, egg: false);
CB_MetLocation.DisplayMember = "Text";
CB_MetLocation.ValueMember = "Value";
CB_MetLocation.DataSource = new BindingSource(met_list, null);
}
CHK_Infected.Visible = CHK_Cured.Visible = SAV.Generation >= 3;
PAN_Contest.Visible = SAV.Generation >= 3;
// Second daycare slot
SlotPictureBoxes[43].Visible = SAV.Generation > 1;
CHK_IsEgg.Visible = Label_Gender.Visible = SAV.Generation > 1;
SlotPictureBoxes[43].Visible = SAV.Generation >= 2;
if (sav.Generation == 1)
{
Label_SPD.Visible = TB_SPDEV.Visible = TB_SPDIV.Visible = Stat_SPD.Visible = false;
Label_SPA.Text = "Spc:";
FLP_SpD.Visible = false;
Label_SPA.Visible = false;
Label_SPC.Visible = true;
TB_HPIV.ReadOnly = true;
MaskedTextBox[] evControls = { TB_SPAEV, TB_HPEV, TB_ATKEV, TB_DEFEV, TB_SPEEV, TB_SPDEV };
foreach (var ctrl in evControls)
{
ctrl.Mask = "00000";
ctrl.Size = new Size(37, 20);
ctrl.Size = Stat_HP.Size;
}
Control[] statControls = {Stat_HP, Stat_ATK, Stat_DEF, Stat_SPA, Stat_SPD, Stat_SPE};
foreach (Control ctrl in statControls)
ctrl.Location = new Point(173, ctrl.Location.Y);
Label_Stats.Location = new Point(168, Label_Stats.Location.Y);
}
else if (sav.Generation == 2)
{
Label_SPD.Visible = TB_SPDEV.Visible = TB_SPDIV.Visible = Stat_SPD.Visible = true;
Label_SPA.Text = "SpA:";
FLP_SpD.Visible = true;
Label_SPA.Visible = true;
Label_SPC.Visible = false;
TB_SPDEV.ReadOnly = TB_SPDIV.ReadOnly = true;
TB_HPIV.ReadOnly = true;
MaskedTextBox[] evControls = { TB_SPAEV, TB_HPEV, TB_ATKEV, TB_DEFEV, TB_SPEEV, TB_SPDEV };
foreach (var ctrl in evControls)
{
ctrl.Mask = "00000";
ctrl.Size = new Size(37, 20);
ctrl.Size = Stat_HP.Size;
}
Control[] statControls = { Stat_HP, Stat_ATK, Stat_DEF, Stat_SPA, Stat_SPD, Stat_SPE };
foreach (Control ctrl in statControls)
ctrl.Location = new Point(173, ctrl.Location.Y);
Label_Stats.Location = new Point(168, Label_Stats.Location.Y);
}
else
{
Label_SPD.Visible = TB_SPDEV.Visible = TB_SPDIV.Visible = Stat_SPD.Visible = true;
Label_SPA.Text = "SpA:";
FLP_SpD.Visible = true;
Label_SPA.Visible = true;
Label_SPC.Visible = false;
TB_SPDEV.ReadOnly = TB_SPDIV.ReadOnly = false;
TB_HPIV.ReadOnly = false;
MaskedTextBox[] evControls = { TB_SPAEV, TB_HPEV, TB_ATKEV, TB_DEFEV, TB_SPEEV, TB_SPDEV };
foreach (var ctrl in evControls)
{
ctrl.Mask = "000";
ctrl.Size = new Size(31, 20);
ctrl.Size = TB_ExtraByte.Size;
}
Control[] statControls = { Stat_HP, Stat_ATK, Stat_DEF, Stat_SPA, Stat_SPD, Stat_SPE };
foreach (Control ctrl in statControls)
ctrl.Location = new Point(167, ctrl.Location.Y);
Label_Stats.Location = new Point(162, Label_Stats.Location.Y);
}
// Recenter PKM SubEditors
FLP_PKMEditors.Location = new Point((tabMain.TabPages[4].Width - FLP_PKMEditors.Width) / 2, FLP_PKMEditors.Location.Y);
FLP_PKMEditors.Location = new Point((Tab_OTMisc.Width - FLP_PKMEditors.Width) / 2, FLP_PKMEditors.Location.Y);
switch (SAV.Generation)
{
@@ -1005,9 +1000,10 @@ private void loadSAV(SaveFile sav, string path)
break;
}
bool init = fieldsInitialized;
fieldsInitialized = false;
fieldsInitialized = fieldsLoaded = false;
pkm = (pkm.Format != SAV.Generation || SAV.Generation < 3) ? SAV.BlankPKM : pk;
populateFilteredDataSources();
populateFields((pkm.Format != SAV.Generation || SAV.Generation < 3) ? SAV.BlankPKM : pk);
populateFields(pkm);
fieldsInitialized |= init;
// SAV Specific Limits
@@ -1015,12 +1011,22 @@ private void loadSAV(SaveFile sav, string path)
TB_OTt2.MaxLength = SAV.OTLength;
TB_Nickname.MaxLength = SAV.NickLength;
// Hide Unused Tabs
if (SAV.Generation == 1 && tabMain.TabPages.Contains(Tab_Met))
tabMain.TabPages.Remove(Tab_Met);
else if (SAV.Generation != 1 && !tabMain.TabPages.Contains(Tab_Met))
{
tabMain.TabPages.Insert(1, Tab_Met);
// force update -- re-added tab may be untranslated
Util.TranslateInterface(this, curlanguage);
}
// Common HaX Interface
CHK_HackedStats.Enabled = CHK_HackedStats.Visible = MT_Level.Enabled = MT_Level.Visible = MT_Form.Enabled = MT_Form.Visible = HaX;
TB_Level.Visible = !HaX;
// Load Extra Byte List
if (GB_ExtraBytes.Visible)
if (GB_ExtraBytes.Enabled)
{
CB_ExtraBytes.Items.Clear();
foreach (byte b in extraBytes)
@@ -1048,7 +1054,7 @@ private static void refreshWC6DB()
for (int i = 0; i < wc6full.Length; i += WC6.SizeFull)
{
byte[] data = new byte[WC6.SizeFull];
Array.Copy(wc6bin, i, data, 0, WC6.SizeFull);
Array.Copy(wc6full, i, data, 0, WC6.SizeFull);
wc6db.Add(new WC6(data));
}
@@ -1072,7 +1078,7 @@ private void changeMainLanguage(object sender, EventArgs e)
InitializeLanguage();
Util.TranslateInterface(this, lang_val[CB_MainLanguage.SelectedIndex]); // Translate the UI to language.
// Recenter PKM SubEditors
FLP_PKMEditors.Location = new Point((tabMain.TabPages[4].Width - FLP_PKMEditors.Width)/2, FLP_PKMEditors.Location.Y);
FLP_PKMEditors.Location = new Point((Tab_OTMisc.Width - FLP_PKMEditors.Width)/2, FLP_PKMEditors.Location.Y);
populateFields(pk); // put data back in form
fieldsInitialized |= alreadyInit;
}
@@ -1341,9 +1347,10 @@ private void populateFilteredDataSources()
public void populateFields(PKM pk, bool focus = true)
{
if (pk == null) { Util.Error("Attempted to load a null file."); return; }
if (pk.Format > SAV.Generation)
{ Util.Alert("Can't load future generation files."); return; }
if ((pk.Format >= 3 && pk.Format > SAV.Generation) // pk3-7, can't go backwards
|| (pk.Format <= 2 && SAV.Generation > 2 && SAV.Generation < 7)) // pk1-2, can't go 3-6
{ Util.Alert($"Can't load Gen{pk.Format} to Gen{SAV.Generation} games."); return; }
bool oldInit = fieldsInitialized;
fieldsInitialized = fieldsLoaded = false;
@@ -1387,6 +1394,9 @@ public void populateFields(PKM pk, bool focus = true)
}
fieldsLoaded = true;
Label_HatchCounter.Visible = CHK_IsEgg.Checked && SAV.Generation > 1;
Label_Friendship.Visible = !CHK_IsEgg.Checked && SAV.Generation > 1;
// Set the Preview Box
dragout.Image = pk.Sprite;
updateLegality();
@@ -1418,6 +1428,9 @@ private void setForms()
CB_Form.Enabled = CB_Form.Visible = Label_Form.Visible = hasForms;
if (SAV.Generation == 2)
CB_Form.Enabled = false;
if (HaX)
Label_Form.Visible = true;
if (!hasForms)
return;
@@ -1575,32 +1588,40 @@ private void clickStatLabel(object sender, MouseEventArgs e)
if (!(ModifierKeys == Keys.Control || ModifierKeys == Keys.Alt))
return;
if (sender == Label_SPC)
sender = Label_SPA;
int index = Array.IndexOf(new[] { Label_HP, Label_ATK, Label_DEF, Label_SPA, Label_SPD, Label_SPE }, sender);
if (ModifierKeys == Keys.Alt) // EV
{
var arrayEV = new[] {TB_HPEV, TB_ATKEV, TB_DEFEV, TB_SPAEV, TB_SPDEV, TB_SPEEV};
arrayEV[index].Text = (e.Button == MouseButtons.Left
? Math.Min(Math.Max(510 - Util.ToInt32(TB_EVTotal.Text) + Util.ToInt32(arrayEV[index].Text), 0), 252)
: 0).ToString();
var mt = new[] {TB_HPEV, TB_ATKEV, TB_DEFEV, TB_SPAEV, TB_SPDEV, TB_SPEEV}[index];
if (e.Button == MouseButtons.Left) // max
mt.Text = SAV.Generation >= 3
? Math.Min(Math.Max(510 - Util.ToInt32(TB_EVTotal.Text) + Util.ToInt32(mt.Text), 0), 252).ToString()
: ushort.MaxValue.ToString();
else // min
mt.Text = 0.ToString();
}
else
new[] {TB_HPIV, TB_ATKIV, TB_DEFIV, TB_SPAIV, TB_SPDIV, TB_SPEIV}[index].Text =
(e.Button == MouseButtons.Left ? 31 : 0).ToString();
(e.Button == MouseButtons.Left ? SAV.MaxIV : 0).ToString();
}
private void clickIV(object sender, EventArgs e)
{
if (ModifierKeys == Keys.Control)
((MaskedTextBox) sender).Text = 31.ToString();
((MaskedTextBox) sender).Text = SAV.MaxIV.ToString();
else if (ModifierKeys == Keys.Alt)
((MaskedTextBox) sender).Text = 0.ToString();
}
private void clickEV(object sender, EventArgs e)
{
MaskedTextBox mt = (MaskedTextBox)sender;
if (ModifierKeys == Keys.Control) // EV
((MaskedTextBox) sender).Text = Math.Min(Math.Max(510 - Util.ToInt32(TB_EVTotal.Text) + Util.ToInt32((sender as MaskedTextBox).Text), 0), 252).ToString();
mt.Text = SAV.Generation >= 3
? Math.Min(Math.Max(510 - Util.ToInt32(TB_EVTotal.Text) + Util.ToInt32(mt.Text), 0), 252).ToString()
: ushort.MaxValue.ToString();
else if (ModifierKeys == Keys.Alt)
((MaskedTextBox) sender).Text = 0.ToString();
mt.Text = 0.ToString();
}
private void clickOT(object sender, EventArgs e)
{
@@ -2148,18 +2169,18 @@ private IEnumerable<ComboItem> getLocationList(GameVersion Version, int SaveForm
case GameVersion.D:
case GameVersion.P:
if (SaveFormat == 4 || (SaveFormat >= 5 && egg))
return metGen4.Take(4).Concat(metGen6.Skip(4).OrderByDescending(loc => loc.Value <= 111)); // Battle Park
return metGen4.Take(4).Concat(metGen4.Skip(4).OrderByDescending(loc => loc.Value <= 111)); // Battle Park
break;
case GameVersion.Pt:
if (SaveFormat == 4 || (SaveFormat >= 5 && egg))
return metGen4.Take(4).Concat(metGen6.Skip(4).OrderByDescending(loc => loc.Value <= 125)); // Rock Peak Ruins
return metGen4.Take(4).Concat(metGen4.Skip(4).OrderByDescending(loc => loc.Value <= 125)); // Rock Peak Ruins
break;
case GameVersion.HG:
case GameVersion.SS:
if (SaveFormat == 4 || (SaveFormat >= 5 && egg))
return metGen4.Take(4).Concat(metGen6.Skip(4).OrderByDescending(loc => loc.Value > 125 && loc.Value < 234)); // Celadon Dept.
return metGen4.Take(4).Concat(metGen4.Skip(4).OrderByDescending(loc => loc.Value > 125 && loc.Value < 234)); // Celadon Dept.
break;
case GameVersion.B:
@@ -2261,7 +2282,7 @@ private void updateNatureModification(object sender, EventArgs e)
Label[] labarray = { Label_ATK, Label_DEF, Label_SPE, Label_SPA, Label_SPD };
// Reset Label Colors
foreach (Label label in labarray)
label.ForeColor = defaultControlText;
label.ResetForeColor();
// Set Colored StatLabels only if Nature isn't Neutral
NatureTip.SetToolTip(CB_Nature,
@@ -2449,9 +2470,12 @@ private void validateComboBox(object sender)
cb.SelectionLength = 0;
if (cb.Text == "")
{ cb.SelectedIndex = 0; return; }
cb.BackColor = cb.SelectedValue == null ? Color.DarkSalmon : defaultControlWhite;
if (cb.SelectedValue == null)
cb.BackColor = Color.DarkSalmon;
else
cb.ResetBackColor();
}
private void validateComboBox(object sender, EventArgs e)
private void validateComboBox(object sender, System.ComponentModel.CancelEventArgs e)
{
if (!(sender is ComboBox))
return;
@@ -2465,7 +2489,7 @@ private void validateComboBox2(object sender, EventArgs e)
{
if (!fieldsInitialized)
return;
validateComboBox(sender, e);
validateComboBox(sender, null);
if (fieldsLoaded)
{
if (sender == CB_Ability && SAV.Generation >= 6)
@@ -2561,7 +2585,7 @@ private void updateStats()
Label[] labarray = { Label_ATK, Label_DEF, Label_SPE, Label_SPA, Label_SPD };
// Reset Label Colors
foreach (Label label in labarray)
label.ForeColor = defaultControlText;
label.ResetForeColor();
// Set Colored StatLabels only if Nature isn't Neutral
if (incr == decr) return;
@@ -2619,38 +2643,30 @@ public bool verifiedPKM()
if (ModifierKeys == (Keys.Control | Keys.Shift | Keys.Alt))
return true; // Override
// Make sure the PKX Fields are filled out properly (color check)
#region ComboBoxes to verify they are set.
ComboBox[] cba = {
CB_Species, CB_Nature, CB_HeldItem, CB_Ability, // Main Tab
CB_MetLocation, CB_EggLocation, CB_Ball, // Met Tab
CB_Move1, CB_Move2, CB_Move3, CB_Move4, // Moves
CB_RelearnMove1, CB_RelearnMove2, CB_RelearnMove3, CB_RelearnMove4 // Moves
};
for (int i = 0; i < cba.Length; i++)
{
int back = cba[i].BackColor.ToArgb();
if (!cba[i].Visible || back == SystemColors.Control.ToArgb() || back == 0 ||
!(back != -1 & back != defaultControlWhite.ToArgb())) continue;
if (i < 6) // Main Tab
tabMain.SelectedIndex = 0;
else if (i < 9) // Met Tab
tabMain.SelectedIndex = 1;
else // Moves
tabMain.SelectedIndex = 3;
goto invalid;
}
#endregion
// Further logic checking
if (SAV.Generation >= 3 && Convert.ToUInt32(TB_EVTotal.Text) > 510 && !CHK_HackedStats.Checked)
{ tabMain.SelectedIndex = 2; goto invalid; }
// If no errors detected...
if (Util.getIndex(CB_Species) != 0) return true;
// Else
tabMain.SelectedIndex = 0;
// else...
invalid:
{ SystemSounds.Exclamation.Play(); return false; }
ComboBox cb = cba.FirstOrDefault(c => c.BackColor == Color.DarkSalmon);
if (cb != null)
{
Control c = cb.Parent;
while (!(c is TabPage))
c = c.Parent;
tabMain.SelectedTab = c as TabPage;
}
else if (SAV.Generation >= 3 && Convert.ToUInt32(TB_EVTotal.Text) > 510 && !CHK_HackedStats.Checked)
tabMain.SelectedTab = Tab_Stats;
else if (Util.getIndex(CB_Species) == 0)
tabMain.SelectedTab = Tab_Main;
else
return true;
SystemSounds.Exclamation.Play();
return false;
}
public static string[] verifyPKMtoSAV(PKM pk)
{
@@ -2844,7 +2860,7 @@ private void clickBoxSort(object sender, EventArgs e)
return;
SAV.resetBoxes();
CB_BoxSelect.SelectedIndex = 0;
setPKXBoxes();
Util.Alert("Boxes cleared!");
}
else if (ModifierKeys == Keys.Alt)
@@ -2862,7 +2878,7 @@ private void clickBoxSort(object sender, EventArgs e)
return;
SAV.sortBoxes();
CB_BoxSelect.SelectedIndex = 0;
setPKXBoxes();
Util.Alert("Boxes sorted!");
}
else if (ModifierKeys == Keys.Control)
@@ -3378,7 +3394,7 @@ private void dumpBoxesToDB(string path, bool individualBoxFolders)
Directory.CreateDirectory(Path.Combine(path, boxfolder));
}
if (!File.Exists(Path.Combine(Path.Combine(path, boxfolder), fileName)))
File.WriteAllBytes(Path.Combine(Path.Combine(path, boxfolder), fileName), pk.Data.Take(SAV.SIZE_STORED).ToArray());
File.WriteAllBytes(Path.Combine(Path.Combine(path, boxfolder), fileName), pk.DecryptedBoxData);
}
}
private void loadBoxesFromDB(string path)
@@ -3700,7 +3716,7 @@ private void pbBoxSlot_MouseMove(object sender, MouseEventArgs e)
getQuickFiller(pb, SAV.getStoredSlot(DragInfo.slotSourceOffset));
pb.BackgroundImage = null;
if (DragInfo.slotDestinationBoxNumber == DragInfo.slotSourceBoxNumber)
if (DragInfo.slotDestinationBoxNumber == DragInfo.slotSourceBoxNumber && DragInfo.slotDestinationSlotNumber > -1)
SlotPictureBoxes[DragInfo.slotDestinationSlotNumber].Image = img;
if (result == DragDropEffects.Copy) // viewed in tabs, apply 'view' highlight

File diff suppressed because it is too large Load Diff

View File

@@ -136,6 +136,7 @@ private void populateFieldsPK5()
TB_EXP.Text = pk5.EXP.ToString();
Label_Gender.Text = gendersymbols[pk5.Gender];
Label_Gender.ForeColor = pk5.Gender == 2 ? Label_Species.ForeColor : (pk5.Gender == 1 ? Color.Red : Color.Blue);
CHK_NSparkle.Checked = pk5.NPokémon;
if (HaX)
DEV_Ability.SelectedValue = pk5.Ability;
@@ -240,6 +241,8 @@ private PKM preparePK5()
pk5.Version = Util.getIndex(CB_GameOrigin);
pk5.Language = Util.getIndex(CB_Language);
pk5.NPokémon = CHK_NSparkle.Checked;
// Toss in Party Stats
Array.Resize(ref pk5.Data, pk5.SIZE_PARTY);
pk5.Stat_Level = Util.ToInt32(TB_Level.Text);

View File

@@ -42,8 +42,10 @@ internal static MysteryGift getMysteryGift(byte[] data)
}
public abstract string Extension { get; }
public string FileName => getCardHeader() + "." + Extension;
public virtual byte[] Data { get; set; }
public abstract PKM convertToPKM(SaveFile SAV);
public abstract int Format { get; }
public MysteryGift Clone()
{
@@ -64,6 +66,18 @@ public MysteryGift Clone()
public virtual int Quantity { get { return 1; } set { } }
public bool Empty => Data.SequenceEqual(new byte[Data.Length]);
public string getCardHeader() => (CardID > 0 ? $"Card #: {CardID.ToString("0000")}" : "N/A") + $" - {CardTitle.Replace('\u3000',' ').Trim()}" + Environment.NewLine;
public string getCardHeader() => (CardID > 0 ? $"Card #: {CardID.ToString("0000")}" : "N/A") + $" - {CardTitle.Replace('\u3000',' ').Trim()}";
// Search Properties
public virtual int Species { get { return -1; } set { } }
public virtual int[] Moves => new int[0];
public virtual bool IsShiny => false;
public virtual bool IsEgg { get { return false; } set { } }
public virtual int HeldItem { get { return -1; } set { } }
public bool Gen7 => Format == 7;
public bool Gen6 => Format == 6;
public bool Gen5 => Format == 5;
public bool Gen4 => Format == 4;
public bool Gen3 => Format == 3;
}
}

View File

@@ -6,7 +6,8 @@ namespace PKHeX
public sealed class PGF : MysteryGift
{
internal const int Size = 0xCC;
public override string Extension => ".pgf";
public override string Extension => "pgf";
public override int Format => 5;
public PGF(byte[] data = null)
{
@@ -41,12 +42,13 @@ public PGF(byte[] data = null)
public bool RIB1_7 { get { return (RIB1 & (1 << 7)) == 1 << 7; } set { RIB1 = (byte)(RIB1 & ~(1 << 7) | (value ? 1 << 7 : 0)); } } // Empty
public int Pokéball { get { return Data[0x0E]; } set { Data[0x0E] = (byte)value; } }
public int HeldItem { get { return BitConverter.ToUInt16(Data, 0x10); } set { BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x10); } }
public override int HeldItem { get { return BitConverter.ToUInt16(Data, 0x10); } set { BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x10); } }
public int Move1 { get { return BitConverter.ToUInt16(Data, 0x12); } set { BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x12); } }
public int Move2 { get { return BitConverter.ToUInt16(Data, 0x14); } set { BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x14); } }
public int Move3 { get { return BitConverter.ToUInt16(Data, 0x16); } set { BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x16); } }
public int Move4 { get { return BitConverter.ToUInt16(Data, 0x18); } set { BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x18); } }
public int Species { get { return BitConverter.ToUInt16(Data, 0x1A); } set { BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x1A); } }
public override int Species { get { return BitConverter.ToUInt16(Data, 0x1A); }
}
public int Form { get { return Data[0x1C]; } set { Data[0x1C] = (byte)value; } }
public int Language { get { return Data[0x1D]; } set { Data[0x1D] = (byte)value; } }
public string Nickname
@@ -79,7 +81,7 @@ public string Nickname
set { Encoding.Unicode.GetBytes(value.PadRight(0x08, (char)0xFFFF)).CopyTo(Data, 0x4A); } }
public int OTGender { get { return Data[0x5A]; } set { Data[0x5A] = (byte)value; } }
public int Level { get { return Data[0x5B]; } set { Data[0x5C] = (byte)value; } }
public bool IsEgg { get { return Data[0x5C] == 1; } set { Data[0x5C] = (byte)(value ? 1 : 0); } }
public override bool IsEgg { get { return Data[0x5C] == 1; } set { Data[0x5C] = (byte)(value ? 1 : 0); } }
// Unused 0x5D 0x5E 0x5F
public override string CardTitle
{
@@ -142,16 +144,9 @@ public override int CardID
public int[] IVs => new[] { IV_HP, IV_ATK, IV_DEF, IV_SPE, IV_SPA, IV_SPD };
public bool IsNicknamed => Nickname.Length > 0;
public int[] Moves
public override int[] Moves
{
get { return new[] { Move1, Move2, Move3, Move4 }; }
set
{
if (value.Length > 0) Move1 = value[0];
if (value.Length > 1) Move2 = value[1];
if (value.Length > 2) Move3 = value[2];
if (value.Length > 3) Move4 = value[3];
}
}
public override bool IsPokémon { get { return CardType == 1; } set { if (value) CardType = 1; } }
public override bool IsItem { get { return CardType == 2; } set { if (value) CardType = 2; } }

View File

@@ -11,7 +11,8 @@ namespace PKHeX
public sealed class PCD : MysteryGift
{
internal const int Size = 0x358; // 856
public override string Extension => ".pcd";
public override string Extension => "pcd";
public override int Format => 4;
public PCD(byte[] data = null)
{
@@ -50,6 +51,12 @@ public override string CardTitle
}
}
public override int Species => Gift.PK.Species;
public override int[] Moves => Gift.PK.Moves;
public override bool IsShiny => Gift.PK.IsShiny;
public override bool IsEgg => Gift.PK.IsEgg;
public override int HeldItem => Gift.PK.HeldItem;
public override PKM convertToPKM(SaveFile SAV)
{
return Gift.convertToPKM(SAV);
@@ -58,7 +65,8 @@ public override PKM convertToPKM(SaveFile SAV)
public class PGT : MysteryGift
{
internal const int Size = 0x104; // 260
public override string Extension => ".pgt";
public override string Extension => "pgt";
public override int Format => 4;
private enum GiftType
{
@@ -103,7 +111,7 @@ private void refreshData(byte[] data)
public byte Slot { get { return Data[2]; } set { Data[2] = value; } }
public byte Detail { get { return Data[3]; } set { Data[3] = value; } }
public override int Item { get { return BitConverter.ToUInt16(Data, 0x4); } set { BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x4); } }
private PK4 PK;
public PK4 PK;
private byte[] Unknown;
private byte[] RAW;
@@ -118,11 +126,16 @@ public override byte[] Data
private GiftType PGTGiftType { get { return (GiftType)Data[0]; } set {Data[0] = (byte)value; } }
public bool IsHatched => PGTGiftType == GiftType.Pokémon;
public bool IsEgg => PGTGiftType == GiftType.PokémonEgg;
public override bool IsEgg => PGTGiftType == GiftType.PokémonEgg;
public bool IsManaphyEgg => PGTGiftType == GiftType.ManaphyEgg;
public override bool IsItem { get { return PGTGiftType == GiftType.Item; } set { if (value) CardType = (int)GiftType.Item; } }
public override bool IsPokémon { get { return PGTGiftType == GiftType.Pokémon || PGTGiftType == GiftType.PokémonEgg || PGTGiftType == GiftType.ManaphyEgg; } set { } }
public override int Species => PK.Species;
public override int[] Moves => PK.Moves;
public override bool IsShiny => PK.IsShiny;
public override int HeldItem => PK.HeldItem;
public override PKM convertToPKM(SaveFile SAV)
{
if (!IsPokémon)

View File

@@ -9,7 +9,8 @@ public sealed class WC6 : MysteryGift
internal const int Size = 0x108;
internal const int SizeFull = 0x310;
internal const uint EonTicketConst = 0x225D73C2;
public override string Extension => ".wc6";
public override string Extension => "wc6";
public override int Format => 6;
public WC6(byte[] data = null)
{
@@ -94,6 +95,7 @@ public WC6(byte[] data = null)
// Pokémon Properties
public override bool IsPokémon { get { return CardType == 0; } set { if (value) CardType = 0; } }
public override bool IsShiny { get { return PIDType == 2; } }
public int TID {
get { return BitConverter.ToUInt16(Data, 0x68); }
set { BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x68); } }
@@ -109,7 +111,7 @@ public WC6(byte[] data = null)
public int Pokéball {
get { return Data[0x76]; }
set { Data[0x76] = (byte)value; } }
public int HeldItem {
public override int HeldItem {
get { return BitConverter.ToUInt16(Data, 0x78); }
set { BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x78); } }
public int Move1 {
@@ -124,7 +126,7 @@ public WC6(byte[] data = null)
public int Move4 {
get { return BitConverter.ToUInt16(Data, 0x80); }
set { BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x80); } }
public int Species {
public override int Species {
get { return BitConverter.ToUInt16(Data, 0x82); }
set { BitConverter.GetBytes((ushort)value).CopyTo(Data, 0x82); } }
public int Form {
@@ -174,7 +176,7 @@ public WC6(byte[] data = null)
get { return Util.TrimFromZero(Encoding.Unicode.GetString(Data, 0xB6, 0x1A)); }
set { Encoding.Unicode.GetBytes(value.PadRight(value.Length + 1, '\0')).CopyTo(Data, 0xB6); } }
public int Level { get { return Data[0xD0]; } set { Data[0xD0] = (byte)value; } }
public bool IsEgg { get { return Data[0xD1] == 1; } set { Data[0xD1] = (byte)(value ? 1 : 0); } }
public override bool IsEgg { get { return Data[0xD1] == 1; } set { Data[0xD1] = (byte)(value ? 1 : 0); } }
public uint PID {
get { return BitConverter.ToUInt32(Data, 0xD4); }
set { BitConverter.GetBytes(value).CopyTo(Data, 0xD4); } }
@@ -218,16 +220,9 @@ public WC6(byte[] data = null)
public int[] IVs => new[] { IV_HP, IV_ATK, IV_DEF, IV_SPE, IV_SPA, IV_SPD };
public bool IsNicknamed => Nickname.Length > 0;
public int[] Moves
public override int[] Moves
{
get { return new[] {Move1, Move2, Move3, Move4}; }
set
{
if (value.Length > 0) Move1 = value[0];
if (value.Length > 1) Move2 = value[1];
if (value.Length > 2) Move3 = value[2];
if (value.Length > 3) Move4 = value[3];
}
}
public int[] RelearnMoves
{

View File

@@ -70,6 +70,8 @@
<Compile Include="Legality\Checks.cs" />
<Compile Include="Legality\Core.cs" />
<Compile Include="Legality\Data.cs" />
<Compile Include="Legality\Tables2.cs" />
<Compile Include="Legality\Tables1.cs" />
<Compile Include="Legality\Tables3.cs" />
<Compile Include="Legality\Tables5.cs" />
<Compile Include="Legality\Tables4.cs" />
@@ -213,6 +215,12 @@
<Compile Include="Subforms\Save Editors\SAV_SimplePokedex.Designer.cs">
<DependentUpon>SAV_SimplePokedex.cs</DependentUpon>
</Compile>
<Compile Include="Subforms\SAV_MysteryGiftDB.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Subforms\SAV_MysteryGiftDB.Designer.cs">
<DependentUpon>SAV_MysteryGiftDB.cs</DependentUpon>
</Compile>
<Compile Include="Subforms\SAV_Database.cs">
<SubType>Form</SubType>
</Compile>
@@ -370,6 +378,9 @@
<EmbeddedResource Include="Subforms\Save Editors\SAV_SimplePokedex.resx">
<DependentUpon>SAV_SimplePokedex.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Subforms\SAV_MysteryGiftDB.resx">
<DependentUpon>SAV_MysteryGiftDB.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Subforms\SAV_Database.resx">
<DependentUpon>SAV_Database.cs</DependentUpon>
</EmbeddedResource>
@@ -2756,6 +2767,7 @@
<None Include="Resources\text\gen3\text_ItemsG1_en.txt" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\img\Program\gift.png" />
<Content Include="Resources\text\gen3\text_ItemsG2_en.txt" />
<None Include="Resources\img\Pokemon Sprites\172_1.png" />
</ItemGroup>

View File

@@ -120,8 +120,8 @@ public override int Species
get { return PKX.getG1Species(Data[0]); }
set
{
// Before updating catch rate, check if Special Yellow Version Pikachu
if (!(PKX.getG1Species(Data[0]) == 25 && value == 25 && Catch_Rate == 163))
// Before updating catch rate, check if non-standard
if (Catch_Rate == PersonalTable.RBY[Species].CatchRate)
Catch_Rate = PersonalTable.RBY[value].CatchRate;
Data[0] = (byte)PKX.setG1Species(value);
Type_A = PersonalTable.RBY[value].Types[0];
@@ -250,6 +250,46 @@ public override bool CanHoldItem(ushort[] ValidArray)
public override int CNT_Tough { get { return 0; } set { } }
public override int CNT_Sheen { get { return 0; } set { } }
#endregion
public PK2 convertToPK2()
{
PK2 pk2 = new PK2(null, Identifier, Japanese);
pk2.Species = Species;
Array.Copy(Data, 0x7, pk2.Data, 0x1, 0x1A);
// https://github.com/pret/pokecrystal/blob/master/engine/link.asm#L1132
if (!Legal.HeldItems_GSC.Contains((ushort)pk2.HeldItem))
switch (pk2.HeldItem)
{
case 0x19:
pk2.HeldItem = 0x92; // Leftovers
break;
case 0x2D:
pk2.HeldItem = 0x53; // Bitter Berry
break;
case 0x32:
pk2.HeldItem = 0xAE; // Leftovers
break;
case 0x5A:
case 0x64:
case 0x78:
case 0x87:
case 0xBE:
case 0xC3:
case 0xDC:
case 0xFA:
case 0xFF:
pk2.HeldItem = 0xAD; // Berry
break;
}
pk2.CurrentFriendship = PersonalTable.C[Species].BaseFriendship;
// Pokerus = 0
// Caught Data = 0
pk2.Stat_Level = PKX.getLevel(Species, EXP);
Array.Copy(otname, 0, pk2.otname, 0, otname.Length);
Array.Copy(nick, 0, pk2.nick, 0, nick.Length);
return pk2;
}
}
public class PokemonList1

View File

@@ -215,18 +215,18 @@ public override bool getGenderIsValid()
if (gv == 255)
return Gender == 2;
if (gv == 254)
return Gender == 0;
if (gv == 0)
return Gender == 1;
if (gv == 0)
return Gender == 0;
switch (gv)
{
case 191:
return IV_ATK >= 2 ? Gender == 0 : Gender == 1;
case 127:
return IV_ATK >= 5 ? Gender == 0 : Gender == 1;
case 63:
return IV_ATK >= 7 ? Gender == 0 : Gender == 1;
case 31:
return IV_ATK >= 2 ? Gender == 0 : Gender == 1;
case 63:
return IV_ATK >= 5 ? Gender == 0 : Gender == 1;
case 127:
return IV_ATK >= 7 ? Gender == 0 : Gender == 1;
case 191:
return IV_ATK >= 12 ? Gender == 0 : Gender == 1;
}
return false;
@@ -242,18 +242,18 @@ public override int Gender
if (gv == 255)
return 2;
if (gv == 254)
return 0;
if (gv == 0)
return 1;
if (gv == 0)
return 0;
switch (gv)
{
case 191:
return IV_ATK >= 2 ? 0 : 1;
case 127:
return IV_ATK >= 5 ? 0 : 1;
case 63:
return IV_ATK >= 7 ? 0 : 1;
case 31:
return IV_ATK >= 2 ? 0 : 1;
case 63:
return IV_ATK >= 5 ? 0 : 1;
case 127:
return IV_ATK >= 7 ? 0 : 1;
case 191:
return IV_ATK >= 12 ? 0 : 1;
}
Console.WriteLine("Unknown Gender value: " + gv);
@@ -325,6 +325,27 @@ public override int HPType
public override int CNT_Tough { get { return 0; } set { } }
public override int CNT_Sheen { get { return 0; } set { } }
#endregion
public PK1 convertToPK1()
{
PK1 pk1 = new PK1(null, Identifier, Japanese);
Array.Copy(Data, 0x1, pk1.Data, 0x7, 0x1A);
pk1.Species = Species; // This will take care of Typing :)
pk1.Stat_HPCurrent = Stat_HPCurrent;
pk1.Stat_Level = Stat_Level;
// Status = 0
Array.Copy(otname, 0, pk1.otname, 0, otname.Length);
Array.Copy(nick, 0, pk1.nick, 0, nick.Length);
int[] newMoves = pk1.Moves;
for (int i = 0; i < 4; i++)
if (newMoves[i] > 165) // not present in Gen 1
newMoves[i] = 0;
pk1.Moves = newMoves;
pk1.FixMoves();
return pk1;
}
}
public class PokemonList2

View File

@@ -81,7 +81,7 @@ public PK4(byte[] decryptedData = null, string ident = null)
public bool RibbonRecord { get { return (RIB2 & (1 << 2)) == 1 << 2; } set { RIB2 = (byte)(RIB2 & ~(1 << 2) | (value ? 1 << 2 : 0)); } }
public bool RibbonEvent { get { return (RIB2 & (1 << 3)) == 1 << 3; } set { RIB2 = (byte)(RIB2 & ~(1 << 3) | (value ? 1 << 3 : 0)); } }
public bool RibbonLegend { get { return (RIB2 & (1 << 4)) == 1 << 4; } set { RIB2 = (byte)(RIB2 & ~(1 << 4) | (value ? 1 << 4 : 0)); } }
public bool RibbonWorldChampion { get { return (RIB2 & (1 << 5)) == 1 << 5; } set { RIB2 = (byte)(RIB2 & ~(1 << 5) | (value ? 1 << 5 : 0)); } }
public bool RibbonChampionWorld { get { return (RIB2 & (1 << 5)) == 1 << 5; } set { RIB2 = (byte)(RIB2 & ~(1 << 5) | (value ? 1 << 5 : 0)); } }
public bool RibbonBirthday { get { return (RIB2 & (1 << 6)) == 1 << 6; } set { RIB2 = (byte)(RIB2 & ~(1 << 6) | (value ? 1 << 6 : 0)); } }
public bool RibbonSpecial { get { return (RIB2 & (1 << 7)) == 1 << 7; } set { RIB2 = (byte)(RIB2 & ~(1 << 7) | (value ? 1 << 7 : 0)); } }
public bool RibbonSouvenir { get { return (RIB3 & (1 << 0)) == 1 << 0; } set { RIB3 = (byte)(RIB3 & ~(1 << 0) | (value ? 1 << 0 : 0)); } }
@@ -323,19 +323,26 @@ public override int Met_Location
public override int PKRS_Strain { get { return PKRS >> 4; } set { PKRS = (byte)(PKRS & 0xF | (value << 4)); } }
public override int Ball
{
get { return Data[HGSS ? 0x86 : 0x83]; }
get
{
// Pokemon obtained in HGSS have the HGSS ball set (@0x86)
// However, this info is not set when receiving a wondercard!
// The PGT contains a preformatted PK4 file, which is slightly modified.
// No HGSS balls were used, and no HGSS ball info is set.
// Sneaky way = return the higher of the two values.
return Math.Max(Data[0x86], Data[0x83]);
}
set
{
if (HGSS)
{
Data[0x83] = (byte)(value <= 0x10 ? value : 4); // Ball to display in DP (cap at Cherish)
// Ball to display in DPPt
Data[0x83] = (byte)(value <= 0x10 ? value : 4); // Cap at Cherish Ball
// HGSS Exclusive Balls -- If the user wants to screw things up, let them. Any legality checking could catch hax.
if (value > 0x10 || (HGSS && !FatefulEncounter))
Data[0x86] = (byte)(value <= 0x18 ? value : 4); // Cap at Comp Ball
}
else
{
Data[0x83] = (byte)(value <= 0x10 ? value : 4); // Cap at Cherish Ball
Data[0x86] = 0; // Unused
}
}
}
public override int Met_Level { get { return Data[0x84] & ~0x80; } set { Data[0x84] = (byte)((Data[0x84] & 0x80) | value); } }

View File

@@ -447,6 +447,8 @@ private int getBasePP(int move)
int[] pptable;
switch (Format)
{
case 1: pptable = Legal.MovePP_RBY; break;
case 2: pptable = Legal.MovePP_GSC; break;
case 3: pptable = Legal.MovePP_RS; break;
case 4: pptable = Legal.MovePP_DP; break;
case 5: pptable = Legal.MovePP_BW; break;

View File

@@ -100,16 +100,36 @@ public static PKM getPKMfromBytes(byte[] data, string ident = null)
}
internal static PKM convertToFormat(PKM pk, int Format, out string comment)
{
if (pk == null)
if (pk == null || pk.Species == 0)
{
comment = "Null input. Aborting.";
return null;
}
string currentFormat = pk.Format.ToString();
PKM pkm = pk.Clone();
if (pk.Format == Format)
{
comment = "No need to convert, current format matches requested format.";
return pk;
}
if (pk.Format <= 2 && Format <= 2) // 1<->2, already checked not equal
{
switch (Format)
{
case 1:
if (pk.Species > 151)
{ comment = $"Cannot convert a {PKX.getSpeciesName(pk.Species, ((PK2)pk).Japanese ? 1 : 2)} to pk{Format}"; return null; }
pkm = ((PK2)pk).convertToPK1();
break;
case 2:
pkm = ((PK1)pk).convertToPK2();
break;
}
comment = $"Converted from pk{pk.Format} to pk{Format}";
return pkm;
}
if (pk.Format > Format)
{
comment = "Cannot convert a PKM backwards." + Environment.NewLine
@@ -128,8 +148,6 @@ internal static PKM convertToFormat(PKM pk, int Format, out string comment)
+ "Please wait for Sun/Moon to release and documentation to occur.";
return null;
}
string currentFormat = pk.Format.ToString();
PKM pkm = pk.Clone();
if (pkm.IsEgg) // force hatch
{
pkm.IsEgg = false;

View File

@@ -43,7 +43,15 @@ public static class PKX
/// <returns>A boolean indicating whether or not the length is valid for a Pokemon file.</returns>
public static bool getIsPKM(long len)
{
return new[] {SIZE_1JLIST, SIZE_1ULIST, SIZE_2ULIST, SIZE_2JLIST, SIZE_3STORED, SIZE_3PARTY, SIZE_4STORED, SIZE_4PARTY, SIZE_5PARTY, SIZE_6STORED, SIZE_6PARTY}.Contains((int)len);
return new[]
{
SIZE_1JLIST, SIZE_1ULIST,
SIZE_2ULIST, SIZE_2JLIST,
SIZE_3STORED, SIZE_3PARTY,
SIZE_4STORED, SIZE_4PARTY,
SIZE_5PARTY,
SIZE_6STORED, SIZE_6PARTY
}.Contains((int)len);
}
// C# PKX Function Library
@@ -2148,18 +2156,6 @@ public static ushort getG4Item(ushort g3val)
};
#endregion
public static int[] getG1LegalItems()
{
return Enumerable.Range(0, 7) // 0-6
.Concat(Enumerable.Range(10, 11)) // 10-20
.Concat(Enumerable.Range(29, 15)) // 29-43
.Concat(Enumerable.Range(45, 5)) // 45-49
.Concat(Enumerable.Range(51, 8)) // 51-58
.Concat(Enumerable.Range(60, 24)) // 60-83
.Concat(Enumerable.Range(196, 54)) // 196-249
.ToArray();
}
public static int getG1Species(int raw_id)
{
int[] table = { 0x00, 0x70, 0x73, 0x20, 0x23, 0x15, 0x64, 0x22, 0x50, 0x02, 0x67, 0x6C, 0x66, 0x58, 0x5E, 0x1D, 0x1F, 0x68, 0x6F, 0x83, 0x3B, 0x97, 0x82, 0x5A, 0x48, 0x5C, 0x7B, 0x78, 0x09, 0x7F, 0x72, 0x00, 0x00, 0x3A, 0x5F, 0x16, 0x10, 0x4F, 0x40, 0x4B, 0x71, 0x43, 0x7A, 0x6A, 0x6B, 0x18, 0x2F, 0x36, 0x60, 0x4C, 0x00, 0x7E, 0x00, 0x7D, 0x52, 0x6D, 0x00, 0x38, 0x56, 0x32, 0x80, 0x00, 0x00, 0x00, 0x53, 0x30, 0x95, 0x00, 0x00, 0x00, 0x54, 0x3C, 0x7C, 0x92, 0x90, 0x91, 0x84, 0x34, 0x62, 0x00, 0x00, 0x00, 0x25, 0x26, 0x19, 0x1A, 0x00, 0x00, 0x93, 0x94, 0x8C, 0x8D, 0x74, 0x75, 0x00, 0x00, 0x1B, 0x1C, 0x8A, 0x8B, 0x27, 0x28, 0x85, 0x88, 0x87, 0x86, 0x42, 0x29, 0x17, 0x2E, 0x3D, 0x3E, 0x0D, 0x0E, 0x0F, 0x00, 0x55, 0x39, 0x33, 0x31, 0x57, 0x00, 0x00, 0x0A, 0x0B, 0x0C, 0x44, 0x00, 0x37, 0x61, 0x2A, 0x96, 0x8F, 0x81, 0x00, 0x00, 0x59, 0x00, 0x63, 0x5B, 0x00, 0x65, 0x24, 0x6E, 0x35, 0x69, 0x00, 0x5D, 0x3F, 0x41, 0x11, 0x12, 0x79, 0x01, 0x03, 0x49, 0x00, 0x76, 0x77, 0x00, 0x00, 0x00, 0x00, 0x4D, 0x4E, 0x13, 0x14, 0x21, 0x1E, 0x4A, 0x89, 0x8E, 0x00, 0x51, 0x00, 0x00, 0x04, 0x07, 0x05, 0x08, 0x06, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x2C, 0x2D, 0x45, 0x46, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };

View File

@@ -31,7 +31,7 @@ public class ShowdownSet
public int[] EVs;
public int[] IVs;
public int[] Moves;
public List<string> InvalidLines = new List<string>();
public readonly List<string> InvalidLines = new List<string>();
// Parsing Utility
public ShowdownSet(string input = null)
@@ -120,7 +120,10 @@ public ShowdownSet(string input = null)
{
string type = moveString.Remove(0, 13).Replace("[", "").Replace("]", ""); // Trim out excess data
int hpVal = Array.IndexOf(hptypes, type); // Get HP Type
if (hpVal >= 0) IVs = PKX.setHPIVs(hpVal, IVs); // Get IVs
if (hpVal >= 0)
IVs = PKX.setHPIVs(hpVal, IVs); // Get IVs
else
InvalidLines.Add($"Invalid Hidden Power Type: {type}");
}
moveString = "Hidden Power";
}
@@ -142,17 +145,41 @@ public ShowdownSet(string input = null)
case "EVs":
{
// Get EV list String
string[] evlist = brokenline[1].Replace("SAtk", "SpA").Replace("SDef", "SpD").Replace("Spd", "Spe").Split(new[] { " / ", " " }, StringSplitOptions.None);
for (int i = 0; i < evlist.Length / 2; i++)
EVs[Array.IndexOf(StatNames, evlist[1 + i * 2])] = (byte)Util.ToInt32(evlist[0 + 2 * i]);
string[] evlist = brokenline[1]
// Because people think they can type sets out...
.Replace("SAtk", "SpA").Replace("Sp Atk", "SpA")
.Replace("SDef", "SpD").Replace("Sp Def", "SpD")
.Replace("Spd", "Spe").Replace("Speed", "Spe").Split(new[] { " / ", " " }, StringSplitOptions.None);
for (int i = 0; i < evlist.Length/2; i++)
{
ushort EV;
ushort.TryParse(evlist[i * 2 + 0], out EV);
int index = Array.IndexOf(StatNames, evlist[i*2 + 1]);
if (index > -1)
EVs[index] = EV;
else
InvalidLines.Add($"Unknown EV Type input: {evlist[i*2]}");
}
break;
}
case "IVs":
{
// Get IV list String
string[] ivlist = brokenline[1].Split(new[] { " / ", " " }, StringSplitOptions.None);
for (int i = 0; i < ivlist.Length / 2; i++)
IVs[Array.IndexOf(StatNames, ivlist[1 + i * 2])] = (byte)Util.ToInt32(ivlist[0 + 2 * i]);
string[] ivlist = brokenline[1]
// Because people think they can type sets out...
.Replace("SAtk", "SpA").Replace("Sp Atk", "SpA")
.Replace("SDef", "SpD").Replace("Sp Def", "SpD")
.Replace("Spd", "Spe").Replace("Speed", "Spe").Split(new[] { " / ", " " }, StringSplitOptions.None);
for (int i = 0; i < ivlist.Length/2; i++)
{
byte IV;
byte.TryParse(ivlist[i*2 + 0], out IV);
int index = Array.IndexOf(StatNames, ivlist[i*2 + 1]);
if (index > -1)
IVs[index] = IV;
else
InvalidLines.Add($"Unknown EV Type input: {ivlist[i * 2]}");
}
break;
}
default:

View File

@@ -10982,6 +10982,16 @@ internal class Resources {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap gift {
get {
object obj = ResourceManager.GetObject("gift", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>

View File

@@ -6415,4 +6415,7 @@
<data name="_172_1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\img\Pokemon Sprites\172_1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="gift" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\img\Program\gift.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 617 B

View File

@@ -5,7 +5,7 @@ namespace PKHeX
{
public sealed class SAV1 : SaveFile
{
public override string BAKName => $"{FileName} [{OT} ({Version})" +/* - {LastSavedTime}*/ "].bak";
public override string BAKName => $"{FileName} [{OT} ({Version}) - {PlayTimeString}].bak";
public override string Filter => "SAV File|*.sav";
public override string Extension => ".sav";
@@ -167,13 +167,14 @@ public override byte[] Write(bool DSV)
public override int MaxItemID => 255;
public override int MaxBallID => 0;
public override int MaxGameID => 99; // What do I set this to...?
public override int MaxMoney => 999999;
public override int BoxCount => Japanese ? 8 : 12;
public override int MaxEV => 65535;
public override int MaxIV => 15;
public override int Generation => 1;
protected override int GiftCountMax => 0;
public override int OTLength => Japanese ? 5 : 10;
public override int OTLength => Japanese ? 5 : 7;
public override int NickLength => Japanese ? 5 : 10;
public override int BoxSlotCount => Japanese ? 30 : 20;
@@ -327,7 +328,7 @@ public uint Coin
}
}
private readonly ushort[] LegalItems = PKX.getG1LegalItems().Select(i => (ushort)i).ToArray();
private readonly ushort[] LegalItems = Legal.Pouch_Items_RBY;
public override InventoryPouch[] Inventory
{
get

View File

@@ -5,7 +5,7 @@ namespace PKHeX
{
public sealed class SAV2 : SaveFile
{
public override string BAKName => $"{FileName} [{OT} ({Version})" +/* - {LastSavedTime}*/ "].bak";
public override string BAKName => $"{FileName} [{OT} ({Version}) - {PlayTimeString}].bak";
public override string Filter => "SAV File|*.sav";
public override string Extension => ".sav";
@@ -31,16 +31,11 @@ public SAV2(byte[] data = null)
getSAVOffsets();
LegalItems = new ushort[] { 3, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 46, 47, 48, 49, 51, 52, 53, 57, 60, 62, 63, 64, 65, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 91, 92, 93, 94, 95, 96, 97, 98, 99, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 117, 118, 119, 121, 122, 123, 124, 125, 126, 131, 132, 138, 139, 140, 143, 144, 146, 150, 151, 152, 156, 158, 163, 168, 169, 170, 172, 173, 174, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189 };
LegalBalls = new ushort[] { 1, 2, 4, 5, 157, 159, 160, 161, 164, 165, 166, 167};
LegalKeyItems = new ushort[] {7, 54, 55, 58, 59, 61, 66, 67, 68 , 69, 71, 127, 128, 130, 133, 134, 175, 178};
if (Version == GameVersion.C)
{
LegalKeyItems = LegalKeyItems.Concat(new ushort[] {70, 115, 116, 129}).ToArray();
}
LegalTMHMs = new ushort[] {191, 192, 193, 194, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 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};
HeldItems = new ushort[] {0}.Concat(LegalItems).Concat(LegalBalls).ToArray();
Array.Sort(HeldItems);
LegalItems = Legal.Pouch_Items_GSC;
LegalBalls = Legal.Pouch_Ball_GSC;
LegalKeyItems = Version == GameVersion.C ? Legal.Pouch_Key_C : Legal.Pouch_Key_GS;
LegalTMHMs = Legal.Pouch_TMHM_GSC;
HeldItems = Legal.HeldItems_GSC;
// Stash boxes after the save file's end.
byte[] TempBox = new byte[SIZE_STOREDBOX];
@@ -221,6 +216,7 @@ private void getSAVOffsets()
public override int MaxItemID => 255;
public override int MaxBallID => 0;
public override int MaxGameID => 99; // What do I set this to...?
public override int MaxMoney => 999999;
public override int BoxCount => Japanese ? 9 : 14;
public override int MaxEV => 65535;

View File

@@ -5,7 +5,7 @@ namespace PKHeX
{
public sealed class SAV3 : SaveFile
{
public override string BAKName => $"{FileName} [{OT} ({Version})" +/* - {LastSavedTime}*/ "].bak";
public override string BAKName => $"{FileName} [{OT} ({Version}) - {PlayTimeString}].bak";
public override string Filter => "SAV File|*.sav";
public override string Extension => ".sav";
@@ -172,6 +172,7 @@ public override byte[] Write(bool DSV)
protected override int GiftCountMax => 1;
public override int OTLength => 8;
public override int NickLength => 10;
public override int MaxMoney => 999999;
public override bool HasParty => true;

View File

@@ -5,7 +5,7 @@ namespace PKHeX
{
public sealed class SAV4 : SaveFile
{
public override string BAKName => $"{FileName} [{OT} ({Version})" +/* - {LastSavedTime}*/ "].bak";
public override string BAKName => $"{FileName} [{OT} ({Version}) - {PlayTimeString}].bak";
public override string Filter => (Footer.Length > 0 ? "DeSmuME DSV|*.dsv|" : "") + "SAV File|*.sav";
public override string Extension => ".sav";
public SAV4(byte[] data = null, GameVersion versionOverride = GameVersion.Any)
@@ -53,6 +53,7 @@ public SAV4(byte[] data = null, GameVersion versionOverride = GameVersion.Any)
protected override int GiftCountMax => 11;
public override int OTLength => 8;
public override int NickLength => 10;
public override int MaxMoney => 999999;
public override int MaxMoveID => 467;
public override int MaxSpeciesID => 493;

View File

@@ -7,7 +7,7 @@ namespace PKHeX
public sealed class SAV5 : SaveFile
{
// Save Data Attributes
public override string BAKName => $"{FileName} [{OT} ({(GameVersion)Game})" +/* - {LastSavedTime}*/ "].bak";
public override string BAKName => $"{FileName} [{OT} ({(GameVersion)Game}) - {PlayTimeString}].bak";
public override string Filter => (Footer.Length > 0 ? "DeSmuME DSV|*.dsv|" : "") + "SAV File|*.sav";
public override string Extension => ".sav";
public SAV5(byte[] data = null, GameVersion versionOverride = GameVersion.Any)

View File

@@ -20,6 +20,7 @@ public abstract class SaveFile
public abstract string Filter { get; }
public byte[] Footer { protected get; set; } = new byte[0]; // .dsv
public bool Japanese { protected get; set; }
public string PlayTimeString => $"{PlayedHours}ː{PlayedMinutes.ToString("00")}ː{PlayedSeconds.ToString("00")}"; // not :
public bool GetJapanese => Japanese;
@@ -104,6 +105,7 @@ public virtual byte[] Write(bool DSV)
public virtual int DaycareSeedSize { get; } = 0;
public abstract int OTLength { get; }
public abstract int NickLength { get; }
public virtual int MaxMoney { get; } = 9999999;
// Offsets
protected int Box { get; set; } = int.MinValue;
@@ -465,7 +467,7 @@ public bool setPCBin(byte[] data)
PKM[] pkms = BoxData;
for (int i = 0; i < pkms.Length; i++)
pkms[i].Data = decryptPKM(pkdata[i]);
pkms[i] = getPKM(decryptPKM(pkdata[i]));
BoxData = pkms;
return true;
}
@@ -483,7 +485,7 @@ public bool setBoxBin(byte[] data, int box)
PKM[] pkms = BoxData;
for (int i = 0; i < BoxSlotCount; i++)
pkms[box*BoxSlotCount + i].Data = decryptPKM(pkdata[i]);
pkms[box*BoxSlotCount + i] = getPKM(decryptPKM(pkdata[i]));
BoxData = pkms;
return true;
}

View File

@@ -1768,7 +1768,9 @@ private void InitializeComponent()
".pk6",
".pk5",
".pk4",
".pk3"});
".pk3",
".pk2",
".pk1"});
this.CB_Format.Location = new System.Drawing.Point(54, 0);
this.CB_Format.Margin = new System.Windows.Forms.Padding(0);
this.CB_Format.Name = "CB_Format";

View File

@@ -525,8 +525,11 @@ private void setResults(List<PKM> res)
private void FillPKXBoxes(int start)
{
if (Results == null)
{
for (int i = 0; i < RES_MAX; i++)
PKXBOXES[i].Image = null;
return;
}
PKM[] data = Results.Skip(start * RES_MIN).Take(RES_MAX).ToArray();
for (int i = 0; i < data.Length; i++)
PKXBOXES[i].Image = data[i].Sprite;
@@ -591,7 +594,8 @@ private void changeFormatFilter(object sender, EventArgs e)
else
{
CB_Format.Visible = true;
CB_Format.SelectedIndex = MAXFORMAT - Main.SAV.Generation + 1; // SAV generation (offset by 1 for "Any")
int index = MAXFORMAT - Main.SAV.Generation + 1;
CB_Format.SelectedIndex = index < CB_Format.Items.Count ? index : 0; // SAV generation (offset by 1 for "Any")
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,354 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Windows.Forms;
namespace PKHeX
{
public partial class SAV_MysteryGiftDB : Form
{
public SAV_MysteryGiftDB(Main f1)
{
m_parent = f1;
InitializeComponent();
// Preset Filters to only show PKM available for loaded save
CB_FormatComparator.SelectedIndex = 3; // <=
PKXBOXES = new[]
{
bpkx1, bpkx2, bpkx3, bpkx4, bpkx5, bpkx6,
bpkx7, bpkx8, bpkx9, bpkx10,bpkx11,bpkx12,
bpkx13,bpkx14,bpkx15,bpkx16,bpkx17,bpkx18,
bpkx19,bpkx20,bpkx21,bpkx22,bpkx23,bpkx24,
bpkx25,bpkx26,bpkx27,bpkx28,bpkx29,bpkx30,
bpkx31,bpkx32,bpkx33,bpkx34,bpkx35,bpkx36,
bpkx37,bpkx38,bpkx39,bpkx40,bpkx41,bpkx42,
bpkx43,bpkx44,bpkx45,bpkx46,bpkx47,bpkx48,
bpkx49,bpkx50,bpkx51,bpkx52,bpkx53,bpkx54,
bpkx55,bpkx56,bpkx57,bpkx58,bpkx59,bpkx60,
bpkx61,bpkx62,bpkx63,bpkx64,bpkx65,bpkx66,
};
// Enable Scrolling when hovered over
PAN_Box.MouseHover += (sender, args) =>
{
if (ActiveForm == this)
SCR_Box.Focus();
};
foreach (var slot in PKXBOXES)
{
slot.MouseEnter += (sender, args) =>
{
if (ActiveForm == this)
SCR_Box.Focus();
};
// Enable Click
slot.MouseClick += (sender, args) =>
{
if (ModifierKeys == Keys.Control)
clickView(sender, args);
};
}
Counter = L_Count.Text;
Viewed = L_Viewed.Text;
L_Viewed.Text = ""; // invis for now
populateComboBoxes();
ContextMenuStrip mnu = new ContextMenuStrip();
ToolStripMenuItem mnuView = new ToolStripMenuItem("View");
// Assign event handlers
mnuView.Click += clickView;
// Add to main context menu
mnu.Items.AddRange(new ToolStripItem[] { mnuView });
// Assign to datagridview
foreach (PictureBox p in PKXBOXES)
p.ContextMenuStrip = mnu;
// Load Data
RawDB = new List<MysteryGift>();
RawDB.AddRange(Legal.WC6DB);
if (Directory.Exists(DatabasePath))
foreach (string file in Directory.GetFiles(DatabasePath, "*", SearchOption.AllDirectories))
{
FileInfo fi = new FileInfo(file);
if (!MysteryGift.getIsMysteryGift(fi.Length)) continue;
var mg = MysteryGift.getMysteryGift(File.ReadAllBytes(file), fi.Extension);
if (mg != null)
RawDB.Add(mg);
}
RawDB = new List<MysteryGift>(RawDB.Where(mg => !mg.IsItem && mg.IsPokémon && mg.Species > 0).Distinct().OrderBy(mg => mg.Species));
foreach (var mg in RawDB)
mg.GiftUsed = false;
setResults(RawDB);
Menu_SearchSettings.DropDown.Closing += (sender, e) =>
{
if (e.CloseReason == ToolStripDropDownCloseReason.ItemClicked)
e.Cancel = true;
};
CenterToParent();
}
private readonly Main m_parent;
private readonly PictureBox[] PKXBOXES;
private readonly string DatabasePath = Main.WC6DatabasePath;
private List<MysteryGift> Results;
private readonly List<MysteryGift> RawDB;
private int slotSelected = -1; // = null;
private Image slotColor;
private const int RES_MAX = 66;
private const int RES_MIN = 6;
private readonly string Counter;
private readonly string Viewed;
private const int MAXFORMAT = 6;
// Important Events
private void clickView(object sender, EventArgs e)
{
sender = ((sender as ToolStripItem)?.Owner as ContextMenuStrip)?.SourceControl ?? sender as PictureBox;
int index = Array.IndexOf(PKXBOXES, sender);
var dataArr = Results.Skip(SCR_Box.Value * RES_MIN).Take(RES_MAX).ToArray();
if (index >= dataArr.Length)
System.Media.SystemSounds.Exclamation.Play();
else
{
m_parent.populateFields(dataArr[index].convertToPKM(Main.SAV), false);
slotSelected = index + SCR_Box.Value * RES_MIN;
slotColor = Properties.Resources.slotView;
FillPKXBoxes(SCR_Box.Value);
L_Viewed.Text = string.Format(Viewed, dataArr[index].FileName);
}
}
private void populateComboBoxes()
{
// Set the Text
CB_HeldItem.DisplayMember =
CB_Species.DisplayMember = "Text";
// Set the Value
CB_HeldItem.ValueMember =
CB_Species.ValueMember = "Value";
var Any = new ComboItem {Text = "Any", Value = -1};
var DS_Species = new List<ComboItem>(Main.SpeciesDataSource);
DS_Species.RemoveAt(0); DS_Species.Insert(0, Any); CB_Species.DataSource = DS_Species;
var DS_Item = new List<ComboItem>(Main.ItemDataSource);
DS_Item.Insert(0, Any); CB_HeldItem.DataSource = DS_Item;
// Set the Move ComboBoxes too..
var DS_Move = new List<ComboItem>(Main.MoveDataSource);
DS_Move.RemoveAt(0); DS_Move.Insert(0, Any);
{
foreach (ComboBox cb in new[] { CB_Move1, CB_Move2, CB_Move3, CB_Move4 })
{
cb.DisplayMember = "Text"; cb.ValueMember = "Value";
cb.DataSource = new BindingSource(DS_Move, null);
}
}
// Trigger a Reset
resetFilters(null, null);
}
private void resetFilters(object sender, EventArgs e)
{
CHK_Shiny.Checked = CHK_IsEgg.Checked = true;
CHK_Shiny.CheckState = CHK_IsEgg.CheckState = CheckState.Indeterminate;
CB_HeldItem.SelectedIndex = 0;
CB_Species.SelectedIndex = 0;
CB_Move1.SelectedIndex = CB_Move2.SelectedIndex = CB_Move3.SelectedIndex = CB_Move4.SelectedIndex = 0;
RTB_Instructions.Clear();
if (sender != null)
System.Media.SystemSounds.Asterisk.Play();
}
// IO Usage
private void openDB(object sender, EventArgs e)
{
if (Directory.Exists(DatabasePath))
Process.Start("explorer.exe", DatabasePath);
}
private void Menu_Export_Click(object sender, EventArgs e)
{
if (Results == null || Results.Count == 0)
{ Util.Alert("No results to export."); return; }
if (DialogResult.Yes != Util.Prompt(MessageBoxButtons.YesNo, "Export to a folder?"))
return;
FolderBrowserDialog fbd = new FolderBrowserDialog();
if (DialogResult.OK != fbd.ShowDialog())
return;
string path = fbd.SelectedPath;
if (!Directory.Exists(path)) // just in case...
Directory.CreateDirectory(path);
foreach (var gift in Results)
File.WriteAllBytes(Path.Combine(path, Util.CleanFileName(gift.FileName)), gift.Data);
}
// View Updates
private void B_Search_Click(object sender, EventArgs e)
{
// Populate Search Query Result
IEnumerable<MysteryGift> res = RawDB;
int format = MAXFORMAT + 1 - CB_Format.SelectedIndex;
switch (CB_FormatComparator.SelectedIndex)
{
case 0: /* Do nothing */ break;
case 1: res = res.Where(mg => mg.Format >= format); break;
case 2: res = res.Where(mg => mg.Format == format); break;
case 3: res = res.Where(mg => mg.Format <= format); break;
}
// Primary Searchables
int species = Util.getIndex(CB_Species);
int item = Util.getIndex(CB_HeldItem);
if (species != -1) res = res.Where(pk => pk.Species == species);
if (item != -1) res = res.Where(pk => pk.HeldItem == item);
// Secondary Searchables
int move1 = Util.getIndex(CB_Move1);
int move2 = Util.getIndex(CB_Move2);
int move3 = Util.getIndex(CB_Move3);
int move4 = Util.getIndex(CB_Move4);
if (move1 != -1) res = res.Where(pk => pk.Moves.Contains(move1));
if (move2 != -1) res = res.Where(pk => pk.Moves.Contains(move2));
if (move3 != -1) res = res.Where(pk => pk.Moves.Contains(move3));
if (move4 != -1) res = res.Where(pk => pk.Moves.Contains(move4));
if (CHK_Shiny.CheckState == CheckState.Checked) res = res.Where(pk => pk.IsShiny);
if (CHK_Shiny.CheckState == CheckState.Unchecked) res = res.Where(pk => !pk.IsShiny);
if (CHK_IsEgg.CheckState == CheckState.Checked) res = res.Where(pk => pk.IsEgg);
if (CHK_IsEgg.CheckState == CheckState.Unchecked) res = res.Where(pk => !pk.IsEgg);
slotSelected = -1; // reset the slot last viewed
if (RTB_Instructions.Lines.Any(line => line.Length > 0))
{
var raw =
RTB_Instructions.Lines
.Where(line => !string.IsNullOrWhiteSpace(line))
.Where(line => new[] { '!', '=' }.Contains(line[0]));
var filters = (from line in raw
let eval = line[0] == '='
let split = line.Substring(1).Split('=')
where split.Length == 2 && !string.IsNullOrWhiteSpace(split[0])
select new BatchEditor.StringInstruction { PropertyName = split[0], PropertyValue = split[1], Evaluator = eval }).ToArray();
if (filters.Any(z => string.IsNullOrWhiteSpace(z.PropertyValue)))
{ Util.Error("Empty Filter Value detected."); return; }
res = res.Where(gift => // Compare across all filters
{
foreach (var cmd in filters)
{
if (!gift.GetType().HasProperty(cmd.PropertyName))
return false;
try { if (ReflectUtil.GetValueEquals(gift, cmd.PropertyName, cmd.PropertyValue) == cmd.Evaluator) continue; }
catch { Console.WriteLine($"Unable to compare {cmd.PropertyName} to {cmd.PropertyValue}."); }
return false;
}
return true;
});
}
var results = res.ToArray();
if (results.Length == 0)
{
Util.Alert("No results found!");
}
setResults(new List<MysteryGift>(results)); // updates Count Label as well.
System.Media.SystemSounds.Asterisk.Play();
}
private void updateScroll(object sender, ScrollEventArgs e)
{
if (e.OldValue != e.NewValue)
FillPKXBoxes(e.NewValue);
}
private void setResults(List<MysteryGift> res)
{
Results = new List<MysteryGift>(res);
SCR_Box.Maximum = (int)Math.Ceiling((decimal)Results.Count / RES_MIN);
if (SCR_Box.Maximum > 0) SCR_Box.Maximum -= 1;
SCR_Box.Value = 0;
FillPKXBoxes(0);
L_Count.Text = string.Format(Counter, Results.Count);
}
private void FillPKXBoxes(int start)
{
if (Results == null)
{
for (int i = 0; i < RES_MAX; i++)
PKXBOXES[i].Image = null;
return;
}
var data = Results.Skip(start * RES_MIN).Take(RES_MAX).ToArray();
for (int i = 0; i < data.Length; i++)
PKXBOXES[i].Image = SAV_Wondercard.getSprite(data[i]);
for (int i = data.Length; i < RES_MAX; i++)
PKXBOXES[i].Image = null;
for (int i = 0; i < RES_MAX; i++)
PKXBOXES[i].BackgroundImage = Properties.Resources.slotTrans;
if (slotSelected != -1 && slotSelected >= RES_MIN * start && slotSelected < RES_MIN * start + RES_MAX)
PKXBOXES[slotSelected - start * RES_MIN].BackgroundImage = slotColor ?? Properties.Resources.slotView;
}
private void Menu_SearchAdvanced_Click(object sender, EventArgs e)
{
if (!Menu_SearchAdvanced.Checked)
{ Size = MinimumSize; RTB_Instructions.Clear(); }
else Size = MaximumSize;
}
private void Menu_Exit_Click(object sender, EventArgs e)
{
Close();
}
protected override void OnMouseWheel(MouseEventArgs e)
{
if (!PAN_Box.RectangleToScreen(PAN_Box.ClientRectangle).Contains(MousePosition))
return;
int oldval = SCR_Box.Value;
int newval = oldval + (e.Delta < 0 ? 1 : -1);
if (newval >= SCR_Box.Minimum && SCR_Box.Maximum >= newval)
FillPKXBoxes(SCR_Box.Value = newval);
}
private void changeFormatFilter(object sender, EventArgs e)
{
if (CB_FormatComparator.SelectedIndex == 0)
{
CB_Format.Visible = false; // !any
CB_Format.SelectedIndex = 0;
}
else
{
CB_Format.Visible = true;
int index = MAXFORMAT - Main.SAV.Generation + 1;
CB_Format.SelectedIndex = index < CB_Format.Items.Count ? index : 0; // SAV generation (offset by 1 for "Any")
}
}
}
}

View File

@@ -0,0 +1,420 @@
<?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="bpkx30.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx29.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx28.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx27.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx26.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx25.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx24.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx23.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx22.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx21.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx20.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx19.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx18.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx17.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx16.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx15.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx14.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx13.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx12.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx11.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx10.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx9.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx8.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx7.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx6.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx5.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx4.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx3.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx2.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx60.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx59.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx58.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx57.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx56.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx55.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx54.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx53.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx52.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx51.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx50.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx49.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx48.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx47.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx46.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx45.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx44.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx43.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx42.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx41.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx40.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx39.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx38.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx37.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx36.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx35.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx34.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx33.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx32.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx31.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="menuStrip1.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx66.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx65.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx64.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx63.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx62.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="bpkx61.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</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
AAAAAAAAAAAAAAAAAAAAAAAAIyMjAQAAAAALCwsPJiYmJysrKycqKionKSkpJykpKSc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GBjM/xgY
zP8YGMz/GBjL/xcXy/8XF8r/FxfJ/xcXyf8WFsj/FRXH/xQUw/8jI8f0Dg5GGwAAAAAAAAAAFhZxAiUl
eIUZGcr/FBTI/xUVyv8WFsv/FhbM/xYWzP8WFsz/FhbN/xcXzf8XF83/FxfN/xcXzv8XF87/FxfO/xcX
zv8XF87/FxfN/xcXzf8WFs3/FhbM/xYWzP8WFsz/FhbL/xUVyv8UFMj/GBjJ/yYmeogWFnYCAAAAAAAA
AAAAAAAAGBh1BzMzk50kJNP+FxfK/xgYzP8YGMz/GBjN/xgYzf8YGM3/GBjN/xgYzf8ZGc7/GRnO/xkZ
zv8ZGc7/GRnO/xkZzv8YGM3/GBjN/xgYzf8YGM3/GBjN/xgYzP8YGMz/FxfK/yMj0v4zM5WfFBRkBwAA
AAAAAAAAAAAAAAAAAAAAAAAAHBx7Ay0tdkg3N5emMTGpxSwsp8gsLKfILCynyCwsp8gsLKfILCynyCws
p8gsLKfILCynyCwsp8gsLKfILCynyCwsp8gsLKfILCynyCwsp8gsLKfILCynyDExqcU2NpenLi54Shsb
ewMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////8AAAD+AAAAfAAAADwAAAA8AAAAPAAAADwAAAA8AA
AAPAAAADwAAAA8AAAAPAAAADwAAAA8AAAAPAAAADwAAAA8AAAAPAAAADwAAAA8AAAAPAAAADwAAAA8AA
AAPAAAADwAAAA8AAAAPAAAAD4AAAB/gAAB//////
</value>
</data>
</root>

View File

@@ -48,11 +48,18 @@ private void Setup()
dgv.Columns.Add(dgvIndex);
dgv.Columns.Add(dgvPuff);
dgv.Rows.Add(100);
for (int i = 0; i < 100; i++)
var Puffs = SAV.Puffs;
dgv.Rows.Add(Puffs.Length);
for (int i = 0; i < Puffs.Length; i++)
{
dgv.Rows[i].Cells[0].Value = (i + 1).ToString();
dgv.Rows[i].Cells[1].Value = pfa[SAV.Data[SAV.Puff + i]];
int puffval = Puffs[i];
if (puffval >= pfa.Length)
{
Util.Error($"Invalid Puff Index: {i}", $"Expected < ${pfa.Length}");
puffval = 0;
}
dgv.Rows[i].Cells[1].Value = pfa[puffval];
}
MT_CNT.Text = SAV.PuffCount.ToString();
}

View File

@@ -42,6 +42,9 @@ public SAV_BoxViewer(Main p)
pb.DragEnter += pbBoxSlot_DragEnter;
pb.QueryContinueDrag += pbBoxSlot_QueryContinueDrag;
}
for (int i = SAV.BoxSlotCount; i < SlotPictureBoxes.Length; i++)
SlotPictureBoxes[i].Visible = false;
try
{
CB_BoxSelect.Items.Clear();
@@ -87,7 +90,7 @@ private void setPKXBoxes()
int boxbgval = SAV.getBoxWallpaper(CB_BoxSelect.SelectedIndex);
PAN_Box.BackgroundImage = BoxWallpaper.getWallpaper(SAV, boxbgval);
for (int i = 0; i < SlotPictureBoxes.Length; i++)
for (int i = 0; i < SAV.BoxSlotCount; i++)
getSlotFiller(boxoffset + SAV.SIZE_STORED*i, SlotPictureBoxes[i]);
}
private void getSlotFiller(int offset, PictureBox pb)

View File

@@ -49,9 +49,10 @@ private void InitializeComponent()
this.B_LoadNew = new System.Windows.Forms.Button();
this.B_LoadOld = new System.Windows.Forms.Button();
this.GB_Flags = new System.Windows.Forms.GroupBox();
this.TLP_Flags = new System.Windows.Forms.TableLayoutPanel();
this.GB_Constants = new System.Windows.Forms.GroupBox();
this.TLP_Const = new System.Windows.Forms.TableLayoutPanel();
this.TLP_Flags = new System.Windows.Forms.TableLayoutPanel();
this.L_EventFlagWarn = new System.Windows.Forms.Label();
this.GB_FlagStatus.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nud)).BeginInit();
this.GB_Researcher.SuspendLayout();
@@ -271,21 +272,38 @@ private void InitializeComponent()
this.GB_Flags.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.GB_Flags.Controls.Add(this.TLP_Flags);
this.GB_Flags.Location = new System.Drawing.Point(12, 12);
this.GB_Flags.Location = new System.Drawing.Point(12, 24);
this.GB_Flags.Name = "GB_Flags";
this.GB_Flags.Size = new System.Drawing.Size(212, 210);
this.GB_Flags.Size = new System.Drawing.Size(212, 198);
this.GB_Flags.TabIndex = 39;
this.GB_Flags.TabStop = false;
this.GB_Flags.Text = "Event Flags";
//
// TLP_Flags
//
this.TLP_Flags.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.TLP_Flags.AutoScroll = true;
this.TLP_Flags.ColumnCount = 2;
this.TLP_Flags.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.TLP_Flags.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.TLP_Flags.Location = new System.Drawing.Point(6, 19);
this.TLP_Flags.Name = "TLP_Flags";
this.TLP_Flags.RowCount = 2;
this.TLP_Flags.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.TLP_Flags.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.TLP_Flags.Size = new System.Drawing.Size(200, 172);
this.TLP_Flags.TabIndex = 0;
//
// GB_Constants
//
this.GB_Constants.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.GB_Constants.Controls.Add(this.TLP_Const);
this.GB_Constants.Location = new System.Drawing.Point(235, 12);
this.GB_Constants.Location = new System.Drawing.Point(235, 24);
this.GB_Constants.Name = "GB_Constants";
this.GB_Constants.Size = new System.Drawing.Size(212, 210);
this.GB_Constants.Size = new System.Drawing.Size(212, 198);
this.GB_Constants.TabIndex = 40;
this.GB_Constants.TabStop = false;
this.GB_Constants.Text = "Event Constants";
@@ -303,31 +321,28 @@ private void InitializeComponent()
this.TLP_Const.Name = "TLP_Const";
this.TLP_Const.RowCount = 1;
this.TLP_Const.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.TLP_Const.Size = new System.Drawing.Size(200, 184);
this.TLP_Const.Size = new System.Drawing.Size(200, 172);
this.TLP_Const.TabIndex = 0;
//
// TLP_Flags
// L_EventFlagWarn
//
this.TLP_Flags.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
this.L_EventFlagWarn.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.TLP_Flags.AutoScroll = true;
this.TLP_Flags.ColumnCount = 2;
this.TLP_Flags.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.TLP_Flags.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.TLP_Flags.Location = new System.Drawing.Point(6, 19);
this.TLP_Flags.Name = "TLP_Flags";
this.TLP_Flags.RowCount = 2;
this.TLP_Flags.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.TLP_Flags.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.TLP_Flags.Size = new System.Drawing.Size(200, 184);
this.TLP_Flags.TabIndex = 0;
this.L_EventFlagWarn.ForeColor = System.Drawing.Color.Red;
this.L_EventFlagWarn.Location = new System.Drawing.Point(12, 1);
this.L_EventFlagWarn.Name = "L_EventFlagWarn";
this.L_EventFlagWarn.Size = new System.Drawing.Size(435, 20);
this.L_EventFlagWarn.TabIndex = 41;
this.L_EventFlagWarn.Text = "Altering Event Flags may impact other story events. Save file backups are recomme" +
"nded.";
this.L_EventFlagWarn.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// SAV_EventFlags
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(454, 351);
this.Controls.Add(this.L_EventFlagWarn);
this.Controls.Add(this.GB_Constants);
this.Controls.Add(this.GB_Flags);
this.Controls.Add(this.GB_Researcher);
@@ -378,5 +393,6 @@ private void InitializeComponent()
private System.Windows.Forms.GroupBox GB_Constants;
private System.Windows.Forms.TableLayoutPanel TLP_Const;
private System.Windows.Forms.TableLayoutPanel TLP_Flags;
private System.Windows.Forms.Label L_EventFlagWarn;
}
}

View File

@@ -218,7 +218,7 @@ private void changeCustomFlag(object sender, EventArgs e)
else
{
c_CustomFlag.Enabled = true;
nud.BackColor = Main.defaultControlWhite;
nud.ResetBackColor();
c_CustomFlag.Checked = flags[flag];
}
}

View File

@@ -13,7 +13,8 @@ public SAV_SimpleTrainer()
cba = new[] {CHK_1, CHK_2, CHK_3, CHK_4, CHK_5, CHK_6, CHK_7, CHK_8};
TB_OTName.MaxLength = SAV.OTLength;
B_MaxCash.Click += (sender, e) => MT_Money.Text = "9,999,999";
B_MaxCash.Click += (sender, e) => MT_Money.Text = SAV.MaxMoney.ToString();
MT_Money.Mask = "00000000000".Substring(0, SAV.MaxMoney.ToString().Length);
B_MaxCoins.Click += (sender, e) => MT_Coins.Text = "9999";
CB_Gender.Items.Clear();

View File

@@ -468,7 +468,7 @@ private void pbBoxSlot_DragEnter(object sender, DragEventArgs e)
}
private int wc_slot = -1;
private static Image getSprite(MysteryGift gift)
internal static Image getSprite(MysteryGift gift)
{
Image img;
if (gift.IsPokémon)
@@ -487,7 +487,7 @@ private static string getDescription(MysteryGift gift)
if (gift.Empty)
return "Empty Slot. No data!";
string s = gift.getCardHeader();
string s = gift.getCardHeader() + Environment.NewLine;
if (gift.IsItem)
{
s += "Item: " + Main.itemlist[gift.Item] + Environment.NewLine + "Quantity: " + gift.Quantity;