Version 1.2.0

This commit is contained in:
Junior 2024-01-04 22:59:30 -03:00
parent 9b3a0e00a2
commit e74d93fab9
83 changed files with 110087 additions and 47507 deletions

702
RHLauncher.Forms/ChangePwdForm.Designer.cs generated Normal file
View file

@ -0,0 +1,702 @@
namespace RHLauncher
{
partial class ChangePwdForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ChangePwdForm));
CloseButton = new Button();
imageListCloseBtn = new ImageList(components);
MinimizeButton = new Button();
imageListMinBtn = new ImageList(components);
CodeLabel = new Label();
imageListOKBtn = new ImageList(components);
ContinueButtonS1 = new Button();
imageListContinueBtn = new ImageList(components);
PasswordLabel = new Label();
RepeatPasswordLabel = new Label();
SendEmailButton = new Button();
imageListSendEmailBtn = new ImageList(components);
CodeTextBox = new TextBox();
Stage1Panel = new Panel();
EmailPictureBox = new PictureBox();
TimerLabel = new Label();
CodePictureBox = new PictureBox();
CodeDescLabel = new Label();
EmailDescLabel = new Label();
EmailTextBox = new TextBox();
DescLabelS1 = new Label();
SubTitleLabelS1 = new Label();
TitleLabelS1 = new Label();
Stage2Panel = new Panel();
PwdStrengthLabel = new Label();
PwdConfirmPictureBox = new PictureBox();
PwdPictureBox = new PictureBox();
PwdConfirmDescLabel = new Label();
PwdDescLabel = new Label();
EmailLabelS2 = new Label();
ReturnLabelS2 = new Label();
OkButtonS2 = new Button();
PasswordTextBox = new TextBox();
RepeatPasswordTextBox = new TextBox();
SubTitleLabelS2 = new Label();
TitleLabelS2 = new Label();
imageListTips = new ImageList(components);
imageListSendEmailBtn_ko = new ImageList(components);
imageListContinueBtn_ko = new ImageList(components);
imageListOKBtn_ko = new ImageList(components);
Stage1Panel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)EmailPictureBox).BeginInit();
((System.ComponentModel.ISupportInitialize)CodePictureBox).BeginInit();
Stage2Panel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)PwdConfirmPictureBox).BeginInit();
((System.ComponentModel.ISupportInitialize)PwdPictureBox).BeginInit();
SuspendLayout();
//
// CloseButton
//
CloseButton.BackColor = Color.Transparent;
CloseButton.FlatAppearance.BorderColor = Color.Black;
CloseButton.FlatAppearance.BorderSize = 0;
CloseButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
CloseButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
CloseButton.FlatStyle = FlatStyle.Flat;
CloseButton.ForeColor = Color.Transparent;
CloseButton.ImageIndex = 0;
CloseButton.ImageList = imageListCloseBtn;
CloseButton.Location = new Point(756, 12);
CloseButton.Name = "CloseButton";
CloseButton.Size = new Size(32, 29);
CloseButton.TabIndex = 9;
CloseButton.UseVisualStyleBackColor = false;
CloseButton.Click += CloseButton_Click;
CloseButton.MouseDown += Button_MouseDown;
CloseButton.MouseLeave += Button_MouseLeave;
CloseButton.MouseHover += Button_MouseHover;
//
// imageListCloseBtn
//
imageListCloseBtn.ColorDepth = ColorDepth.Depth32Bit;
imageListCloseBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListCloseBtn.ImageStream");
imageListCloseBtn.TransparentColor = Color.Transparent;
imageListCloseBtn.Images.SetKeyName(0, "button_close_normal.png");
imageListCloseBtn.Images.SetKeyName(1, "button_close_active.png");
imageListCloseBtn.Images.SetKeyName(2, "button_close_down.png");
//
// MinimizeButton
//
MinimizeButton.BackColor = Color.Transparent;
MinimizeButton.FlatAppearance.BorderColor = Color.Black;
MinimizeButton.FlatAppearance.BorderSize = 0;
MinimizeButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
MinimizeButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
MinimizeButton.FlatStyle = FlatStyle.Flat;
MinimizeButton.ForeColor = Color.Transparent;
MinimizeButton.ImageIndex = 0;
MinimizeButton.ImageList = imageListMinBtn;
MinimizeButton.Location = new Point(681, 7);
MinimizeButton.Name = "MinimizeButton";
MinimizeButton.Size = new Size(25, 26);
MinimizeButton.TabIndex = 8;
MinimizeButton.UseVisualStyleBackColor = false;
MinimizeButton.Click += MinimizeButton_Click;
MinimizeButton.MouseDown += Button_MouseDown;
MinimizeButton.MouseLeave += Button_MouseLeave;
MinimizeButton.MouseHover += Button_MouseHover;
//
// imageListMinBtn
//
imageListMinBtn.ColorDepth = ColorDepth.Depth32Bit;
imageListMinBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListMinBtn.ImageStream");
imageListMinBtn.TransparentColor = Color.Transparent;
imageListMinBtn.Images.SetKeyName(0, "button_minimize_normal.png");
imageListMinBtn.Images.SetKeyName(1, "button_minimize_active.png");
imageListMinBtn.Images.SetKeyName(2, "button_minimize_down.png");
//
// CodeLabel
//
CodeLabel.Anchor = AnchorStyles.Top;
CodeLabel.AutoEllipsis = true;
CodeLabel.AutoSize = true;
CodeLabel.BackColor = Color.Transparent;
CodeLabel.Font = new Font("Microsoft Sans Serif", 10F, FontStyle.Bold, GraphicsUnit.Point);
CodeLabel.ForeColor = Color.White;
CodeLabel.ImeMode = ImeMode.NoControl;
CodeLabel.Location = new Point(85, 172);
CodeLabel.Name = "CodeLabel";
CodeLabel.Size = new Size(132, 17);
CodeLabel.TabIndex = 15;
CodeLabel.Text = "Verification Code";
CodeLabel.TextAlign = ContentAlignment.TopCenter;
//
// imageListOKBtn
//
imageListOKBtn.ColorDepth = ColorDepth.Depth32Bit;
imageListOKBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListOKBtn.ImageStream");
imageListOKBtn.TransparentColor = Color.Transparent;
imageListOKBtn.Images.SetKeyName(0, "messagewnd.button.ok.normal.png");
imageListOKBtn.Images.SetKeyName(1, "messagewnd.button.ok.active.png");
imageListOKBtn.Images.SetKeyName(2, "messagewnd.button.ok.down.png");
//
// ContinueButtonS1
//
ContinueButtonS1.BackColor = Color.Transparent;
ContinueButtonS1.FlatAppearance.BorderSize = 0;
ContinueButtonS1.FlatAppearance.MouseDownBackColor = Color.Transparent;
ContinueButtonS1.FlatAppearance.MouseOverBackColor = Color.Transparent;
ContinueButtonS1.FlatStyle = FlatStyle.Flat;
ContinueButtonS1.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
ContinueButtonS1.ImageIndex = 0;
ContinueButtonS1.ImageList = imageListContinueBtn;
ContinueButtonS1.ImeMode = ImeMode.NoControl;
ContinueButtonS1.Location = new Point(85, 242);
ContinueButtonS1.Name = "ContinueButtonS1";
ContinueButtonS1.Size = new Size(110, 44);
ContinueButtonS1.TabIndex = 16;
ContinueButtonS1.UseVisualStyleBackColor = false;
ContinueButtonS1.Click += ContinueButtonS1_Click;
ContinueButtonS1.MouseDown += Button_MouseDown;
ContinueButtonS1.MouseLeave += Button_MouseLeave;
ContinueButtonS1.MouseHover += Button_MouseHover;
//
// imageListContinueBtn
//
imageListContinueBtn.ColorDepth = ColorDepth.Depth32Bit;
imageListContinueBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListContinueBtn.ImageStream");
imageListContinueBtn.TransparentColor = Color.Transparent;
imageListContinueBtn.Images.SetKeyName(0, "Registerwnd.button.continue.normal.png");
imageListContinueBtn.Images.SetKeyName(1, "Registerwnd.button.continue.active.png");
imageListContinueBtn.Images.SetKeyName(2, "Registerwnd.button.continue.down.png");
//
// PasswordLabel
//
PasswordLabel.Anchor = AnchorStyles.Top;
PasswordLabel.AutoEllipsis = true;
PasswordLabel.AutoSize = true;
PasswordLabel.BackColor = Color.Transparent;
PasswordLabel.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
PasswordLabel.ForeColor = Color.White;
PasswordLabel.ImeMode = ImeMode.NoControl;
PasswordLabel.Location = new Point(98, 179);
PasswordLabel.Name = "PasswordLabel";
PasswordLabel.Size = new Size(167, 19);
PasswordLabel.TabIndex = 19;
PasswordLabel.Text = "Enter the new password";
PasswordLabel.TextAlign = ContentAlignment.TopCenter;
//
// RepeatPasswordLabel
//
RepeatPasswordLabel.Anchor = AnchorStyles.Top;
RepeatPasswordLabel.AutoEllipsis = true;
RepeatPasswordLabel.AutoSize = true;
RepeatPasswordLabel.BackColor = Color.Transparent;
RepeatPasswordLabel.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
RepeatPasswordLabel.ForeColor = Color.White;
RepeatPasswordLabel.ImeMode = ImeMode.NoControl;
RepeatPasswordLabel.Location = new Point(95, 255);
RepeatPasswordLabel.Name = "RepeatPasswordLabel";
RepeatPasswordLabel.Size = new Size(191, 19);
RepeatPasswordLabel.TabIndex = 20;
RepeatPasswordLabel.Text = "Re-enter the new password";
RepeatPasswordLabel.TextAlign = ContentAlignment.TopCenter;
//
// SendEmailButton
//
SendEmailButton.BackColor = Color.Transparent;
SendEmailButton.FlatAppearance.BorderSize = 0;
SendEmailButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
SendEmailButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
SendEmailButton.FlatStyle = FlatStyle.Flat;
SendEmailButton.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
SendEmailButton.ImageIndex = 0;
SendEmailButton.ImageList = imageListSendEmailBtn;
SendEmailButton.ImeMode = ImeMode.NoControl;
SendEmailButton.Location = new Point(254, 242);
SendEmailButton.Name = "SendEmailButton";
SendEmailButton.Size = new Size(110, 44);
SendEmailButton.TabIndex = 21;
SendEmailButton.UseVisualStyleBackColor = false;
SendEmailButton.Click += SendEmailButton_Click;
SendEmailButton.MouseDown += Button_MouseDown;
SendEmailButton.MouseLeave += Button_MouseLeave;
SendEmailButton.MouseHover += Button_MouseHover;
//
// imageListSendEmailBtn
//
imageListSendEmailBtn.ColorDepth = ColorDepth.Depth32Bit;
imageListSendEmailBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListSendEmailBtn.ImageStream");
imageListSendEmailBtn.TransparentColor = Color.Transparent;
imageListSendEmailBtn.Images.SetKeyName(0, "ChangePwwnd.button.email.normal.png");
imageListSendEmailBtn.Images.SetKeyName(1, "ChangePwwnd.button.email.active.png");
imageListSendEmailBtn.Images.SetKeyName(2, "ChangePwwnd.button.email.down.png");
//
// CodeTextBox
//
CodeTextBox.AcceptsTab = true;
CodeTextBox.Location = new Point(85, 191);
CodeTextBox.Name = "CodeTextBox";
CodeTextBox.Size = new Size(279, 23);
CodeTextBox.TabIndex = 22;
CodeTextBox.TextChanged += CodeTextBox_TextChanged;
//
// Stage1Panel
//
Stage1Panel.BackColor = Color.Transparent;
Stage1Panel.Controls.Add(EmailPictureBox);
Stage1Panel.Controls.Add(TimerLabel);
Stage1Panel.Controls.Add(CodePictureBox);
Stage1Panel.Controls.Add(CodeDescLabel);
Stage1Panel.Controls.Add(EmailDescLabel);
Stage1Panel.Controls.Add(EmailTextBox);
Stage1Panel.Controls.Add(DescLabelS1);
Stage1Panel.Controls.Add(SubTitleLabelS1);
Stage1Panel.Controls.Add(TitleLabelS1);
Stage1Panel.Controls.Add(SendEmailButton);
Stage1Panel.Controls.Add(CodeTextBox);
Stage1Panel.Controls.Add(ContinueButtonS1);
Stage1Panel.Controls.Add(CodeLabel);
Stage1Panel.Location = new Point(0, 79);
Stage1Panel.Name = "Stage1Panel";
Stage1Panel.Size = new Size(800, 450);
Stage1Panel.TabIndex = 23;
//
// EmailPictureBox
//
EmailPictureBox.BackColor = Color.Transparent;
EmailPictureBox.Location = new Point(377, 108);
EmailPictureBox.Name = "EmailPictureBox";
EmailPictureBox.Size = new Size(14, 14);
EmailPictureBox.TabIndex = 39;
EmailPictureBox.TabStop = false;
//
// TimerLabel
//
TimerLabel.Anchor = AnchorStyles.Top;
TimerLabel.AutoSize = true;
TimerLabel.BackColor = Color.Transparent;
TimerLabel.Font = new Font("Segoe UI", 11.25F, FontStyle.Bold, GraphicsUnit.Point);
TimerLabel.ForeColor = Color.White;
TimerLabel.ImeMode = ImeMode.NoControl;
TimerLabel.Location = new Point(366, 255);
TimerLabel.Name = "TimerLabel";
TimerLabel.Size = new Size(0, 20);
TimerLabel.TabIndex = 42;
TimerLabel.TextAlign = ContentAlignment.TopCenter;
//
// CodePictureBox
//
CodePictureBox.BackColor = Color.Transparent;
CodePictureBox.Location = new Point(375, 196);
CodePictureBox.Name = "CodePictureBox";
CodePictureBox.Size = new Size(14, 14);
CodePictureBox.TabIndex = 41;
CodePictureBox.TabStop = false;
//
// CodeDescLabel
//
CodeDescLabel.Anchor = AnchorStyles.Top;
CodeDescLabel.AutoSize = true;
CodeDescLabel.BackColor = Color.Transparent;
CodeDescLabel.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
CodeDescLabel.ForeColor = Color.White;
CodeDescLabel.ImeMode = ImeMode.NoControl;
CodeDescLabel.Location = new Point(391, 196);
CodeDescLabel.Name = "CodeDescLabel";
CodeDescLabel.Size = new Size(0, 13);
CodeDescLabel.TabIndex = 40;
CodeDescLabel.TextAlign = ContentAlignment.TopCenter;
//
// EmailDescLabel
//
EmailDescLabel.Anchor = AnchorStyles.Top;
EmailDescLabel.AutoSize = true;
EmailDescLabel.BackColor = Color.Transparent;
EmailDescLabel.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
EmailDescLabel.ForeColor = Color.White;
EmailDescLabel.ImeMode = ImeMode.NoControl;
EmailDescLabel.Location = new Point(393, 108);
EmailDescLabel.Name = "EmailDescLabel";
EmailDescLabel.Size = new Size(0, 13);
EmailDescLabel.TabIndex = 38;
EmailDescLabel.TextAlign = ContentAlignment.TopCenter;
//
// EmailTextBox
//
EmailTextBox.AcceptsTab = true;
EmailTextBox.Location = new Point(85, 103);
EmailTextBox.Name = "EmailTextBox";
EmailTextBox.Size = new Size(279, 23);
EmailTextBox.TabIndex = 23;
EmailTextBox.TextChanged += EmailTextBox_TextChanged;
//
// DescLabelS1
//
DescLabelS1.Anchor = AnchorStyles.Top;
DescLabelS1.AutoEllipsis = true;
DescLabelS1.AutoSize = true;
DescLabelS1.BackColor = Color.Transparent;
DescLabelS1.Font = new Font("Segoe UI", 9.75F, FontStyle.Bold, GraphicsUnit.Point);
DescLabelS1.ForeColor = Color.White;
DescLabelS1.ImeMode = ImeMode.NoControl;
DescLabelS1.Location = new Point(88, 83);
DescLabelS1.Name = "DescLabelS1";
DescLabelS1.Size = new Size(161, 17);
DescLabelS1.TabIndex = 22;
DescLabelS1.Text = "Enter your Email address";
DescLabelS1.TextAlign = ContentAlignment.TopCenter;
//
// SubTitleLabelS1
//
SubTitleLabelS1.Anchor = AnchorStyles.Top;
SubTitleLabelS1.AutoEllipsis = true;
SubTitleLabelS1.AutoSize = true;
SubTitleLabelS1.BackColor = Color.Transparent;
SubTitleLabelS1.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
SubTitleLabelS1.ForeColor = Color.White;
SubTitleLabelS1.ImeMode = ImeMode.NoControl;
SubTitleLabelS1.Location = new Point(101, 45);
SubTitleLabelS1.Name = "SubTitleLabelS1";
SubTitleLabelS1.Size = new Size(93, 19);
SubTitleLabelS1.TabIndex = 24;
SubTitleLabelS1.Text = "Rusty Hearts";
SubTitleLabelS1.TextAlign = ContentAlignment.TopCenter;
//
// TitleLabelS1
//
TitleLabelS1.Anchor = AnchorStyles.Top;
TitleLabelS1.AutoEllipsis = true;
TitleLabelS1.AutoSize = true;
TitleLabelS1.BackColor = Color.Transparent;
TitleLabelS1.Font = new Font("Segoe UI", 20F, FontStyle.Bold, GraphicsUnit.Point);
TitleLabelS1.ForeColor = Color.White;
TitleLabelS1.ImeMode = ImeMode.NoControl;
TitleLabelS1.Location = new Point(85, 3);
TitleLabelS1.Name = "TitleLabelS1";
TitleLabelS1.Size = new Size(242, 37);
TitleLabelS1.TabIndex = 23;
TitleLabelS1.Text = "Change Password";
TitleLabelS1.TextAlign = ContentAlignment.TopCenter;
//
// Stage2Panel
//
Stage2Panel.BackColor = Color.Transparent;
Stage2Panel.Controls.Add(PwdStrengthLabel);
Stage2Panel.Controls.Add(PwdConfirmPictureBox);
Stage2Panel.Controls.Add(PwdPictureBox);
Stage2Panel.Controls.Add(PwdConfirmDescLabel);
Stage2Panel.Controls.Add(PwdDescLabel);
Stage2Panel.Controls.Add(EmailLabelS2);
Stage2Panel.Controls.Add(ReturnLabelS2);
Stage2Panel.Controls.Add(OkButtonS2);
Stage2Panel.Controls.Add(PasswordTextBox);
Stage2Panel.Controls.Add(RepeatPasswordTextBox);
Stage2Panel.Controls.Add(SubTitleLabelS2);
Stage2Panel.Controls.Add(TitleLabelS2);
Stage2Panel.Controls.Add(PasswordLabel);
Stage2Panel.Controls.Add(RepeatPasswordLabel);
Stage2Panel.Location = new Point(0, 79);
Stage2Panel.Name = "Stage2Panel";
Stage2Panel.Size = new Size(800, 450);
Stage2Panel.TabIndex = 25;
//
// PwdStrengthLabel
//
PwdStrengthLabel.Anchor = AnchorStyles.Top;
PwdStrengthLabel.AutoSize = true;
PwdStrengthLabel.BackColor = Color.Transparent;
PwdStrengthLabel.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
PwdStrengthLabel.ForeColor = Color.White;
PwdStrengthLabel.ImeMode = ImeMode.NoControl;
PwdStrengthLabel.Location = new Point(93, 226);
PwdStrengthLabel.Name = "PwdStrengthLabel";
PwdStrengthLabel.Size = new Size(0, 13);
PwdStrengthLabel.TabIndex = 36;
PwdStrengthLabel.TextAlign = ContentAlignment.TopCenter;
//
// PwdConfirmPictureBox
//
PwdConfirmPictureBox.BackColor = Color.Transparent;
PwdConfirmPictureBox.Location = new Point(379, 284);
PwdConfirmPictureBox.Name = "PwdConfirmPictureBox";
PwdConfirmPictureBox.Size = new Size(14, 14);
PwdConfirmPictureBox.TabIndex = 35;
PwdConfirmPictureBox.TabStop = false;
//
// PwdPictureBox
//
PwdPictureBox.BackColor = Color.Transparent;
PwdPictureBox.Location = new Point(379, 205);
PwdPictureBox.Name = "PwdPictureBox";
PwdPictureBox.Size = new Size(14, 14);
PwdPictureBox.TabIndex = 34;
PwdPictureBox.TabStop = false;
//
// PwdConfirmDescLabel
//
PwdConfirmDescLabel.Anchor = AnchorStyles.Top;
PwdConfirmDescLabel.AutoSize = true;
PwdConfirmDescLabel.BackColor = Color.Transparent;
PwdConfirmDescLabel.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
PwdConfirmDescLabel.ForeColor = Color.White;
PwdConfirmDescLabel.ImeMode = ImeMode.NoControl;
PwdConfirmDescLabel.Location = new Point(395, 284);
PwdConfirmDescLabel.MaximumSize = new Size(250, 0);
PwdConfirmDescLabel.Name = "PwdConfirmDescLabel";
PwdConfirmDescLabel.Size = new Size(116, 13);
PwdConfirmDescLabel.TabIndex = 33;
PwdConfirmDescLabel.Text = "Repeat the password";
PwdConfirmDescLabel.TextAlign = ContentAlignment.TopCenter;
//
// PwdDescLabel
//
PwdDescLabel.Anchor = AnchorStyles.Top;
PwdDescLabel.AutoEllipsis = true;
PwdDescLabel.AutoSize = true;
PwdDescLabel.BackColor = Color.Transparent;
PwdDescLabel.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
PwdDescLabel.ForeColor = Color.White;
PwdDescLabel.ImeMode = ImeMode.NoControl;
PwdDescLabel.Location = new Point(395, 206);
PwdDescLabel.MaximumSize = new Size(250, 0);
PwdDescLabel.Name = "PwdDescLabel";
PwdDescLabel.Size = new Size(84, 13);
PwdDescLabel.TabIndex = 32;
PwdDescLabel.Text = "6-16 characters";
PwdDescLabel.TextAlign = ContentAlignment.TopCenter;
//
// EmailLabelS2
//
EmailLabelS2.AutoSize = true;
EmailLabelS2.Font = new Font("Segoe UI", 11F, FontStyle.Bold, GraphicsUnit.Point);
EmailLabelS2.ForeColor = Color.DodgerBlue;
EmailLabelS2.Location = new Point(101, 106);
EmailLabelS2.Name = "EmailLabelS2";
EmailLabelS2.Size = new Size(47, 20);
EmailLabelS2.TabIndex = 28;
EmailLabelS2.Text = "Email";
//
// ReturnLabelS2
//
ReturnLabelS2.Anchor = AnchorStyles.Top;
ReturnLabelS2.AutoEllipsis = true;
ReturnLabelS2.AutoSize = true;
ReturnLabelS2.BackColor = Color.Transparent;
ReturnLabelS2.Cursor = Cursors.Hand;
ReturnLabelS2.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
ReturnLabelS2.ForeColor = Color.Gainsboro;
ReturnLabelS2.ImeMode = ImeMode.NoControl;
ReturnLabelS2.Location = new Point(98, 392);
ReturnLabelS2.Name = "ReturnLabelS2";
ReturnLabelS2.Size = new Size(67, 19);
ReturnLabelS2.TabIndex = 27;
ReturnLabelS2.Text = "< Return";
ReturnLabelS2.TextAlign = ContentAlignment.TopCenter;
ReturnLabelS2.Click += ReturnLabel_Click;
ReturnLabelS2.MouseLeave += Label_MouseLeave;
ReturnLabelS2.MouseHover += Label_MouseHover;
//
// OkButtonS2
//
OkButtonS2.BackColor = Color.Transparent;
OkButtonS2.FlatAppearance.BorderSize = 0;
OkButtonS2.FlatAppearance.MouseDownBackColor = Color.Transparent;
OkButtonS2.FlatAppearance.MouseOverBackColor = Color.Transparent;
OkButtonS2.FlatStyle = FlatStyle.Flat;
OkButtonS2.ImageIndex = 0;
OkButtonS2.ImageList = imageListOKBtn;
OkButtonS2.ImeMode = ImeMode.NoControl;
OkButtonS2.Location = new Point(95, 323);
OkButtonS2.Name = "OkButtonS2";
OkButtonS2.Size = new Size(110, 44);
OkButtonS2.TabIndex = 26;
OkButtonS2.UseVisualStyleBackColor = false;
OkButtonS2.Click += OkButtonS2_Click;
OkButtonS2.MouseDown += Button_MouseDown;
OkButtonS2.MouseLeave += Button_MouseLeave;
OkButtonS2.MouseHover += Button_MouseHover;
//
// PasswordTextBox
//
PasswordTextBox.Location = new Point(93, 200);
PasswordTextBox.Name = "PasswordTextBox";
PasswordTextBox.Size = new Size(279, 23);
PasswordTextBox.TabIndex = 25;
PasswordTextBox.UseSystemPasswordChar = true;
PasswordTextBox.TextChanged += PasswordTextBox_TextChanged;
//
// RepeatPasswordTextBox
//
RepeatPasswordTextBox.Location = new Point(93, 281);
RepeatPasswordTextBox.Name = "RepeatPasswordTextBox";
RepeatPasswordTextBox.Size = new Size(279, 23);
RepeatPasswordTextBox.TabIndex = 24;
RepeatPasswordTextBox.UseSystemPasswordChar = true;
RepeatPasswordTextBox.TextChanged += RepeatPasswordTextBox_TextChanged;
//
// SubTitleLabelS2
//
SubTitleLabelS2.Anchor = AnchorStyles.Top;
SubTitleLabelS2.AutoEllipsis = true;
SubTitleLabelS2.AutoSize = true;
SubTitleLabelS2.BackColor = Color.Transparent;
SubTitleLabelS2.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
SubTitleLabelS2.ForeColor = Color.White;
SubTitleLabelS2.ImeMode = ImeMode.NoControl;
SubTitleLabelS2.Location = new Point(101, 72);
SubTitleLabelS2.Name = "SubTitleLabelS2";
SubTitleLabelS2.Size = new Size(63, 19);
SubTitleLabelS2.TabIndex = 22;
SubTitleLabelS2.Text = "Account";
SubTitleLabelS2.TextAlign = ContentAlignment.TopCenter;
//
// TitleLabelS2
//
TitleLabelS2.Anchor = AnchorStyles.Top;
TitleLabelS2.AutoEllipsis = true;
TitleLabelS2.AutoSize = true;
TitleLabelS2.BackColor = Color.Transparent;
TitleLabelS2.Font = new Font("Segoe UI", 20F, FontStyle.Bold, GraphicsUnit.Point);
TitleLabelS2.ForeColor = Color.White;
TitleLabelS2.ImeMode = ImeMode.NoControl;
TitleLabelS2.Location = new Point(85, 3);
TitleLabelS2.Name = "TitleLabelS2";
TitleLabelS2.Size = new Size(242, 37);
TitleLabelS2.TabIndex = 21;
TitleLabelS2.Text = "Change Password";
TitleLabelS2.TextAlign = ContentAlignment.TopCenter;
//
// imageListTips
//
imageListTips.ColorDepth = ColorDepth.Depth32Bit;
imageListTips.ImageStream = (ImageListStreamer)resources.GetObject("imageListTips.ImageStream");
imageListTips.TransparentColor = Color.Transparent;
imageListTips.Images.SetKeyName(0, "tips_error.png");
imageListTips.Images.SetKeyName(1, "tips_ok.png");
//
// imageListSendEmailBtn_ko
//
imageListSendEmailBtn_ko.ColorDepth = ColorDepth.Depth32Bit;
imageListSendEmailBtn_ko.ImageStream = (ImageListStreamer)resources.GetObject("imageListSendEmailBtn_ko.ImageStream");
imageListSendEmailBtn_ko.TransparentColor = Color.Transparent;
imageListSendEmailBtn_ko.Images.SetKeyName(0, "ChangePwwnd_button_email_normal_ko.png");
imageListSendEmailBtn_ko.Images.SetKeyName(1, "ChangePwwnd_button_email_active_ko.png");
imageListSendEmailBtn_ko.Images.SetKeyName(2, "ChangePwwnd_button_email_down_ko.png");
//
// imageListContinueBtn_ko
//
imageListContinueBtn_ko.ColorDepth = ColorDepth.Depth32Bit;
imageListContinueBtn_ko.ImageStream = (ImageListStreamer)resources.GetObject("imageListContinueBtn_ko.ImageStream");
imageListContinueBtn_ko.TransparentColor = Color.Transparent;
imageListContinueBtn_ko.Images.SetKeyName(0, "Registerwnd_button_continue_normal_ko.png");
imageListContinueBtn_ko.Images.SetKeyName(1, "Registerwnd_button_continue_active_ko.png");
imageListContinueBtn_ko.Images.SetKeyName(2, "Registerwnd_button_continue_down_ko.png");
//
// imageListOKBtn_ko
//
imageListOKBtn_ko.ColorDepth = ColorDepth.Depth32Bit;
imageListOKBtn_ko.ImageStream = (ImageListStreamer)resources.GetObject("imageListOKBtn_ko.ImageStream");
imageListOKBtn_ko.TransparentColor = Color.Transparent;
imageListOKBtn_ko.Images.SetKeyName(0, "messagewnd.button.ok.normal.png");
imageListOKBtn_ko.Images.SetKeyName(1, "messagewnd.button.ok.active.png");
imageListOKBtn_ko.Images.SetKeyName(2, "messagewnd.button.ok.down.png");
//
// ChangePwdForm
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
BackColor = Color.Black;
BackgroundImage = (Image)resources.GetObject("$this.BackgroundImage");
BackgroundImageLayout = ImageLayout.Center;
ClientSize = new Size(800, 571);
Controls.Add(CloseButton);
Controls.Add(MinimizeButton);
Controls.Add(Stage1Panel);
Controls.Add(Stage2Panel);
DoubleBuffered = true;
FormBorderStyle = FormBorderStyle.None;
Icon = (Icon)resources.GetObject("$this.Icon");
Name = "ChangePwdForm";
StartPosition = FormStartPosition.CenterScreen;
Text = "Change Password";
FormClosing += ChangePwd_FormClosing;
Load += ChangePwd_Load;
Stage1Panel.ResumeLayout(false);
Stage1Panel.PerformLayout();
((System.ComponentModel.ISupportInitialize)EmailPictureBox).EndInit();
((System.ComponentModel.ISupportInitialize)CodePictureBox).EndInit();
Stage2Panel.ResumeLayout(false);
Stage2Panel.PerformLayout();
((System.ComponentModel.ISupportInitialize)PwdConfirmPictureBox).EndInit();
((System.ComponentModel.ISupportInitialize)PwdPictureBox).EndInit();
ResumeLayout(false);
}
#endregion
private Button CloseButton;
private ImageList imageListCloseBtn;
private Button MinimizeButton;
private ImageList imageListMinBtn;
private Label CodeLabel;
private ImageList imageListOKBtn;
private Button ContinueButtonS1;
private Label PasswordLabel;
private Label RepeatPasswordLabel;
private Button SendEmailButton;
private TextBox CodeTextBox;
private Label SubTitleLabelS1;
private Label TitleLabelS1;
private Panel Stage1Panel;
private TextBox EmailTextBox;
private Label DescLabelS1;
private Panel Stage2Panel;
private Button OkButtonS2;
private TextBox PasswordTextBox;
private TextBox RepeatPasswordTextBox;
private Label SubTitleLabelS2;
private Label TitleLabelS2;
private Label ReturnLabelS2;
private Label EmailLabelS2;
private ImageList imageListSendEmailBtn;
private PictureBox PwdConfirmPictureBox;
private PictureBox PwdPictureBox;
private Label PwdConfirmDescLabel;
private Label PwdDescLabel;
private ImageList imageListTips;
private PictureBox EmailPictureBox;
private Label EmailDescLabel;
private PictureBox CodePictureBox;
private Label CodeDescLabel;
private Label TimerLabel;
private ImageList imageListContinueBtn;
private Label PwdStrengthLabel;
private ImageList imageListSendEmailBtn_ko;
private ImageList imageListContinueBtn_ko;
private ImageList imageListOKBtn_ko;
}
}

