Ejemplo n.º 1
0
        public void LoadConfig()
        {
            loading = true;
            try
            {
                currentGame = Utility.TryReadFromXmlFile <ParamsFromMainFormToGame>(Application.StartupPath + "//config.cfg");
                if (currentGame == null)
                {
                    currentGame = new ParamsFromMainFormToGame();
                }

                //   cbHistory.Checked = bool.Parse(ss[2]);
                trackBar1.Value = currentGame.AnimationSpeedInPercent / 10;
                trackBar2.Value = currentGame.Brightness;

                edtPlayer1.Text   = currentGame.firstProgramAddress ?? "";
                edtPlayer2.Text   = currentGame.secondProgramAddress ?? "";
                cbPlayer1.Checked = currentGame.firstIsControlledByHuman;
                cbPlayer2.Checked = currentGame.secondIsControlledByHuman;
                // edtHistory.Text = reader.ReadLine();

                openFileDialog1.FileName = currentGame.lastOpenFileDialog;
                openFileDialog2.FileName = currentGame.replayPath;
            }
            catch (Exception ex)
            {
            }
            finally
            {
                loading = false;
            }
        }
Ejemplo n.º 2
0
        public void LoadConfig()
        {
            try
            {
                currentGame = ReadFromXmlFile <ParamsFromMainFormToGame>(Application.StartupPath + "//config.cfg");


                cbPlayer1.Checked = currentGame.firstIsControlledByHuman;
                cbPlayer2.Checked = currentGame.secondIsControlledByHuman;
                //   cbHistory.Checked = bool.Parse(ss[2]);
                trackBar1.Value = currentGame.AnumationSpeedInPercent / 10;

                edtPlayer1.Text = currentGame.firstProgramAddress ?? "";
                edtPlayer2.Text = currentGame.secondProgramAddress ?? "";
                // edtHistory.Text = reader.ReadLine();

                openFileDialog1.FileName = currentGame.lastOpenFileDialog;
            }
            catch (Exception ex)
            {
            }
        }