Techblox Mod Manager / Launcher
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SettingsForm.cs 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using System.Windows.Forms;
  3. namespace GCMM
  4. {
  5. public partial class SettingsForm : Form
  6. {
  7. private MainForm mainForm;
  8. private bool autopatchingEnabled;
  9. public SettingsForm()
  10. {
  11. InitializeComponent();
  12. }
  13. private void Form1_Load(object sender, EventArgs e)
  14. {
  15. mainForm = (MainForm) Owner;
  16. gamelocation.Text = mainForm.Configuration.GamePath;
  17. autopatchingEnabled = mainForm.Configuration.AutoPatch == AutoPatchingState.Enabled;
  18. autopatching.Checked = autopatchingEnabled;
  19. }
  20. private void browsebtn_Click(object sender, EventArgs e)
  21. {
  22. gamelocation.Text = mainForm.SelectGameFolder() ?? gamelocation.Text;
  23. }
  24. private void savebtn_Click(object sender, EventArgs e)
  25. {
  26. mainForm.Configuration.GamePath = gamelocation.Text;
  27. if (autopatching.Checked != autopatchingEnabled)
  28. mainForm.EnableDisableAutoPatchingWithDialog(autopatching.Checked);
  29. mainForm.Configuration.Save();
  30. Close();
  31. }
  32. private void cancelbtn_Click(object sender, EventArgs e)
  33. {
  34. Close();
  35. }
  36. }
  37. }