View file

@ -0,0 +1,558 @@
using RHLauncher.RHLauncher.Helper;
using RHLauncher.RHLauncher.i8n;
using System.Text.RegularExpressions;
namespace RHLauncher
{
public partial class ChangePwdForm : Form
{
private RegistryHandler registryHandler = new();
public string SendPasswordCodeUrl = Configuration.Default.SendPasswordCodeUrl;
public string VerifyCodeUrl = Configuration.Default.VerifyCodeUrl;
public string ChangePasswordUrl = Configuration.Default.ChangePasswordUrl;
public string Lang = Configuration.Default.Lang;
private List<Button>? buttons;
private List<ImageList>? imageLists;
private Dictionary<string, List<ImageList>>? languageImageLists;
private readonly System.Windows.Forms.Timer resendTimer = new();
private int secondsLeft = 60;
private readonly bool _shouldRestart;
public ChangePwdForm(bool shouldRestart = false)
{
InitializeComponent();
Stage1Panel.Visible = true;
Stage2Panel.Visible = false;
resendTimer = new System.Windows.Forms.Timer
{
Interval = 1000
};
resendTimer.Tick += ResendTimer_Tick;
_shouldRestart = shouldRestart;
LoadLocalizedStrings();
Text = LocalizedStrings.ChangePwdFormTitle;
TitleLabelS1.Text = LocalizedStrings.ChangePassword;
TitleLabelS2.Text = LocalizedStrings.ChangePassword;
SubTitleLabelS1.Text = LocalizedStrings.RustyHearts;
SubTitleLabelS2.Text = LocalizedStrings.Account;
DescLabelS1.Text = LocalizedStrings.EnterEmail;
ReturnLabelS2.Text = LocalizedStrings.Return;
CodeLabel.Text = LocalizedStrings.VerificationCode;
PasswordLabel.Text = LocalizedStrings.NewPassword;
PwdDescLabel.Text = LocalizedStrings.NewPasswordDesc;
RepeatPasswordLabel.Text = LocalizedStrings.RepeatPassword;
PwdConfirmDescLabel.Text = LocalizedStrings.RepeatPasswordDesc;
}
private void LoadLocalizedStrings()
{
// Initialize buttons and image lists
buttons = new List<Button> { ContinueButtonS1, SendEmailButton, OkButtonS2 };
imageLists = new List<ImageList> { imageListContinueBtn, imageListSendEmailBtn, imageListOKBtn };
// Initialize language-specific image lists
languageImageLists = new Dictionary<string, List<ImageList>>
{
{ "en", new List<ImageList> { imageListContinueBtn, imageListSendEmailBtn, imageListOKBtn } }, // English image lists
{ "ko", new List<ImageList> { imageListContinueBtn_ko, imageListSendEmailBtn_ko, imageListOKBtn_ko } }, // Korean image lists
// Add other languages and their respective image lists here
};
// Load the appropriate resource file based on the selected language
LocalizationHelper.LoadLocalizedStrings(Lang, buttons, imageLists, languageImageLists);
}
#region Form Events
private void ChangePwd_Load(object sender, EventArgs e)
{
ContinueButtonS1.Enabled = false;
}
private void ChangePwd_FormClosing(object sender, FormClosingEventArgs e)
{
resendTimer.Dispose();
if (sender is ChangePwdForm changePwd)
{
changePwd.Dispose();
}
}
#endregion
#region Methods
private async Task<string> SendEmailRequestAsync()
{
using HttpClient client = new();
using HttpResponseMessage response = await client.PostAsync(SendPasswordCodeUrl, new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("email", EmailTextBox.Text),
}));
return await response.Content.ReadAsStringAsync();
}
private void HandleSendEmailResponse(string response)
{
Invoke((MethodInvoker)(() =>
{
switch (response)
{
case "EmailSent":
SendEmailButton.Enabled = false;
resendTimer.Start();
break;
case "ValidVerificationCode":
// Hide the firs panel and show the second panel
Stage1Panel.Visible = false;
Stage2Panel.Visible = true;
EmailLabelS2.Text = EmailTextBox.Text;
CodeDescLabel.Text = "";
CodePictureBox.Image = imageListTips.Images[1];
break;
case "PasswordChanged":
MsgBoxForm.Show(LocalizedStrings.PasswordChanged, LocalizedStrings.Success);
OnPasswordChanged();
break;
case "SamePassword":
MsgBoxForm.Show(LocalizedStrings.SamePassword, LocalizedStrings.Failed);
break;
case "AccountNotFound":
EmailDescLabel.Text = LocalizedStrings.AccountNotFound;
EmailDescLabel.ForeColor = Color.Red;
EmailPictureBox.Image = imageListTips.Images[0];
return;
case "InvalidVerificationCode":
CodeDescLabel.Text = LocalizedStrings.InvalidVerificationCode;
CodeDescLabel.ForeColor = Color.Red;
CodePictureBox.Image = imageListTips.Images[0];
return;
case "ExpiredVerificationCode":
CodeDescLabel.Text = LocalizedStrings.ExpiredVerificationCode;
CodeDescLabel.ForeColor = Color.Red;
CodePictureBox.Image = imageListTips.Images[0];
return;
default:
MsgBoxForm.Show("Error:" + response, LocalizedStrings.Error);
break;
}
}));
}
private void ResendTimer_Tick(object? sender, EventArgs e)
{
// Decrement the secondsLeft variable and update the button text
secondsLeft--;
Invoke((MethodInvoker)(() =>
{
TimerLabel.Text = $"({secondsLeft})";
if (secondsLeft == 0)
{
resendTimer.Stop();
SendEmailButton.Enabled = true;
TimerLabel.Text = "";
}
}));
}
private async Task<string> VerifyCodeSendRequestAsync()
{
using HttpClient client = new();
using HttpResponseMessage response = await client.PostAsync(VerifyCodeUrl, new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("email", EmailTextBox.Text),
new KeyValuePair<string, string>("verification_code", CodeTextBox.Text),
new KeyValuePair<string, string>("verification_code_type", "Password"),
}));
return await response.Content.ReadAsStringAsync();
}
private async Task<string> ChangePasswordSendRequestAsync()
{
using HttpClient client = new();
using HttpResponseMessage response = await client.PostAsync(ChangePasswordUrl, new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("email", EmailTextBox.Text),
new KeyValuePair<string, string>("password", PasswordTextBox.Text),
new KeyValuePair<string, string>("verification_code", CodeTextBox.Text),
}));
return await response.Content.ReadAsStringAsync();
}
private void OnPasswordChanged()
{
if (_shouldRestart)
{
registryHandler = new RegistryHandler();
registryHandler.ClearPassword();
Invoke((MethodInvoker)(() => Close()));
Task.Delay(500).ContinueWith(_ =>
{
Application.Restart();
});
}
else
{
Invoke((MethodInvoker)(() => Close()));
}
}
private static void HandleException(Exception ex)
{
string errorMessage = ex.Message;
string errorLog = ex.Message + ex.StackTrace;
Exception newEx = new(errorMessage, ex);
Exception newLogEx = new(errorLog, ex);
ExceptionHandler.HandleException(newEx, newLogEx);
}
#endregion
#region Button Click Events
private async void SendEmailButton_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(EmailTextBox.Text))
{
EmailDescLabel.Text = LocalizedStrings.EmailDescLabelEmpty;
EmailDescLabel.ForeColor = Color.Red;
EmailPictureBox.Image = imageListTips.Images[0];
return;
}
// Disable the ResendEmailButton and stop the timer
SendEmailButton.Enabled = false;
resendTimer.Stop();
try
{
Regex emailRegex = RegexPatterns.EmailRegex();
if (emailRegex.IsMatch(EmailTextBox.Text))
{
// email is valid
EmailPictureBox.Image = imageListTips.Images[1];
EmailDescLabel.Text = "";
}
else
{
// email is not valid
EmailPictureBox.Image = imageListTips.Images[0];
EmailDescLabel.Text = LocalizedStrings.EmailDescLabelInvalid;
return;
}
// Reset the secondsLeft variable and start the timer again
secondsLeft = 60;
resendTimer.Start();
SendEmailButton.Enabled = false;
string response = await SendEmailRequestAsync();
HandleSendEmailResponse(response);
}
catch (Exception ex)
{
HandleException(ex);
}
}
private async void ContinueButtonS1_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(CodeTextBox.Text))
{
CodeDescLabel.Text = LocalizedStrings.CodeDescLabel;
CodeDescLabel.ForeColor = Color.Red;
CodePictureBox.Image = imageListTips.Images[0];
return;
}
try
{
string response = await VerifyCodeSendRequestAsync();
HandleSendEmailResponse(response);
}
catch (Exception ex)
{
HandleException(ex);
}
}
private async void OkButtonS2_Click(object sender, EventArgs e)
{
try
{
string response = await ChangePasswordSendRequestAsync();
HandleSendEmailResponse(response);
}
catch (Exception ex)
{
HandleException(ex);
}
}
private void ReturnLabel_Click(object sender, EventArgs e)
{
// Show the previous panel and hide the current panel
if (Stage2Panel.Visible)
{
Stage1Panel.Visible = true;
Stage2Panel.Visible = false;
}
}
private bool PasswordTextBoxValid = false;
private void PasswordTextBox_TextChanged(object sender, EventArgs e)
{
string password = PasswordTextBox.Text;
// Check for minimum length and maximum length
if (password.Length < 6 || password.Length > 16)
{
PwdDescLabel.Text = LocalizedStrings.PwdDescLabelSize;
PwdDescLabel.ForeColor = Color.Red;
PwdPictureBox.Image = imageListTips.Images[0];
PasswordTextBoxValid = false;
RepeatPasswordTextBoxValid = false;
CheckFormS2Validity();
return;
}
// Check for at least one uppercase, one lowercase letter, and one number
Regex pwRegex = RegexPatterns.PWRegex();
if (!pwRegex.IsMatch(password))
{
PwdDescLabel.Text = LocalizedStrings.PwdDescLabelCriteria;
PwdDescLabel.ForeColor = Color.Red;
PwdPictureBox.Image = imageListTips.Images[0];
PwdStrengthLabel.Text = LocalizedStrings.PwdStrengthLabelWeak;
PwdStrengthLabel.ForeColor = Color.Red;
PasswordTextBoxValid = false;
RepeatPasswordTextBoxValid = false;
CheckFormS2Validity();
return;
}
// Check for additional character types such as symbols
Regex strongPWRegex = RegexPatterns.StrongPWRegex();
if (strongPWRegex.IsMatch(password))
{
PwdDescLabel.Text = "";
PwdPictureBox.Image = imageListTips.Images[1];
PwdStrengthLabel.Text = LocalizedStrings.PwdStrengthLabelStrong;
PwdStrengthLabel.ForeColor = Color.Green;
PasswordTextBoxValid = true;
RepeatPasswordTextBox_TextChanged(sender, e);
return;
}
// Password is valid but could be stronger
PwdDescLabel.Text = "";
PwdPictureBox.Image = imageListTips.Images[1];
PwdStrengthLabel.Text = LocalizedStrings.PwdStrengthLabelMedium;
PwdStrengthLabel.ForeColor = Color.Yellow;
PasswordTextBoxValid = true;
RepeatPasswordTextBox_TextChanged(sender, e);
return;
}
private bool RepeatPasswordTextBoxValid = false;
private void RepeatPasswordTextBox_TextChanged(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(RepeatPasswordTextBox.Text))
{
PwdConfirmDescLabel.Text = LocalizedStrings.PwdConfirmDescLabelEmpty;
PwdConfirmDescLabel.ForeColor = Color.Red;
PwdConfirmPictureBox.Image = imageListTips.Images[0];
RepeatPasswordTextBoxValid = RepeatPasswordTextBox.Text.Equals(PasswordTextBox.Text);
}
else if (!RepeatPasswordTextBox.Text.Equals(PasswordTextBox.Text))
{
PwdConfirmDescLabel.Text = LocalizedStrings.PwdConfirmDescLabelMatch;
PwdConfirmDescLabel.ForeColor = Color.Red;
PwdConfirmPictureBox.Image = imageListTips.Images[0];
RepeatPasswordTextBoxValid = RepeatPasswordTextBox.Text.Equals(PasswordTextBox.Text);
}
else
{
PwdConfirmDescLabel.Text = "";
PwdConfirmPictureBox.Image = imageListTips.Images[1];
RepeatPasswordTextBoxValid = RepeatPasswordTextBox.Text.Equals(PasswordTextBox.Text);
}
CheckFormS2Validity();
}
private bool EmailTextBoxValid = false;
private void EmailTextBox_TextChanged(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(EmailTextBox.Text))
{
EmailDescLabel.Text = LocalizedStrings.EmailDescLabelEmpty;
EmailDescLabel.ForeColor = Color.Red;
EmailPictureBox.Image = imageListTips.Images[0];
EmailTextBoxValid = false;
}
try
{
Regex emailRegex = RegexPatterns.EmailRegex();
if (emailRegex.IsMatch(EmailTextBox.Text))
{
// email is valid
EmailPictureBox.Image = imageListTips.Images[1];
EmailDescLabel.Text = "";
EmailTextBoxValid = true;
}
else
{
// email is not valid
EmailPictureBox.Image = imageListTips.Images[0];
EmailDescLabel.Text = LocalizedStrings.EmailDescLabelInvalid;
EmailTextBoxValid = false;
}
}
catch (FormatException)
{
EmailPictureBox.Image = imageListTips.Images[0];
}
CheckFormS1Validity();
}
private bool CodeTextBoxValid = false;
private void CodeTextBox_TextChanged(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(CodeTextBox.Text))
{
CodeDescLabel.Text = LocalizedStrings.CodeDescLabel;
CodeDescLabel.ForeColor = Color.Red;
CodePictureBox.Image = imageListTips.Images[0];
CodeTextBoxValid = false;
}
try
{
string input = CodeTextBox.Text;
if (int.TryParse(input, out int number))
{
// input is numeric
CodeDescLabel.Text = "";
CodePictureBox.Image = imageListTips.Images[1];
CodeTextBoxValid = true;
}
else
{
// input is not numeric
CodeDescLabel.Text = LocalizedStrings.InvalidVerificationCode;
CodeDescLabel.ForeColor = Color.Red;
CodePictureBox.Image = imageListTips.Images[0];
CodeTextBoxValid = false;
}
}
catch (FormatException)
{
CodePictureBox.Image = imageListTips.Images[0];
}
CheckFormS1Validity();
}
private void CheckFormS1Validity()
{
if (EmailTextBoxValid &&
CodeTextBoxValid)
{
ContinueButtonS1.Enabled = true;
}
else
{
ContinueButtonS1.Enabled = false;
}
}
private void CheckFormS2Validity()
{
if (PasswordTextBoxValid &&
RepeatPasswordTextBoxValid)
{
OkButtonS2.Enabled = true;
}
else
{
OkButtonS2.Enabled = false;
}
}
private void CloseButton_Click(object sender, EventArgs e)
{
Close();
}
private void MinimizeButton_Click(object sender, EventArgs e)
{
WindowState = FormWindowState.Minimized;
}
#endregion
#region Button Events
private void Button_MouseHover(object sender, EventArgs e)
{
if (sender is Button button)
{
button.ImageIndex = 1;
}
}
private void Button_MouseLeave(object sender, EventArgs e)
{
if (sender is Button button)
{
button.ImageIndex = 0;
}
}
private void Button_MouseDown(object sender, MouseEventArgs e)
{
if (sender is Button button)
{
button.ImageIndex = 2;
}
}
private void Label_MouseHover(object sender, EventArgs e)
{
if (sender is Label label)
{
label.ForeColor = Color.White;
}
}
private void Label_MouseLeave(object sender, EventArgs e)
{
if (sender is Label label)
{
label.ForeColor = Color.Gainsboro;
}
}
#endregion
}
}

