Beispiel #1
0
        protected string GetStateToLoad(string file, string[] states)
        {
            LoadFileFromListDialog levDia = new LoadFileFromListDialog();

            levDia.SetText("Stats for " + Game.GetName());
            levDia.InsertLevels(states);
            string toReturn = string.Empty;

            if (levDia.ShowDialog() == DialogResult.OK)
            {
                toReturn = FM.GetState(file, levDia.GetSelected());
            }

            levDia.Dispose();
            return(toReturn);
        }
Beispiel #2
0
        /**
         * Gets filename from dialog
         * Get that file from Filer
         * Call other Load(fileName)
         */
        public void LoadLevel(string which)
        {
            LoadFileFromListDialog levDia = new LoadFileFromListDialog();

            levDia.InsertLevels(Filer.GetAllLevels());

            if (levDia.ShowDialog() == DialogResult.OK)
            {
                string fileName = levDia.GetSelected();
                string file     = Filer.Load(fileName);
                string level    = FM.GetLevel(file);
                switch (which)
                {
                case GAME_STRING:
                    PlayLevel(fileName, level);
                    break;

                case DESIGN_STRING:
                    OpenDesignerLoad(fileName, level);
                    break;
                }
            }
            levDia.Dispose();
        }