Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        public GUI()
        {
            MSGBoxText = "";
            ShownMSGBoxText = "";
            ShowMSG = false;
            MSGisdone = true;
            MSGposition = new Vector2(10f, 10f);
            MSGColor = Color.White;
            MsgBox = new Sprite();
            MsgBoxAscii = new Sprite();
            asciiMode = false;

            InventoryBackground = new Sprite();
            InventoryBackgroundAscii = new Sprite();
            InventoryHighlight = new Sprite();
            InvPositionY = 543;
            InventoryBackground.Position = new Vector2(0f, (float)InvPositionY);
            ShowInventory = false;
            InvList = new List<Item>();
            InventorySelected = 0;

            project = new Project();

            ItemPic = new Sprite();

            ScreenFadeTex = new Sprite();
            FadeOpacity = 0f;

            EnterKeySprite = new Sprite();
            SpaceKeySprite = new Sprite();
            ShiftKeySprite = new Sprite();
            EnterKeySpriteOrg = new Sprite();
            SpaceKeySpriteOrg = new Sprite();
            ShiftKeySpriteOrg = new Sprite();
            EnterKeySpriteascii = new Sprite();
            SpaceKeySpriteascii = new Sprite();
            ShiftKeySpriteascii = new Sprite();

            FontColor = Color.Wheat;

            scrollcounter = 0;
        }
Exemplo n.º 3
0
        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>();
        }