74 lines
2.6 KiB
C#
74 lines
2.6 KiB
C#
using System;
|
|
using System.Windows.Forms;
|
|
|
|
namespace Mitria_Minecraft_Launcher
|
|
{
|
|
public partial class LauncherSetupForm : Form
|
|
{
|
|
public LauncherSetupForm()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
private void LauncherSetupForm_Load(object sender, EventArgs e)
|
|
{
|
|
|
|
Text = "Base Setup For " + Settings.NowProfile.ServerName;
|
|
textBox_GameDirectory.Text = Settings.UserLauncherConfig.GameDirectory;
|
|
checkBox_ShellView.Checked = Settings.UserLauncherConfig.ShellView;
|
|
|
|
textBox_Argument.Text = Settings.NowProfile.Argument;
|
|
}
|
|
private void button_GameDirectory_Open_Click(object sender, EventArgs e)
|
|
{
|
|
FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog();
|
|
DialogResult result = folderBrowserDialog.ShowDialog();
|
|
if(result == DialogResult.OK)
|
|
{
|
|
textBox_GameDirectory.Text = folderBrowserDialog.SelectedPath + "\\Mitria";
|
|
}
|
|
}
|
|
|
|
private void button_Argument_Initialize_Click(object sender, EventArgs e)
|
|
{
|
|
textBox_Argument.Text = Settings.NowProfile.OriginalArgument;
|
|
}
|
|
|
|
private void button_Save_Click(object sender, EventArgs e)
|
|
{
|
|
if(Settings.UserLauncherConfig.GameDirectory != textBox_GameDirectory.Text)
|
|
{
|
|
if (System.IO.Directory.Exists(Settings.UserLauncherConfig.GameDirectory))
|
|
{
|
|
System.IO.Directory.Delete(Settings.UserLauncherConfig.GameDirectory, true);
|
|
}
|
|
if (!System.IO.Directory.Exists(textBox_GameDirectory.Text))
|
|
{
|
|
System.IO.Directory.CreateDirectory(textBox_GameDirectory.Text);
|
|
}
|
|
}
|
|
Settings.UserLauncherConfig.GameDirectory = textBox_GameDirectory.Text;
|
|
Settings.UserLauncherConfig.ShellView = checkBox_ShellView.Checked;
|
|
Settings.NowProfile.Argument = textBox_Argument.Text;
|
|
Settings.SaveUserLauncherConfig();
|
|
this.Close();
|
|
}
|
|
|
|
private void button_Cancel_Click(object sender, EventArgs e)
|
|
{
|
|
this.Close();
|
|
}
|
|
|
|
private void button_Package_Initialize_Click(object sender, EventArgs e)
|
|
{
|
|
Settings.UserClientVersion.PackageVersion = "0.0.0.0";
|
|
Settings.SaveUserClientVersion();
|
|
}
|
|
|
|
private void button_Component_Initialize_Click(object sender, EventArgs e)
|
|
{
|
|
Settings.UserClientVersion.ComponentVersion = "0.0.0.0";
|
|
Settings.SaveUserClientVersion();
|
|
}
|
|
}
|
|
}
|