diff --git a/LauncherForm.Designer.cs b/LauncherForm.Designer.cs index 2d56d99..5b50330 100644 --- a/LauncherForm.Designer.cs +++ b/LauncherForm.Designer.cs @@ -32,15 +32,17 @@ private void InitializeComponent() this.button1 = new System.Windows.Forms.Button(); this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components); this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.listBox1 = new System.Windows.Forms.ListBox(); this.textBox1 = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); this.groupBox1.SuspendLayout(); this.SuspendLayout(); // // button1 // - this.button1.Location = new System.Drawing.Point(217, 166); + this.button1.Location = new System.Drawing.Point(217, 169); this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.Size = new System.Drawing.Size(75, 20); this.button1.TabIndex = 0; this.button1.Text = "Запуск"; this.button1.UseVisualStyleBackColor = true; @@ -53,37 +55,56 @@ private void InitializeComponent() // // groupBox1 // - this.groupBox1.Controls.Add(this.textBox1); + this.groupBox1.Controls.Add(this.listBox1); this.groupBox1.Location = new System.Drawing.Point(12, 12); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(280, 148); + this.groupBox1.Size = new System.Drawing.Size(280, 151); this.groupBox1.TabIndex = 1; this.groupBox1.TabStop = false; - this.groupBox1.Text = "Настройки запуска"; + this.groupBox1.Text = "Выбрать сборку"; this.groupBox1.Enter += new System.EventHandler(this.GroupBox1_Enter); // + // listBox1 + // + this.listBox1.FormattingEnabled = true; + this.listBox1.Location = new System.Drawing.Point(6, 19); + this.listBox1.Name = "listBox1"; + this.listBox1.Size = new System.Drawing.Size(268, 121); + this.listBox1.TabIndex = 1; + this.listBox1.SelectedIndexChanged += new System.EventHandler(this.ListBox1_SelectedIndexChanged); + // // textBox1 // - this.textBox1.Location = new System.Drawing.Point(6, 19); - this.textBox1.MaxLength = 255; + this.textBox1.Location = new System.Drawing.Point(92, 169); this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(268, 20); - this.textBox1.TabIndex = 0; - this.textBox1.TextChanged += new System.EventHandler(this.TextBox1_TextChanged); + this.textBox1.Size = new System.Drawing.Size(119, 20); + this.textBox1.TabIndex = 2; + this.textBox1.TextChanged += new System.EventHandler(this.TextBox1_TextChanged_1); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(15, 172); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(70, 13); + this.label1.TabIndex = 3; + this.label1.Text = "Имя игрока:"; // // LauncherForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(304, 201); + this.Controls.Add(this.label1); + this.Controls.Add(this.textBox1); this.Controls.Add(this.groupBox1); this.Controls.Add(this.button1); this.Name = "LauncherForm"; this.Text = "SharpMCL"; this.Load += new System.EventHandler(this.Form1_Load); this.groupBox1.ResumeLayout(false); - this.groupBox1.PerformLayout(); this.ResumeLayout(false); + this.PerformLayout(); } @@ -92,6 +113,8 @@ private void InitializeComponent() private System.Windows.Forms.Button button1; private System.Windows.Forms.NotifyIcon notifyIcon1; private System.Windows.Forms.GroupBox groupBox1; - public System.Windows.Forms.TextBox textBox1; + public System.Windows.Forms.ListBox listBox1; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.Label label1; } } \ No newline at end of file diff --git a/LauncherForm.cs b/LauncherForm.cs index 7ca26a3..bbff6be 100644 --- a/LauncherForm.cs +++ b/LauncherForm.cs @@ -1,4 +1,5 @@ using System; +using System.IO; using System.Reflection; using System.Windows.Forms; @@ -13,19 +14,30 @@ public LauncherForm() private void Form1_Load(object sender, EventArgs e) { - + DirectoryInfo IntancesDir = new DirectoryInfo(System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + @".\Instances"); + foreach (var d in IntancesDir.GetDirectories()) + { + listBox1.Items.Add(d.Name); + } + foreach (var d in IntancesDir.GetFiles()) + { + listBox1.Items.Add(d.Name); + } } private void Button1_Click(object sender, EventArgs e) { String InstanceName = ""; - InstanceName = textBox1.Text; + String UserName = ""; + InstanceName = listBox1.Text; + UserName = textBox1.Text; String ClientPath = @"\Instances\" + InstanceName + @"\"; String clientdir = System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + ClientPath; - String client = "DPT"; - String user = "USSRNAME"; + String client = InstanceName; + String user = UserName; String uuid = Guid.NewGuid().ToString(); String session = "0"; + this.Close(); Program.start(clientdir, client, user, uuid, session); } @@ -38,5 +50,20 @@ private void TextBox1_TextChanged(object sender, EventArgs e) { } + + private void ListBox1_SelectedIndexChanged(object sender, EventArgs e) + { + + } + + private void TextBox1_TextChanged_1(object sender, EventArgs e) + { + + } + + private void Label1_Click(object sender, EventArgs e) + { + + } } } diff --git a/Program.cs b/Program.cs index 2957e11..e3f7ab7 100644 --- a/Program.cs +++ b/Program.cs @@ -3,7 +3,6 @@ using System; using System.Diagnostics; using System.IO; -using System.Reflection; using System.Runtime.InteropServices; using System.Text; using System.Windows.Forms;