Skip to content

Commit

Permalink
Moved the start function to Form
Browse files Browse the repository at this point in the history
  • Loading branch information
DartPower committed Jun 2, 2019
1 parent 2978e05 commit 586ae36
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 9 deletions.
14 changes: 14 additions & 0 deletions LauncherForm.Designer.cs

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

14 changes: 14 additions & 0 deletions LauncherForm.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
using System;
using System.Reflection;
using System.Windows.Forms;

namespace SharpMCL
{
public partial class LauncherForm : Form
{
const string InstanceName = "";
const string ClientPath = @"\Instances\" + InstanceName + @"\";
private string clientdir = System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + ClientPath;
private string client = "DPT";
private string user = "USSRNAME";
private string uuid = Guid.NewGuid().ToString();
private string session = "0";

public LauncherForm()
{
InitializeComponent();
Expand All @@ -14,5 +23,10 @@ private void Form1_Load(object sender, EventArgs e)
{

}

private void Button1_Click(object sender, EventArgs e)
{
Program.start(clientdir, client, user, uuid, session);
}
}
}
10 changes: 1 addition & 9 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,11 @@ static void Main(string[] args)
currentProcess.PriorityClass = ProcessPriorityClass.High;
Console.BackgroundColor = ConsoleColor.Black;
Console.ForegroundColor = ConsoleColor.White;
const string InstanceName = "";
const string ClientPath = @"\Instances\" + InstanceName + @"\";
string clientdir = System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + ClientPath;
string client = "DPT";
string user = "USSRNAME";
string uuid = Guid.NewGuid().ToString();
string session = "0";
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
try
{
Application.Run(new LauncherForm());
//start(clientdir, client, user, uuid, session);
}
catch (Exception ex)
{
Expand All @@ -49,7 +41,7 @@ static void Main(string[] args)
}
}

static void start(string clientdir, string client, string user, string uuid, string session)
public static void start(string clientdir, string client, string user, string uuid, string session)
{
string nfolder = clientdir + @"versions\" + client + @"\natives";
Directory.CreateDirectory(nfolder);
Expand Down

0 comments on commit 586ae36

Please sign in to comment.