public void LoadProjectfile() { string path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase); path = path.Substring(6, path.Length - 6); // Getting rid of the file:\ it puts in front of the path with the above line string relPath = System.IO.Path.Combine(path,proj.Name + ".prj"); proj = (Project)Project.Load(relPath, typeof(Project)); if (proj != null) { GameVariables = proj.GetGlobalVariables(); items.items = proj.GetItems(); } else { proj = new Project(Projectname, GameVariables, items.ReturnItemList()); Console.WriteLine("Could not load Projectfile!"); } items.LoadContent(Content); }
private void InitializeContent() { map = new Maps(); if (FirstRoom != "") { string path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase); path = path.Substring(6, path.Length - 6); // Getting rid of the file:\ it puts in front of the path with the above line string relPath = System.IO.Path.Combine(path + "\\saves\\", FirstRoom); LoadMap(relPath, true); } else { //Test-Walkmaps map.AddWalkRect(new Rectangle(174, 101, 271, 183)); map.AddWalkRect(new Rectangle(174, 258, 71, 149)); } player = new Player(); items = new Itemhandler(); GameVariables = new List<String[]>(); proj = new Project(Projectname, GameVariables, items.ReturnItemList()); save = new Savegame(proj.GetGlobalVariables(), player.InvList, map); LoadProjectfile(); Editor = new Form1(this); NewWalkMap = new Rectangle(0, 0, 0, 0); Snapshots = new List<Snapshot>(); }