File diff suppressed because it is too large Load diff

214
RHLauncher.Forms/ConfigForm.Designer.cs generated Normal file
View file

@ -0,0 +1,214 @@
namespace RHLauncher
{
partial class ConfigForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ConfigForm));
CloseButton = new Button();
imageListCloseBtn = new ImageList(components);
imageListOKBtn = new ImageList(components);
TitleLabel = new Label();
imageListBtn = new ImageList(components);
cbLauncherLanguage = new ComboBox();
LanguageLabel = new Label();
OkButton = new Button();
VersionLabel = new Label();
toolTip = new ToolTip(components);
SuspendLayout();
//
// CloseButton
//
CloseButton.BackColor = Color.Transparent;
CloseButton.FlatAppearance.BorderColor = Color.Black;
CloseButton.FlatAppearance.BorderSize = 0;
CloseButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
CloseButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
CloseButton.FlatStyle = FlatStyle.Flat;
CloseButton.ForeColor = Color.Transparent;
CloseButton.ImageIndex = 0;
CloseButton.ImageList = imageListCloseBtn;
CloseButton.ImeMode = ImeMode.NoControl;
CloseButton.Location = new Point(607, 9);
CloseButton.Name = "CloseButton";
CloseButton.Size = new Size(32, 29);
CloseButton.TabIndex = 8;
CloseButton.UseVisualStyleBackColor = false;
CloseButton.Click += CloseButton_Click;
CloseButton.MouseDown += Button_MouseDown;
CloseButton.MouseLeave += Button_MouseLeave;
CloseButton.MouseHover += Button_MouseHover;
//
// imageListCloseBtn
//
imageListCloseBtn.ColorDepth = ColorDepth.Depth32Bit;
imageListCloseBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListCloseBtn.ImageStream");
imageListCloseBtn.TransparentColor = Color.Transparent;
imageListCloseBtn.Images.SetKeyName(0, "button_close_normal.png");
imageListCloseBtn.Images.SetKeyName(1, "button_close_active.png");
imageListCloseBtn.Images.SetKeyName(2, "button_close_down.png");
//
// imageListOKBtn
//
imageListOKBtn.ColorDepth = ColorDepth.Depth32Bit;
imageListOKBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListOKBtn.ImageStream");
imageListOKBtn.TransparentColor = Color.Transparent;
imageListOKBtn.Images.SetKeyName(0, "messagewnd.button.ok.normal.png");
imageListOKBtn.Images.SetKeyName(1, "messagewnd.button.ok.active.png");
imageListOKBtn.Images.SetKeyName(2, "messagewnd.button.ok.down.png");
//
// TitleLabel
//
TitleLabel.Anchor = AnchorStyles.None;
TitleLabel.AutoEllipsis = true;
TitleLabel.AutoSize = true;
TitleLabel.BackColor = Color.Transparent;
TitleLabel.Font = new Font("Segoe UI", 11F, FontStyle.Bold, GraphicsUnit.Point);
TitleLabel.ForeColor = Color.White;
TitleLabel.ImageAlign = ContentAlignment.TopRight;
TitleLabel.ImeMode = ImeMode.NoControl;
TitleLabel.Location = new Point(287, 18);
TitleLabel.Name = "TitleLabel";
TitleLabel.Size = new Size(66, 20);
TitleLabel.TabIndex = 10;
TitleLabel.Text = "Settings";
TitleLabel.TextAlign = ContentAlignment.MiddleCenter;
//
// imageListBtn
//
imageListBtn.ColorDepth = ColorDepth.Depth32Bit;
imageListBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListBtn.ImageStream");
imageListBtn.TransparentColor = Color.Transparent;
imageListBtn.Images.SetKeyName(0, "button_normal.png");
imageListBtn.Images.SetKeyName(1, "button_active.png");
imageListBtn.Images.SetKeyName(2, "button_down.png");
//
// cbLauncherLanguage
//
cbLauncherLanguage.DropDownStyle = ComboBoxStyle.DropDownList;
cbLauncherLanguage.FormattingEnabled = true;
cbLauncherLanguage.Items.AddRange(new object[] { "English", "한국어" });
cbLauncherLanguage.Location = new Point(254, 91);
cbLauncherLanguage.Name = "cbLauncherLanguage";
cbLauncherLanguage.Size = new Size(145, 23);
cbLauncherLanguage.TabIndex = 12;
cbLauncherLanguage.SelectedIndexChanged += CbLauncherLanguage_SelectedIndexChanged;
//
// LanguageLabel
//
LanguageLabel.Anchor = AnchorStyles.None;
LanguageLabel.AutoEllipsis = true;
LanguageLabel.AutoSize = true;
LanguageLabel.BackColor = Color.Transparent;
LanguageLabel.Font = new Font("Segoe UI", 11F, FontStyle.Bold, GraphicsUnit.Point);
LanguageLabel.ForeColor = Color.White;
LanguageLabel.ImageAlign = ContentAlignment.TopRight;
LanguageLabel.ImeMode = ImeMode.NoControl;
LanguageLabel.Location = new Point(254, 68);
LanguageLabel.Name = "LanguageLabel";
LanguageLabel.Size = new Size(145, 20);
LanguageLabel.TabIndex = 13;
LanguageLabel.Text = "Launcher Language";
LanguageLabel.TextAlign = ContentAlignment.MiddleCenter;
//
// OkButton
//
OkButton.BackColor = Color.Transparent;
OkButton.FlatAppearance.BorderSize = 0;
OkButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
OkButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
OkButton.FlatStyle = FlatStyle.Flat;
OkButton.ImageIndex = 0;
OkButton.ImageList = imageListOKBtn;
OkButton.ImeMode = ImeMode.NoControl;
OkButton.Location = new Point(268, 218);
OkButton.Name = "OkButton";
OkButton.Size = new Size(110, 44);
OkButton.TabIndex = 14;
OkButton.UseVisualStyleBackColor = false;
OkButton.Click += OkButton_Click;
OkButton.MouseDown += Button_MouseDown;
OkButton.MouseLeave += Button_MouseLeave;
OkButton.MouseHover += Button_MouseHover;
//
// VersionLabel
//
VersionLabel.AutoSize = true;
VersionLabel.BackColor = Color.Transparent;
VersionLabel.Cursor = Cursors.Hand;
VersionLabel.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
VersionLabel.ForeColor = Color.White;
VersionLabel.Location = new Point(5, 248);
VersionLabel.Name = "VersionLabel";
VersionLabel.Size = new Size(62, 19);
VersionLabel.TabIndex = 16;
VersionLabel.Text = "Version:";
toolTip.SetToolTip(VersionLabel, "Click to open github repository");
VersionLabel.Click += VersionLabel_Click;
//
// ConfigForm
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
BackColor = Color.Magenta;
BackgroundImage = (Image)resources.GetObject("$this.BackgroundImage");
ClientSize = new Size(646, 272);
Controls.Add(VersionLabel);
Controls.Add(OkButton);
Controls.Add(LanguageLabel);
Controls.Add(cbLauncherLanguage);
Controls.Add(TitleLabel);
Controls.Add(CloseButton);
DoubleBuffered = true;
FormBorderStyle = FormBorderStyle.None;
Icon = (Icon)resources.GetObject("$this.Icon");
Name = "ConfigForm";
ShowInTaskbar = false;
StartPosition = FormStartPosition.CenterScreen;
Text = "Message";
TransparencyKey = Color.Magenta;
FormClosing += ConfigForm_FormClosing;
Load += ConfigForm_Load;
ResumeLayout(false);
PerformLayout();
}
#endregion
private Button CloseButton;
private ImageList imageListCloseBtn;
private ImageList imageListOKBtn;
private Label TitleLabel;
private ImageList imageListBtn;
private ComboBox cbLauncherLanguage;
private Label LanguageLabel;
private Button OkButton;
private Label VersionLabel;
private ToolTip toolTip;
}
}

View file

@ -0,0 +1,148 @@
using RHLauncher.RHLauncher.i8n;
using RHLauncher.RHLauncher.Helper;
using System.Diagnostics;
namespace RHLauncher
{
public partial class ConfigForm : Form
{
public string Url = "https://github.com/JuniorDark/RustyHearts-Launcher";
private bool languageChanged = false;
readonly string currentLanguageCode = Configuration.Default.Lang;
public ConfigForm()
{
InitializeComponent();
string currentVersion = GetLauncherVersion.GetVersion();
cbLauncherLanguage.SelectedItem = GetLanguageName(currentLanguageCode);
VersionLabel.Text = $"{LocalizedStrings.Version}: {currentVersion}";
Text = LocalizedStrings.ConfigFormTitle;
TitleLabel.Text = LocalizedStrings.Settings;
LanguageLabel.Text = LocalizedStrings.LauncherLanguage;
}
#region Form Events
private void ConfigForm_Load(object sender, EventArgs e)
{
TitleLabel.Left = (ClientSize.Width - TitleLabel.Width) / 2;
}
private void ConfigForm_FormClosing(object sender, FormClosingEventArgs e)
{
Dispose();
}
#endregion
#region Language Methods
private void CbLauncherLanguage_SelectedIndexChanged(object sender, EventArgs e)
{
if (cbLauncherLanguage.SelectedItem is string selectedItem)
{
string selectedLanguageCode = GetLanguageCode(selectedItem);
if (selectedLanguageCode != currentLanguageCode)
{
languageChanged = true;
}
else
{
languageChanged = false;
}
}
}
private static string GetLanguageCode(string? language)
{
return language switch
{
"English" => "en",
"한국어" => "ko",
_ => "en", // default to English if not found
};
}
private static string GetLanguageName(string code)
{
return code switch
{
"en" => "English",
"ko" => "한국어",
_ => "English", // default to English if not found
};
}
#endregion
#region Button Click Events
private void OkButton_Click(object sender, EventArgs e)
{
if (languageChanged)
{
string? selectedLanguage = cbLauncherLanguage.SelectedItem.ToString();
string languageCode = GetLanguageCode(selectedLanguage);
if (languageCode != null)
{
// Update the language in the INI file
Configuration.Default.Lang = languageCode;
Configuration.Default.iniFile.WriteValue("Launcher", "Lang", languageCode);
DialogResult result = MsgBoxForm.ShowYN(LocalizedStrings.ChangeLanguageMessage, LocalizedStrings.Confirmation);
if (result == DialogResult.Yes)
{
Invoke((MethodInvoker)(() => Close()));
Task.Delay(1000).ContinueWith(_ =>
{
Application.Restart();
});
}
}
}
else
{
Close();
}
}
private void VersionLabel_Click(object sender, EventArgs e)
{
Process.Start(new ProcessStartInfo { FileName = Url, UseShellExecute = true });
}
private void CloseButton_Click(object sender, EventArgs e)
{
Close();
}
#endregion
#region Button Events
private void Button_MouseHover(object sender, EventArgs e)
{
if (sender is Button button)
{
button.ImageIndex = 1;
}
}
private void Button_MouseLeave(object sender, EventArgs e)
{
if (sender is Button button)
{
button.ImageIndex = 0;
}
}
private void Button_MouseDown(object sender, MouseEventArgs e)
{
if (sender is Button button)
{
button.ImageIndex = 2;
}
}
#endregion
}
}

File diff suppressed because it is too large Load diff

840
RHLauncher.Forms/LauncherForm.Designer.cs generated Normal file
View file

