Example #1
0
        public LoadButton(OptionsMenu op)
        {
            menu = op;
            rec = new Rectangle((menu.game.gameWidth / 2) - 100, menu.game.gameHeight - 100, 100, 20);
            drawString = new Vector2((float)(rec.X), (float)(rec.Y));
            mouse = menu.game.mouse;

            DirectoryInfo d = new DirectoryInfo(Environment.CurrentDirectory);
            while (d.ToString() != "dynasty")
            {
                d = d.Parent;
            }
            string p = d.FullName + @"\GameData\Maps\";
            d = new DirectoryInfo(p);

            FileInfo[] files = d.GetFiles();
            int x = 0;
            filenames = new FileNameEntry[files.Length];
            foreach(FileInfo file in files)
            {
                Rectangle rect = new Rectangle(menu.game.gameWidth/2, x*30, 100, 30);
                filenames[x] = new FileNameEntry(menu.game.mouse, menu, rect , file.Name);
                x++;
            }
        }
Example #2
0
        public void updateList()
        {
            DirectoryInfo d = new DirectoryInfo(Environment.CurrentDirectory);
            while (d.ToString() != "dynasty")
            {
                d = d.Parent;
            }
            string p = d.FullName + @"\GameData\Maps\";
            d = new DirectoryInfo(p);

            FileInfo[] files = d.GetFiles();
            int x = 0;
            filenames = new FileNameEntry[files.Length];
            foreach (FileInfo file in files)
            {
                Rectangle rect = new Rectangle(menu.game.gameWidth / 2, x * 30, 100, 30);
                filenames[x] = new FileNameEntry(menu.game.mouse, menu, rect, file.Name);
                x++;
            }
        }