-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.cs
85 lines (75 loc) · 2.79 KB
/
settings.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
* Created by SharpDevelop.
* User: Niko
* Date: 05.02.2014
* Time: 20:48
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Drawing;
using System.Windows.Forms;
namespace ModSync
{
/// <summary>
/// Description of settings.
/// </summary>
public partial class settings : Form
{
public settings()
{
InitializeComponent();
initSettings();
}
void initSettings()
{
if (Properties.Settings.Default.arma3path == "NONE")
{
string path = Environment.ExpandEnvironmentVariables("%programfiles(x86)%");
path += "\\Steam\\SteamApps\\common\\Arma 3\\";
Properties.Settings.Default.arma3path = path;
}
tb_armapath.Text = Properties.Settings.Default.arma3path;
tb_modlaunch.Text = Properties.Settings.Default.mods;
chb_nosplash.Checked = Properties.Settings.Default.nosplash;
chb_worldempty.Checked = Properties.Settings.Default.worldempty;
tb_autojoinserver.Text = Properties.Settings.Default.autojoinserver;
tb_password.Text = Properties.Settings.Default.password;
tb_otherstartup.Text = Properties.Settings.Default.otherstartup;
tb_svnserver.Text = Properties.Settings.Default.svnserver;
chb_checkforupdates.Checked = Properties.Settings.Default.checkforupdates;
}
void saveSettings()
{
Properties.Settings.Default.arma3path = tb_armapath.Text;
Properties.Settings.Default.mods = tb_modlaunch.Text;
Properties.Settings.Default.nosplash = chb_nosplash.Checked;
Properties.Settings.Default.worldempty = chb_worldempty.Checked;
Properties.Settings.Default.svnserver = tb_svnserver.Text;
Properties.Settings.Default.checkforupdates = chb_checkforupdates.Checked;
Properties.Settings.Default.autojoinserver = tb_autojoinserver.Text;
Properties.Settings.Default.password = tb_password.Text;
Properties.Settings.Default.otherstartup = tb_otherstartup.Text;
Properties.Settings.Default.Save();
}
void Bt_okClick(object sender, EventArgs e)
{
saveSettings();
this.DialogResult = DialogResult.OK;
this.Close();
}
private void bt_selecta3path_Click(object sender, EventArgs e)
{
FolderBrowserDialog fbd = new FolderBrowserDialog();
if (fbd.ShowDialog() == DialogResult.OK)
{
tb_armapath.Text = fbd.SelectedPath;
}
}
private void bt_abort_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Abort;
this.Close();
}
}
}