Update data export

This commit is contained in:
Kurt
2016-12-03 17:34:40 -08:00
parent b8895ddaeb
commit abda1dc5f4

View File

@@ -328,17 +328,18 @@ private void B_Export_Click(object sender, EventArgs e)
{
B_Save_Click(sender, e);
Directory.CreateDirectory("encdata");
foreach (var Map in Areas)
{
byte[][] tabs = new byte[Map.Tables.Count / 2][];
for (int i = 0; i < Map.Tables.Count; i += 2)
{
tabs[i] = new byte[4].Concat(Map.Tables[i].Data).Concat(Map.Tables[i + 1].Data).ToArray();
tabs[i/2] = new byte[4].Concat(Map.Tables[i].Data).Concat(Map.Tables[i + 1].Data).ToArray();
}
var packed = mini.packMini(tabs, "EA");
encdata[Map.FileNumber] = packed;
File.WriteAllBytes(Path.Combine("encdata", Map.FileNumber.ToString()), packed);
}
MessageBox.Show("Exported all tables!");
Util.Alert("Exported all tables!");
}
private class Area