@ -0,0 +1,840 @@
namespace RHLauncher
{
partial class LauncherForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LauncherForm));
CloseButton = new Button();
imageListCloseBtn = new ImageList(components);
MinimizeButton = new Button();
imageListMinBtn = new ImageList(components);
LaunchButton = new Button();
imageListLaunch = new ImageList(components);
NameLabel = new Label();
CharPictureBox = new PictureBox();
getUpdatePanel = new Panel();
StopButton = new Button();
imageListStopBtn = new ImageList(components);
FileCountLabel = new Label();
FileSizeLabel = new Label();
SpeedLabel = new Label();
TimeLabel = new Label();
PercentLabel = new Label();
DownloadingLabel = new Label();
FileNameLabel = new Label();
progressBar = new ProgressBar();
webView2 = new Microsoft.Web.WebView2.WinForms.WebView2();
LabelNews = new Label();
imageListButton = new ImageList(components);
AccOptionsButton = new Button();
AccPanel = new Panel();
LogoutButton = new Button();
imageListMenuButton = new ImageList(components);
ChangePwdButton = new Button();
LaunchOptionsButton = new Button();
imageListLaunchOpt = new ImageList(components);
LaunchPanel = new Panel();
OpenSettingsButton = new Button();
OpenInstallDirButton = new Button();
ManageButton = new Button();
CheckUpdateButton = new Button();
ChangeInstallLocationButton = new Button();
InstallPanel = new Panel();
UninstallButton = new Button();
notifyIcon = new NotifyIcon(components);
LabelInstalled = new Label();
LabelLocate = new Label();
SettingsButton = new Button();
imageListGear = new ImageList(components);
toolTip = new ToolTip(components);
((System.ComponentModel.ISupportInitialize)CharPictureBox).BeginInit();
getUpdatePanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)webView2).BeginInit();
AccPanel.SuspendLayout();
LaunchPanel.SuspendLayout();
InstallPanel.SuspendLayout();
SuspendLayout();
//
// CloseButton
//
CloseButton.BackColor = Color.Transparent;
CloseButton.FlatAppearance.BorderColor = Color.Black;
CloseButton.FlatAppearance.BorderSize = 0;
CloseButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
CloseButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
CloseButton.FlatStyle = FlatStyle.Flat;
CloseButton.ForeColor = Color.Transparent;
CloseButton.ImageIndex = 0;
CloseButton.ImageList = imageListCloseBtn;
CloseButton.ImeMode = ImeMode.NoControl;
CloseButton.Location = new Point(1203, 8);
CloseButton.Name = "CloseButton";
CloseButton.Size = new Size(32, 29);
CloseButton.TabIndex = 9;
CloseButton.UseVisualStyleBackColor = false;
CloseButton.Click += CloseButton_Click;
CloseButton.MouseDown += Button_MouseDown;
CloseButton.MouseLeave += Button_MouseLeave;
CloseButton.MouseHover += Button_MouseHover;
//
// imageListCloseBtn
//
imageListCloseBtn.ColorDepth = ColorDepth.Depth32Bit;
imageListCloseBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListCloseBtn.ImageStream");
imageListCloseBtn.TransparentColor = Color.Transparent;
imageListCloseBtn.Images.SetKeyName(0, "button_close_normal.png");
imageListCloseBtn.Images.SetKeyName(1, "button_close_active.png");
imageListCloseBtn.Images.SetKeyName(2, "button_close_down.png");
//
// MinimizeButton
//
MinimizeButton.BackColor = Color.Transparent;
MinimizeButton.FlatAppearance.BorderColor = Color.Black;
MinimizeButton.FlatAppearance.BorderSize = 0;
MinimizeButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
MinimizeButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
MinimizeButton.FlatStyle = FlatStyle.Flat;
MinimizeButton.ForeColor = Color.Transparent;
MinimizeButton.ImageIndex = 0;
MinimizeButton.ImageList = imageListMinBtn;
MinimizeButton.ImeMode = ImeMode.NoControl;
MinimizeButton.Location = new Point(1176, 31);
MinimizeButton.Name = "MinimizeButton";
MinimizeButton.Size = new Size(25, 26);
MinimizeButton.TabIndex = 8;
MinimizeButton.UseVisualStyleBackColor = false;
MinimizeButton.Click += MinimizeButton_Click;
MinimizeButton.MouseDown += Button_MouseDown;
MinimizeButton.MouseLeave += Button_MouseLeave;
MinimizeButton.MouseHover += Button_MouseHover;
//
// imageListMinBtn
//
imageListMinBtn.ColorDepth = ColorDepth.Depth32Bit;
imageListMinBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListMinBtn.ImageStream");
imageListMinBtn.TransparentColor = Color.Transparent;
imageListMinBtn.Images.SetKeyName(0, "button_minimize_normal.png");
imageListMinBtn.Images.SetKeyName(1, "button_minimize_active.png");
imageListMinBtn.Images.SetKeyName(2, "button_minimize_down.png");
//
// LaunchButton
//
LaunchButton.BackColor = Color.Transparent;
LaunchButton.FlatAppearance.BorderSize = 0;
LaunchButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
LaunchButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
LaunchButton.FlatStyle = FlatStyle.Flat;
LaunchButton.Font = new Font("Segoe UI", 15F, FontStyle.Bold, GraphicsUnit.Point);
LaunchButton.ForeColor = Color.White;
LaunchButton.ImageIndex = 0;
LaunchButton.ImageList = imageListLaunch;
LaunchButton.ImeMode = ImeMode.NoControl;
LaunchButton.Location = new Point(997, 590);
LaunchButton.Name = "LaunchButton";
LaunchButton.Size = new Size(158, 52);
LaunchButton.TabIndex = 10;
LaunchButton.Text = "Launch";
LaunchButton.UseVisualStyleBackColor = false;
LaunchButton.MouseDown += Button_MouseDown;
LaunchButton.MouseLeave += Button_MouseLeave;
LaunchButton.MouseHover += Button_MouseHover;
//
// imageListLaunch
//
imageListLaunch.ColorDepth = ColorDepth.Depth32Bit;
imageListLaunch.ImageStream = (ImageListStreamer)resources.GetObject("imageListLaunch.ImageStream");
imageListLaunch.TransparentColor = Color.Transparent;
imageListLaunch.Images.SetKeyName(0, "launchbutton_bkg_normal.png");
imageListLaunch.Images.SetKeyName(1, "launchbutton_bkg_active.png");
imageListLaunch.Images.SetKeyName(2, "launchbutton_bkg_down.png");
//
// NameLabel
//
NameLabel.BackColor = Color.Transparent;
NameLabel.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
NameLabel.ForeColor = Color.White;
NameLabel.ImeMode = ImeMode.NoControl;
NameLabel.Location = new Point(822, 32);
NameLabel.Name = "NameLabel";
NameLabel.Size = new Size(191, 15);
NameLabel.TabIndex = 13;
NameLabel.Text = "Welcome, {_windyCode}";
NameLabel.TextAlign = ContentAlignment.MiddleRight;
//
// CharPictureBox
//
CharPictureBox.BackColor = Color.Transparent;
CharPictureBox.Image = (Image)resources.GetObject("CharPictureBox.Image");
CharPictureBox.Location = new Point(23, 165);
CharPictureBox.Name = "CharPictureBox";
CharPictureBox.Size = new Size(367, 497);
CharPictureBox.SizeMode = PictureBoxSizeMode.Zoom;
CharPictureBox.TabIndex = 17;
CharPictureBox.TabStop = false;
CharPictureBox.Click += CharPictureBox_Click;
//
// getUpdatePanel
//
getUpdatePanel.BackColor = Color.Transparent;
getUpdatePanel.BackgroundImageLayout = ImageLayout.Stretch;
getUpdatePanel.BorderStyle = BorderStyle.FixedSingle;
getUpdatePanel.Controls.Add(StopButton);
getUpdatePanel.Controls.Add(FileCountLabel);
getUpdatePanel.Controls.Add(FileSizeLabel);
getUpdatePanel.Controls.Add(SpeedLabel);
getUpdatePanel.Controls.Add(TimeLabel);
getUpdatePanel.Controls.Add(PercentLabel);
getUpdatePanel.Controls.Add(DownloadingLabel);
getUpdatePanel.Controls.Add(FileNameLabel);
getUpdatePanel.Controls.Add(progressBar);
getUpdatePanel.Location = new Point(397, 570);
getUpdatePanel.Name = "getUpdatePanel";
getUpdatePanel.Size = new Size(594, 93);
getUpdatePanel.TabIndex = 18;
//
// StopButton
//
StopButton.BackColor = Color.Transparent;
StopButton.FlatAppearance.BorderColor = Color.Black;
StopButton.FlatAppearance.BorderSize = 0;
StopButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
StopButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
StopButton.FlatStyle = FlatStyle.Flat;
StopButton.ForeColor = Color.Transparent;
StopButton.ImageIndex = 0;
StopButton.ImageList = imageListStopBtn;
StopButton.ImeMode = ImeMode.NoControl;
StopButton.Location = new Point(562, 36);
StopButton.Name = "StopButton";
StopButton.Size = new Size(25, 25);
StopButton.TabIndex = 28;
StopButton.UseVisualStyleBackColor = false;
StopButton.Click += StopButton_Click;
StopButton.MouseDown += Button_MouseDown;
StopButton.MouseLeave += Button_MouseLeave;
StopButton.MouseHover += Button_MouseHover;
//
// imageListStopBtn
//
imageListStopBtn.ColorDepth = ColorDepth.Depth8Bit;
imageListStopBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListStopBtn.ImageStream");
imageListStopBtn.TransparentColor = Color.Transparent;
imageListStopBtn.Images.SetKeyName(0, "button_stop_normal.png");
imageListStopBtn.Images.SetKeyName(1, "button_stop_active.png");
imageListStopBtn.Images.SetKeyName(2, "button_stop_down.png");
//
// FileCountLabel
//
FileCountLabel.Anchor = AnchorStyles.Top;
FileCountLabel.AutoSize = true;
FileCountLabel.BackColor = Color.Transparent;
FileCountLabel.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
FileCountLabel.ForeColor = Color.White;
FileCountLabel.ImeMode = ImeMode.NoControl;
FileCountLabel.Location = new Point(130, 15);
FileCountLabel.Name = "FileCountLabel";
FileCountLabel.Size = new Size(32, 13);
FileCountLabel.TabIndex = 20;
FileCountLabel.Text = "(0/0)";
FileCountLabel.TextAlign = ContentAlignment.TopCenter;
//
// FileSizeLabel
//
FileSizeLabel.Anchor = AnchorStyles.Top;
FileSizeLabel.AutoSize = true;
FileSizeLabel.BackColor = Color.Transparent;
FileSizeLabel.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
FileSizeLabel.ForeColor = Color.White;
FileSizeLabel.ImeMode = ImeMode.NoControl;
FileSizeLabel.Location = new Point(251, 15);
FileSizeLabel.Name = "FileSizeLabel";
FileSizeLabel.Size = new Size(31, 13);
FileSizeLabel.TabIndex = 19;
FileSizeLabel.Text = "0MB";
FileSizeLabel.TextAlign = ContentAlignment.TopCenter;
//
// SpeedLabel
//
SpeedLabel.Anchor = AnchorStyles.Top;
SpeedLabel.AutoSize = true;
SpeedLabel.BackColor = Color.Transparent;
SpeedLabel.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
SpeedLabel.ForeColor = Color.White;
SpeedLabel.ImeMode = ImeMode.NoControl;
SpeedLabel.Location = new Point(381, 15);
SpeedLabel.Name = "SpeedLabel";
SpeedLabel.Size = new Size(41, 13);
SpeedLabel.TabIndex = 17;
SpeedLabel.Text = "0MB/s";
SpeedLabel.TextAlign = ContentAlignment.TopCenter;
//
// TimeLabel
//
TimeLabel.Anchor = AnchorStyles.Top;
TimeLabel.AutoSize = true;
TimeLabel.BackColor = Color.Transparent;
TimeLabel.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
TimeLabel.ForeColor = Color.White;
TimeLabel.ImeMode = ImeMode.NoControl;
TimeLabel.Location = new Point(455, 15);
TimeLabel.Name = "TimeLabel";
TimeLabel.Size = new Size(49, 13);
TimeLabel.TabIndex = 16;
TimeLabel.Text = "00:00:00";
TimeLabel.TextAlign = ContentAlignment.TopCenter;
//
// PercentLabel
//
PercentLabel.Anchor = AnchorStyles.Top;
PercentLabel.AutoSize = true;
PercentLabel.BackColor = Color.Transparent;
PercentLabel.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
PercentLabel.ForeColor = Color.White;
PercentLabel.ImeMode = ImeMode.NoControl;
PercentLabel.Location = new Point(527, 44);
PercentLabel.Name = "PercentLabel";
PercentLabel.Size = new Size(23, 13);
PercentLabel.TabIndex = 15;
PercentLabel.Text = "0%";
PercentLabel.TextAlign = ContentAlignment.TopCenter;
//
// DownloadingLabel
//
DownloadingLabel.Anchor = AnchorStyles.Top;
DownloadingLabel.AutoSize = true;
DownloadingLabel.BackColor = Color.Transparent;
DownloadingLabel.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
DownloadingLabel.ForeColor = Color.White;
DownloadingLabel.ImeMode = ImeMode.NoControl;
DownloadingLabel.Location = new Point(12, 15);
DownloadingLabel.Name = "DownloadingLabel";
DownloadingLabel.Size = new Size(78, 13);
DownloadingLabel.TabIndex = 14;
DownloadingLabel.Text = "Downloading";
DownloadingLabel.TextAlign = ContentAlignment.TopCenter;
//
// FileNameLabel
//
FileNameLabel.AutoSize = true;
FileNameLabel.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
FileNameLabel.ForeColor = Color.White;
FileNameLabel.Location = new Point(10, 70);
FileNameLabel.Name = "FileNameLabel";
FileNameLabel.Size = new Size(56, 15);
FileNameLabel.TabIndex = 1;
FileNameLabel.Text = "filename";
//
// progressBar
//
progressBar.Location = new Point(11, 38);
progressBar.Name = "progressBar";
progressBar.Size = new Size(502, 23);
progressBar.TabIndex = 0;
//
// webView2
//
webView2.AllowExternalDrop = true;
webView2.BackColor = Color.RoyalBlue;
webView2.CreationProperties = null;
webView2.DefaultBackgroundColor = Color.White;
webView2.Location = new Point(412, 101);
webView2.Name = "webView2";
webView2.Size = new Size(475, 405);
webView2.TabIndex = 21;
webView2.ZoomFactor = 1D;
//
// LabelNews
//
LabelNews.AutoSize = true;
LabelNews.BackColor = Color.Transparent;
LabelNews.FlatStyle = FlatStyle.Flat;
LabelNews.Font = new Font("Segoe UI", 20.25F, FontStyle.Bold | FontStyle.Underline, GraphicsUnit.Point);
LabelNews.ForeColor = Color.FromArgb(246, 239, 247);
LabelNews.Location = new Point(599, 64);
LabelNews.Name = "LabelNews";
LabelNews.Size = new Size(95, 37);
LabelNews.TabIndex = 22;
LabelNews.Text = "NEWS";
//
// imageListButton
//
imageListButton.ColorDepth = ColorDepth.Depth32Bit;
imageListButton.ImageStream = (ImageListStreamer)resources.GetObject("imageListButton.ImageStream");
imageListButton.TransparentColor = Color.Transparent;
imageListButton.Images.SetKeyName(0, "list_button_normal.png");
imageListButton.Images.SetKeyName(1, "list_button_hover.png");
//
// AccOptionsButton
//
AccOptionsButton.BackColor = Color.Transparent;
AccOptionsButton.FlatAppearance.BorderColor = Color.Black;
AccOptionsButton.FlatAppearance.BorderSize = 0;
AccOptionsButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
AccOptionsButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
AccOptionsButton.FlatStyle = FlatStyle.Flat;
AccOptionsButton.ForeColor = Color.Transparent;
AccOptionsButton.ImageIndex = 0;
AccOptionsButton.ImageList = imageListButton;
AccOptionsButton.ImeMode = ImeMode.NoControl;
AccOptionsButton.Location = new Point(1018, 26);
AccOptionsButton.Name = "AccOptionsButton";
AccOptionsButton.Size = new Size(25, 26);
AccOptionsButton.TabIndex = 23;
AccOptionsButton.UseVisualStyleBackColor = false;
AccOptionsButton.Click += AccOptionsButton_Click;
AccOptionsButton.MouseLeave += Button_MouseLeave;
AccOptionsButton.MouseHover += Button_MouseHover;
//
// AccPanel
//
AccPanel.BackColor = Color.RoyalBlue;
AccPanel.BackgroundImage = (Image)resources.GetObject("AccPanel.BackgroundImage");
AccPanel.Controls.Add(LogoutButton);
AccPanel.Controls.Add(ChangePwdButton);
AccPanel.Location = new Point(969, 52);
AccPanel.Name = "AccPanel";
AccPanel.Size = new Size(124, 62);
AccPanel.TabIndex = 24;
AccPanel.Visible = false;
//
// LogoutButton
//
LogoutButton.BackColor = Color.Transparent;
LogoutButton.FlatAppearance.BorderSize = 0;
LogoutButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
LogoutButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
LogoutButton.FlatStyle = FlatStyle.Flat;
LogoutButton.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
LogoutButton.ForeColor = Color.White;
LogoutButton.ImageIndex = 0;
LogoutButton.ImageList = imageListMenuButton;
LogoutButton.ImeMode = ImeMode.NoControl;
LogoutButton.Location = new Point(3, 31);
LogoutButton.Name = "LogoutButton";
LogoutButton.Size = new Size(118, 28);
LogoutButton.TabIndex = 29;
LogoutButton.Text = "Logout";
LogoutButton.UseVisualStyleBackColor = false;
LogoutButton.Click += LogoutButton_Click;
LogoutButton.MouseDown += Button_MouseDown;
LogoutButton.MouseLeave += Button_MouseLeave;
LogoutButton.MouseHover += Button_MouseHover;
//
// imageListMenuButton
//
imageListMenuButton.ColorDepth = ColorDepth.Depth32Bit;
imageListMenuButton.ImageStream = (ImageListStreamer)resources.GetObject("imageListMenuButton.ImageStream");
imageListMenuButton.TransparentColor = Color.Transparent;
imageListMenuButton.Images.SetKeyName(0, "menubutton_bkg_normal.png");
imageListMenuButton.Images.SetKeyName(1, "menubutton_bkg_active.png");
imageListMenuButton.Images.SetKeyName(2, "menubutton_bkg_down.png");
//
// ChangePwdButton
//
ChangePwdButton.BackColor = Color.Transparent;
ChangePwdButton.FlatAppearance.BorderSize = 0;
ChangePwdButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
ChangePwdButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
ChangePwdButton.FlatStyle = FlatStyle.Flat;
ChangePwdButton.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
ChangePwdButton.ForeColor = Color.White;
ChangePwdButton.ImageIndex = 0;
ChangePwdButton.ImageList = imageListMenuButton;
ChangePwdButton.ImeMode = ImeMode.NoControl;
ChangePwdButton.Location = new Point(3, 3);
ChangePwdButton.Name = "ChangePwdButton";
ChangePwdButton.Size = new Size(118, 28);
ChangePwdButton.TabIndex = 28;
ChangePwdButton.Text = "Change Password";
ChangePwdButton.UseVisualStyleBackColor = false;
ChangePwdButton.Click += ChangePwdButton_Click;
ChangePwdButton.MouseDown += Button_MouseDown;
ChangePwdButton.MouseLeave += Button_MouseLeave;
ChangePwdButton.MouseHover += Button_MouseHover;
//
// LaunchOptionsButton
//
LaunchOptionsButton.BackColor = Color.Transparent;
LaunchOptionsButton.FlatAppearance.BorderSize = 0;
LaunchOptionsButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
LaunchOptionsButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
LaunchOptionsButton.FlatStyle = FlatStyle.Flat;
LaunchOptionsButton.Font = new Font("Microsoft Sans Serif", 14F, FontStyle.Regular, GraphicsUnit.Point);
LaunchOptionsButton.ForeColor = Color.White;
LaunchOptionsButton.ImageIndex = 0;
LaunchOptionsButton.ImageList = imageListLaunchOpt;
LaunchOptionsButton.ImeMode = ImeMode.NoControl;
LaunchOptionsButton.Location = new Point(1155, 590);
LaunchOptionsButton.Name = "LaunchOptionsButton";
LaunchOptionsButton.Size = new Size(34, 52);
LaunchOptionsButton.TabIndex = 25;
LaunchOptionsButton.UseVisualStyleBackColor = false;
LaunchOptionsButton.Click += LaunchOptionsButton_Click;
LaunchOptionsButton.MouseDown += Button_MouseDown;
LaunchOptionsButton.MouseLeave += Button_MouseLeave;
LaunchOptionsButton.MouseHover += Button_MouseHover;
//
// imageListLaunchOpt
//
imageListLaunchOpt.ColorDepth = ColorDepth.Depth32Bit;
imageListLaunchOpt.ImageStream = (ImageListStreamer)resources.GetObject("imageListLaunchOpt.ImageStream");
imageListLaunchOpt.TransparentColor = Color.Transparent;
imageListLaunchOpt.Images.SetKeyName(0, "launchoptionbutton_normal.png");
imageListLaunchOpt.Images.SetKeyName(1, "launchoptionbutton_active.png");
imageListLaunchOpt.Images.SetKeyName(2, "launchoptionbutton_down.png");
//
// LaunchPanel
//
LaunchPanel.BackColor = Color.RoyalBlue;
LaunchPanel.BackgroundImage = (Image)resources.GetObject("LaunchPanel.BackgroundImage");
LaunchPanel.Controls.Add(OpenSettingsButton);
LaunchPanel.Controls.Add(OpenInstallDirButton);
LaunchPanel.Controls.Add(ManageButton);
LaunchPanel.Controls.Add(CheckUpdateButton);
LaunchPanel.Location = new Point(1066, 469);
LaunchPanel.Name = "LaunchPanel";
LaunchPanel.Size = new Size(124, 120);
LaunchPanel.TabIndex = 26;
LaunchPanel.Visible = false;
//
// OpenSettingsButton
//
OpenSettingsButton.BackColor = Color.Transparent;
OpenSettingsButton.FlatAppearance.BorderSize = 0;
OpenSettingsButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
OpenSettingsButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
OpenSettingsButton.FlatStyle = FlatStyle.Flat;
OpenSettingsButton.Font = new Font("Segoe UI", 7F, FontStyle.Bold, GraphicsUnit.Point);
OpenSettingsButton.ForeColor = Color.White;
OpenSettingsButton.ImageIndex = 0;
OpenSettingsButton.ImageList = imageListMenuButton;
OpenSettingsButton.ImeMode = ImeMode.NoControl;
OpenSettingsButton.Location = new Point(3, 2);
OpenSettingsButton.Name = "OpenSettingsButton";
OpenSettingsButton.Size = new Size(118, 28);
OpenSettingsButton.TabIndex = 31;
OpenSettingsButton.Text = "Game Settings";
OpenSettingsButton.UseVisualStyleBackColor = false;
OpenSettingsButton.Click += OpenSettingsButton_Click;
OpenSettingsButton.MouseDown += Button_MouseDown;
OpenSettingsButton.MouseLeave += Button_MouseLeave;
OpenSettingsButton.MouseHover += Button_MouseHover;
//
// OpenInstallDirButton
//
OpenInstallDirButton.BackColor = Color.Transparent;
OpenInstallDirButton.FlatAppearance.BorderSize = 0;
OpenInstallDirButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
OpenInstallDirButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
OpenInstallDirButton.FlatStyle = FlatStyle.Flat;
OpenInstallDirButton.Font = new Font("Segoe UI", 7F, FontStyle.Bold, GraphicsUnit.Point);
OpenInstallDirButton.ForeColor = Color.White;
OpenInstallDirButton.ImageIndex = 0;
OpenInstallDirButton.ImageList = imageListMenuButton;
OpenInstallDirButton.ImeMode = ImeMode.NoControl;
OpenInstallDirButton.Location = new Point(3, 60);
OpenInstallDirButton.Name = "OpenInstallDirButton";
OpenInstallDirButton.Size = new Size(118, 28);
OpenInstallDirButton.TabIndex = 28;
OpenInstallDirButton.Text = "Open Install Directory";
OpenInstallDirButton.UseVisualStyleBackColor = false;
OpenInstallDirButton.Click += OpenInstallDirButton_Click;
OpenInstallDirButton.MouseDown += Button_MouseDown;
OpenInstallDirButton.MouseLeave += Button_MouseLeave;
OpenInstallDirButton.MouseHover += Button_MouseHover;
//
// ManageButton
//
ManageButton.BackColor = Color.Transparent;
ManageButton.FlatAppearance.BorderSize = 0;
ManageButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
ManageButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
ManageButton.FlatStyle = FlatStyle.Flat;
ManageButton.Font = new Font("Segoe UI", 7F, FontStyle.Bold, GraphicsUnit.Point);
ManageButton.ForeColor = Color.White;
ManageButton.ImageIndex = 0;
ManageButton.ImageList = imageListMenuButton;
ManageButton.ImeMode = ImeMode.NoControl;
ManageButton.Location = new Point(3, 89);
ManageButton.Name = "ManageButton";
ManageButton.Size = new Size(118, 28);
ManageButton.TabIndex = 30;
ManageButton.Text = "< Manage";
ManageButton.UseVisualStyleBackColor = false;
ManageButton.Click += ManageButton_Click;
ManageButton.MouseDown += Button_MouseDown;
ManageButton.MouseLeave += Button_MouseLeave;
ManageButton.MouseHover += Button_MouseHover;
//
// CheckUpdateButton
//
CheckUpdateButton.BackColor = Color.Transparent;
CheckUpdateButton.FlatAppearance.BorderSize = 0;
CheckUpdateButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
CheckUpdateButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
CheckUpdateButton.FlatStyle = FlatStyle.Flat;
CheckUpdateButton.Font = new Font("Segoe UI", 7F, FontStyle.Bold, GraphicsUnit.Point);
CheckUpdateButton.ForeColor = Color.White;
CheckUpdateButton.ImageIndex = 0;
CheckUpdateButton.ImageList = imageListMenuButton;
CheckUpdateButton.ImeMode = ImeMode.NoControl;
CheckUpdateButton.Location = new Point(3, 31);
CheckUpdateButton.Name = "CheckUpdateButton";
CheckUpdateButton.Size = new Size(118, 28);
CheckUpdateButton.TabIndex = 27;
CheckUpdateButton.Text = "Check for Updates";
CheckUpdateButton.UseVisualStyleBackColor = false;
CheckUpdateButton.Click += UpdateCheckButton_Click;
CheckUpdateButton.MouseDown += Button_MouseDown;
CheckUpdateButton.MouseLeave += Button_MouseLeave;
CheckUpdateButton.MouseHover += Button_MouseHover;
//
// ChangeInstallLocationButton
//
ChangeInstallLocationButton.BackColor = Color.Transparent;
ChangeInstallLocationButton.FlatAppearance.BorderSize = 0;
ChangeInstallLocationButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
ChangeInstallLocationButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
ChangeInstallLocationButton.FlatStyle = FlatStyle.Flat;
ChangeInstallLocationButton.Font = new Font("Microsoft Sans Serif", 7F, FontStyle.Bold, GraphicsUnit.Point);
ChangeInstallLocationButton.ForeColor = Color.White;
ChangeInstallLocationButton.ImageIndex = 0;
ChangeInstallLocationButton.ImageList = imageListMenuButton;
ChangeInstallLocationButton.ImeMode = ImeMode.NoControl;
ChangeInstallLocationButton.Location = new Point(3, 2);
ChangeInstallLocationButton.Name = "ChangeInstallLocationButton";
ChangeInstallLocationButton.Size = new Size(118, 28);
ChangeInstallLocationButton.TabIndex = 28;
ChangeInstallLocationButton.Text = "Install Location";
ChangeInstallLocationButton.UseVisualStyleBackColor = false;
ChangeInstallLocationButton.Click += ChangeInstallLocationButton_Click;
ChangeInstallLocationButton.MouseDown += Button_MouseDown;
ChangeInstallLocationButton.MouseLeave += Button_MouseLeave;
ChangeInstallLocationButton.MouseHover += Button_MouseHover;
//
// InstallPanel
//
InstallPanel.BackColor = Color.RoyalBlue;
InstallPanel.BackgroundImage = (Image)resources.GetObject("InstallPanel.BackgroundImage");
InstallPanel.Controls.Add(UninstallButton);
InstallPanel.Controls.Add(ChangeInstallLocationButton);
InstallPanel.Location = new Point(941, 469);
InstallPanel.Name = "InstallPanel";
InstallPanel.Size = new Size(124, 62);
InstallPanel.TabIndex = 27;
InstallPanel.Visible = false;
//
// UninstallButton
//
UninstallButton.BackColor = Color.Transparent;
UninstallButton.FlatAppearance.BorderSize = 0;
UninstallButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
UninstallButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
UninstallButton.FlatStyle = FlatStyle.Flat;
UninstallButton.Font = new Font("Microsoft Sans Serif", 7F, FontStyle.Bold, GraphicsUnit.Point);
UninstallButton.ForeColor = Color.Red;
UninstallButton.ImageIndex = 0;
UninstallButton.ImageList = imageListMenuButton;
UninstallButton.ImeMode = ImeMode.NoControl;
UninstallButton.Location = new Point(3, 31);
UninstallButton.Name = "UninstallButton";
UninstallButton.Size = new Size(118, 28);
UninstallButton.TabIndex = 29;
UninstallButton.Text = "Uninstall";
UninstallButton.UseVisualStyleBackColor = false;
UninstallButton.Click += UninstallButton_Click;
UninstallButton.MouseDown += Button_MouseDown;
UninstallButton.MouseLeave += Button_MouseLeave;
UninstallButton.MouseHover += Button_MouseHover;
//
// notifyIcon
//
notifyIcon.Icon = (Icon)resources.GetObject("notifyIcon.Icon");
notifyIcon.Text = "Rusty Hearts";
notifyIcon.Visible = true;
notifyIcon.MouseClick += NotifyIcon_MouseClick;
//
// LabelInstalled
//
LabelInstalled.AutoSize = true;
LabelInstalled.BackColor = Color.Transparent;
LabelInstalled.FlatStyle = FlatStyle.Flat;
LabelInstalled.Font = new Font("Segoe UI", 9F, FontStyle.Bold | FontStyle.Underline, GraphicsUnit.Point);
LabelInstalled.ForeColor = Color.FromArgb(246, 239, 247);
LabelInstalled.Location = new Point(998, 647);
LabelInstalled.MaximumSize = new Size(85, 0);
LabelInstalled.Name = "LabelInstalled";
LabelInstalled.Size = new Size(59, 15);
LabelInstalled.TabIndex = 28;
LabelInstalled.Text = "Installed?";
LabelInstalled.Visible = false;
//
// LabelLocate
//
LabelLocate.AutoSize = true;
LabelLocate.BackColor = Color.Transparent;
LabelLocate.Cursor = Cursors.Hand;
LabelLocate.FlatStyle = FlatStyle.Flat;
LabelLocate.Font = new Font("Segoe UI", 9F, FontStyle.Bold | FontStyle.Underline, GraphicsUnit.Point);
LabelLocate.ForeColor = Color.Gold;
LabelLocate.Location = new Point(1078, 647);
LabelLocate.MaximumSize = new Size(90, 0);
LabelLocate.Name = "LabelLocate";
LabelLocate.Size = new Size(80, 15);
LabelLocate.TabIndex = 29;
LabelLocate.Text = "Locate Game";
LabelLocate.Visible = false;
LabelLocate.Click += LbLocate_Click;
LabelLocate.MouseLeave += LabelLocate_MouseLeave;
LabelLocate.MouseHover += LabelLocate_MouseHover;
//
// SettingsButton
//
SettingsButton.BackColor = Color.Transparent;
SettingsButton.FlatAppearance.BorderColor = Color.Black;
SettingsButton.FlatAppearance.BorderSize = 0;
SettingsButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
SettingsButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
SettingsButton.FlatStyle = FlatStyle.Flat;
SettingsButton.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
SettingsButton.ForeColor = Color.Transparent;
SettingsButton.ImageIndex = 0;
SettingsButton.ImageList = imageListGear;
SettingsButton.ImeMode = ImeMode.NoControl;
SettingsButton.Location = new Point(1130, 32);
SettingsButton.Name = "SettingsButton";
SettingsButton.Size = new Size(25, 26);
SettingsButton.TabIndex = 30;
SettingsButton.UseVisualStyleBackColor = false;
SettingsButton.Click += SettingsButton_Click;
SettingsButton.MouseLeave += Button_MouseLeave;
SettingsButton.MouseHover += Button_MouseHover;
//
// imageListGear
//
imageListGear.ColorDepth = ColorDepth.Depth32Bit;
imageListGear.ImageStream = (ImageListStreamer)resources.GetObject("imageListGear.ImageStream");
imageListGear.TransparentColor = Color.Transparent;
imageListGear.Images.SetKeyName(0, "gear.png");
imageListGear.Images.SetKeyName(1, "gear_hover.png");
//
// LauncherForm
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
BackColor = Color.Magenta;
BackgroundImage = (Image)resources.GetObject("$this.BackgroundImage");
BackgroundImageLayout = ImageLayout.None;
ClientSize = new Size(1239, 700);
Controls.Add(SettingsButton);
Controls.Add(LabelLocate);
Controls.Add(LabelInstalled);
Controls.Add(InstallPanel);
Controls.Add(LaunchPanel);
Controls.Add(LaunchOptionsButton);
Controls.Add(AccPanel);
Controls.Add(AccOptionsButton);
Controls.Add(LabelNews);
Controls.Add(webView2);
Controls.Add(getUpdatePanel);
Controls.Add(CharPictureBox);
Controls.Add(NameLabel);
Controls.Add(LaunchButton);
Controls.Add(CloseButton);
Controls.Add(MinimizeButton);
DoubleBuffered = true;
FormBorderStyle = FormBorderStyle.None;
Icon = (Icon)resources.GetObject("$this.Icon");
Name = "LauncherForm";
StartPosition = FormStartPosition.CenterScreen;
Text = "Rusty Hearts Launcher";
TransparencyKey = Color.Magenta;
FormClosing += LauncherForm_FormClosing;
FormClosed += LauncherForm_FormClosed;
Load += LauncherForm_Load;
MouseDown += OnMouseDown;
Resize += LauncherForm_Resize;
((System.ComponentModel.ISupportInitialize)CharPictureBox).EndInit();
getUpdatePanel.ResumeLayout(false);
getUpdatePanel.PerformLayout();
((System.ComponentModel.ISupportInitialize)webView2).EndInit();
AccPanel.ResumeLayout(false);
LaunchPanel.ResumeLayout(false);
InstallPanel.ResumeLayout(false);
ResumeLayout(false);
PerformLayout();
}
#endregion
private Button CloseButton;
private ImageList imageListCloseBtn;
private Button MinimizeButton;
private ImageList imageListMinBtn;
private ImageList imageListLaunch;
private Label NameLabel;
private PictureBox CharPictureBox;
private Panel getUpdatePanel;
private ProgressBar progressBar;
private Label FileSizeLabel;
private Label SpeedLabel;
private Label TimeLabel;
private Label PercentLabel;
private Label DownloadingLabel;
private Label FileNameLabel;
private Button LaunchButton;
private Label FileCountLabel;
private Microsoft.Web.WebView2.WinForms.WebView2 webView2;
private Label LabelNews;
private ImageList imageListButton;
private Button AccOptionsButton;
private Panel AccPanel;
private Button LaunchOptionsButton;
private ImageList imageListLaunchOpt;
private Panel LaunchPanel;
private Button CheckUpdateButton;
private ImageList imageListMenuButton;
private Button LogoutButton;
private Button ChangePwdButton;
private Button ChangeInstallLocationButton;
private Button ManageButton;
private Panel InstallPanel;
private Button UninstallButton;
private Button OpenInstallDirButton;
private Button OpenSettingsButton;
private ImageList imageListStopBtn;
private Button StopButton;
private NotifyIcon notifyIcon;
private Label LabelInstalled;
private Label LabelLocate;
private Button SettingsButton;
private ImageList imageListGear;
private ToolTip toolTip;
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

