mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-22 03:53:08 +00:00
Cleaning & Minor Improvements/Additions
This commit is contained in:
parent
43b1afec3f
commit
6f516a23d1
12 changed files with 264 additions and 49 deletions
|
@ -849,8 +849,8 @@ namespace PKHeX
|
|||
mEggLocN = PKX.getLocation(true, mgamevers, meggloc);
|
||||
mGameN = Form1.gamelist[mgamevers];
|
||||
mBallN = Form1.balllist[mball];
|
||||
motlangN = Form1.gamelanguages[motlang];
|
||||
mdsregIDN = Form1.consoleregions[mdsregID];
|
||||
motlangN = Form1.gamelanguages[motlang].Split(',')[1];
|
||||
mdsregIDN = Form1.consoleregions[mdsregID].Split(',')[1];
|
||||
}
|
||||
catch { return; }
|
||||
}
|
||||
|
|
|
@ -192,16 +192,16 @@ namespace PKHeX
|
|||
public byte[] buff = new byte[260]; // Tab Pokemon Data Storage
|
||||
public byte[] savefile = new byte[0x100000];
|
||||
public byte[] cyberSAV = new byte[0x65600];
|
||||
public static byte[] ramsav = null;
|
||||
public static bool ramsavloaded = false;
|
||||
public bool savegame_oras = true;
|
||||
public bool cybergadget = false;
|
||||
public bool savLoaded = false;
|
||||
public int savindex;
|
||||
public bool savedited;
|
||||
public byte[] ramsav = null;
|
||||
public bool ramsavloaded = false;
|
||||
public string pathSDF = null;
|
||||
public string path3DS = null;
|
||||
|
||||
|
||||
public static string Status = "Starting up PKHeX...";
|
||||
public static bool HaX = false;
|
||||
public static bool specialChars = false; // Open Form Tracking
|
||||
|
@ -3695,16 +3695,13 @@ namespace PKHeX
|
|||
}
|
||||
private void setBoxNames()
|
||||
{
|
||||
int selectedbox = C_BoxSelect.SelectedIndex; // precache selected box
|
||||
int selectedbox = C_BoxSelect.SelectedIndex; // precache selected box
|
||||
// Build ComboBox Dropdown Items
|
||||
try
|
||||
{
|
||||
C_BoxSelect.Items.Clear();
|
||||
for (int i = 0; i < 31; i++)
|
||||
{
|
||||
string boxname = Encoding.Unicode.GetString(savefile, SaveGame.PCLayout + (0x7F000 * savindex) + 0x22 * i, 0x22);
|
||||
C_BoxSelect.Items.Add(boxname);
|
||||
}
|
||||
C_BoxSelect.Items.Add(Encoding.Unicode.GetString(savefile, SaveGame.PCLayout + (0x7F000 * savindex) + 0x22 * i, 0x22));
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
@ -4156,7 +4153,7 @@ namespace PKHeX
|
|||
if (sfd.ShowDialog() == DialogResult.OK)
|
||||
File.WriteAllBytes(sfd.FileName, savefile.Skip(SaveGame.Box).Take(0xE8 * 30 * 31).ToArray());
|
||||
}
|
||||
if (dr == DialogResult.No)
|
||||
else if (dr == DialogResult.No)
|
||||
{
|
||||
SaveFileDialog sfd = new SaveFileDialog();
|
||||
sfd.Filter = "Box Data|*.bin";
|
||||
|
|
|
@ -402,7 +402,7 @@ http://projectpokemon.org/forums/showthread.php?36986
|
|||
--- Window titles are translatable too; change the existing title within the translation file.
|
||||
- Added: Hall of Fame Editor. Thank you SciresM for the implementation!
|
||||
- Added: Country / Region text for all languages. Thank you Slashmolder for the raw data!
|
||||
- Added: Ingame Font characters. To manually enter them, right click the Nickname label. Thank you mapaler (枫谷剑仙)!
|
||||
- Added: Ingame Font characters. To manually enter them, right click the Nickname label. Thank you mapaler!
|
||||
- Changed: Replaced the Quick-Dragouts for exporting with an overall 'tabs' sprite. Functionality is the same; for encrypted export hold Control.
|
||||
- Changed: A few O-Power labels for X/Y. Thank you RainThunder!
|
||||
- Internal: Tons of code reorganization, might be a little faster/lighter.
|
||||
|
@ -469,10 +469,24 @@ http://projectpokemon.org/forums/showthread.php?36986
|
|||
- Improved: Loading Box/Debug binaries will display the boxes if they are not visible.
|
||||
- Update (b): Added 2 more types of XY RAMSav types.
|
||||
|
||||
1/29/15 - New Update:
|
||||
1/29/15 - New Update: (24200)
|
||||
- Changed: ramsav detection to allow users to store backups with unique names. Be sure it contains "ram" in the file name!
|
||||
- Fixed: Gen4 Egg Locations should now load for pre-GenV origin mons. Thanks Omicron!
|
||||
- Fixed: Unown forms M & F won't alter the gender label. Thanks Favna!
|
||||
- Fixed: ram2sav usage with X/Y after OR/AS and not deleting the OR/AS save before dumping X/Y (data past sav length). Thanks trainboy2019!
|
||||
- Added: Symbol selection for OT/Latest Handler like for Nicknames; access changed to control clicking the TextBox. Thanks ProfShroomish!
|
||||
- Changed: FindIndex hunting to account for rare ramsav types. Thanks Crowhogan33 for reporting and SciresM for fixing!
|
||||
- Changed: FindIndex hunting to account for rare ramsav types. Thanks Crowhogan33 for reporting and SciresM for fixing!
|
||||
|
||||
2/1/15 - New Update:
|
||||
- Fixed: Characteristics now match those ingame (EC%6 instead of PID%6). Thanks JubalTheLion!
|
||||
- Fixed: A few Exceptions with loading have been corrected (bad initialization).
|
||||
- Fixed: Splash screen image no longer tiles for some systems with a larger scale.
|
||||
- Fixed: Source code recompiling will no longer cause the program to text-translate improperly. Thanks Slashmolder!
|
||||
- Fixed: Box Report 3DSRegion and Language no longer shows the index number; just the text. Thanks Kaisonic!
|
||||
- Fixed: Ingame Fonts should no longer cause the program to crash when being drawn (FontFamily will no longer be GC'd).
|
||||
- Changed: Special Characters are now accessible by Control Clicking within the TextBox.
|
||||
- Added: Ingame font to Trainer and Hall of Fame windows.
|
||||
- Added: Deletion of Hall of Fame Entries (except First Clear), and Deletion of Favorite Secret Bases.
|
||||
- Added: Loading of multiple Wondercards via Drag & Drop.
|
||||
- Added: Boot Status to help debug some users being stuck on the splash screen.
|
||||
- Added: Event Constant editing to Event Flag window.
|
|
@ -1,10 +1,10 @@
|
|||
If you are having issues viewing gender symbols, Options -> Toggle Unicode Text.
|
||||
If you are having issues viewing certain symbols: Options -> Toggle Unicode Text.
|
||||
|
||||
|
||||
// Main Window
|
||||
|
||||
Hold Control when dragging out the Tab PKM to save as ekx.
|
||||
Control Click on Nickname/OT box to bring up the ingame-special characters.
|
||||
Control Click on a Nickname/OT box to bring up the ingame-special characters.
|
||||
|
||||
Control + Click on...
|
||||
Randomize IVs: Set all IVs to max.
|
||||
|
@ -22,7 +22,7 @@ Click on the Save File path (above Boxes): Auto-detect/Reload save.
|
|||
Control-Drag a Box Slot to Copy-Overwrite
|
||||
Alt-Drag a Box Slot to Delete-Overwrite
|
||||
|
||||
Control-Shift-Click a slot to (clone) set a Pokemon to every slot in the box.
|
||||
Control-Alt-Click a slot to (Clone/Delete) set a Pokemon to every slot in the box.
|
||||
Control-Click a slot to load slot to tabs.
|
||||
Shift-Click a slot to set tabs to slot.
|
||||
Alt-Click a slot to delete the data in slot.
|
||||
|
@ -30,8 +30,16 @@ Alt-Click a slot to delete the data in slot.
|
|||
Control-Click the OpenTemp button to open the CyberGadget Cache folder.
|
||||
Alt-Click the OpenTemp button to open the SaveDataFiler folder.
|
||||
|
||||
Hold Shift while exporting a ramsav.bin to transplant it to another cart/system.
|
||||
Hold Control while exporting a ramsav.bin to export the "main" instead.
|
||||
|
||||
// Inventory Editor
|
||||
|
||||
Alt-Click loading a pouch will give all items with quantity x995. *1 for TMHM/Key
|
||||
// Misc Editors
|
||||
|
||||
INVENTORY:
|
||||
- Alt-Click loading a pouch will give all items with quantity x995. *1 for TMHM/Key.
|
||||
|
||||
POKEPUFF:
|
||||
- Control Click the All Button to give un-exceptional Pokepuffs.
|
||||
- Control Click the Sort Button to sort in reverse.
|
||||
|
||||
|
|
57
SAV/SAV_EventFlagsORAS.Designer.cs
generated
57
SAV/SAV_EventFlagsORAS.Designer.cs
generated
|
@ -115,6 +115,10 @@
|
|||
this.flag_0284 = new System.Windows.Forms.CheckBox();
|
||||
this.MT_Ash = new System.Windows.Forms.MaskedTextBox();
|
||||
this.L_Ash = new System.Windows.Forms.Label();
|
||||
this.L_Stats = new System.Windows.Forms.Label();
|
||||
this.CB_Stats = new System.Windows.Forms.ComboBox();
|
||||
this.L_Value = new System.Windows.Forms.Label();
|
||||
this.MT_Stat = new System.Windows.Forms.MaskedTextBox();
|
||||
this.GB_FlagStatus.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nud)).BeginInit();
|
||||
this.GB_Researcher.SuspendLayout();
|
||||
|
@ -1195,11 +1199,60 @@
|
|||
this.L_Ash.TabIndex = 19;
|
||||
this.L_Ash.Text = "Volcanic Ash:";
|
||||
//
|
||||
// L_Stats
|
||||
//
|
||||
this.L_Stats.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.L_Stats.AutoSize = true;
|
||||
this.L_Stats.Location = new System.Drawing.Point(317, 236);
|
||||
this.L_Stats.Name = "L_Stats";
|
||||
this.L_Stats.Size = new System.Drawing.Size(85, 13);
|
||||
this.L_Stats.TabIndex = 37;
|
||||
this.L_Stats.Text = "Event Constants";
|
||||
//
|
||||
// CB_Stats
|
||||
//
|
||||
this.CB_Stats.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.CB_Stats.DropDownHeight = 156;
|
||||
this.CB_Stats.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.CB_Stats.DropDownWidth = 180;
|
||||
this.CB_Stats.FormattingEnabled = true;
|
||||
this.CB_Stats.IntegralHeight = false;
|
||||
this.CB_Stats.Location = new System.Drawing.Point(320, 252);
|
||||
this.CB_Stats.Name = "CB_Stats";
|
||||
this.CB_Stats.Size = new System.Drawing.Size(94, 21);
|
||||
this.CB_Stats.TabIndex = 36;
|
||||
this.CB_Stats.SelectedIndexChanged += new System.EventHandler(this.changeConstantIndex);
|
||||
//
|
||||
// L_Value
|
||||
//
|
||||
this.L_Value.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.L_Value.AutoSize = true;
|
||||
this.L_Value.Location = new System.Drawing.Point(317, 276);
|
||||
this.L_Value.Name = "L_Value";
|
||||
this.L_Value.Size = new System.Drawing.Size(34, 13);
|
||||
this.L_Value.TabIndex = 35;
|
||||
this.L_Value.Text = "Value";
|
||||
//
|
||||
// MT_Stat
|
||||
//
|
||||
this.MT_Stat.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.MT_Stat.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.MT_Stat.Location = new System.Drawing.Point(376, 276);
|
||||
this.MT_Stat.Mask = "00000";
|
||||
this.MT_Stat.Name = "MT_Stat";
|
||||
this.MT_Stat.Size = new System.Drawing.Size(38, 20);
|
||||
this.MT_Stat.TabIndex = 34;
|
||||
this.MT_Stat.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
|
||||
//
|
||||
// SAV_EventFlagsORAS
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(594, 512);
|
||||
this.Controls.Add(this.L_Stats);
|
||||
this.Controls.Add(this.CB_Stats);
|
||||
this.Controls.Add(this.L_Value);
|
||||
this.Controls.Add(this.MT_Stat);
|
||||
this.Controls.Add(this.L_Ash);
|
||||
this.Controls.Add(this.MT_Ash);
|
||||
this.Controls.Add(this.GB_Misc);
|
||||
|
@ -1317,5 +1370,9 @@
|
|||
private System.Windows.Forms.Label L_SkyTower;
|
||||
private System.Windows.Forms.CheckBox flag_2835;
|
||||
private System.Windows.Forms.CheckBox flag_0420;
|
||||
private System.Windows.Forms.Label L_Stats;
|
||||
private System.Windows.Forms.ComboBox CB_Stats;
|
||||
private System.Windows.Forms.Label L_Value;
|
||||
private System.Windows.Forms.MaskedTextBox MT_Stat;
|
||||
}
|
||||
}
|
|
@ -30,6 +30,7 @@ namespace PKHeX
|
|||
bool setup = true;
|
||||
public CheckBox[] chka;
|
||||
public bool[] flags = new bool[3072];
|
||||
public ushort[] Constants = new ushort[0x2FC / 2];
|
||||
private void B_Cancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
Close();
|
||||
|
@ -40,23 +41,28 @@ namespace PKHeX
|
|||
for (int i = 0; i < chka.Length; i++)
|
||||
flags[getFlagNum(chka[i])] = chka[i].Checked;
|
||||
|
||||
byte[] data = new byte[flags.Length / 8];
|
||||
|
||||
byte[] data = new byte[flags.Length / 8];
|
||||
|
||||
for (int i = 0; i < flags.Length; i++)
|
||||
if (flags[i])
|
||||
data[i/8] |= (byte)(1 << i%8);
|
||||
data[i / 8] |= (byte)(1 << i % 8);
|
||||
|
||||
Array.Copy(data, 0, m_parent.savefile, 0x1A0FC + savshift, 0x180);
|
||||
|
||||
|
||||
// Copy back Volcanic Ash counter
|
||||
Array.Copy(BitConverter.GetBytes(Util.ToUInt32(MT_Ash)), 0, m_parent.savefile, 0x14A78 + 0x5400 + savshift, 2);
|
||||
|
||||
// Copy back Constants
|
||||
changeConstantIndex(null, null); // Trigger Saving
|
||||
for (int i = 0; i < Constants.Length; i++)
|
||||
Array.Copy(BitConverter.GetBytes((ushort)Constants[i]), 0, m_parent.savefile, 0x19E00 + savshift + 2 * i, 2);
|
||||
|
||||
this.Close();
|
||||
}
|
||||
private void Setup()
|
||||
{
|
||||
// Fill Bit arrays
|
||||
|
||||
|
||||
chka = new CheckBox[] {
|
||||
|
||||
flag_0173,flag_2811, // Raikou
|
||||
|
@ -107,6 +113,15 @@ namespace PKHeX
|
|||
BitArray BitRegion = new BitArray(data);
|
||||
BitRegion.CopyTo(flags, 0);
|
||||
|
||||
// Setup Event Constant Editor
|
||||
CB_Stats.Items.Clear();
|
||||
for (int i = 0; i < 0x2FC; i += 2)
|
||||
{
|
||||
CB_Stats.Items.Add(String.Format("0x{0}", i.ToString("X3")));
|
||||
Constants[i / 2] = BitConverter.ToUInt16(m_parent.savefile, 0x19E00 + i);
|
||||
}
|
||||
CB_Stats.SelectedIndex = 0;
|
||||
|
||||
// Populate Flags
|
||||
setup = true;
|
||||
popFlags();
|
||||
|
@ -204,20 +219,29 @@ namespace PKHeX
|
|||
else
|
||||
{ Util.Error("Invalid SAV Size", String.Format("File Size: {0} (bytes)"), fi.Length.ToString(), "File Loaded: " + path); return; }
|
||||
}
|
||||
else
|
||||
else
|
||||
return;
|
||||
|
||||
|
||||
Button bs = (Button)sender;
|
||||
if (bs.Name == "B_LoadOld")
|
||||
{
|
||||
Array.Copy(eventflags, olddata, 0x180);
|
||||
TB_OldSAV.Text = path;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
Array.Copy(eventflags, newdata, 0x180);
|
||||
TB_NewSAV.Text = path;
|
||||
}
|
||||
}
|
||||
int entry = -1;
|
||||
private void changeConstantIndex(object sender, EventArgs e)
|
||||
{
|
||||
if (entry > -1) // Set Entry
|
||||
Constants[entry] = (ushort)(Math.Min(Util.ToUInt32(MT_Stat), 0xFFFF));
|
||||
|
||||
entry = CB_Stats.SelectedIndex; // Get Entry
|
||||
MT_Stat.Text = Constants[entry].ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
61
SAV/SAV_EventFlagsXY.Designer.cs
generated
61
SAV/SAV_EventFlagsXY.Designer.cs
generated
|
@ -70,6 +70,10 @@
|
|||
this.flag_0286 = new System.Windows.Forms.CheckBox();
|
||||
this.flag_0285 = new System.Windows.Forms.CheckBox();
|
||||
this.flag_2546 = new System.Windows.Forms.CheckBox();
|
||||
this.L_Stats = new System.Windows.Forms.Label();
|
||||
this.CB_Stats = new System.Windows.Forms.ComboBox();
|
||||
this.L_Value = new System.Windows.Forms.Label();
|
||||
this.MT_Stat = new System.Windows.Forms.MaskedTextBox();
|
||||
this.GB_FlagStatus.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nud)).BeginInit();
|
||||
this.GB_Researcher.SuspendLayout();
|
||||
|
@ -408,7 +412,7 @@
|
|||
this.GB_Misc.Controls.Add(this.flag_0285);
|
||||
this.GB_Misc.Location = new System.Drawing.Point(287, 12);
|
||||
this.GB_Misc.Name = "GB_Misc";
|
||||
this.GB_Misc.Size = new System.Drawing.Size(154, 288);
|
||||
this.GB_Misc.Size = new System.Drawing.Size(154, 215);
|
||||
this.GB_Misc.TabIndex = 17;
|
||||
this.GB_Misc.TabStop = false;
|
||||
this.GB_Misc.Text = "Misc";
|
||||
|
@ -513,7 +517,7 @@
|
|||
//
|
||||
this.flag_0675.AutoSize = true;
|
||||
this.flag_0675.CheckAlign = System.Drawing.ContentAlignment.TopLeft;
|
||||
this.flag_0675.Location = new System.Drawing.Point(15, 243);
|
||||
this.flag_0675.Location = new System.Drawing.Point(6, 182);
|
||||
this.flag_0675.Name = "flag_0675";
|
||||
this.flag_0675.Size = new System.Drawing.Size(119, 17);
|
||||
this.flag_0675.TabIndex = 17;
|
||||
|
@ -556,11 +560,60 @@
|
|||
this.flag_2546.UseVisualStyleBackColor = true;
|
||||
this.flag_2546.Click += new System.EventHandler(this.toggleFlag);
|
||||
//
|
||||
// L_Stats
|
||||
//
|
||||
this.L_Stats.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.L_Stats.AutoSize = true;
|
||||
this.L_Stats.Location = new System.Drawing.Point(290, 230);
|
||||
this.L_Stats.Name = "L_Stats";
|
||||
this.L_Stats.Size = new System.Drawing.Size(85, 13);
|
||||
this.L_Stats.TabIndex = 32;
|
||||
this.L_Stats.Text = "Event Constants";
|
||||
//
|
||||
// CB_Stats
|
||||
//
|
||||
this.CB_Stats.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.CB_Stats.DropDownHeight = 156;
|
||||
this.CB_Stats.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.CB_Stats.DropDownWidth = 180;
|
||||
this.CB_Stats.FormattingEnabled = true;
|
||||
this.CB_Stats.IntegralHeight = false;
|
||||
this.CB_Stats.Location = new System.Drawing.Point(293, 246);
|
||||
this.CB_Stats.Name = "CB_Stats";
|
||||
this.CB_Stats.Size = new System.Drawing.Size(94, 21);
|
||||
this.CB_Stats.TabIndex = 31;
|
||||
this.CB_Stats.SelectedIndexChanged += new System.EventHandler(this.changeConstantIndex);
|
||||
//
|
||||
// L_Value
|
||||
//
|
||||
this.L_Value.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.L_Value.AutoSize = true;
|
||||
this.L_Value.Location = new System.Drawing.Point(290, 270);
|
||||
this.L_Value.Name = "L_Value";
|
||||
this.L_Value.Size = new System.Drawing.Size(34, 13);
|
||||
this.L_Value.TabIndex = 30;
|
||||
this.L_Value.Text = "Value";
|
||||
//
|
||||
// MT_Stat
|
||||
//
|
||||
this.MT_Stat.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.MT_Stat.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.MT_Stat.Location = new System.Drawing.Point(349, 270);
|
||||
this.MT_Stat.Mask = "00000";
|
||||
this.MT_Stat.Name = "MT_Stat";
|
||||
this.MT_Stat.Size = new System.Drawing.Size(38, 20);
|
||||
this.MT_Stat.TabIndex = 29;
|
||||
this.MT_Stat.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
|
||||
//
|
||||
// SAV_EventFlagsXY
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(449, 342);
|
||||
this.Controls.Add(this.L_Stats);
|
||||
this.Controls.Add(this.CB_Stats);
|
||||
this.Controls.Add(this.L_Value);
|
||||
this.Controls.Add(this.MT_Stat);
|
||||
this.Controls.Add(this.flag_2546);
|
||||
this.Controls.Add(this.GB_Misc);
|
||||
this.Controls.Add(this.GB_Rebattle);
|
||||
|
@ -640,5 +693,9 @@
|
|||
private System.Windows.Forms.CheckBox flag_0286;
|
||||
private System.Windows.Forms.CheckBox flag_0285;
|
||||
private System.Windows.Forms.CheckBox flag_2546;
|
||||
private System.Windows.Forms.Label L_Stats;
|
||||
private System.Windows.Forms.ComboBox CB_Stats;
|
||||
private System.Windows.Forms.Label L_Value;
|
||||
private System.Windows.Forms.MaskedTextBox MT_Stat;
|
||||
}
|
||||
}
|
|
@ -29,6 +29,7 @@ namespace PKHeX
|
|||
bool setup = true;
|
||||
public CheckBox[] chka;
|
||||
public bool[] flags = new bool[3072];
|
||||
public ushort[] Constants = new ushort[0x2FC / 2];
|
||||
private void B_Cancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
Close();
|
||||
|
@ -39,20 +40,26 @@ namespace PKHeX
|
|||
for (int i = 0; i < chka.Length; i++)
|
||||
flags[getFlagNum(chka[i])] = chka[i].Checked;
|
||||
|
||||
byte[] data = new byte[flags.Length / 8];
|
||||
|
||||
byte[] data = new byte[flags.Length / 8];
|
||||
|
||||
for (int i = 0; i < flags.Length; i++)
|
||||
{
|
||||
if (flags[i])
|
||||
data[i/8] |= (byte)(1 << i%8);
|
||||
data[i / 8] |= (byte)(1 << i % 8);
|
||||
}
|
||||
Array.Copy(data, 0, m_parent.savefile, 0x1A0FC + savshift, 0x180);
|
||||
|
||||
// Copy back Constants
|
||||
changeConstantIndex(null, null); // Trigger Saving
|
||||
for (int i = 0; i < Constants.Length; i++)
|
||||
Array.Copy(BitConverter.GetBytes((ushort)Constants[i]), 0, m_parent.savefile, 0x19E00 + savshift + 2 * i, 2);
|
||||
|
||||
this.Close();
|
||||
}
|
||||
private void Setup()
|
||||
{
|
||||
// Fill Bit arrays
|
||||
|
||||
|
||||
chka = new CheckBox[] {
|
||||
flag_0001,flag_0002,flag_0003,flag_0004,flag_0005,
|
||||
flag_2237,flag_2238,flag_2239,
|
||||
|
@ -69,6 +76,15 @@ namespace PKHeX
|
|||
BitArray BitRegion = new BitArray(data);
|
||||
BitRegion.CopyTo(flags, 0);
|
||||
|
||||
// Setup Event Constant Editor
|
||||
CB_Stats.Items.Clear();
|
||||
for (int i = 0; i < 0x2FC; i += 2)
|
||||
{
|
||||
CB_Stats.Items.Add(String.Format("0x{0}", i.ToString("X3")));
|
||||
Constants[i / 2] = BitConverter.ToUInt16(m_parent.savefile, 0x19E00 + i);
|
||||
}
|
||||
CB_Stats.SelectedIndex = 0;
|
||||
|
||||
// Populate Flags
|
||||
setup = true;
|
||||
popFlags();
|
||||
|
@ -173,18 +189,27 @@ namespace PKHeX
|
|||
{ Util.Error("Invalid SAV Size"); return; }
|
||||
}
|
||||
else return;
|
||||
|
||||
|
||||
Button bs = (Button)sender;
|
||||
if (bs.Name == "B_LoadOld")
|
||||
{
|
||||
Array.Copy(eventflags, olddata, 0x180);
|
||||
TB_OldSAV.Text = path;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
Array.Copy(eventflags, newdata, 0x180);
|
||||
TB_NewSAV.Text = path;
|
||||
}
|
||||
}
|
||||
int entry = -1;
|
||||
private void changeConstantIndex(object sender, EventArgs e)
|
||||
{
|
||||
if (entry > -1) // Set Entry
|
||||
Constants[entry] = (ushort)(Math.Min(Util.ToUInt32(MT_Stat), 0xFFFF));
|
||||
|
||||
entry = CB_Stats.SelectedIndex; // Get Entry
|
||||
MT_Stat.Text = Constants[entry].ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -20,13 +20,10 @@ namespace PKHeX
|
|||
pfa = Form1.puffs;
|
||||
savindex = m_parent.savindex;
|
||||
pfa[0] = "---";
|
||||
setup();
|
||||
Setup();
|
||||
|
||||
ToolTip ToolTip1 = new ToolTip();
|
||||
ToolTip1.SetToolTip(this.B_Sort, "Hold CTRL to reverse sort.");
|
||||
|
||||
ToolTip ToolTip2 = new ToolTip();
|
||||
ToolTip2.SetToolTip(this.B_All, "Hold CTRL to give Deluxe instead of Supreme.");
|
||||
new ToolTip().SetToolTip(this.B_Sort, "Hold CTRL to reverse sort.");
|
||||
new ToolTip().SetToolTip(this.B_All, "Hold CTRL to give Deluxe instead of Supreme.");
|
||||
}
|
||||
Form1 m_parent;
|
||||
public byte[] sav = new byte[0x100000];
|
||||
|
@ -40,7 +37,7 @@ namespace PKHeX
|
|||
"Deluxe Sweet","Deluxe Mint","Deluxe Citrus","Deluxe Mocha","Deluxe Spice",
|
||||
"Supreme Wish","Supreme Honor","Supreme Spring","Supreme Summer","Supreme Fall","Supreme Winter",
|
||||
};
|
||||
private void setup()
|
||||
private void Setup()
|
||||
{
|
||||
dataGridView1.Rows.Clear();
|
||||
dataGridView1.Columns.Clear();
|
||||
|
@ -100,11 +97,10 @@ namespace PKHeX
|
|||
}
|
||||
byte[] newpuffs = new byte[100];
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
newpuffs[i] = (byte)(Util.rnd32() % basemod + basepuff);
|
||||
}
|
||||
|
||||
Array.Copy(newpuffs, 0, sav, 0x5400 + savindex * 0x7F000, 100);
|
||||
setup();
|
||||
Setup();
|
||||
}
|
||||
private void B_None_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
@ -115,7 +111,7 @@ namespace PKHeX
|
|||
newpuffs[3] = 4;
|
||||
newpuffs[4] = 5;
|
||||
Array.Copy(newpuffs, 0, sav, 0x5400 + savindex * 0x7F000, 100);
|
||||
setup();
|
||||
Setup();
|
||||
}
|
||||
private void B_Sort_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
@ -148,7 +144,7 @@ namespace PKHeX
|
|||
Array.Resize(ref puffarray, 100);
|
||||
}
|
||||
Array.Copy(puffarray, 0, sav, 0x5400 + savindex * 0x7F000, 100);
|
||||
setup();
|
||||
Setup();
|
||||
}
|
||||
private void B_Save_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
|
13
SAV/SAV_SecretBase.Designer.cs
generated
13
SAV/SAV_SecretBase.Designer.cs
generated
|
@ -114,6 +114,7 @@
|
|||
this.B_FSave = new System.Windows.Forms.Button();
|
||||
this.MT_Flags = new System.Windows.Forms.MaskedTextBox();
|
||||
this.L_FlagsCaptured = new System.Windows.Forms.Label();
|
||||
this.B_FDelete = new System.Windows.Forms.Button();
|
||||
this.f_PKM.SuspendLayout();
|
||||
this.GB_PKM.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.NUD_FPKM)).BeginInit();
|
||||
|
@ -1133,11 +1134,22 @@
|
|||
this.L_FlagsCaptured.TabIndex = 22;
|
||||
this.L_FlagsCaptured.Text = "Flags Captured: ";
|
||||
//
|
||||
// B_FDelete
|
||||
//
|
||||
this.B_FDelete.Location = new System.Drawing.Point(96, 85);
|
||||
this.B_FDelete.Name = "B_FDelete";
|
||||
this.B_FDelete.Size = new System.Drawing.Size(18, 24);
|
||||
this.B_FDelete.TabIndex = 23;
|
||||
this.B_FDelete.Text = "X";
|
||||
this.B_FDelete.UseVisualStyleBackColor = true;
|
||||
this.B_FDelete.Click += new System.EventHandler(this.B_FDelete_Click);
|
||||
//
|
||||
// SAV_SecretBase
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(514, 332);
|
||||
this.Controls.Add(this.B_FDelete);
|
||||
this.Controls.Add(this.L_FlagsCaptured);
|
||||
this.Controls.Add(this.MT_Flags);
|
||||
this.Controls.Add(this.B_FSave);
|
||||
|
@ -1262,5 +1274,6 @@
|
|||
private System.Windows.Forms.NumericUpDown NUD_FBaseLocation;
|
||||
private System.Windows.Forms.MaskedTextBox MT_Flags;
|
||||
private System.Windows.Forms.Label L_FlagsCaptured;
|
||||
private System.Windows.Forms.Button B_FDelete;
|
||||
}
|
||||
}
|
|
@ -490,5 +490,28 @@ namespace PKHeX
|
|||
{
|
||||
Label_Gender.Text = Form1.gendersymbols[genderflag];
|
||||
}
|
||||
|
||||
private void B_FDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (LB_Favorite.SelectedIndex < 1) { Util.Alert("Cannot delete your Secret Base."); return; }
|
||||
int index = LB_Favorite.SelectedIndex - 1;
|
||||
|
||||
int playeroff = fav_offset + 0x5400 + 0x326;
|
||||
int favoff = fav_offset + 0x5400 + 0x63A;
|
||||
string OT = Util.TrimFromZero(Encoding.Unicode.GetString(sav, sv + playeroff + 0x218, 0x1A));
|
||||
string BaseTrainer = Util.TrimFromZero(Encoding.Unicode.GetString(sav, sv + favoff + index * 0x3E0 + 0x218, 0x1A));
|
||||
if (BaseTrainer.Length < 1 || BaseTrainer[0] == '\0')
|
||||
BaseTrainer = "Empty";
|
||||
|
||||
if (Util.Prompt(MessageBoxButtons.YesNo, String.Format("Delete {1}'s base (Entry {0}) from your records?", index, BaseTrainer)) == DialogResult.Yes)
|
||||
{
|
||||
int max = 29; int size = 0x3E0;
|
||||
int offset = sv + favoff + index * size;
|
||||
if (index != max) Array.Copy(sav, offset + size, sav, offset, size * (max - index));
|
||||
// Ensure Last Entry is Cleared
|
||||
Array.Copy(new byte[size], 0, sav, size * max, size);
|
||||
popFavorite();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,6 +44,7 @@ namespace PKHeX
|
|||
getComboBoxes();
|
||||
getTextBoxes();
|
||||
getBadges();
|
||||
GB_Map.Enabled = !Form1.ramsavloaded;
|
||||
|
||||
statdata = new string[] {
|
||||
"0x000", "0x000", // Steps taken?
|
||||
|
|
Loading…
Reference in a new issue