- First Update
This commit is contained in:
73
Mitria_Minecraft_Launcher/LauncherSetupForm.cs
Normal file
73
Mitria_Minecraft_Launcher/LauncherSetupForm.cs
Normal file
@@ -0,0 +1,73 @@
|
||||
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)
|
||||
{
|
||||
textBox_GameDirectory.Text = Settings.UserLauncherConfig.GameDirectory;
|
||||
textBox_Argument.Text = Settings.UserLauncherConfig.Argument;
|
||||
checkBox_ShellView.Checked = Settings.UserLauncherConfig.ShellView;
|
||||
}
|
||||
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.BaseArgument;
|
||||
}
|
||||
|
||||
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.Argument = textBox_Argument.Text;
|
||||
Settings.UserLauncherConfig.ShellView = checkBox_ShellView.Checked;
|
||||
Settings.SaveUserLauncherConfig();
|
||||
Settings.LoadUserClientVersion();
|
||||
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user