383
RHLauncher.Forms/LoginForm.Designer.cs generated Normal file
View file

@ -0,0 +1,383 @@
namespace RHLauncher
{
partial class LoginForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LoginForm));
UsernameLabel = new Label();
PasswordLabel = new Label();
UsernameTextBox = new TextBox();
PasswordTextBox = new TextBox();
MinimizeButton = new Button();
imageListMinBtn = new ImageList(components);
imageListCloseBtn = new ImageList(components);
CloseButton = new Button();
imageListLogin = new ImageList(components);
LoginButton = new Button();
RegisterButton = new Button();
imageListRegister = new ImageList(components);
CheckBoxAutoLogin = new CheckBox();
CheckBoxSaveUser = new CheckBox();
timer = new System.Windows.Forms.Timer(components);
progressBarLogin = new ProgressBar();
ForgotPwdLabel = new Label();
VersionLabel = new Label();
imageListLogin_ko = new ImageList(components);
imageList2 = new ImageList(components);
imageListRegister_ko = new ImageList(components);
notifyIcon = new NotifyIcon(components);
SuspendLayout();
//
// UsernameLabel
//
UsernameLabel.AutoSize = true;
UsernameLabel.BackColor = Color.Transparent;
UsernameLabel.Font = new Font("Segoe UI", 11F, FontStyle.Bold, GraphicsUnit.Point);
UsernameLabel.ForeColor = Color.White;
UsernameLabel.Location = new Point(612, 199);
UsernameLabel.Name = "UsernameLabel";
UsernameLabel.Size = new Size(76, 25);
UsernameLabel.TabIndex = 0;
UsernameLabel.Text = "Username";
UsernameLabel.UseCompatibleTextRendering = true;
//
// PasswordLabel
//
PasswordLabel.AutoSize = true;
PasswordLabel.BackColor = Color.Transparent;
PasswordLabel.Font = new Font("Segoe UI Black", 11F, FontStyle.Bold, GraphicsUnit.Point);
PasswordLabel.ForeColor = Color.White;
PasswordLabel.Location = new Point(612, 248);
PasswordLabel.Name = "PasswordLabel";
PasswordLabel.Size = new Size(81, 20);
PasswordLabel.TabIndex = 1;
PasswordLabel.Text = "Password";
//
// UsernameTextBox
//
UsernameTextBox.Font = new Font("Microsoft Sans Serif", 9F, FontStyle.Regular, GraphicsUnit.Point);
UsernameTextBox.Location = new Point(614, 222);
UsernameTextBox.Name = "UsernameTextBox";
UsernameTextBox.Size = new Size(206, 21);
UsernameTextBox.TabIndex = 2;
//
// PasswordTextBox
//
PasswordTextBox.Font = new Font("Microsoft Sans Serif", 9F, FontStyle.Regular, GraphicsUnit.Point);
PasswordTextBox.Location = new Point(614, 271);
PasswordTextBox.Name = "PasswordTextBox";
PasswordTextBox.PasswordChar = '*';
PasswordTextBox.Size = new Size(206, 21);
PasswordTextBox.TabIndex = 3;
//
// MinimizeButton
//
MinimizeButton.BackColor = Color.Transparent;
MinimizeButton.FlatAppearance.BorderColor = Color.Black;
MinimizeButton.FlatAppearance.BorderSize = 0;
MinimizeButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
MinimizeButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
MinimizeButton.FlatStyle = FlatStyle.Flat;
MinimizeButton.ForeColor = Color.Transparent;
MinimizeButton.ImageIndex = 0;
MinimizeButton.ImageList = imageListMinBtn;
MinimizeButton.Location = new Point(752, 7);
MinimizeButton.Name = "MinimizeButton";
MinimizeButton.Size = new Size(25, 26);
MinimizeButton.TabIndex = 5;
MinimizeButton.UseVisualStyleBackColor = false;
MinimizeButton.Click += MinimizeButton_Click;
MinimizeButton.MouseDown += Button_MouseDown;
MinimizeButton.MouseLeave += Button_MouseLeave;
MinimizeButton.MouseHover += Button_MouseHover;
//
// imageListMinBtn
//
imageListMinBtn.ColorDepth = ColorDepth.Depth32Bit;
imageListMinBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListMinBtn.ImageStream");
imageListMinBtn.TransparentColor = Color.Transparent;
imageListMinBtn.Images.SetKeyName(0, "button_minimize_normal.png");
imageListMinBtn.Images.SetKeyName(1, "button_minimize_active.png");
imageListMinBtn.Images.SetKeyName(2, "button_minimize_down.png");
//
// imageListCloseBtn
//
imageListCloseBtn.ColorDepth = ColorDepth.Depth32Bit;
imageListCloseBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListCloseBtn.ImageStream");
imageListCloseBtn.TransparentColor = Color.Transparent;
imageListCloseBtn.Images.SetKeyName(0, "button_close_normal.png");
imageListCloseBtn.Images.SetKeyName(1, "button_close_active.png");
imageListCloseBtn.Images.SetKeyName(2, "button_close_down.png");
//
// CloseButton
//
CloseButton.BackColor = Color.Transparent;
CloseButton.FlatAppearance.BorderColor = Color.Black;
CloseButton.FlatAppearance.BorderSize = 0;
CloseButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
CloseButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
CloseButton.FlatStyle = FlatStyle.Flat;
CloseButton.ForeColor = Color.Transparent;
CloseButton.ImageIndex = 0;
CloseButton.ImageList = imageListCloseBtn;
CloseButton.Location = new Point(827, 12);
CloseButton.Name = "CloseButton";
CloseButton.Size = new Size(32, 29);
CloseButton.TabIndex = 7;
CloseButton.UseVisualStyleBackColor = false;
CloseButton.Click += CloseButton_Click;
CloseButton.MouseDown += Button_MouseDown;
CloseButton.MouseLeave += Button_MouseLeave;
CloseButton.MouseHover += Button_MouseHover;
//
// imageListLogin
//
imageListLogin.ColorDepth = ColorDepth.Depth32Bit;
imageListLogin.ImageStream = (ImageListStreamer)resources.GetObject("imageListLogin.ImageStream");
imageListLogin.TransparentColor = Color.Transparent;
imageListLogin.Images.SetKeyName(0, "button_login_normal.png");
imageListLogin.Images.SetKeyName(1, "button_login_active.png");
imageListLogin.Images.SetKeyName(2, "button_login_down.png");
//
// LoginButton
//
LoginButton.BackColor = Color.Transparent;
LoginButton.FlatAppearance.BorderSize = 0;
LoginButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
LoginButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
LoginButton.FlatStyle = FlatStyle.Flat;
LoginButton.ImageIndex = 0;
LoginButton.ImageList = imageListLogin;
LoginButton.Location = new Point(612, 349);
LoginButton.Name = "LoginButton";
LoginButton.Size = new Size(210, 60);
LoginButton.TabIndex = 8;
LoginButton.UseVisualStyleBackColor = false;
LoginButton.Click += LoginButton_Click;
LoginButton.MouseDown += Button_MouseDown;
LoginButton.MouseLeave += Button_MouseLeave;
LoginButton.MouseHover += Button_MouseHover;
//
// RegisterButton
//
RegisterButton.BackColor = Color.Transparent;
RegisterButton.FlatAppearance.BorderSize = 0;
RegisterButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
RegisterButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
RegisterButton.FlatStyle = FlatStyle.Flat;
RegisterButton.ImageIndex = 0;
RegisterButton.ImageList = imageListRegister;
RegisterButton.Location = new Point(666, 433);
RegisterButton.Name = "RegisterButton";
RegisterButton.Size = new Size(101, 26);
RegisterButton.TabIndex = 9;
RegisterButton.UseVisualStyleBackColor = false;
RegisterButton.Click += RegisterButton_Click;
RegisterButton.MouseDown += Button_MouseDown;
RegisterButton.MouseLeave += Button_MouseLeave;
RegisterButton.MouseHover += Button_MouseHover;
//
// imageListRegister
//
imageListRegister.ColorDepth = ColorDepth.Depth32Bit;
imageListRegister.ImageStream = (ImageListStreamer)resources.GetObject("imageListRegister.ImageStream");
imageListRegister.TransparentColor = Color.Transparent;
imageListRegister.Images.SetKeyName(0, "button_register_normal.png");
imageListRegister.Images.SetKeyName(1, "button_register_active.png");
imageListRegister.Images.SetKeyName(2, "button_register_down.png");
//
// CheckBoxAutoLogin
//
CheckBoxAutoLogin.AutoSize = true;
CheckBoxAutoLogin.BackColor = Color.Transparent;
CheckBoxAutoLogin.Font = new Font("Segoe UI", 11F, FontStyle.Bold, GraphicsUnit.Point);
CheckBoxAutoLogin.ForeColor = Color.White;
CheckBoxAutoLogin.Location = new Point(612, 325);
CheckBoxAutoLogin.Name = "CheckBoxAutoLogin";
CheckBoxAutoLogin.Size = new Size(106, 24);
CheckBoxAutoLogin.TabIndex = 11;
CheckBoxAutoLogin.Text = "Auto Login";
CheckBoxAutoLogin.UseVisualStyleBackColor = false;
CheckBoxAutoLogin.CheckedChanged += CheckBoxAutoLogin_CheckedChanged;
//
// CheckBoxSaveUser
//
CheckBoxSaveUser.AutoSize = true;
CheckBoxSaveUser.BackColor = Color.Transparent;
CheckBoxSaveUser.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
CheckBoxSaveUser.ForeColor = Color.White;
CheckBoxSaveUser.ImeMode = ImeMode.NoControl;
CheckBoxSaveUser.Location = new Point(612, 302);
CheckBoxSaveUser.Name = "CheckBoxSaveUser";
CheckBoxSaveUser.Size = new Size(173, 23);
CheckBoxSaveUser.TabIndex = 12;
CheckBoxSaveUser.Text = "Remember Username";
CheckBoxSaveUser.UseVisualStyleBackColor = false;
CheckBoxSaveUser.CheckedChanged += CheckBoxSaveUser_CheckedChanged;
//
// timer
//
timer.Enabled = true;
//
// progressBarLogin
//
progressBarLogin.BackColor = SystemColors.ControlDark;
progressBarLogin.ForeColor = Color.Transparent;
progressBarLogin.Location = new Point(787, 369);
progressBarLogin.Name = "progressBarLogin";
progressBarLogin.Size = new Size(24, 23);
progressBarLogin.Style = ProgressBarStyle.Continuous;
progressBarLogin.TabIndex = 13;
progressBarLogin.Visible = false;
//
// ForgotPwdLabel
//
ForgotPwdLabel.AutoSize = true;
ForgotPwdLabel.BackColor = Color.Transparent;
ForgotPwdLabel.Cursor = Cursors.Hand;
ForgotPwdLabel.Font = new Font("Segoe UI", 11F, FontStyle.Bold, GraphicsUnit.Point);
ForgotPwdLabel.ForeColor = Color.White;
ForgotPwdLabel.Location = new Point(652, 410);
ForgotPwdLabel.Name = "ForgotPwdLabel";
ForgotPwdLabel.Size = new Size(134, 20);
ForgotPwdLabel.TabIndex = 14;
ForgotPwdLabel.Text = "Forgot Password?";
ForgotPwdLabel.Click += ForgotPwdLabel_Click;
ForgotPwdLabel.MouseLeave += ForgotPwdLabel_MouseLeave;
ForgotPwdLabel.MouseHover += ForgotPwdLabel_MouseHover;
//
// VersionLabel
//
VersionLabel.AutoSize = true;
VersionLabel.BackColor = Color.Transparent;
VersionLabel.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
VersionLabel.ForeColor = Color.White;
VersionLabel.Location = new Point(8, 471);
VersionLabel.Name = "VersionLabel";
VersionLabel.Size = new Size(62, 19);
VersionLabel.TabIndex = 15;
VersionLabel.Text = "Version:";
//
// imageListLogin_ko
//
imageListLogin_ko.ColorDepth = ColorDepth.Depth32Bit;
imageListLogin_ko.ImageStream = (ImageListStreamer)resources.GetObject("imageListLogin_ko.ImageStream");
imageListLogin_ko.TransparentColor = Color.Transparent;
imageListLogin_ko.Images.SetKeyName(0, "button_login_normal_ko.png");
imageListLogin_ko.Images.SetKeyName(1, "button_login_active_ko.png");
imageListLogin_ko.Images.SetKeyName(2, "button_login_down_ko.png");
//
// imageList2
//
imageList2.ColorDepth = ColorDepth.Depth32Bit;
imageList2.ImageStream = (ImageListStreamer)resources.GetObject("imageList2.ImageStream");
imageList2.TransparentColor = Color.Transparent;
imageList2.Images.SetKeyName(0, "button_login_normal.png");
imageList2.Images.SetKeyName(1, "button_login_active.png");
imageList2.Images.SetKeyName(2, "button_login_down.png");
//
// imageListRegister_ko
//
imageListRegister_ko.ColorDepth = ColorDepth.Depth32Bit;
imageListRegister_ko.ImageStream = (ImageListStreamer)resources.GetObject("imageListRegister_ko.ImageStream");
imageListRegister_ko.TransparentColor = Color.Transparent;
imageListRegister_ko.Images.SetKeyName(0, "button_register_normal_ko.png");
imageListRegister_ko.Images.SetKeyName(1, "button_register_active_ko.png");
imageListRegister_ko.Images.SetKeyName(2, "button_register_down_ko.png");
//
// notifyIcon
//
notifyIcon.Icon = (Icon)resources.GetObject("notifyIcon.Icon");
notifyIcon.Text = "Rusty Hearts";
notifyIcon.Visible = true;
notifyIcon.MouseClick += NotifyIcon_MouseClick;
//
// LoginForm
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
AutoSize = true;
BackColor = Color.Magenta;
BackgroundImage = (Image)resources.GetObject("$this.BackgroundImage");
BackgroundImageLayout = ImageLayout.Stretch;
ClientSize = new Size(874, 497);
Controls.Add(VersionLabel);
Controls.Add(ForgotPwdLabel);
Controls.Add(progressBarLogin);
Controls.Add(CheckBoxSaveUser);
Controls.Add(CheckBoxAutoLogin);
Controls.Add(RegisterButton);
Controls.Add(LoginButton);
Controls.Add(CloseButton);
Controls.Add(MinimizeButton);
Controls.Add(PasswordTextBox);
Controls.Add(UsernameTextBox);
Controls.Add(PasswordLabel);
Controls.Add(UsernameLabel);
DoubleBuffered = true;
FormBorderStyle = FormBorderStyle.None;
Icon = (Icon)resources.GetObject("$this.Icon");
Name = "LoginForm";
StartPosition = FormStartPosition.CenterScreen;
Text = "Rusty Hearts Launcher";
TransparencyKey = Color.Magenta;
FormClosing += LoginForm_FormClosing;
Load += LoginForm_Load;
MouseDown += OnMouseDown;
Resize += LoginForm_Resize;
ResumeLayout(false);
PerformLayout();
}
#endregion
private Label UsernameLabel;
private Label PasswordLabel;
public TextBox UsernameTextBox;
private TextBox PasswordTextBox;
private Button MinimizeButton;
private ImageList imageListMinBtn;
private ImageList imageListCloseBtn;
private Button CloseButton;
private ImageList imageListLogin;
private Button LoginButton;
private Button RegisterButton;
private ImageList imageListRegister;
private CheckBox CheckBoxAutoLogin;
private CheckBox CheckBoxSaveUser;
private System.Windows.Forms.Timer timer;
private ProgressBar progressBarLogin;
private Label ForgotPwdLabel;
private Label VersionLabel;
private ImageList imageListLogin_ko;
private ImageList imageList2;
private ImageList imageListRegister_ko;
private NotifyIcon notifyIcon;
}
}

View file

@ -0,0 +1,402 @@
using Newtonsoft.Json;
using RHLauncher.RHLauncher.Helper;
using RHLauncher.RHLauncher.Http;
using RHLauncher.RHLauncher.i8n;
using System.Text.RegularExpressions;
namespace RHLauncher
{
public partial class LoginForm : Form
{
private RegistryHandler registryHandler = new();
public string windyCode = string.Empty;
public string password = string.Empty;
public string LoginUrl = Configuration.Default.LoginUrl;
public string Lang = Configuration.Default.Lang;
private List<Button>? buttons;
private List<ImageList>? imageLists;
private Dictionary<string, List<ImageList>>? languageImageLists;
public LoginForm()
{
InitializeComponent();
LoadLocalizedStrings();
notifyIcon.Text = LocalizedStrings.RustyHearts;
Text = LocalizedStrings.LauncherFormTitle;
UsernameLabel.Text = LocalizedStrings.UsernameLabel;
PasswordLabel.Text = LocalizedStrings.PasswordLabel;
CheckBoxSaveUser.Text = LocalizedStrings.CheckBoxSaveUser;
CheckBoxAutoLogin.Text = LocalizedStrings.CheckBoxAutoLogin;
ForgotPwdLabel.Text = LocalizedStrings.ForgotPwdLabel;
// Adjust ForgotPwdLabel location for Korean
if (Lang == "ko")
{
ForgotPwdLabel.Location = new Point(630, 410);
}
}
private void LoadLocalizedStrings()
{
// Initialize buttons and image lists
buttons = new List<Button> { LoginButton, RegisterButton };
imageLists = new List<ImageList> { imageListLogin, imageListRegister };
// Initialize language-specific image lists
languageImageLists = new Dictionary<string, List<ImageList>>
{
{ "en", new List<ImageList> { imageListLogin, imageListRegister } }, // English image lists
{ "ko", new List<ImageList> { imageListLogin_ko, imageListRegister_ko } }, // Korean image lists
// Add other languages and their respective image lists here
};
// Load the appropriate resource file based on the selected language
LocalizationHelper.LoadLocalizedStrings(Lang, buttons, imageLists, languageImageLists);
}
#region Form Events
private async void LoginForm_Load(object sender, EventArgs e)
{
string currentVersion = GetLauncherVersion.GetVersion();
VersionLabel.Text = $"{LocalizedStrings.Version}: {currentVersion}";
registryHandler = new RegistryHandler();
if (!registryHandler.KeyExist())
{
registryHandler.CreateKey();
}
else
{
string?[] values = registryHandler.ReadValues();
UsernameTextBox.Text = values[0];
PasswordTextBox.Text = values[1];
CheckBoxSaveUser.Checked = values[2] == "1";
CheckBoxAutoLogin.Checked = values[3] == "1";
await CheckForLauncherUpdate();
AutoLogin();
}
}
private void LoginForm_FormClosing(object sender, FormClosingEventArgs e)
{
notifyIcon.Visible = false;
notifyIcon?.Dispose();
if (e.CloseReason == CloseReason.UserClosing)
{
Application.Exit();
}
}
private void LoginForm_Resize(object sender, EventArgs e)
{
if (WindowState == FormWindowState.Minimized)
{
notifyIcon.Visible = true;
}
else
{
notifyIcon.Visible = false;
}
}
#endregion
#region Login Methods
private async Task Login()
{
Regex usernameRegex = RegexPatterns.UsernameRegex();
if (string.IsNullOrEmpty(UsernameTextBox.Text))
{
MsgBoxForm.Show(LocalizedStrings.LoginInsertUsername, LocalizedStrings.LoginWindowTitle);
return;
}
if (!usernameRegex.IsMatch(UsernameTextBox.Text))
{
MsgBoxForm.Show(LocalizedStrings.LoginInvalidUsernameFormat, LocalizedStrings.LoginWindowTitle);
return;
}
if (string.IsNullOrEmpty(PasswordTextBox.Text))
{
MsgBoxForm.Show(LocalizedStrings.LoginInsertPassword, LocalizedStrings.LoginWindowTitle);
return;
}
try
{
progressBarLogin.Visible = true;
progressBarLogin.Style = ProgressBarStyle.Marquee;
progressBarLogin.MarqueeAnimationSpeed = 30;
LoginButton.Enabled = false;
string response = await SendLoginRequestAsync();
HandleLoginResponse(response);
}
catch (Exception ex)
{
HandleException(ex);
}
finally
{
progressBarLogin.Visible = false;
LoginButton.Enabled = true;
}
}
private async void AutoLogin()
{
if (CheckBoxAutoLogin.Checked)
{
try
{
if (!string.IsNullOrEmpty(UsernameTextBox.Text) && !string.IsNullOrEmpty(PasswordTextBox.Text))
{
await Login();
}
}
catch (Exception ex)
{
HandleException(ex);
}
}
}
private async Task<string> SendLoginRequestAsync()
{
using HttpClient client = new();
using HttpResponseMessage response = await client.PostAsync(LoginUrl, new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("account", UsernameTextBox.Text),
new KeyValuePair<string, string>("password", PasswordTextBox.Text)
}));
return await response.Content.ReadAsStringAsync();
}
private void HandleLoginResponse(string response)
{
try
{
Dictionary<string, string>? loginResponse = JsonConvert.DeserializeObject<Dictionary<string, string>>(response);
if (loginResponse != null)
{
if (loginResponse.TryGetValue("Result", out var result))
{
switch (result)
{
case "LoginSuccess":
windyCode = loginResponse["WindyCode"];
password = loginResponse["Token"];
progressBarLogin.Visible = false;
Hide();
notifyIcon.Visible = false;
LauncherForm launcherForm = new(windyCode, password);
launcherForm.ShowDialog();
break;
case "InvalidCredentials":
MsgBoxForm.Show(LocalizedStrings.LoginInvalidCredentials, LocalizedStrings.LoginInfoTitle);
break;
case "InvalidUsernameFormat":
MsgBoxForm.Show(LocalizedStrings.LoginInvalidUsernameFormat, LocalizedStrings.LoginInfoTitle);
break;
case "AccountNotFound":
MsgBoxForm.Show(LocalizedStrings.LoginInvalidCredentials, LocalizedStrings.LoginInfoTitle);
break;
case "Locked":
MsgBoxForm.Show(LocalizedStrings.LoginLocked, LocalizedStrings.LoginInfoTitle);
break;
case "TooManyAttempts":
MsgBoxForm.Show(LocalizedStrings.LoginTooManyAttempts, LocalizedStrings.LoginInfoTitle);
break;
default:
MsgBoxForm.Show(LocalizedStrings.Error + result, LocalizedStrings.Error);
break;
}
}
else
{
MsgBoxForm.Show(LocalizedStrings.Error + "Response does not contain a Result field.", LocalizedStrings.Error);
}
}
else
{
MsgBoxForm.Show(LocalizedStrings.Error + "Failed to deserialize the response.", LocalizedStrings.Error);
}
}
catch (Exception ex)
{
HandleException(ex);
}
}
private void CheckBoxAutoLogin_CheckedChanged(object sender, EventArgs e)
{
if (CheckBoxAutoLogin.Checked)
{
if (!string.IsNullOrEmpty(UsernameTextBox.Text) && !string.IsNullOrEmpty(PasswordTextBox.Text))
{
registryHandler.SaveValues(UsernameTextBox.Text, PasswordTextBox.Text, true, true);
}
}
else
{
registryHandler.SaveValues(UsernameTextBox.Text, "", true, false);
}
}
private void CheckBoxSaveUser_CheckedChanged(object sender, EventArgs e)
{
if (CheckBoxSaveUser.Checked)
{
if (!string.IsNullOrEmpty(UsernameTextBox.Text))
{
registryHandler.SaveUser(UsernameTextBox.Text, true);
}
}
else
{
registryHandler.SaveUser("", false);
}
}
#endregion
#region Methods
private static async Task CheckForLauncherUpdate()
{
try
{
LauncherUpdater launcherUpdater = new();
await launcherUpdater.CheckForLauncherUpdateAsync();
}
catch (Exception ex)
{
HandleException(ex);
}
}
private static void HandleException(Exception ex)
{
string errorMessage = ex.Message;
string errorLog = ex.Message + ex.StackTrace;
Exception newEx = new(errorMessage, ex);
Exception newLogEx = new(errorLog, ex);
ExceptionHandler.HandleException(newEx, newLogEx);
}
#endregion
#region Button Click Events
private async void LoginButton_Click(object sender, EventArgs e)
{
try
{
await Login();
}
catch (Exception ex)
{
HandleException(ex);
}
}
private void RegisterButton_Click(object sender, EventArgs e)
{
try
{
using RegisterForm RegisterForm = new();
RegisterForm.ShowDialog();
}
catch (Exception ex)
{
HandleException(ex);
}
}
private void ForgotPwdLabel_Click(object sender, EventArgs e)
{
try
{
using ChangePwdForm ChangePwd = new();
ChangePwd.ShowDialog();
}
catch (Exception ex)
{
HandleException(ex);
}
}
private void CloseButton_Click(object sender, EventArgs e)
{
Close();
}
private void MinimizeButton_Click(object sender, EventArgs e)
{
WindowState = FormWindowState.Minimized;
}
private void OnMouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
FormUtils.MoveForm(Handle);
}
}
#endregion
#region Button Events
private void NotifyIcon_MouseClick(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
Show();
WindowState = FormWindowState.Normal;
notifyIcon.Visible = false;
}
}
private void Button_MouseHover(object sender, EventArgs e)
{
if (sender is Button button)
{
button.ImageIndex = 1;
}
}
private void Button_MouseLeave(object sender, EventArgs e)
{
if (sender is Button button)
{
button.ImageIndex = 0;
}
}
private void Button_MouseDown(object sender, MouseEventArgs e)
{
if (sender is Button button)
{
button.ImageIndex = 2;
}
}
private void ForgotPwdLabel_MouseHover(object sender, EventArgs e)
{
ForgotPwdLabel.ForeColor = Color.White;
}
private void ForgotPwdLabel_MouseLeave(object sender, EventArgs e)
{
ForgotPwdLabel.ForeColor = Color.Gainsboro;
}
#endregion
}
}

