Relocate PokePuff sav properties

This commit is contained in:
Kurt
2015-11-21 19:17:35 -08:00
parent 0064d1b497
commit 19ff462fff
2 changed files with 7 additions and 5 deletions

View File

@@ -436,6 +436,9 @@ public bool DaycareOccupied2
set { Data[DaycareSlot[DaycareIndex] + (PK6.SIZE_STORED + 8) * 1] = (byte)(value ? 1 : 0); }
}
public byte[] Puffs { get { return Data.Skip(Puff).Take(100).ToArray(); } set { value.CopyTo(Data, Puff); } }
public int PuffCount { get { return BitConverter.ToInt32(Data, Puff + 100); } set { BitConverter.GetBytes(value).CopyTo(Data, Puff + 100); } }
// Data Accessing
public byte[] getData(int Offset, int Length)
{

View File

@@ -63,7 +63,7 @@ private void Setup()
dgv.Rows[i].Cells[0].Value = (i + 1).ToString();
dgv.Rows[i].Cells[1].Value = pfa[sav[Main.SAV.Puff + i]];
}
MT_CNT.Text = BitConverter.ToUInt32(sav, Main.SAV.Puff + 100).ToString("0");
MT_CNT.Text = Main.SAV.PuffCount.ToString();
}
private void dropclick(object sender, DataGridViewCellEventArgs e)
{
@@ -145,11 +145,10 @@ private void B_Save_Click(object sender, EventArgs e)
emptyslots++;
continue;
}
puffarray[i - emptyslots] = (byte) Array.IndexOf(pfa, puff);
puffarray[i - emptyslots] = (byte)Array.IndexOf(pfa, puff);
}
Array.Copy(puffarray, 0, sav, Main.SAV.Puff, 100);
Array.Copy(sav, Main.SAV.Data, sav.Length);
Main.SAV.Puffs = puffarray;
Main.SAV.PuffCount = Util.ToInt32(MT_CNT);
Main.SAV.Edited = true;
Close();
}