2021-05-15 23:08:27 +00:00
|
|
|
|
using System;
|
2020-06-15 19:11:05 +00:00
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
2021-06-15 23:25:48 +00:00
|
|
|
|
namespace TBMM
|
2020-06-15 19:11:05 +00:00
|
|
|
|
{
|
|
|
|
|
public partial class SettingsForm : Form
|
|
|
|
|
{
|
|
|
|
|
private MainForm mainForm;
|
2021-01-20 21:41:21 +00:00
|
|
|
|
private bool autopatchingEnabled;
|
2020-06-15 19:11:05 +00:00
|
|
|
|
public SettingsForm()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Form1_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
2021-05-15 23:08:27 +00:00
|
|
|
|
mainForm = (MainForm) Owner;
|
|
|
|
|
gamelocation.Text = mainForm.Configuration.GamePath;
|
|
|
|
|
autopatchingEnabled = mainForm.Configuration.AutoPatch == AutoPatchingState.Enabled;
|
2021-01-20 21:41:21 +00:00
|
|
|
|
autopatching.Checked = autopatchingEnabled;
|
2020-06-15 19:11:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void browsebtn_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
gamelocation.Text = mainForm.SelectGameFolder() ?? gamelocation.Text;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void savebtn_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2021-05-15 23:08:27 +00:00
|
|
|
|
mainForm.Configuration.GamePath = gamelocation.Text;
|
|
|
|
|
mainForm.Configuration.Save();
|
2020-06-15 19:11:05 +00:00
|
|
|
|
Close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void cancelbtn_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Close();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|