File diff suppressed because it is too large Load diff

246
RHLauncher.Forms/MsgBoxForm.Designer.cs generated Normal file
View file

@ -0,0 +1,246 @@
namespace RHLauncher
{
partial class MsgBoxForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MsgBoxForm));
CloseButton = new Button();
imageListCloseBtn = new ImageList(components);
OkButton = new Button();
imageListOKBtn = new ImageList(components);
TitleLabel = new Label();
TextLabel = new Label();
tbMessage = new TextBox();
YesButton = new Button();
imageListBtn = new ImageList(components);
NoButton = new Button();
SuspendLayout();
//
// CloseButton
//
CloseButton.BackColor = Color.Transparent;
CloseButton.FlatAppearance.BorderColor = Color.Black;
CloseButton.FlatAppearance.BorderSize = 0;
CloseButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
CloseButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
CloseButton.FlatStyle = FlatStyle.Flat;
CloseButton.ForeColor = Color.Transparent;
CloseButton.ImageIndex = 0;
CloseButton.ImageList = imageListCloseBtn;
CloseButton.ImeMode = ImeMode.NoControl;
CloseButton.Location = new Point(607, 9);
CloseButton.Name = "CloseButton";
CloseButton.Size = new Size(32, 29);
CloseButton.TabIndex = 8;
CloseButton.UseVisualStyleBackColor = false;
CloseButton.Click += CloseButton_Click;
CloseButton.MouseDown += Button_MouseDown;
CloseButton.MouseLeave += Button_MouseLeave;
CloseButton.MouseHover += Button_MouseHover;
//
// imageListCloseBtn
//
imageListCloseBtn.ColorDepth = ColorDepth.Depth32Bit;
imageListCloseBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListCloseBtn.ImageStream");
imageListCloseBtn.TransparentColor = Color.Transparent;
imageListCloseBtn.Images.SetKeyName(0, "button_close_normal.png");
imageListCloseBtn.Images.SetKeyName(1, "button_close_active.png");
imageListCloseBtn.Images.SetKeyName(2, "button_close_down.png");
//
// OkButton
//
OkButton.BackColor = Color.Transparent;
OkButton.FlatAppearance.BorderSize = 0;
OkButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
OkButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
OkButton.FlatStyle = FlatStyle.Flat;
OkButton.ImageIndex = 0;
OkButton.ImageList = imageListOKBtn;
OkButton.ImeMode = ImeMode.NoControl;
OkButton.Location = new Point(268, 224);
OkButton.Name = "OkButton";
OkButton.Size = new Size(110, 44);
OkButton.TabIndex = 9;
OkButton.UseVisualStyleBackColor = false;
OkButton.Click += OkButton_Click;
OkButton.MouseDown += Button_MouseDown;
OkButton.MouseLeave += Button_MouseLeave;
OkButton.MouseHover += Button_MouseHover;
//
// imageListOKBtn
//
imageListOKBtn.ColorDepth = ColorDepth.Depth32Bit;
imageListOKBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListOKBtn.ImageStream");
imageListOKBtn.TransparentColor = Color.Transparent;
imageListOKBtn.Images.SetKeyName(0, "messagewnd.button.ok.normal.png");
imageListOKBtn.Images.SetKeyName(1, "messagewnd.button.ok.active.png");
imageListOKBtn.Images.SetKeyName(2, "messagewnd.button.ok.down.png");
//
// TitleLabel
//
TitleLabel.Anchor = AnchorStyles.None;
TitleLabel.AutoEllipsis = true;
TitleLabel.AutoSize = true;
TitleLabel.BackColor = Color.Transparent;
TitleLabel.Font = new Font("Segoe UI", 11F, FontStyle.Bold, GraphicsUnit.Point);
TitleLabel.ForeColor = Color.White;
TitleLabel.ImageAlign = ContentAlignment.TopRight;
TitleLabel.ImeMode = ImeMode.NoControl;
TitleLabel.Location = new Point(285, 20);
TitleLabel.Name = "TitleLabel";
TitleLabel.Size = new Size(40, 20);
TitleLabel.TabIndex = 10;
TitleLabel.Text = "Title";
TitleLabel.TextAlign = ContentAlignment.MiddleCenter;
//
// TextLabel
//
TextLabel.Anchor = AnchorStyles.Left;
TextLabel.AutoEllipsis = true;
TextLabel.AutoSize = true;
TextLabel.BackColor = Color.Transparent;
TextLabel.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
TextLabel.ForeColor = Color.White;
TextLabel.ImeMode = ImeMode.NoControl;
TextLabel.Location = new Point(39, 62);
TextLabel.MaximumSize = new Size(550, 0);
TextLabel.MinimumSize = new Size(50, 0);
TextLabel.Name = "TextLabel";
TextLabel.Size = new Size(50, 15);
TextLabel.TabIndex = 11;
TextLabel.Text = "Text";
//
// tbMessage
//
tbMessage.Location = new Point(106, 88);
tbMessage.Multiline = true;
tbMessage.Name = "tbMessage";
tbMessage.ReadOnly = true;
tbMessage.ScrollBars = ScrollBars.Vertical;
tbMessage.Size = new Size(441, 129);
tbMessage.TabIndex = 12;
tbMessage.WordWrap = false;
//
// YesButton
//
YesButton.BackColor = Color.Transparent;
YesButton.FlatAppearance.BorderSize = 0;
YesButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
YesButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
YesButton.FlatStyle = FlatStyle.Flat;
YesButton.Font = new Font("Segoe UI", 11F, FontStyle.Bold, GraphicsUnit.Point);
YesButton.ForeColor = Color.White;
YesButton.ImageIndex = 0;
YesButton.ImageList = imageListBtn;
YesButton.ImeMode = ImeMode.NoControl;
YesButton.Location = new Point(164, 224);
YesButton.Name = "YesButton";
YesButton.Size = new Size(110, 44);
YesButton.TabIndex = 13;
YesButton.Text = "Yes";
YesButton.UseVisualStyleBackColor = false;
YesButton.Click += YesButton_Click;
YesButton.MouseDown += Button_MouseDown;
YesButton.MouseLeave += Button_MouseLeave;
YesButton.MouseHover += Button_MouseHover;
//
// imageListBtn
//
imageListBtn.ColorDepth = ColorDepth.Depth32Bit;
imageListBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListBtn.ImageStream");
imageListBtn.TransparentColor = Color.Transparent;
imageListBtn.Images.SetKeyName(0, "button_normal.png");
imageListBtn.Images.SetKeyName(1, "button_active.png");
imageListBtn.Images.SetKeyName(2, "button_down.png");
//
// NoButton
//
NoButton.BackColor = Color.Transparent;
NoButton.FlatAppearance.BorderSize = 0;
NoButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
NoButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
NoButton.FlatStyle = FlatStyle.Flat;
NoButton.Font = new Font("Segoe UI", 11F, FontStyle.Bold, GraphicsUnit.Point);
NoButton.ForeColor = Color.White;
NoButton.ImageIndex = 0;
NoButton.ImageList = imageListBtn;
NoButton.ImeMode = ImeMode.NoControl;
NoButton.Location = new Point(373, 224);
NoButton.Name = "NoButton";
NoButton.Size = new Size(110, 44);
NoButton.TabIndex = 14;
NoButton.Text = "No";
NoButton.UseVisualStyleBackColor = false;
NoButton.Click += NoButton_Click;
NoButton.MouseDown += Button_MouseDown;
NoButton.MouseLeave += Button_MouseLeave;
NoButton.MouseHover += Button_MouseHover;
//
// MsgBoxForm
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
BackColor = Color.Magenta;
BackgroundImage = (Image)resources.GetObject("$this.BackgroundImage");
BackgroundImageLayout = ImageLayout.Center;
ClientSize = new Size(646, 272);
Controls.Add(NoButton);
Controls.Add(YesButton);
Controls.Add(tbMessage);
Controls.Add(TextLabel);
Controls.Add(TitleLabel);
Controls.Add(OkButton);
Controls.Add(CloseButton);
DoubleBuffered = true;
FormBorderStyle = FormBorderStyle.None;
Icon = (Icon)resources.GetObject("$this.Icon");
Name = "MsgBoxForm";
StartPosition = FormStartPosition.CenterScreen;
Text = "Message";
TransparencyKey = Color.Magenta;
FormClosing += MsgBoxForm_FormClosing;
Load += MsgBoxForm_Load;
ResumeLayout(false);
PerformLayout();
}
#endregion
private Button CloseButton;
private ImageList imageListCloseBtn;
private Button OkButton;
private ImageList imageListOKBtn;
private Label TitleLabel;
private Label TextLabel;
private TextBox tbMessage;
private Button YesButton;
private ImageList imageListBtn;
private Button NoButton;
}
}

View file

@ -0,0 +1,120 @@
using RHLauncher.RHLauncher.i8n;
namespace RHLauncher
{
public partial class MsgBoxForm : Form
{
public new DialogResult DialogResult { get; private set; }
public MsgBoxForm()
{
InitializeComponent();
Text = LocalizedStrings.MsgBoxFormTitle;
YesButton.Text = LocalizedStrings.Yes;
NoButton.Text = LocalizedStrings.No;
}
#region Form Events
private void MsgBoxForm_Load(object sender, EventArgs e)
{
TitleLabel.Left = (ClientSize.Width - TitleLabel.Width) / 2;
OkButton.Left = (ClientSize.Width - OkButton.Width) / 2;
}
private void MsgBoxForm_FormClosing(object sender, FormClosingEventArgs e)
{
Dispose();
}
#endregion
#region Button Click Events
private void YesButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Yes;
Close();
}
private void NoButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.No;
Close();
}
private void CloseButton_Click(object sender, EventArgs e)
{
Close();
}
private void OkButton_Click(object sender, EventArgs e)
{
Close();
}
#endregion
#region Methods
public static void Show(string message, string title)
{
MsgBoxForm msgBox = new();
msgBox.tbMessage.Visible = false;
msgBox.YesButton.Visible = false;
msgBox.NoButton.Visible = false;
msgBox.TextLabel.Text = message;
msgBox.TitleLabel.Text = title;
msgBox.ShowDialog();
}
public static void ShowST(string message, string title, string stacktrace)
{
MsgBoxForm msgBox = new();
msgBox.tbMessage.Visible = true;
msgBox.YesButton.Visible = false;
msgBox.NoButton.Visible = false;
msgBox.TextLabel.Text = message;
msgBox.tbMessage.Text = stacktrace;
msgBox.TitleLabel.Text = title;
msgBox.ShowDialog();
}
public static DialogResult ShowYN(string message, string title)
{
MsgBoxForm msgBox = new();
msgBox.tbMessage.Visible = false;
msgBox.OkButton.Visible = false;
msgBox.YesButton.Visible = true;
msgBox.NoButton.Visible = true;
msgBox.TextLabel.Text = message;
msgBox.TitleLabel.Text = title;
msgBox.ShowDialog();
return msgBox.DialogResult;
}
#endregion
#region Button Events
private void Button_MouseHover(object sender, EventArgs e)
{
if (sender is Button button)
{
button.ImageIndex = 1;
}
}
private void Button_MouseLeave(object sender, EventArgs e)
{
if (sender is Button button)
{
button.ImageIndex = 0;
}
}
private void Button_MouseDown(object sender, MouseEventArgs e)
{
if (sender is Button button)
{
button.ImageIndex = 2;
}
}
#endregion
}
}

File diff suppressed because it is too large Load diff

800
RHLauncher.Forms/RegisterForm.Designer.cs generated Normal file
View file

