private void displayEntry(object sender, EventArgs e)
{
editing = false;
RTB.Font = new Font("Courier New", 8);
RTB.LanguageOption = RichTextBoxLanguageOptions.DualFont;
int index = LB_DataEntry.SelectedIndex;
int offset = index * 0x1B4;
uint vnd = BitConverter.ToUInt32(data, offset + 0x1B0);
uint vn = vnd & 0xFF;
TB_VN.Text = vn.ToString("000");
string s = "Entry #" + vn + Environment.NewLine;
uint date = (vnd >> 14) & 0x1FFFF;
uint year = (date & 0xFF) + 2000;
uint month = (date >> 8) & 0xF;
uint day = (date >> 12);
if (day == 0)
{
s += "No records in this slot.";
foreach (object t in editor_spec)
((Control)t).Enabled = false;
editing = false;
NUP_PartyIndex_ValueChanged(sender, e);
goto end;
}
foreach (object t in editor_spec)
((Control)t).Enabled = true;
s += "Date: " + year + "/" + month + "/" + day + "" + Environment.NewLine + Environment.NewLine;
CAL_MetDate.Value = new DateTime((int)year, (int)month, (int)day);
int moncount = 0;
for (int i = 0; i < 6; i++)
{
int species = BitConverter.ToUInt16(data, offset + 0x00);
int helditem = BitConverter.ToUInt16(data, offset + 0x02);
int move1 = BitConverter.ToUInt16(data, offset + 0x04);
int move2 = BitConverter.ToUInt16(data, offset + 0x06);
int move3 = BitConverter.ToUInt16(data, offset + 0x08);
int move4 = BitConverter.ToUInt16(data, offset + 0x0A);
int TID = BitConverter.ToUInt16(data, offset + 0x10);
int SID = BitConverter.ToUInt16(data, offset + 0x12);
uint slgf = BitConverter.ToUInt32(data, offset + 0x14);
// uint form = slgf & 0x1F;
uint gender = (slgf >> 5) & 3; // 0 M; 1 F; 2 G
uint level = (slgf >> 7) & 0x7F;
uint shiny = (slgf >> 14) & 0x1;
// uint unkn = slgf >> 15;
string nickname = Util.TrimFromZero(Encoding.Unicode.GetString(data, offset + 0x18, 22));
string OTname = Util.TrimFromZero(Encoding.Unicode.GetString(data, offset + 0x30, 22));
if (species == 0)
continue;
moncount++;
string genderstr=gendersymbols[gender];
string shinystr = (shiny == 1) ? "Yes" : "No";
s += "Name: " + nickname;
s += " (" + Form1.specieslist[species] + " - " + genderstr + ")" + Environment.NewLine;
s += "Level: " + level + Environment.NewLine;
s += "Shiny: " + shinystr + Environment.NewLine;
s += "Held Item: " + Form1.itemlist[helditem] + Environment.NewLine;
s += "Move 1: " + Form1.movelist[move1] + Environment.NewLine;
s += "Move 2: " + Form1.movelist[move2] + Environment.NewLine;
s += "Move 3: " + Form1.movelist[move3] + Environment.NewLine;
s += "Move 4: " + Form1.movelist[move4] + Environment.NewLine;
s += "OT: " + OTname + " (" + TID + "/" + SID + ")" + Environment.NewLine;
s += Environment.NewLine;
offset += 0x48;
}
if (sender != null)
{
NUP_PartyIndex.Maximum = (moncount == 0) ? 1 : moncount;
NUP_PartyIndex.Value = 1;
NUP_PartyIndex_ValueChanged(sender, e);
}
else editing = true;
end:
RTB.Text = s;
RTB.Font = new Font("Courier New", 8);
}
private void NUP_PartyIndex_ValueChanged(object sender, EventArgs e)