-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConfigWindow.cs
114 lines (102 loc) · 3.85 KB
/
ConfigWindow.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
using System;
using System.Windows.Forms;
using Styx.Common;
namespace Simcraft
{
public partial class ConfigWindow : Form
{
public ConfigWindow()
{
InitializeComponent();
fillKeyBox(cdKey);
fillKeyBox(exKey);
fillKeyBox(BKey);
fillKeyBox(AoeKey);
fillModBox(cdMod);
fillModBox(bMod);
fillModBox(exMod);
fillModBox(aoeMod);
cdKey.SelectedItem = SimCSettings.currentSettings.Cooldowns.key;
exKey.SelectedItem = SimCSettings.currentSettings.Execution.key;
BKey.SelectedItem = SimCSettings.currentSettings.Burst.key;
AoeKey.SelectedItem = SimCSettings.currentSettings.Aoe.key;
cdMod.SelectedItem = SimCSettings.currentSettings.Cooldowns.mod;
exMod.SelectedItem = SimCSettings.currentSettings.Execution.mod;
bMod.SelectedItem = SimCSettings.currentSettings.Burst.mod;
aoeMod.SelectedItem = SimCSettings.currentSettings.Aoe.mod;
}
private void fillKeyBox(ComboBox b1)
{
var values = Enum.GetValues(typeof(Keys));
foreach (var v in values)
{
b1.Items.Add(v);
}
/*b1.Items.Add(Keys.A);
b1.Items.Add(Keys.B);
b1.Items.Add(Keys.C);
b1.Items.Add(Keys.D);
b1.Items.Add(Keys.E);
b1.Items.Add(Keys.F);
b1.Items.Add(Keys.G);
b1.Items.Add(Keys.H);
b1.Items.Add(Keys.I);
b1.Items.Add(Keys.J);
b1.Items.Add(Keys.K);
b1.Items.Add(Keys.L);
b1.Items.Add(Keys.M);
b1.Items.Add(Keys.N);
b1.Items.Add(Keys.O);
b1.Items.Add(Keys.P);
b1.Items.Add(Keys.Q);
b1.Items.Add(Keys.R);
b1.Items.Add(Keys.S);
b1.Items.Add(Keys.T);
b1.Items.Add(Keys.U);
b1.Items.Add(Keys.V);
b1.Items.Add(Keys.W);
b1.Items.Add(Keys.X);
b1.Items.Add(Keys.Y);
b1.Items.Add(Keys.Z);
b1.Items.Add(Keys.D1);
b1.Items.Add(Keys.D2);
b1.Items.Add(Keys.D3);
b1.Items.Add(Keys.D4);
b1.Items.Add(Keys.D5);
b1.Items.Add(Keys.D6);
b1.Items.Add(Keys.D7);
b1.Items.Add(Keys.D8);
b1.Items.Add(Keys.D9);
b1.Items.Add(Keys.);*/
}
private void fillModBox(ComboBox b1)
{
b1.Items.Add(Styx.Common.ModifierKeys.Alt);
b1.Items.Add(Styx.Common.ModifierKeys.Control);
b1.Items.Add(Styx.Common.ModifierKeys.Shift);
b1.Items.Add(Styx.Common.ModifierKeys.NoRepeat);
}
private void button1_Click(object sender, EventArgs e)
{
SimCSettings.currentSettings.Cooldowns.key = (Keys) cdKey.SelectedItem;
SimCSettings.currentSettings.Execution.key = (Keys) exKey.SelectedItem;
SimCSettings.currentSettings.Burst.key = (Keys) BKey.SelectedItem;
SimCSettings.currentSettings.Aoe.key = (Keys) AoeKey.SelectedItem;
SimCSettings.currentSettings.Cooldowns.mod = (ModifierKeys) cdMod.SelectedItem;
SimCSettings.currentSettings.Execution.mod = (ModifierKeys) exMod.SelectedItem;
SimCSettings.currentSettings.Burst.mod = (ModifierKeys) bMod.SelectedItem;
SimCSettings.currentSettings.Aoe.mod = (ModifierKeys) aoeMod.SelectedItem;
SimCSettings.Save();
SimcraftImpl.UnregisterHotkeys();
SimcraftImpl.RegisterHotkeys();
Close();
}
private void panel4_Paint(object sender, PaintEventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
Close();
}
}
}