@ -0,0 +1,800 @@
namespace RHLauncher
{
partial class RegisterForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RegisterForm));
CloseButton = new Button();
imageListCloseBtn = new ImageList(components);
MinimizeButton = new Button();
imageListMinBtn = new ImageList(components);
CodeLabel = new Label();
imageListContinueBtn = new ImageList(components);
ContinueButtonS1 = new Button();
PasswordLabel = new Label();
RepeatPasswordLabel = new Label();
SendEmailButton = new Button();
imageListSendEmailBtn = new ImageList(components);
CodeTextBox = new TextBox();
Stage1Panel = new Panel();
EmailPictureBox = new PictureBox();
EmailDescLabel = new Label();
EmailTextBox = new TextBox();
EmailLabel = new Label();
TimerLabel = new Label();
CodePictureBox = new PictureBox();
CodeDescLabel = new Label();
SubTitleLabelS1 = new Label();
TitleLabelS1 = new Label();
Stage2Panel = new Panel();
PwdStrengthLabel = new Label();
AgreementLabel = new Label();
AgreeCheckBox = new CheckBox();
NamePictureBox = new PictureBox();
UsernameTextBox = new TextBox();
NameDescLabel = new Label();
NameLabel = new Label();
PwdConfirmPictureBox = new PictureBox();
PwdPictureBox = new PictureBox();
PwdConfirmDescLabel = new Label();
PwdDescLabel = new Label();
EmailLabelS2 = new Label();
ReturnLabelS2 = new Label();
ContinueButtonS2 = new Button();
PasswordTextBox = new TextBox();
RepeatPasswordTextBox = new TextBox();
SubTitleLabelS2 = new Label();
TitleLabelS2 = new Label();
imageListTips = new ImageList(components);
imageListOkBtn = new ImageList(components);
imageListSendEmailBtn_ko = new ImageList(components);
imageListOKBtn_ko = new ImageList(components);
imageListContinueBtn_ko = new ImageList(components);
Stage1Panel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)EmailPictureBox).BeginInit();
((System.ComponentModel.ISupportInitialize)CodePictureBox).BeginInit();
Stage2Panel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)NamePictureBox).BeginInit();
((System.ComponentModel.ISupportInitialize)PwdConfirmPictureBox).BeginInit();
((System.ComponentModel.ISupportInitialize)PwdPictureBox).BeginInit();
SuspendLayout();
//
// CloseButton
//
CloseButton.BackColor = Color.Transparent;
CloseButton.FlatAppearance.BorderColor = Color.Black;
CloseButton.FlatAppearance.BorderSize = 0;
CloseButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
CloseButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
CloseButton.FlatStyle = FlatStyle.Flat;
CloseButton.ForeColor = Color.Transparent;
CloseButton.ImageIndex = 0;
CloseButton.ImageList = imageListCloseBtn;
CloseButton.Location = new Point(756, 12);
CloseButton.Name = "CloseButton";
CloseButton.Size = new Size(32, 29);
CloseButton.TabIndex = 9;
CloseButton.UseVisualStyleBackColor = false;
CloseButton.Click += CloseButton_Click;
CloseButton.MouseDown += Button_MouseDown;
CloseButton.MouseLeave += Button_MouseLeave;
CloseButton.MouseHover += Button_MouseHover;
//
// imageListCloseBtn
//
imageListCloseBtn.ColorDepth = ColorDepth.Depth32Bit;
imageListCloseBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListCloseBtn.ImageStream");
imageListCloseBtn.TransparentColor = Color.Transparent;
imageListCloseBtn.Images.SetKeyName(0, "button_close_normal.png");
imageListCloseBtn.Images.SetKeyName(1, "button_close_active.png");
imageListCloseBtn.Images.SetKeyName(2, "button_close_down.png");
//
// MinimizeButton
//
MinimizeButton.BackColor = Color.Transparent;
MinimizeButton.FlatAppearance.BorderColor = Color.Black;
MinimizeButton.FlatAppearance.BorderSize = 0;
MinimizeButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
MinimizeButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
MinimizeButton.FlatStyle = FlatStyle.Flat;
MinimizeButton.ForeColor = Color.Transparent;
MinimizeButton.ImageIndex = 0;
MinimizeButton.ImageList = imageListMinBtn;
MinimizeButton.Location = new Point(681, 7);
MinimizeButton.Name = "MinimizeButton";
MinimizeButton.Size = new Size(25, 26);
MinimizeButton.TabIndex = 8;
MinimizeButton.UseVisualStyleBackColor = false;
MinimizeButton.Click += MinimizeButton_Click;
MinimizeButton.MouseDown += Button_MouseDown;
MinimizeButton.MouseLeave += Button_MouseLeave;
MinimizeButton.MouseHover += Button_MouseHover;
//
// imageListMinBtn
//
imageListMinBtn.ColorDepth = ColorDepth.Depth32Bit;
imageListMinBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListMinBtn.ImageStream");
imageListMinBtn.TransparentColor = Color.Transparent;
imageListMinBtn.Images.SetKeyName(0, "button_minimize_normal.png");
imageListMinBtn.Images.SetKeyName(1, "button_minimize_active.png");
imageListMinBtn.Images.SetKeyName(2, "button_minimize_down.png");
//
// CodeLabel
//
CodeLabel.Anchor = AnchorStyles.Top;
CodeLabel.AutoEllipsis = true;
CodeLabel.AutoSize = true;
CodeLabel.BackColor = Color.Transparent;
CodeLabel.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
CodeLabel.ForeColor = Color.White;
CodeLabel.ImeMode = ImeMode.NoControl;
CodeLabel.Location = new Point(85, 171);
CodeLabel.Name = "CodeLabel";
CodeLabel.Size = new Size(124, 19);
CodeLabel.TabIndex = 15;
CodeLabel.Text = "Verification Code";
CodeLabel.TextAlign = ContentAlignment.TopCenter;
//
// imageListContinueBtn
//
imageListContinueBtn.ColorDepth = ColorDepth.Depth32Bit;
imageListContinueBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListContinueBtn.ImageStream");
imageListContinueBtn.TransparentColor = Color.Transparent;
imageListContinueBtn.Images.SetKeyName(0, "Registerwnd.button.continue.normal.png");
imageListContinueBtn.Images.SetKeyName(1, "Registerwnd.button.continue.active.png");
imageListContinueBtn.Images.SetKeyName(2, "Registerwnd.button.continue.down.png");
//
// ContinueButtonS1
//
ContinueButtonS1.BackColor = Color.Transparent;
ContinueButtonS1.FlatAppearance.BorderSize = 0;
ContinueButtonS1.FlatAppearance.MouseDownBackColor = Color.Transparent;
ContinueButtonS1.FlatAppearance.MouseOverBackColor = Color.Transparent;
ContinueButtonS1.FlatStyle = FlatStyle.Flat;
ContinueButtonS1.ImageIndex = 0;
ContinueButtonS1.ImageList = imageListContinueBtn;
ContinueButtonS1.ImeMode = ImeMode.NoControl;
ContinueButtonS1.Location = new Point(85, 242);
ContinueButtonS1.Name = "ContinueButtonS1";
ContinueButtonS1.Size = new Size(110, 44);
ContinueButtonS1.TabIndex = 16;
ContinueButtonS1.UseVisualStyleBackColor = false;
ContinueButtonS1.Click += ContinueButtonS1_Click;
ContinueButtonS1.MouseDown += Button_MouseDown;
ContinueButtonS1.MouseLeave += Button_MouseLeave;
ContinueButtonS1.MouseHover += Button_MouseHover;
//
// PasswordLabel
//
PasswordLabel.Anchor = AnchorStyles.Top;
PasswordLabel.AutoEllipsis = true;
PasswordLabel.AutoSize = true;
PasswordLabel.BackColor = Color.Transparent;
PasswordLabel.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
PasswordLabel.ForeColor = Color.White;
PasswordLabel.ImeMode = ImeMode.NoControl;
PasswordLabel.Location = new Point(98, 195);
PasswordLabel.Name = "PasswordLabel";
PasswordLabel.Size = new Size(136, 19);
PasswordLabel.TabIndex = 19;
PasswordLabel.Text = "Enter the password";
PasswordLabel.TextAlign = ContentAlignment.TopCenter;
//
// RepeatPasswordLabel
//
RepeatPasswordLabel.Anchor = AnchorStyles.Top;
RepeatPasswordLabel.AutoEllipsis = true;
RepeatPasswordLabel.AutoSize = true;
RepeatPasswordLabel.BackColor = Color.Transparent;
RepeatPasswordLabel.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
RepeatPasswordLabel.ForeColor = Color.White;
RepeatPasswordLabel.ImeMode = ImeMode.NoControl;
RepeatPasswordLabel.Location = new Point(95, 262);
RepeatPasswordLabel.Name = "RepeatPasswordLabel";
RepeatPasswordLabel.Size = new Size(160, 19);
RepeatPasswordLabel.TabIndex = 20;
RepeatPasswordLabel.Text = "Re-enter the password";
RepeatPasswordLabel.TextAlign = ContentAlignment.TopCenter;
//
// SendEmailButton
//
SendEmailButton.BackColor = Color.Transparent;
SendEmailButton.FlatAppearance.BorderSize = 0;
SendEmailButton.FlatAppearance.MouseDownBackColor = Color.Transparent;
SendEmailButton.FlatAppearance.MouseOverBackColor = Color.Transparent;
SendEmailButton.FlatStyle = FlatStyle.Flat;
SendEmailButton.ImageIndex = 0;
SendEmailButton.ImageList = imageListSendEmailBtn;
SendEmailButton.ImeMode = ImeMode.NoControl;
SendEmailButton.Location = new Point(254, 242);
SendEmailButton.Name = "SendEmailButton";
SendEmailButton.Size = new Size(110, 44);
SendEmailButton.TabIndex = 21;
SendEmailButton.UseVisualStyleBackColor = false;
SendEmailButton.Click += SendEmailButton_Click;
SendEmailButton.MouseDown += Button_MouseDown;
SendEmailButton.MouseLeave += Button_MouseLeave;
SendEmailButton.MouseHover += Button_MouseHover;
//
// imageListSendEmailBtn
//
imageListSendEmailBtn.ColorDepth = ColorDepth.Depth32Bit;
imageListSendEmailBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListSendEmailBtn.ImageStream");
imageListSendEmailBtn.TransparentColor = Color.Transparent;
imageListSendEmailBtn.Images.SetKeyName(0, "ChangePwwnd.button.email.normal.png");
imageListSendEmailBtn.Images.SetKeyName(1, "ChangePwwnd.button.email.active.png");
imageListSendEmailBtn.Images.SetKeyName(2, "ChangePwwnd.button.email.down.png");
//
// CodeTextBox
//
CodeTextBox.Location = new Point(85, 191);
CodeTextBox.Name = "CodeTextBox";
CodeTextBox.Size = new Size(279, 23);
CodeTextBox.TabIndex = 22;
CodeTextBox.TextChanged += CodeTextBox_TextChanged;
//
// Stage1Panel
//
Stage1Panel.BackColor = Color.Transparent;
Stage1Panel.Controls.Add(EmailPictureBox);
Stage1Panel.Controls.Add(EmailDescLabel);
Stage1Panel.Controls.Add(EmailTextBox);
Stage1Panel.Controls.Add(EmailLabel);
Stage1Panel.Controls.Add(TimerLabel);
Stage1Panel.Controls.Add(CodePictureBox);
Stage1Panel.Controls.Add(CodeDescLabel);
Stage1Panel.Controls.Add(SubTitleLabelS1);
Stage1Panel.Controls.Add(TitleLabelS1);
Stage1Panel.Controls.Add(SendEmailButton);
Stage1Panel.Controls.Add(CodeTextBox);
Stage1Panel.Controls.Add(ContinueButtonS1);
Stage1Panel.Controls.Add(CodeLabel);
Stage1Panel.Location = new Point(0, 79);
Stage1Panel.Name = "Stage1Panel";
Stage1Panel.Size = new Size(800, 450);
Stage1Panel.TabIndex = 23;
//
// EmailPictureBox
//
EmailPictureBox.BackColor = Color.Transparent;
EmailPictureBox.Location = new Point(377, 108);
EmailPictureBox.Name = "EmailPictureBox";
EmailPictureBox.Size = new Size(14, 14);
EmailPictureBox.TabIndex = 46;
EmailPictureBox.TabStop = false;
//
// EmailDescLabel
//
EmailDescLabel.Anchor = AnchorStyles.Top;
EmailDescLabel.AutoSize = true;
EmailDescLabel.BackColor = Color.Transparent;
EmailDescLabel.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
EmailDescLabel.ForeColor = Color.White;
EmailDescLabel.ImeMode = ImeMode.NoControl;
EmailDescLabel.Location = new Point(393, 108);
EmailDescLabel.Name = "EmailDescLabel";
EmailDescLabel.Size = new Size(0, 13);
EmailDescLabel.TabIndex = 45;
EmailDescLabel.TextAlign = ContentAlignment.TopCenter;
//
// EmailTextBox
//
EmailTextBox.Location = new Point(85, 103);
EmailTextBox.Name = "EmailTextBox";
EmailTextBox.Size = new Size(279, 23);
EmailTextBox.TabIndex = 44;
EmailTextBox.TextChanged += EmailTextBox_TextChanged;
//
// EmailLabel
//
EmailLabel.Anchor = AnchorStyles.Top;
EmailLabel.AutoEllipsis = true;
EmailLabel.AutoSize = true;
EmailLabel.BackColor = Color.Transparent;
EmailLabel.Font = new Font("Segoe UI", 9.75F, FontStyle.Bold, GraphicsUnit.Point);
EmailLabel.ForeColor = Color.White;
EmailLabel.ImeMode = ImeMode.NoControl;
EmailLabel.Location = new Point(88, 82);
EmailLabel.Name = "EmailLabel";
EmailLabel.Size = new Size(96, 17);
EmailLabel.TabIndex = 43;
EmailLabel.Text = "Account Email";
EmailLabel.TextAlign = ContentAlignment.TopCenter;
//
// TimerLabel
//
TimerLabel.Anchor = AnchorStyles.Top;
TimerLabel.AutoSize = true;
TimerLabel.BackColor = Color.Transparent;
TimerLabel.Font = new Font("Segoe UI", 11.25F, FontStyle.Bold, GraphicsUnit.Point);
TimerLabel.ForeColor = Color.White;
TimerLabel.ImeMode = ImeMode.NoControl;
TimerLabel.Location = new Point(366, 255);
TimerLabel.Name = "TimerLabel";
TimerLabel.Size = new Size(0, 20);
TimerLabel.TabIndex = 42;
TimerLabel.TextAlign = ContentAlignment.TopCenter;
//
// CodePictureBox
//
CodePictureBox.BackColor = Color.Transparent;
CodePictureBox.Location = new Point(375, 196);
CodePictureBox.Name = "CodePictureBox";
CodePictureBox.Size = new Size(14, 14);
CodePictureBox.TabIndex = 41;
CodePictureBox.TabStop = false;
//
// CodeDescLabel
//
CodeDescLabel.Anchor = AnchorStyles.Top;
CodeDescLabel.AutoSize = true;
CodeDescLabel.BackColor = Color.Transparent;
CodeDescLabel.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
CodeDescLabel.ForeColor = Color.White;
CodeDescLabel.ImeMode = ImeMode.NoControl;
CodeDescLabel.Location = new Point(391, 196);
CodeDescLabel.Name = "CodeDescLabel";
CodeDescLabel.Size = new Size(0, 13);
CodeDescLabel.TabIndex = 40;
CodeDescLabel.TextAlign = ContentAlignment.TopCenter;
//
// SubTitleLabelS1
//
SubTitleLabelS1.Anchor = AnchorStyles.Top;
SubTitleLabelS1.AutoEllipsis = true;
SubTitleLabelS1.AutoSize = true;
SubTitleLabelS1.BackColor = Color.Transparent;
SubTitleLabelS1.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
SubTitleLabelS1.ForeColor = Color.White;
SubTitleLabelS1.ImeMode = ImeMode.NoControl;
SubTitleLabelS1.Location = new Point(101, 44);
SubTitleLabelS1.Name = "SubTitleLabelS1";
SubTitleLabelS1.Size = new Size(93, 19);
SubTitleLabelS1.TabIndex = 24;
SubTitleLabelS1.Text = "Rusty Hearts";
SubTitleLabelS1.TextAlign = ContentAlignment.TopCenter;
//
// TitleLabelS1
//
TitleLabelS1.Anchor = AnchorStyles.Top;
TitleLabelS1.AutoEllipsis = true;
TitleLabelS1.AutoSize = true;
TitleLabelS1.BackColor = Color.Transparent;
TitleLabelS1.Font = new Font("Segoe UI", 20F, FontStyle.Bold, GraphicsUnit.Point);
TitleLabelS1.ForeColor = Color.White;
TitleLabelS1.ImeMode = ImeMode.NoControl;
TitleLabelS1.Location = new Point(85, 2);
TitleLabelS1.Name = "TitleLabelS1";
TitleLabelS1.Size = new Size(235, 37);
TitleLabelS1.TabIndex = 23;
TitleLabelS1.Text = "Register Account";
TitleLabelS1.TextAlign = ContentAlignment.TopCenter;
//
// Stage2Panel
//
Stage2Panel.BackColor = Color.Transparent;
Stage2Panel.Controls.Add(PwdStrengthLabel);
Stage2Panel.Controls.Add(AgreementLabel);
Stage2Panel.Controls.Add(AgreeCheckBox);
Stage2Panel.Controls.Add(NamePictureBox);
Stage2Panel.Controls.Add(UsernameTextBox);
Stage2Panel.Controls.Add(NameDescLabel);
Stage2Panel.Controls.Add(NameLabel);
Stage2Panel.Controls.Add(PwdConfirmPictureBox);
Stage2Panel.Controls.Add(PwdPictureBox);
Stage2Panel.Controls.Add(PwdConfirmDescLabel);
Stage2Panel.Controls.Add(PwdDescLabel);
Stage2Panel.Controls.Add(EmailLabelS2);
Stage2Panel.Controls.Add(ReturnLabelS2);
Stage2Panel.Controls.Add(ContinueButtonS2);
Stage2Panel.Controls.Add(PasswordTextBox);
Stage2Panel.Controls.Add(RepeatPasswordTextBox);
Stage2Panel.Controls.Add(SubTitleLabelS2);
Stage2Panel.Controls.Add(TitleLabelS2);
Stage2Panel.Controls.Add(PasswordLabel);
Stage2Panel.Controls.Add(RepeatPasswordLabel);
Stage2Panel.Location = new Point(0, 79);
Stage2Panel.Name = "Stage2Panel";
Stage2Panel.Size = new Size(800, 450);
Stage2Panel.TabIndex = 25;
//
// PwdStrengthLabel
//
PwdStrengthLabel.Anchor = AnchorStyles.Top;
PwdStrengthLabel.AutoSize = true;
PwdStrengthLabel.BackColor = Color.Transparent;
PwdStrengthLabel.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
PwdStrengthLabel.ForeColor = Color.White;
PwdStrengthLabel.ImeMode = ImeMode.NoControl;
PwdStrengthLabel.Location = new Point(93, 242);
PwdStrengthLabel.Name = "PwdStrengthLabel";
PwdStrengthLabel.Size = new Size(0, 13);
PwdStrengthLabel.TabIndex = 42;
PwdStrengthLabel.TextAlign = ContentAlignment.TopCenter;
//
// AgreementLabel
//
AgreementLabel.Anchor = AnchorStyles.Top;
AgreementLabel.AutoEllipsis = true;
AgreementLabel.AutoSize = true;
AgreementLabel.BackColor = Color.Transparent;
AgreementLabel.Cursor = Cursors.Hand;
AgreementLabel.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
AgreementLabel.ForeColor = Color.Gainsboro;
AgreementLabel.ImeMode = ImeMode.NoControl;
AgreementLabel.Location = new Point(259, 321);
AgreementLabel.Name = "AgreementLabel";
AgreementLabel.Size = new Size(132, 19);
AgreementLabel.TabIndex = 41;
AgreementLabel.Text = "\"User Agreement\"";
AgreementLabel.TextAlign = ContentAlignment.TopCenter;
AgreementLabel.Click += AgreementLabel_Click;
AgreementLabel.MouseLeave += Label_MouseLeave;
AgreementLabel.MouseHover += Label_MouseHover;
//
// AgreeCheckBox
//
AgreeCheckBox.AutoSize = true;
AgreeCheckBox.BackColor = Color.Transparent;
AgreeCheckBox.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
AgreeCheckBox.ForeColor = Color.White;
AgreeCheckBox.Location = new Point(95, 320);
AgreeCheckBox.Name = "AgreeCheckBox";
AgreeCheckBox.Size = new Size(171, 23);
AgreeCheckBox.TabIndex = 40;
AgreeCheckBox.Text = "Agree and accept the";
AgreeCheckBox.UseVisualStyleBackColor = false;
AgreeCheckBox.CheckedChanged += AgreeCheckBox_CheckedChanged;
//
// NamePictureBox
//
NamePictureBox.BackColor = Color.Transparent;
NamePictureBox.Location = new Point(379, 151);
NamePictureBox.Name = "NamePictureBox";
NamePictureBox.Size = new Size(14, 14);
NamePictureBox.TabIndex = 39;
NamePictureBox.TabStop = false;
//
// UsernameTextBox
//
UsernameTextBox.Location = new Point(93, 147);
UsernameTextBox.Name = "UsernameTextBox";
UsernameTextBox.Size = new Size(279, 23);
UsernameTextBox.TabIndex = 38;
UsernameTextBox.TextChanged += NameTextBox_TextChanged;
//
// NameDescLabel
//
NameDescLabel.Anchor = AnchorStyles.Top;
NameDescLabel.AutoEllipsis = true;
NameDescLabel.AutoSize = true;
NameDescLabel.BackColor = Color.Transparent;
NameDescLabel.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
NameDescLabel.ForeColor = Color.White;
NameDescLabel.ImeMode = ImeMode.NoControl;
NameDescLabel.Location = new Point(395, 152);
NameDescLabel.MaximumSize = new Size(250, 0);
NameDescLabel.Name = "NameDescLabel";
NameDescLabel.Size = new Size(158, 13);
NameDescLabel.TabIndex = 37;
NameDescLabel.Text = "6-16 alphanumeric characters";
NameDescLabel.TextAlign = ContentAlignment.TopCenter;
//
// NameLabel
//
NameLabel.Anchor = AnchorStyles.Top;
NameLabel.AutoSize = true;
NameLabel.BackColor = Color.Transparent;
NameLabel.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
NameLabel.ForeColor = Color.White;
NameLabel.ImeMode = ImeMode.NoControl;
NameLabel.Location = new Point(104, 126);
NameLabel.Name = "NameLabel";
NameLabel.Size = new Size(107, 19);
NameLabel.TabIndex = 36;
NameLabel.Text = "Account Name";
NameLabel.TextAlign = ContentAlignment.TopCenter;
//
// PwdConfirmPictureBox
//
PwdConfirmPictureBox.BackColor = Color.Transparent;
PwdConfirmPictureBox.Location = new Point(379, 284);
PwdConfirmPictureBox.Name = "PwdConfirmPictureBox";
PwdConfirmPictureBox.Size = new Size(14, 14);
PwdConfirmPictureBox.TabIndex = 35;
PwdConfirmPictureBox.TabStop = false;
//
// PwdPictureBox
//
PwdPictureBox.BackColor = Color.Transparent;
PwdPictureBox.Location = new Point(379, 220);
PwdPictureBox.Name = "PwdPictureBox";
PwdPictureBox.Size = new Size(14, 14);
PwdPictureBox.TabIndex = 34;
PwdPictureBox.TabStop = false;
//
// PwdConfirmDescLabel
//
PwdConfirmDescLabel.Anchor = AnchorStyles.Top;
PwdConfirmDescLabel.AutoSize = true;
PwdConfirmDescLabel.BackColor = Color.Transparent;
PwdConfirmDescLabel.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
PwdConfirmDescLabel.ForeColor = Color.White;
PwdConfirmDescLabel.ImeMode = ImeMode.NoControl;
PwdConfirmDescLabel.Location = new Point(395, 284);
PwdConfirmDescLabel.MaximumSize = new Size(250, 0);
PwdConfirmDescLabel.Name = "PwdConfirmDescLabel";
PwdConfirmDescLabel.Size = new Size(116, 13);
PwdConfirmDescLabel.TabIndex = 33;
PwdConfirmDescLabel.Text = "Repeat the password";
PwdConfirmDescLabel.TextAlign = ContentAlignment.TopCenter;
//
// PwdDescLabel
//
PwdDescLabel.Anchor = AnchorStyles.Top;
PwdDescLabel.AutoSize = true;
PwdDescLabel.BackColor = Color.Transparent;
PwdDescLabel.Font = new Font("Segoe UI", 8F, FontStyle.Bold, GraphicsUnit.Point);
PwdDescLabel.ForeColor = Color.White;
PwdDescLabel.ImeMode = ImeMode.NoControl;
PwdDescLabel.Location = new Point(395, 221);
PwdDescLabel.MaximumSize = new Size(250, 0);
PwdDescLabel.Name = "PwdDescLabel";
PwdDescLabel.Size = new Size(84, 13);
PwdDescLabel.TabIndex = 32;
PwdDescLabel.Text = "6-16 characters";
PwdDescLabel.TextAlign = ContentAlignment.TopCenter;
//
// EmailLabelS2
//
EmailLabelS2.AutoSize = true;
EmailLabelS2.Font = new Font("Segoe UI", 11F, FontStyle.Bold, GraphicsUnit.Point);
EmailLabelS2.ForeColor = Color.DodgerBlue;
EmailLabelS2.Location = new Point(101, 74);
EmailLabelS2.Name = "EmailLabelS2";
EmailLabelS2.Size = new Size(47, 20);
EmailLabelS2.TabIndex = 28;
EmailLabelS2.Text = "Email";
//
// ReturnLabelS2
//
ReturnLabelS2.Anchor = AnchorStyles.Top;
ReturnLabelS2.AutoEllipsis = true;
ReturnLabelS2.AutoSize = true;
ReturnLabelS2.BackColor = Color.Transparent;
ReturnLabelS2.Cursor = Cursors.Hand;
ReturnLabelS2.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
ReturnLabelS2.ForeColor = Color.Gainsboro;
ReturnLabelS2.ImeMode = ImeMode.NoControl;
ReturnLabelS2.Location = new Point(98, 420);
ReturnLabelS2.Name = "ReturnLabelS2";
ReturnLabelS2.Size = new Size(67, 19);
ReturnLabelS2.TabIndex = 27;
ReturnLabelS2.Text = "< Return";
ReturnLabelS2.TextAlign = ContentAlignment.TopCenter;
ReturnLabelS2.Click += ReturnLabel_Click;
ReturnLabelS2.MouseLeave += Label_MouseLeave;
ReturnLabelS2.MouseHover += Label_MouseHover;
//
// ContinueButtonS2
//
ContinueButtonS2.BackColor = Color.Transparent;
ContinueButtonS2.FlatAppearance.BorderSize = 0;
ContinueButtonS2.FlatAppearance.MouseDownBackColor = Color.Transparent;
ContinueButtonS2.FlatAppearance.MouseOverBackColor = Color.Transparent;
ContinueButtonS2.FlatStyle = FlatStyle.Flat;
ContinueButtonS2.ImageIndex = 0;
ContinueButtonS2.ImageList = imageListContinueBtn;
ContinueButtonS2.ImeMode = ImeMode.NoControl;
ContinueButtonS2.Location = new Point(94, 351);
ContinueButtonS2.Name = "ContinueButtonS2";
ContinueButtonS2.Size = new Size(110, 44);
ContinueButtonS2.TabIndex = 26;
ContinueButtonS2.UseVisualStyleBackColor = false;
ContinueButtonS2.Click += ContinueButtonS2_Click;
ContinueButtonS2.MouseDown += Button_MouseDown;
ContinueButtonS2.MouseLeave += Button_MouseLeave;
ContinueButtonS2.MouseHover += Button_MouseHover;
//
// PasswordTextBox
//
PasswordTextBox.Location = new Point(93, 215);
PasswordTextBox.Name = "PasswordTextBox";
PasswordTextBox.Size = new Size(279, 23);
PasswordTextBox.TabIndex = 25;
PasswordTextBox.UseSystemPasswordChar = true;
PasswordTextBox.TextChanged += PasswordTextBox_TextChanged;
//
// RepeatPasswordTextBox
//
RepeatPasswordTextBox.Location = new Point(93, 281);
RepeatPasswordTextBox.Name = "RepeatPasswordTextBox";
RepeatPasswordTextBox.Size = new Size(279, 23);
RepeatPasswordTextBox.TabIndex = 24;
RepeatPasswordTextBox.UseSystemPasswordChar = true;
RepeatPasswordTextBox.TextChanged += RepeatPasswordTextBox_TextChanged;
//
// SubTitleLabelS2
//
SubTitleLabelS2.Anchor = AnchorStyles.Top;
SubTitleLabelS2.AutoEllipsis = true;
SubTitleLabelS2.AutoSize = true;
SubTitleLabelS2.BackColor = Color.Transparent;
SubTitleLabelS2.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point);
SubTitleLabelS2.ForeColor = Color.White;
SubTitleLabelS2.ImeMode = ImeMode.NoControl;
SubTitleLabelS2.Location = new Point(101, 42);
SubTitleLabelS2.Name = "SubTitleLabelS2";
SubTitleLabelS2.Size = new Size(63, 19);
SubTitleLabelS2.TabIndex = 22;
SubTitleLabelS2.Text = "Account";
SubTitleLabelS2.TextAlign = ContentAlignment.TopCenter;
//
// TitleLabelS2
//
TitleLabelS2.Anchor = AnchorStyles.Top;
TitleLabelS2.AutoEllipsis = true;
TitleLabelS2.AutoSize = true;
TitleLabelS2.BackColor = Color.Transparent;
TitleLabelS2.Font = new Font("Segoe UI", 20F, FontStyle.Bold, GraphicsUnit.Point);
TitleLabelS2.ForeColor = Color.White;
TitleLabelS2.ImeMode = ImeMode.NoControl;
TitleLabelS2.Location = new Point(85, 3);
TitleLabelS2.Name = "TitleLabelS2";
TitleLabelS2.Size = new Size(218, 37);
TitleLabelS2.TabIndex = 21;
TitleLabelS2.Text = "Account Details";
TitleLabelS2.TextAlign = ContentAlignment.TopCenter;
//
// imageListTips
//
imageListTips.ColorDepth = ColorDepth.Depth32Bit;
imageListTips.ImageStream = (ImageListStreamer)resources.GetObject("imageListTips.ImageStream");
imageListTips.TransparentColor = Color.Transparent;
imageListTips.Images.SetKeyName(0, "tips_error.png");
imageListTips.Images.SetKeyName(1, "tips_ok.png");
//
// imageListOkBtn
//
imageListOkBtn.ColorDepth = ColorDepth.Depth32Bit;
imageListOkBtn.ImageStream = (ImageListStreamer)resources.GetObject("imageListOkBtn.ImageStream");
imageListOkBtn.TransparentColor = Color.Transparent;
imageListOkBtn.Images.SetKeyName(0, "messagewnd.button.ok.normal.png");
imageListOkBtn.Images.SetKeyName(1, "messagewnd.button.ok.active.png");
imageListOkBtn.Images.SetKeyName(2, "messagewnd.button.ok.down.png");
//
// imageListSendEmailBtn_ko
//
imageListSendEmailBtn_ko.ColorDepth = ColorDepth.Depth32Bit;
imageListSendEmailBtn_ko.ImageStream = (ImageListStreamer)resources.GetObject("imageListSendEmailBtn_ko.ImageStream");
imageListSendEmailBtn_ko.TransparentColor = Color.Transparent;
imageListSendEmailBtn_ko.Images.SetKeyName(0, "ChangePwwnd_button_email_normal_ko.png");
imageListSendEmailBtn_ko.Images.SetKeyName(1, "ChangePwwnd_button_email_active_ko.png");
imageListSendEmailBtn_ko.Images.SetKeyName(2, "ChangePwwnd_button_email_down_ko.png");
//
// imageListOKBtn_ko
//
imageListOKBtn_ko.ColorDepth = ColorDepth.Depth32Bit;
imageListOKBtn_ko.ImageStream = (ImageListStreamer)resources.GetObject("imageListOKBtn_ko.ImageStream");
imageListOKBtn_ko.TransparentColor = Color.Transparent;
imageListOKBtn_ko.Images.SetKeyName(0, "messagewnd.button.ok.normal.png");
imageListOKBtn_ko.Images.SetKeyName(1, "messagewnd.button.ok.active.png");
imageListOKBtn_ko.Images.SetKeyName(2, "messagewnd.button.ok.down.png");
//
// imageListContinueBtn_ko
//
imageListContinueBtn_ko.ColorDepth = ColorDepth.Depth32Bit;
imageListContinueBtn_ko.ImageStream = (ImageListStreamer)resources.GetObject("imageListContinueBtn_ko.ImageStream");
imageListContinueBtn_ko.TransparentColor = Color.Transparent;
imageListContinueBtn_ko.Images.SetKeyName(0, "Registerwnd_button_continue_normal_ko.png");
imageListContinueBtn_ko.Images.SetKeyName(1, "Registerwnd_button_continue_active_ko.png");
imageListContinueBtn_ko.Images.SetKeyName(2, "Registerwnd_button_continue_down_ko.png");
//
// RegisterForm
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
BackColor = Color.Black;
BackgroundImage = (Image)resources.GetObject("$this.BackgroundImage");
BackgroundImageLayout = ImageLayout.Center;
ClientSize = new Size(800, 571);
Controls.Add(CloseButton);
Controls.Add(MinimizeButton);
Controls.Add(Stage1Panel);
Controls.Add(Stage2Panel);
DoubleBuffered = true;
FormBorderStyle = FormBorderStyle.None;
Icon = (Icon)resources.GetObject("$this.Icon");
Name = "RegisterForm";
StartPosition = FormStartPosition.CenterScreen;
Text = "Register Account";
FormClosing += RegForm_FormClosing;
Load += RegForm_Load;
Stage1Panel.ResumeLayout(false);
Stage1Panel.PerformLayout();
((System.ComponentModel.ISupportInitialize)EmailPictureBox).EndInit();
((System.ComponentModel.ISupportInitialize)CodePictureBox).EndInit();
Stage2Panel.ResumeLayout(false);
Stage2Panel.PerformLayout();
((System.ComponentModel.ISupportInitialize)NamePictureBox).EndInit();
((System.ComponentModel.ISupportInitialize)PwdConfirmPictureBox).EndInit();
((System.ComponentModel.ISupportInitialize)PwdPictureBox).EndInit();
ResumeLayout(false);
}
#endregion
private Button CloseButton;
private ImageList imageListCloseBtn;
private Button MinimizeButton;
private ImageList imageListMinBtn;
private Label CodeLabel;
private ImageList imageListContinueBtn;
private Button ContinueButtonS1;
private Label PasswordLabel;
private Label RepeatPasswordLabel;
private Button SendEmailButton;
private TextBox CodeTextBox;
private Label SubTitleLabelS1;
private Label TitleLabelS1;
private Panel Stage1Panel;
private Panel Stage2Panel;
private Button ContinueButtonS2;
private TextBox PasswordTextBox;
private TextBox RepeatPasswordTextBox;
private Label SubTitleLabelS2;
private Label TitleLabelS2;
private Label ReturnLabelS2;
private Label EmailLabelS2;
private ImageList imageListSendEmailBtn;
private PictureBox PwdConfirmPictureBox;
private PictureBox PwdPictureBox;
private Label PwdConfirmDescLabel;
private Label PwdDescLabel;
private ImageList imageListTips;
private PictureBox CodePictureBox;
private Label CodeDescLabel;
private Label TimerLabel;
private PictureBox EmailPictureBox;
private Label EmailDescLabel;
private TextBox EmailTextBox;
private Label EmailLabel;
private ImageList imageListOkBtn;
private PictureBox NamePictureBox;
private TextBox UsernameTextBox;
private Label NameDescLabel;
private Label NameLabel;
private CheckBox AgreeCheckBox;
private Label AgreementLabel;
private Label PwdStrengthLabel;
private ImageList imageListSendEmailBtn_ko;
private ImageList imageListOKBtn_ko;
private ImageList imageListContinueBtn_ko;
}
}

