mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-10-01 07:26:42 -05:00
Merge pull request #40 from Kaisonic/master
Add Level to Box Data Report
This commit is contained in:
@@ -559,7 +559,7 @@ private string
|
||||
|
||||
private int
|
||||
mability, mabilitynum, mnature, mgenderflag, maltforms, mPKRS_Strain, mPKRS_Duration,
|
||||
mmetlevel, motgender;
|
||||
mmetlevel, motgender, mLevel;
|
||||
|
||||
private bool
|
||||
misegg, misnick, misshiny, mfeflag;
|
||||
@@ -613,6 +613,7 @@ private ushort
|
||||
public uint SPD_IV { get { return mSPD_IV; } }
|
||||
public uint SPE_IV { get { return mSPE_IV; } }
|
||||
public uint EXP { get { return mexp; } }
|
||||
public int Level { get { return mLevel; } }
|
||||
public uint HP_EV { get { return mHP_EV; } }
|
||||
public uint ATK_EV { get { return mATK_EV; } }
|
||||
public uint DEF_EV { get { return mDEF_EV; } }
|
||||
@@ -847,6 +848,7 @@ public PKX(byte[] pkx, string ident)
|
||||
mRMove4N = Form1.movelist[meggmove4];
|
||||
mMetLocN = PKX.getLocation(false, mgamevers, mmetloc);
|
||||
mEggLocN = PKX.getLocation(true, mgamevers, meggloc);
|
||||
mLevel = PKX.getLevel(mspecies, ref mexp);
|
||||
mGameN = Form1.gamelist[mgamevers];
|
||||
mBallN = Form1.balllist[mball];
|
||||
motlangN = Form1.gamelanguages[motlang] ?? String.Format("UNK {0}", motlang);
|
||||
|
||||
@@ -376,8 +376,8 @@ private void mainMenuBoxReport(object sender, EventArgs e)
|
||||
{
|
||||
frmReport ReportForm = new frmReport();
|
||||
int offset = 0x27A00; if (savegame_oras) offset = 0x33000 + 0x5400;
|
||||
ReportForm.Show();
|
||||
ReportForm.PopulateData(savefile, savindex, offset);
|
||||
ReportForm.ShowDialog();
|
||||
}
|
||||
private void mainMenuUnicode(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
10
SAV/frmReport.Designer.cs
generated
10
SAV/frmReport.Designer.cs
generated
@@ -31,6 +31,7 @@ private void InitializeComponent()
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmReport));
|
||||
this.dgData = new System.Windows.Forms.DataGridView();
|
||||
this.BoxBar = new System.Windows.Forms.ProgressBar();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgData)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
@@ -49,11 +50,19 @@ private void InitializeComponent()
|
||||
this.dgData.Size = new System.Drawing.Size(812, 461);
|
||||
this.dgData.TabIndex = 0;
|
||||
//
|
||||
// BoxBar
|
||||
//
|
||||
this.BoxBar.Location = new System.Drawing.Point(13, 13);
|
||||
this.BoxBar.Name = "BoxBar";
|
||||
this.BoxBar.Size = new System.Drawing.Size(787, 23);
|
||||
this.BoxBar.TabIndex = 1;
|
||||
//
|
||||
// frmReport
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(812, 461);
|
||||
this.Controls.Add(this.BoxBar);
|
||||
this.Controls.Add(this.dgData);
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Name = "frmReport";
|
||||
@@ -68,5 +77,6 @@ private void InitializeComponent()
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.DataGridView dgData;
|
||||
private System.Windows.Forms.ProgressBar BoxBar;
|
||||
}
|
||||
}
|
||||
@@ -28,11 +28,14 @@ public void PopulateData(byte[] InputData, int savindex, int baseoffset)
|
||||
PokemonList PL = new PokemonList();
|
||||
PKX.Structures.SaveGame SaveGame = new PKX.Structures.SaveGame("XY");
|
||||
if (savindex > 1) savindex = 0;
|
||||
BoxBar.Maximum = 930 + 100;
|
||||
BoxBar.Step = 1;
|
||||
for (int BoxNum = 0; BoxNum < 31; BoxNum++)
|
||||
{
|
||||
int boxoffset = baseoffset + 0x7F000 * savindex + BoxNum * (0xE8 * 30);
|
||||
for (int SlotNum = 0; SlotNum < 30; SlotNum++)
|
||||
{
|
||||
BoxBar.PerformStep();
|
||||
int offset = boxoffset + 0xE8 * SlotNum;
|
||||
byte[] slotdata = new byte[0xE8];
|
||||
Array.Copy(SaveData, offset, slotdata, 0, 0xE8);
|
||||
@@ -46,11 +49,14 @@ public void PopulateData(byte[] InputData, int savindex, int baseoffset)
|
||||
}
|
||||
dgData.DataSource = PL;
|
||||
dgData.AutoGenerateColumns = true;
|
||||
BoxBar.Maximum = 930 + dgData.Columns.Count;
|
||||
for (int i = 0; i < dgData.Columns.Count; i++)
|
||||
{
|
||||
BoxBar.PerformStep();
|
||||
if (dgData.Columns[i] is DataGridViewImageColumn) continue; // Don't add sorting for Sprites
|
||||
dgData.Columns[i].SortMode = DataGridViewColumnSortMode.Automatic;
|
||||
}
|
||||
BoxBar.Visible = false;
|
||||
}
|
||||
private void promptSaveCSV(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
@@ -75,7 +81,7 @@ private void Export_CSV(string path)
|
||||
var cells = row.Cells.Cast<DataGridViewCell>();
|
||||
sb.AppendLine(string.Join(",", cells.Select(cell => "\"" + cell.Value + "\"").ToArray()));
|
||||
}
|
||||
System.IO.File.WriteAllText(path, sb.ToString(), Encoding.UTF8);
|
||||
System.IO.File.WriteAllText(path, sb.ToString(), Encoding.UTF8);
|
||||
}
|
||||
|
||||
public class PokemonList : SortableBindingList<PKX> { }
|
||||
|
||||
Reference in New Issue
Block a user