// 选择游戏路径的按钮 private void button1_MouseClick(object sender, MouseEventArgs e) { DialogResult dialogResult = GamePathDialog.ShowDialog(); if (dialogResult == DialogResult.OK || dialogResult == DialogResult.Yes) { string gamePath = GamePathDialog.SelectedPath; if (gamePath.EndsWith("Mount & Blade II Bannerlord")) { GameDirPath.Text = GamePathDialog.SelectedPath; } else { DialogResult boxResult = MessageBox.Show("检测到您选中的路径并不是以Mount & Blade II Bannerlord结尾,您确定选择的路径正确?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (boxResult == DialogResult.Yes) { GameDirPath.Text = GamePathDialog.SelectedPath; } else { button1_MouseClick(sender, e); } } } }
private void ChangeGamePath(object sender, EventArgs e) { MessageBox.Show(@"You will now be asked to select the path your game is installed in. It should contain the folders ""game"" and ""boot"".", "Select Game Path", MessageBoxButtons.OK); if (GamePathDialog.ShowDialog() == DialogResult.OK) { Properties.Settings.Default["gamepath"] = GamePathDialog.SelectedPath; Properties.Settings.Default.Save(); pathLabel.Text = "Current Game Path:\n" + Properties.Settings.Default.gamepath; } }
public void initialSetup() { MessageBox.Show(@"You will now be asked to select the path your game is installed in. It should contain the folders ""game"" and ""boot"".", "Select Game Path", MessageBoxButtons.OK); if (GamePathDialog.ShowDialog() == DialogResult.OK) { Properties.Settings.Default["gamepath"] = GamePathDialog.SelectedPath; } else { Environment.Exit(0); } DialogResult dxresult = MessageBox.Show("Do you want to use DirectX 11?", " ", MessageBoxButtons.YesNo, MessageBoxIcon.None, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly); if (dxresult == System.Windows.Forms.DialogResult.Yes) { Properties.Settings.Default["isdx11"] = true; } else { Properties.Settings.Default["isdx11"] = false; } DialogResult hwresult = MessageBox.Show("Do you want to load Heavensward?", " ", MessageBoxButtons.YesNo, MessageBoxIcon.None, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly); if (hwresult == System.Windows.Forms.DialogResult.Yes) { Properties.Settings.Default["expansionlevel"] = 1; } else { Properties.Settings.Default["expansionlevel"] = 0; } Properties.Settings.Default["setupcomplete"] = true; Properties.Settings.Default.Save(); }
private void BtnOpenGamePath_Click(object sender, EventArgs e) { GamePathDialog.SelectedPath = @".\.minecraft"; GamePathDialog.ShowDialog(); tbGamePath.Text = GamePathDialog.SelectedPath; }