public OpenLevelDialog()
 {
     InitializeComponent();
     this.ok_button.Click     += new RoutedEventHandler(ok_button_Click);
     this.cancel_button.Click += new RoutedEventHandler(cancel_button_Click);
     string[] files = FileStuff.GetFilesInFolder("data/levels", false);
     foreach (string file in files)
     {
         string name = file.EndsWith(".txt") ? file.Substring(0, file.Length - 4) : file;
         this.level_selector.Items.Add(name);
     }
     this.level_selector.SelectedIndex = 0;
     this.Status = false;
 }
Beispiel #2
0
        public static void Initialize()
        {
            string folder = "data/tile_manifests";

            string[] files = FileStuff.GetFilesInFolder(folder, false);
            foreach (string file in files)
            {
                string path     = folder + "/" + file;
                string contents = FileStuff.ReadFile(path);
                string name     = file.EndsWith(".txt") ? file.Substring(0, file.Length - 4) : file;

                InitializeCategory(name, contents);
            }
        }