-
Notifications
You must be signed in to change notification settings - Fork 0
/
GUI.cs
135 lines (120 loc) · 4 KB
/
GUI.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ScreenShake
{
public partial class GUI : Form
{
public GUI()
{
InitializeComponent();
new SettingControl(rotationSpeedSlider, rotationSpeedTextBox, 0.01, .15, "Rotation Speed");
new SettingControl(rotationIntensitySlider, rotationIntensityTextBox, 0.001, .01, "Rotation Intensity");
new SettingControl(shakeSpeedSlider, shakeSpeedTextBox, 0.1, 8, "Shake Speed");
new SettingControl(shakeIntensitySlider, shakeIntensityTextBox, 0.01, 0.05, "Shake Intensity");
}
public string Seed
{
get
{
return seedBox.Text;
}
}
public bool shakeX
{
get
{
return xCheckBox.Checked;
}
}
public bool shakeY
{
get
{
return yCheckBox.Checked;
}
}
private void applyBtn_Click(object sender, EventArgs e)
{
// Add shake keyframes to Picture In Picture based on settings
ScreenShake.Apply();
Close();
}
private void defaultSettingsBtn_Click(object sender, EventArgs e)
{
foreach (SettingControl setting in SettingControl.SettingControls.Values)
{
setting.Value = setting.defaultValue;
}
seedBox.Text = "0";
xCheckBox.Checked = true;
yCheckBox.Checked = true;
}
private void shakeSpeedSlider_Scroll(object sender, EventArgs e)
{
if (SettingControl.SettingControls.ContainsKey("Shake Speed"))
{
SettingControl.SettingControls["Shake Speed"].UpdateFromSlider();
}
}
private void shakeSpeedTextBox_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
SettingControl.SettingControls["Shake Speed"].UpdateFromTextBox();
e.Handled = true;
}
}
private void shakeIntensitySlider_Scroll(object sender, EventArgs e)
{
if (SettingControl.SettingControls.ContainsKey("Shake Intensity"))
{
SettingControl.SettingControls["Shake Intensity"].UpdateFromSlider();
}
}
private void shakeIntensityTextBox_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
SettingControl.SettingControls["Shake Intensity"].UpdateFromTextBox();
e.Handled = true;
}
}
private void rotationSpeedSlider_Scroll(object sender, EventArgs e)
{
if (SettingControl.SettingControls.ContainsKey("Rotation Speed"))
{
SettingControl.SettingControls["Rotation Speed"].UpdateFromSlider();
}
}
private void rotationSpeedTextBox_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
SettingControl.SettingControls["Rotation Speed"].UpdateFromTextBox();
e.Handled = true;
}
}
private void rotationIntensitySlider_Scroll(object sender, EventArgs e)
{
if (SettingControl.SettingControls.ContainsKey("Rotation Intensity"))
{
SettingControl.SettingControls["Rotation Intensity"].UpdateFromSlider();
}
}
private void rotationIntensityTextBox_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
SettingControl.SettingControls["Rotation Intensity"].UpdateFromTextBox();
e.Handled = true;
}
}
}
}