public static bool ImportBattlefields(string fullPath) { var battlefield = new Battlefields.Serialized[battlefields.Length]; for (int i = 0; i < battlefield.Length; i++) { battlefield[i] = new Battlefields.Serialized(); } try { Do.Import(battlefield, fullPath + "\\" + "battlefield", "BATTLEFIELD", true); } catch { MessageBox.Show("One or more files not a battlefield data file.", "LAZY SHELL", MessageBoxButtons.OK, MessageBoxIcon.Stop); return(false); } for (int i = 0; i < battlefield.Length; i++) { Tilesets[battlefields[i].Tileset] = battlefield[i].Tileset; battlefields[i].GraphicSetA = battlefield[i].GraphicSetA; battlefields[i].GraphicSetB = battlefield[i].GraphicSetB; battlefields[i].GraphicSetC = battlefield[i].GraphicSetC; battlefields[i].GraphicSetD = battlefield[i].GraphicSetD; battlefields[i].GraphicSetE = battlefield[i].GraphicSetE; PaletteSets[battlefields[i].PaletteSet] = battlefield[i].PaletteSet; battlefields[i].Index = i; } return(true); }
public static bool ImportBattlefield(int index, string fullPath) { var battlefield = new Battlefields.Serialized(); try { battlefield = (Battlefields.Serialized)Do.Import(battlefield, fullPath); } catch { MessageBox.Show("File not a battlefield data file.", "LAZY SHELL", MessageBoxButtons.OK, MessageBoxIcon.Stop); return(false); } Tilesets[battlefields[index].Tileset] = battlefield.Tileset; battlefields[index].GraphicSetA = battlefield.GraphicSetA; battlefields[index].GraphicSetB = battlefield.GraphicSetB; battlefields[index].GraphicSetC = battlefield.GraphicSetC; battlefields[index].GraphicSetD = battlefield.GraphicSetD; battlefields[index].GraphicSetE = battlefield.GraphicSetE; PaletteSets[battlefields[index].PaletteSet] = battlefield.PaletteSet; battlefields[index].Index = index; // return(true); }