Skip to content

Commit

Permalink
Merge pull request #2 from NukedBart/indev
Browse files Browse the repository at this point in the history
Major updates for global settings, skins next
  • Loading branch information
NukedBart committed Jun 18, 2022
2 parents 1ea6927 + 97b7f63 commit 71981b6
Show file tree
Hide file tree
Showing 5 changed files with 235 additions and 6 deletions.
172 changes: 169 additions & 3 deletions Form1.Designer.cs

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

58 changes: 57 additions & 1 deletion Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,35 @@ public partial class Form1 : Form
public static List<int[]> blueMapping = new List<int[]>();

private int progressValue = 100;
private bool debug = false;
private string contentPath;
private int scanDepth = 10;
private bool cheatsEnabled = false;
private bool manacostsEnabled = true;
private bool cooldownsEnabled = true;
private bool minionSpawnsEnabled = true;

public Form1()
{
InitializeComponent();
// Content Path Scan, CPS
string gDirectory = "";
for (int i = 1; i < scanDepth + 1; i++)
{
string directory = "";
for (int j = 1; j < i + 1; j++)
{
directory += "../";
}
if (Directory.Exists(directory + "Contents/"))
{
contentPath = directory + "Contents/";
textBox1.Text = directory + "Contents/";
gDirectory = directory;
break;
}
if (Directory.Exists(gDirectory)) break;
}
}

private void button4_Click(object sender, EventArgs e)
Expand Down Expand Up @@ -245,6 +270,7 @@ private void maximizeTrigger()

private void Form1_Load(object sender, EventArgs e)
{
if (debug) return;
if (!File.Exists("GameServerConsole.exe") || !Directory.Exists("Settings\\"))
{
MessageBox.Show("未找到服务器文件,请将本程序至于GameServerConsole.exe同级目录!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
Expand Down Expand Up @@ -274,13 +300,43 @@ private Game prepareBuild()
}
setProgess(50);
button3.Text = "建立数据结构...";
return new Game(players);
return new Game(players, manacostsEnabled, cooldownsEnabled, cheatsEnabled, minionSpawnsEnabled, contentPath);
}
private string buildJson(Game game)
{
setProgess(75);
button3.Text = "构建Json...";
return JsonConvert.SerializeObject(game, Formatting.Indented);
}

private void button8_Click(object sender, EventArgs e)
{
tabControl1.SelectedIndex = 0;
}

private void textBox1_TextChanged(object sender, EventArgs e)
{
contentPath = textBox1.Text;
}

private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
cheatsEnabled = checkBox1.Checked;
}

private void checkBox2_CheckedChanged(object sender, EventArgs e)
{
manacostsEnabled = checkBox2.Checked;
}

private void checkBox3_CheckedChanged(object sender, EventArgs e)
{
cooldownsEnabled = checkBox3.Checked;
}

private void checkBox4_CheckedChanged(object sender, EventArgs e)
{
minionSpawnsEnabled = checkBox4.Checked;
}
}
}
11 changes: 9 additions & 2 deletions Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,17 @@ public class Game
{
public List<Player> players;
public ModSettings game = new ModSettings();
public GameInfo gameInfo = new GameInfo();
public Game(List<Player> players)
public GameInfo gameInfo;
public Game(List<Player> players,
bool MANACOSTS_ENABLED = true,
bool COOLDOWNS_ENABLED = true,
bool CHEATS_ENABLED = false,
bool MINION_SPAWNS_ENABLED = true,
string CONTENT_PATH = "../../../../Content",
bool IS_DAMAGE_TEXT_GLOBAL = false)
{
this.players = players;
gameInfo = new GameInfo(MANACOSTS_ENABLED, COOLDOWNS_ENABLED, CHEATS_ENABLED, MINION_SPAWNS_ENABLED, CONTENT_PATH, IS_DAMAGE_TEXT_GLOBAL);
}
}
}
Binary file modified bin/Debug/LeagueSandbox LAN Server Launcher.exe
Binary file not shown.
Binary file modified bin/Debug/LeagueSandbox LAN Server Launcher.pdb
Binary file not shown.

0 comments on commit 71981b6

Please sign in to comment.