-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathEditSong.cs
125 lines (106 loc) · 5.08 KB
/
EditSong.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
using System;
using System.Windows.Forms;
namespace GHLCP
{
public partial class EditSong : Form
{
private readonly Gamedir gamedir;
private readonly Trackconfig trackconfig;
private bool dontAlertChanges = false;
public EditSong(Gamedir gamedir, Trackconfig trackconfig)
{
InitializeComponent();
this.gamedir = gamedir;
this.trackconfig = trackconfig;
}
private void EditSong_Load(object sender, EventArgs e)
{
Populate();
}
public void Populate()
{
dontAlertChanges = true;
idBox.Text = trackconfig.Id;
artistBox.Text = trackconfig.Artist;
tracknameBox.Text = trackconfig.Trackname;
Text = $"Editing Song: {trackconfig.Artist} - {trackconfig.Trackname} [{trackconfig.Id}]";
unlockedInGHLBox.Checked = trackconfig.UnlockedInGHLiveByDefault;
intensityBox.Value = trackconfig.Intensity;
TrackconfigVideo video = trackconfig.Video;
videoEnabledCheck.Checked = video.HasVideo;
videoStartBox.Value = Convert.ToDecimal(video.MusicStartTime);
TrackconfigStagefright stagefright = trackconfig.Stagefright;
enableStagefright.Checked = stagefright.Enabled;
parentSetlistBox.Text = stagefright.ParentSetlist;
careerStartBox.Value = Convert.ToDecimal(stagefright.TrackStartTime);
careerEndBox.Value = Convert.ToDecimal(stagefright.TrackEndTime);
quickStartBox.Value = Convert.ToDecimal(stagefright.QuickplayStartTime);
quickEndBox.Value = Convert.ToDecimal(stagefright.QuickplayEndTime);
TrackconfigHighway highway = trackconfig.Highway;
speedBBox.Value = Convert.ToDecimal(highway.Beginner);
speedEBox.Value = Convert.ToDecimal(highway.Easy);
speedMBox.Value = Convert.ToDecimal(highway.Medium);
speedHBox.Value = Convert.ToDecimal(highway.Hard);
speedXBox.Value = Convert.ToDecimal(highway.Expert);
opacityBox.Value = Convert.ToDecimal(highway.Opacity);
transparencyBox.Value = Convert.ToDecimal(highway.Transparency);
dontAlertChanges = false;
}
private void cancelEdit_Click(object sender, EventArgs e)
{
Close();
}
private void videoEnabledCheck_CheckedChanged(object sender, EventArgs e)
{
videoStartBox.Enabled = videoEnabledCheck.Checked;
}
private void enableStagefright_CheckedChanged(object sender, EventArgs e)
{
if (dontAlertChanges)
{
return;
}
if (trackconfig.IsDefault)
{
DialogResult yeah = MessageBox.Show("Disabling the Stagefright metadata on default songs may cause issues such as the career mode crashing the game. Are you sure you want to do this?", "Guitar Hero Live Control Panel", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
switch (yeah)
{
case DialogResult.Yes:
break;
case DialogResult.No:
dontAlertChanges = true;
enableStagefright.Checked = !enableStagefright.Checked;
dontAlertChanges = false;
break;
}
}
}
private void saveTrack_Click(object sender, EventArgs e)
{
trackconfig.Artist = artistBox.Text;
trackconfig.Trackname = tracknameBox.Text;
trackconfig.UnlockedInGHLiveByDefault = unlockedInGHLBox.Checked;
trackconfig.Intensity = Convert.ToInt32(intensityBox.Value);
TrackconfigHighway highway = trackconfig.Highway;
highway.Beginner = Convert.ToDouble(speedBBox.Value);
highway.Easy = Convert.ToDouble(speedEBox.Value);
highway.Medium = Convert.ToDouble(speedMBox.Value);
highway.Hard = Convert.ToDouble(speedHBox.Value);
highway.Expert = Convert.ToDouble(speedXBox.Value);
highway.Opacity = Convert.ToDouble(opacityBox.Value);
highway.Transparency = Convert.ToDouble(transparencyBox.Value);
TrackconfigVideo video = trackconfig.Video;
video.HasVideo = videoEnabledCheck.Checked;
video.MusicStartTime = Convert.ToDouble(videoStartBox.Value);
TrackconfigStagefright stagefright = trackconfig.Stagefright;
stagefright.TrackStartTime = Convert.ToDouble(careerStartBox.Value);
stagefright.TrackEndTime = Convert.ToDouble(careerEndBox.Value);
stagefright.QuickplayStartTime = Convert.ToDouble(quickStartBox.Value);
stagefright.QuickplayEndTime = Convert.ToDouble(quickEndBox.Value);
gamedir.SetParentSetlist(trackconfig, enableStagefright.Checked, parentSetlistBox.Text);
gamedir.WriteTrackconfig(trackconfig);
DialogResult = DialogResult.Yes;
Close();
}
}
}