예제 #1
0
        //savegame
        private void button2_MouseClick(Object obj, MouseEventArgs e)
        {
            if (display.gameover == true)
            {
                return;
            }
            if (display.LockGame == true)
            {
                return;
            }
            SaveFileDialog gamesave = new SaveFileDialog();

            gamesave.Title            = "UIT Pokemon save game";
            gamesave.Filter           = "Only file (*uitp)|*uitp";
            gamesave.InitialDirectory = Information.directories;
            if (gamesave.ShowDialog() == DialogResult.OK)
            {
                zipgame zip = display.SaveGame();
                LoadSaveGame.SaveGame(zip, gamesave.FileName + ".uitp");
            }
            try
            {
                gamesave.Dispose();
                GC.Collect();
            }
            catch
            {
                // write report file
            }
        }
예제 #2
0
        //open game
        private void button1_MouseClick(Object obj, MouseEventArgs e)
        {
            OpenFileDialog gameload = new OpenFileDialog();

            gameload.Title            = "UIT Pokemon load game";
            gameload.Filter           = "Only file (*uitp)|*uitp";
            gameload.InitialDirectory = Information.directories;
            if (gameload.ShowDialog() == DialogResult.OK)
            {
                zipgame zip = LoadSaveGame.LoadGame(gameload.FileName);
                display.LoadGame(zip);
            }
            try
            {
                gameload.Dispose();
                GC.SuppressFinalize(gameload);
                GC.Collect();
            }
            catch { }
        }