forked from HeyM1ke/ValorantStreamOverlay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Settings.cs
58 lines (45 loc) · 1.73 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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace ValorantStreamOverlay
{
public partial class Settings : Form
{
public Settings()
{
InitializeComponent();
}
private void applyButton_Click(object sender, EventArgs e)
{
ApplySettings();
}
void ApplySettings()
{
Properties.Settings.Default.username = usernameTextBox.Text;
Properties.Settings.Default.password = passwordTextBox.Text;
Properties.Settings.Default.region = regionDrop.SelectedIndex;
Properties.Settings.Default.skin = skinDrop.SelectedIndex;
Properties.Settings.Default.refresh = refreshDrop.SelectedIndex;
Properties.Settings.Default.Save();
//After Setting user inputs to settings, ask user to reboot program :)
DialogResult dialogResult =
MessageBox.Show("Please reboot overlay, for new settings to apply.", "Reboot to apply", MessageBoxButtons.OK);
if (dialogResult == DialogResult.OK)
Environment.Exit(1);
else
Environment.Exit(1);
}
private void Settings_Load(object sender, EventArgs e)
{
usernameTextBox.Text = Properties.Settings.Default.username;
passwordTextBox.Text = Properties.Settings.Default.password;
regionDrop.SelectedIndex = Properties.Settings.Default.region;
skinDrop.SelectedIndex = Properties.Settings.Default.skin;
refreshDrop.SelectedIndex = Properties.Settings.Default.refresh;
}
}
}