-
Notifications
You must be signed in to change notification settings - Fork 1
/
IntroForm.cs
140 lines (122 loc) · 4.27 KB
/
IntroForm.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
136
137
138
139
140
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Media;
namespace Game
{
public partial class IntroForm : Form
{
Thread t;
public IntroForm()
{
InitializeComponent();
}
private void Host_RadioBtn_CheckedChanged(object sender, EventArgs e)
{
Client_GroupBox.Enabled = false;
Host_GroupBox.Enabled = true;
//Play_Btn.Enabled = true;
}
private void Client_RadioBtn_CheckedChanged(object sender, EventArgs e)
{
Client_GroupBox.Enabled = true;
Host_GroupBox.Enabled = false;
//Play_Btn.Enabled = true;
}
private void Single_RadBtn_CheckedChanged(object sender, EventArgs e)
{
Client_GroupBox.Enabled = false;
Host_GroupBox.Enabled = false;
// Play_Btn.Enabled = true;
}
private void spclient_rdbutton1_CheckedChanged(object sender, EventArgs e)
{
Client_GroupBox.Enabled = false;
Host_GroupBox.Enabled = false;
// Play_Btn.Enabled = true;
}
private void Play_Btn_Click(object sender, EventArgs e)
{
SoundPlayer exp = new SoundPlayer(@"resourcesnew\audio\ayyy.wav");
exp.Play();
if (Host_RadioBtn.Checked && Host_GroupBox.Enabled)
{
int portNum = int.Parse(Host_Port_TxtBox.Text);
GameForm gf = new GameForm(portNum, this);
this.Hide();
gf.Show();
}
else if (Client_RadioBtn.Checked && Client_GroupBox.Enabled)
{
int portNum = int.Parse(Client_Port_TxtBox.Text);
String hostIP = Client_IP_TxtBox.Text;
GameForm gf = new GameForm(hostIP, portNum, this);
this.Hide();
gf.Show();
}
else if (Single_RadBtn.Checked && SinglePlayer_groupBox.Enabled)
{
GameForm gf = new GameForm(this, User.Host);
this.Hide();
gf.Show();
}
else if(SinglePlayer_groupBox.Enabled && spclient_rdbutton1.Checked)
{
GameForm gf = new GameForm(this, User.Client);
this.Hide();
gf.Show();
}
}
private void button1_Click(object sender, EventArgs e)
{
SinglePlayer_groupBox.Enabled=false;
SinglePlayer_groupBox.Hide();
Multiplayer_groupBox.Show();
Multiplayer_groupBox.Enabled = true;
Play_Btn.Enabled = true;
}
private void groupBox1_Enter(object sender, EventArgs e)
{
}
private void spclient_rdbutton1_CheckedChanged_1(object sender, EventArgs e)
{
Play_Btn.Enabled = true;
}
private void Singleplayer_Click(object sender, EventArgs e)
{
SinglePlayer_groupBox.Enabled = true;
SinglePlayer_groupBox.Show();
Multiplayer_groupBox.Enabled = false;
Multiplayer_groupBox.Hide();
Play_Btn.Enabled = true;
}
private void Single_RadBtn_CheckedChanged_1(object sender, EventArgs e)
{
Play_Btn.Enabled = true;
}
private void Host_RadioBtn_CheckedChanged_1(object sender, EventArgs e)
{
Play_Btn.Enabled = true;
Client_GroupBox.Enabled = false;
Host_GroupBox.Enabled = true;
}
private void Client_RadioBtn_CheckedChanged_1(object sender, EventArgs e)
{
Play_Btn.Enabled = true;
Client_GroupBox.Enabled = true;
Host_GroupBox.Enabled = false;
}
private void IntroForm_Load(object sender, EventArgs e)
{
SoundPlayer exp = new SoundPlayer(@"resourcesnew\audio\BurtBacharach.wav");
exp.Play();
}
}
}