static ProjectController() { SpriteManager = new SpriteManager(); BlockManager = new BlockManager(); GraphicsManager = new GraphicsManager(); ProjectManager = new ProjectManager(); LevelManager = new LevelManager(); WorldManager = new WorldManager(); ColorManager = new ColorManager(); PaletteManager = new PaletteManager(); SpecialManager = new SpecialManager(); LayoutManager = new LayoutManager(); MusicManager = new MusicManager(); ReubenDirectory = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\Reuben"; if (!Directory.Exists(ReubenDirectory)) { Directory.CreateDirectory(ReubenDirectory); } }
public static bool CreateNewProject(string filename, string name) { RootDirectory = filename.Substring(0, filename.LastIndexOf(Path.DirectorySeparatorChar)); if (!Directory.Exists(RootDirectory)) { Directory.CreateDirectory(RootDirectory); } LevelDirectory = string.Format("{0}{1}Levels", RootDirectory, Path.DirectorySeparatorChar); WorldDirectory = string.Format("{0}{1}Worlds", RootDirectory, Path.DirectorySeparatorChar); Directory.CreateDirectory(LevelDirectory); Directory.CreateDirectory(WorldDirectory); ProjectName = name; // Load defaults SpriteManager.LoadDefaultSprites(); SpriteManager.Save(string.Format("{0}{1}sprites.xml", RootDirectory, Path.DirectorySeparatorChar)); BlockManager.LoadDefault(); BlockManager.SaveDefinitions(string.Format("{0}{1}{2}.tsa", RootDirectory, Path.DirectorySeparatorChar, ProjectName)); BlockManager.SaveBlockStrings(string.Format("{0}{1}strings.xml", RootDirectory, Path.DirectorySeparatorChar, ProjectName)); GraphicsManager.LoadDefault(); GraphicsManager.SaveGraphics(string.Format("{0}{1}{2}.chr", RootDirectory, Path.DirectorySeparatorChar, ProjectName)); LevelManager.Default(); WorldManager.Default(); ColorManager.LoadDefaultColor(); MusicManager.LoadDefault(); PaletteManager.Default(); SpecialManager.LoadDefaultSpecialGraphics(); SpecialManager.LoadDefaultSpecials(); SpecialManager.SaveGraphics(string.Format("{0}{1}special.chr", RootDirectory, Path.DirectorySeparatorChar)); SpecialManager.SaveSpecials(string.Format("{0}{1}special.xml", RootDirectory, Path.DirectorySeparatorChar)); LayoutManager.LoadDefault(); ProjectManager.New(name); ProjectManager.Save(string.Format("{0}{1}{2}.rbn", RootDirectory, Path.DirectorySeparatorChar, ProjectName)); return(true); }