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.

41 lines
1.1KB

  1. using System;
  2. using System.Windows.Forms;
  3. namespace TBMM
  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. mainForm.Configuration.Save();
  28. Close();
  29. }
  30. private void cancelbtn_Click(object sender, EventArgs e)
  31. {
  32. Close();
  33. }
  34. }
  35. }