Skip to content

Commit

Permalink
Merge pull request #3 from NukedBart/indev
Browse files Browse the repository at this point in the history
TestingMode features added, a dummy skin selector
  • Loading branch information
NukedBart committed Jun 20, 2022
2 parents 71981b6 + 397ab78 commit 7326b72
Show file tree
Hide file tree
Showing 8 changed files with 429 additions and 59 deletions.
36 changes: 36 additions & 0 deletions Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 46 additions & 4 deletions Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ public partial class Form1 : Form
public static List<int> idList = new List<int>();
public static List<int[]> redMapping = new List<int[]>();
public static List<int[]> blueMapping = new List<int[]>();
public static bool testingMode = false;

private int progressValue = 100;
private bool debug = false;
private bool debug = true;
private string contentPath;
private int scanDepth = 10;
private bool cheatsEnabled = false;
Expand Down Expand Up @@ -82,10 +83,24 @@ private void button3_Click(object sender, EventArgs e)
Console.WriteLine(buffer);
setProgess(85);
button3.Text = "写入Json...";
File.WriteAllText("Settings\\GameInfo.json", buffer);
try
{
File.WriteAllText("Settings\\GameInfo.json", buffer);
}
catch (Exception ex)
{
MessageBox.Show("无法找到目录:\n" + ex.Message, "错误 - 无法找到目录", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
setProgess(95);
button3.Text = "启动服务器...";
Process.Start("GameServerConsole.exe");
try
{
Process.Start("GameServerConsole.exe");
}
catch (Exception ex)
{
MessageBox.Show("无法启动服务器:\n" + ex.Message, "错误 - 无法启动服务器", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
setProgess(100);
button3.Text = "启动服务器!";
launchDisabled = false;
Expand Down Expand Up @@ -187,6 +202,7 @@ private void button1_Click(object sender, EventArgs e)
red[redPlayerCount - 1].Show();
tabControl1.SelectedIndex = playerCount;
idList.Add(playerId);
listBox1.SelectedIndex = redPlayerCount - 1;
}
else
{
Expand Down Expand Up @@ -217,6 +233,7 @@ private void button2_Click(object sender, EventArgs e)
blue[bluePlayerCount - 1].Show();
tabControl1.SelectedIndex = playerCount;
idList.Add(playerId);
listBox2.SelectedIndex = bluePlayerCount - 1;
}
else
{
Expand Down Expand Up @@ -316,7 +333,12 @@ private void button8_Click(object sender, EventArgs e)

private void textBox1_TextChanged(object sender, EventArgs e)
{
contentPath = textBox1.Text;
if (Directory.Exists(textBox1.Text))
{
contentPath = textBox1.Text;
textBox1.ForeColor = Color.WhiteSmoke;
}
else textBox1.ForeColor = Color.Red;
}

private void checkBox1_CheckedChanged(object sender, EventArgs e)
Expand All @@ -338,5 +360,25 @@ private void checkBox4_CheckedChanged(object sender, EventArgs e)
{
minionSpawnsEnabled = checkBox4.Checked;
}

private void checkBox5_CheckedChanged(object sender, EventArgs e)
{
label7.Visible = checkBox5.Checked;
checkBox5.ForeColor =
!checkBox5.Checked ?
Color.PaleGreen :
Color.OrangeRed ;
testingMode = checkBox5.Checked;
for (int i = 0; i < redPlayerCount; i++)
{
Form2 cache = tabControl1.TabPages[redMapping[i][1]].Controls[0] as Form2;
cache.updateTestMode();
}
for (int i = 0; i < bluePlayerCount; i++)
{
Form2 cache = tabControl1.TabPages[blueMapping[i][1]].Controls[0] as Form2;
cache.updateTestMode();
}
}
}
}
Loading

0 comments on commit 7326b72

Please sign in to comment.