View file

@ -0,0 +1,615 @@
using RHLauncher.RHLauncher.Helper;
using RHLauncher.RHLauncher.i8n;
using System.Diagnostics;
using System.Text.RegularExpressions;
namespace RHLauncher
{
public partial class RegisterForm : Form
{
public string SendCodeUrl = Configuration.Default.SendCodeUrl;
public string AgreementUrl = Configuration.Default.AgreementUrl;
public string VerifyCodeUrl = Configuration.Default.VerifyCodeUrl;
public string RegisterUrl = Configuration.Default.RegisterUrl;
public string Lang = Configuration.Default.Lang;
private List<Button>? buttons;
private List<ImageList>? imageLists;
private Dictionary<string, List<ImageList>>? languageImageLists;
private readonly System.Windows.Forms.Timer resendTimer = new();
private int secondsLeft = 60;
public RegisterForm()
{
InitializeComponent();
Stage1Panel.Visible = true;
Stage2Panel.Visible = false;
LoadLocalizedStrings();
Text = LocalizedStrings.ChangePwdFormTitle;
EmailLabel.Text = LocalizedStrings.AccountEmail;
TitleLabelS1.Text = LocalizedStrings.RegisterAccount;
SubTitleLabelS1.Text = LocalizedStrings.RustyHearts;
CodeLabel.Text = LocalizedStrings.VerificationCode;
TitleLabelS2.Text = LocalizedStrings.AccountDetails;
SubTitleLabelS2.Text = LocalizedStrings.Account;
NameLabel.Text = LocalizedStrings.AccountName;
PasswordLabel.Text = LocalizedStrings.EnterPassword;
RepeatPasswordLabel.Text = LocalizedStrings.RepeatPassword;
AgreeCheckBox.Text = LocalizedStrings.AgreeTerms;
AgreementLabel.Text = LocalizedStrings.UserAgreement;
NameDescLabel.Text = LocalizedStrings.UsernameDesc;
PwdDescLabel.Text = LocalizedStrings.NewPasswordDesc;
PwdConfirmDescLabel.Text = LocalizedStrings.RepeatPasswordDesc;
ReturnLabelS2.Text = LocalizedStrings.Return;
resendTimer = new System.Windows.Forms.Timer
{
Interval = 1000
};
resendTimer.Tick += ResendTimer_Tick;
}
private void LoadLocalizedStrings()
{
// Initialize buttons and image lists
buttons = new List<Button> { ContinueButtonS1, SendEmailButton, ContinueButtonS2 };
imageLists = new List<ImageList> { imageListContinueBtn, imageListSendEmailBtn, imageListContinueBtn };
// Initialize language-specific image lists
languageImageLists = new Dictionary<string, List<ImageList>>
{
{ "en", new List<ImageList> { imageListContinueBtn, imageListSendEmailBtn, imageListContinueBtn } }, // English image lists
{ "ko", new List<ImageList> { imageListContinueBtn_ko, imageListSendEmailBtn_ko, imageListContinueBtn_ko } }, // Korean image lists
// Add other languages and their respective image lists here
};
// Load the appropriate resource file based on the selected language
LocalizationHelper.LoadLocalizedStrings(Lang, buttons, imageLists, languageImageLists);
}
#region Form Events
private void RegForm_Load(object sender, EventArgs e)
{
ContinueButtonS1.Enabled = false;
}
private void RegForm_FormClosing(object sender, FormClosingEventArgs e)
{
resendTimer.Dispose();
Dispose();
}
#endregion
#region Methods
private async Task<string> SendEmailRequestAsync()
{
using HttpClient client = new();
using HttpResponseMessage response = await client.PostAsync(SendCodeUrl, new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("email", EmailTextBox.Text),
}));
return await response.Content.ReadAsStringAsync();
}
private void HandleSendEmailResponse(string response)
{
switch (response)
{
case "EmailSent":
SendEmailButton.Enabled = false;
resendTimer.Start();
break;
case "AccountExists":
MsgBoxForm.Show(LocalizedStrings.AccountEmailExists, LocalizedStrings.Info);
break;
case "ValidVerificationCode":
// Hide the first panel and show the second panel
Stage1Panel.Visible = false;
Stage2Panel.Visible = true;
EmailLabelS2.Text = EmailTextBox.Text;
CodeDescLabel.Text = "";
CodePictureBox.Image = imageListTips.Images[1];
break;
case "InvalidVerificationCode":
CodeDescLabel.Text = LocalizedStrings.InvalidVerificationCode;
CodeDescLabel.ForeColor = Color.Red;
CodePictureBox.Image = imageListTips.Images[0];
return;
case "ExpiredVerificationCode":
CodeDescLabel.Text = LocalizedStrings.ExpiredVerificationCode;
CodeDescLabel.ForeColor = Color.Red;
CodePictureBox.Image = imageListTips.Images[0];
return;
default:
MsgBoxForm.Show($"{LocalizedStrings.Error}: {response}", LocalizedStrings.Error);
break;
}
}
private void ResendTimer_Tick(object? sender, EventArgs e)
{
// Decrement the secondsLeft variable and update the button text
secondsLeft--;
TimerLabel.Text = $"({secondsLeft})";
// If the timer has finished counting down, stop the timer and enable the ResendEmailButton
if (secondsLeft == 0)
{
resendTimer.Stop();
SendEmailButton.Enabled = true;
TimerLabel.Text = "";
}
}
private async Task<string> VerifyCodeSendRequestAsync()
{
using HttpClient client = new();
using HttpResponseMessage response = await client.PostAsync(VerifyCodeUrl, new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("email", EmailTextBox.Text),
new KeyValuePair<string, string>("verification_code", CodeTextBox.Text),
new KeyValuePair<string, string>("verification_code_type", "Account"),
}));
return await response.Content.ReadAsStringAsync();
}
private async Task<string> SendRequestAsync()
{
using HttpClient client = new();
using HttpResponseMessage response = await client.PostAsync(RegisterUrl, new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("windyCode", UsernameTextBox.Text),
new KeyValuePair<string, string>("email", EmailTextBox.Text),
new KeyValuePair<string, string>("password", PasswordTextBox.Text)
}));
return await response.Content.ReadAsStringAsync();
}
private void HandleResponse(string response)
{
switch (response)
{
case "Success":
MsgBoxForm.Show(LocalizedStrings.AccountCreateSuccess, LocalizedStrings.RegisterWindow);
Close();
break;
case "AccountExists":
MsgBoxForm.Show(LocalizedStrings.AccountExists, LocalizedStrings.Info);
break;
case "WindyCodeExists":
MsgBoxForm.Show(LocalizedStrings.WindyCodeExists, LocalizedStrings.Error);
break;
case "InvalidUserNameFormat":
MsgBoxForm.Show(LocalizedStrings.InvalidUserNameFormat, LocalizedStrings.Error);
break;
case "InvalidEmailFormat":
MsgBoxForm.Show(LocalizedStrings.InvalidEmailFormat, LocalizedStrings.Error);
break;
default:
MsgBoxForm.Show($"{LocalizedStrings.Error}: {response}", LocalizedStrings.Error);
break;
}
}
private static void HandleException(Exception ex)
{
string errorMessage = ex.Message;
string errorLog = ex.Message + ex.StackTrace;
Exception newEx = new(errorMessage, ex);
Exception newLogEx = new(errorLog, ex);
ExceptionHandler.HandleException(newEx, newLogEx);
}
#endregion
#region Button Click Events
private void AgreementLabel_Click(object sender, EventArgs e)
{
Process.Start(new ProcessStartInfo { FileName = AgreementUrl, UseShellExecute = true });
}
private async void SendEmailButton_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(EmailTextBox.Text))
{
EmailDescLabel.Text = LocalizedStrings.EmailDescLabelEmpty;
EmailDescLabel.ForeColor = Color.Red;
EmailPictureBox.Image = imageListTips.Images[0];
return;
}
// Disable the ResendEmailButton and stop the timer
SendEmailButton.Enabled = false;
resendTimer.Stop();
try
{
Regex emailRegex = RegexPatterns.EmailRegex();
if (emailRegex.IsMatch(EmailTextBox.Text))
{
// email is valid
EmailPictureBox.Image = imageListTips.Images[1];
EmailDescLabel.Text = "";
}
else
{
// email is not valid
EmailPictureBox.Image = imageListTips.Images[0];
EmailDescLabel.Text = LocalizedStrings.EmailDescLabelInvalid;
return;
}
// Reset the secondsLeft variable and start the timer again
secondsLeft = 60;
resendTimer.Start();
SendEmailButton.Enabled = false;
string response = await SendEmailRequestAsync();
HandleSendEmailResponse(response);
}
catch (Exception ex)
{
HandleException(ex);
}
}
private async void ContinueButtonS1_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(CodeTextBox.Text))
{
CodeDescLabel.Text = LocalizedStrings.CodeDescLabel;
CodeDescLabel.ForeColor = Color.Red;
CodePictureBox.Image = imageListTips.Images[0];
return;
}
try
{
string response = await VerifyCodeSendRequestAsync();
HandleSendEmailResponse(response);
}
catch (Exception ex)
{
HandleException(ex);
}
}
private async void ContinueButtonS2_Click(object sender, EventArgs e)
{
ContinueButtonS2.Enabled = false;
try
{
string response = await SendRequestAsync();
HandleResponse(response);
}
catch (Exception ex)
{
HandleException(ex);
}
}
private void ReturnLabel_Click(object sender, EventArgs e)
{
// Show the previous panel and hide the current panel
if (Stage2Panel.Visible)
{
Stage1Panel.Visible = true;
Stage2Panel.Visible = false;
}
else if (Stage1Panel.Visible)
{
Stage1Panel.Visible = false;
Stage2Panel.Visible = true;
}
}
private bool NameTextBoxValid = false;
private void NameTextBox_TextChanged(object sender, EventArgs e)
{
Regex usernameRegex = RegexPatterns.UsernameRegex();
if (string.IsNullOrEmpty(UsernameTextBox.Text) || UsernameTextBox.Text.Length < 6 || UsernameTextBox.Text.Length > 16 || !usernameRegex.IsMatch(UsernameTextBox.Text) || HasUppercase(UsernameTextBox.Text))
{
if (string.IsNullOrEmpty(UsernameTextBox.Text))
{
NameDescLabel.Text = LocalizedStrings.UsernameDescLabelEmpty;
NameDescLabel.ForeColor = Color.Red;
NamePictureBox.Image = imageListTips.Images[0];
NameTextBoxValid = false;
}
else if (UsernameTextBox.Text.Length < 6 || UsernameTextBox.Text.Length > 16)
{
NameDescLabel.Text = LocalizedStrings.UsernameDescLabelSize;
NameDescLabel.ForeColor = Color.Red;
NamePictureBox.Image = imageListTips.Images[0];
NameTextBoxValid = false;
}
else if (HasUppercase(UsernameTextBox.Text))
{
NameDescLabel.Text = LocalizedStrings.UsernameDescLabelUppercase;
NameDescLabel.ForeColor = Color.Red;
NamePictureBox.Image = imageListTips.Images[0];
NameTextBoxValid = false;
}
else if (!usernameRegex.IsMatch(UsernameTextBox.Text))
{
NameDescLabel.Text = LocalizedStrings.UsernameDescLabelInvalid;
NameDescLabel.ForeColor = Color.Red;
NamePictureBox.Image = imageListTips.Images[0];
NameTextBoxValid = false;
}
}
else
{
NameDescLabel.Text = "";
NamePictureBox.Image = imageListTips.Images[1];
NameTextBoxValid = true;
}
CheckFormS2Validity();
}
private static bool HasUppercase(string text)
{
return text.Any(char.IsUpper);
}
private bool PasswordTextBoxValid = false;
private void PasswordTextBox_TextChanged(object sender, EventArgs e)
{
string password = PasswordTextBox.Text;
// Check for minimum length and maximum length
if (password.Length < 6 || password.Length > 16)
{
PwdDescLabel.Text = LocalizedStrings.PwdDescLabelSize;
PwdDescLabel.ForeColor = Color.Red;
PwdPictureBox.Image = imageListTips.Images[0];
PasswordTextBoxValid = false;
RepeatPasswordTextBoxValid = false;
CheckFormS2Validity();
return;
}
// Check for at least one uppercase, one lowercase letter, and one number
Regex pwRegex = RegexPatterns.PWRegex();
if (!pwRegex.IsMatch(password))
{
PwdDescLabel.Text = LocalizedStrings.PwdDescLabelCriteria;
PwdDescLabel.ForeColor = Color.Red;
PwdPictureBox.Image = imageListTips.Images[0];
PwdStrengthLabel.Text = LocalizedStrings.PwdStrengthLabelWeak;
PwdStrengthLabel.ForeColor = Color.Red;
PasswordTextBoxValid = false;
RepeatPasswordTextBoxValid = false;
CheckFormS2Validity();
return;
}
// Check for additional character types such as symbols
Regex strongPWRegex = RegexPatterns.StrongPWRegex();
if (strongPWRegex.IsMatch(password))
{
PwdDescLabel.Text = "";
PwdPictureBox.Image = imageListTips.Images[1];
PwdStrengthLabel.Text = LocalizedStrings.PwdStrengthLabelStrong;
PwdStrengthLabel.ForeColor = Color.Green;
PasswordTextBoxValid = true;
RepeatPasswordTextBox_TextChanged(sender, e);
return;
}
// Password is valid but could be stronger
PwdDescLabel.Text = "";
PwdPictureBox.Image = imageListTips.Images[1];
PwdStrengthLabel.Text = LocalizedStrings.PwdStrengthLabelMedium;
PwdStrengthLabel.ForeColor = Color.Yellow;
PasswordTextBoxValid = true;
RepeatPasswordTextBox_TextChanged(sender, e);
return;
}
private bool RepeatPasswordTextBoxValid = false;
private void RepeatPasswordTextBox_TextChanged(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(RepeatPasswordTextBox.Text))
{
PwdConfirmDescLabel.Text = LocalizedStrings.PwdConfirmDescLabelEmpty;
PwdConfirmDescLabel.ForeColor = Color.Red;
PwdConfirmPictureBox.Image = imageListTips.Images[0];
RepeatPasswordTextBoxValid = RepeatPasswordTextBox.Text.Equals(PasswordTextBox.Text);
}
else if (!RepeatPasswordTextBox.Text.Equals(PasswordTextBox.Text))
{
PwdConfirmDescLabel.Text = LocalizedStrings.PwdConfirmDescLabelMatch;
PwdConfirmDescLabel.ForeColor = Color.Red;
PwdConfirmPictureBox.Image = imageListTips.Images[0];
RepeatPasswordTextBoxValid = RepeatPasswordTextBox.Text.Equals(PasswordTextBox.Text);
}
else
{
PwdConfirmDescLabel.Text = "";
PwdConfirmPictureBox.Image = imageListTips.Images[1];
RepeatPasswordTextBoxValid = RepeatPasswordTextBox.Text.Equals(PasswordTextBox.Text);
}
CheckFormS2Validity();
}
private bool EmailTextBoxValid = false;
private void EmailTextBox_TextChanged(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(EmailTextBox.Text))
{
EmailDescLabel.Text = LocalizedStrings.EmailDescLabelEmpty;
EmailDescLabel.ForeColor = Color.Red;
EmailPictureBox.Image = imageListTips.Images[0];
EmailTextBoxValid = false;
}
try
{
Regex emailRegex = RegexPatterns.EmailRegex();
if (emailRegex.IsMatch(EmailTextBox.Text))
{
// email is valid
EmailPictureBox.Image = imageListTips.Images[1];
EmailDescLabel.Text = "";
EmailTextBoxValid = true;
}
else
{
// email is not valid
EmailPictureBox.Image = imageListTips.Images[0];
EmailDescLabel.Text = LocalizedStrings.EmailDescLabelInvalid;
EmailTextBoxValid = false;
}
}
catch (FormatException)
{
EmailPictureBox.Image = imageListTips.Images[0];
}
CheckFormS1Validity();
}
private bool CodeTextBoxValid = false;
private void CodeTextBox_TextChanged(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(CodeTextBox.Text))
{
CodeDescLabel.Text = LocalizedStrings.CodeDescLabel;
CodeDescLabel.ForeColor = Color.Red;
CodePictureBox.Image = imageListTips.Images[0];
CodeTextBoxValid = false;
}
try
{
string input = CodeTextBox.Text;
if (int.TryParse(input, out int number))
{
// input is numeric
CodeDescLabel.Text = "";
CodePictureBox.Image = imageListTips.Images[1];
CodeTextBoxValid = true;
}
else
{
// input is not numeric
CodeDescLabel.Text = LocalizedStrings.CodeDescLabelInvalid;
CodeDescLabel.ForeColor = Color.Red;
CodePictureBox.Image = imageListTips.Images[0];
CodeTextBoxValid = false;
}
}
catch (FormatException)
{
CodePictureBox.Image = imageListTips.Images[0];
}
CheckFormS1Validity();
}
private void AgreeCheckBox_CheckedChanged(object sender, EventArgs e)
{
CheckFormS2Validity();
}
private void CheckFormS1Validity()
{
if (EmailTextBoxValid &&
CodeTextBoxValid)
{
ContinueButtonS1.Enabled = true;
}
else
{
ContinueButtonS1.Enabled = false;
}
}
private void CheckFormS2Validity()
{
if (NameTextBoxValid &&
PasswordTextBoxValid &&
RepeatPasswordTextBoxValid &&
AgreeCheckBox.Checked)
{
ContinueButtonS2.Enabled = true;
}
else
{
ContinueButtonS2.Enabled = false;
}
}
private void CloseButton_Click(object sender, EventArgs e)
{
Close();
}
private void MinimizeButton_Click(object sender, EventArgs e)
{
WindowState = FormWindowState.Minimized;
}
#endregion
#region Button Events
private void Button_MouseHover(object sender, EventArgs e)
{
if (sender is Button button)
{
button.ImageIndex = 1;
}
}
private void Button_MouseLeave(object sender, EventArgs e)
{
if (sender is Button button)
{
button.ImageIndex = 0;
}
}
private void Button_MouseDown(object sender, MouseEventArgs e)
{
if (sender is Button button)
{
button.ImageIndex = 2;
}
}
private void Label_MouseHover(object sender, EventArgs e)
{
if (sender is Label label)
{
label.ForeColor = Color.White;
}
}
private void Label_MouseLeave(object sender, EventArgs e)
{
if (sender is Label label)
{
label.ForeColor = Color.Gainsboro;
}
}
#endregion
}
}

File diff suppressed because it is too large Load diff