private void GetOfflineWorldsCallback(IAuthProvider sender, IAuthResponse response)
 {
     if (response.SuccessCode != 1)
     {
         this.throwClientErrorConnection(this.lblLoginError, response.Message);
     }
     else
     {
         WorldList = ((XmlRpcAuthResponse) response).WorldList;
         LanguageList = new Dictionary<string, LocalizationLanguage>();
         foreach (WorldInfo info in WorldList)
         {
             if (!LanguageList.ContainsKey(info.Supportculture))
             {
                 LocalizationLanguage language = new LocalizationLanguage {
                     CultureCode = info.Supportculture
                 };
                 LanguageList.Add(info.Supportculture, language);
             }
         }
         if (Program.mySettings.NumWorldsCount < 0)
         {
             Program.mySettings.NumWorldsCount = WorldList.Count;
             Program.mySettings.NumWorldsLastChanged = DateTime.MinValue;
             Program.mySettings.Save();
         }
         else if (Program.mySettings.NumWorldsCount != WorldList.Count)
         {
             Program.mySettings.NumWorldsCount = WorldList.Count;
             Program.mySettings.NumWorldsLastChanged = DateTime.Now;
             Program.mySettings.Save();
             NewWorldsAvailable = true;
         }
         else
         {
             TimeSpan span = (TimeSpan) (DateTime.Now - Program.mySettings.NumWorldsLastChanged);
             if (span.TotalDays < 7.0)
             {
                 NewWorldsAvailable = true;
             }
         }
         if (DateTime.Now < new DateTime(0x7dc, 2, 0x12))
         {
             NewWorldsAvailable = false;
         }
         List<WorldInfo> worldsBySupportCulture = this.GetWorldsBySupportCulture("");
         this.BuildOfflineWorldList(worldsBySupportCulture);
         if (NewWorldsAvailable)
         {
             if (this.lblNewWorlds == null)
             {
                 this.lblNewWorlds = new CustomSelfDrawPanel.CSDLabel();
             }
             this.lblNewWorlds.Text = SK.Text("LOGIN_New_Worlds", "A New World is available!");
             this.lblNewWorlds.Color = ARGBColors.Green;
             this.lblNewWorlds.Position = new Point(10, this.LoginPanelControls_LoggedOut.Height - 70);
             this.lblNewWorlds.Size = new Size(this.LoginPanelControls_LoggedOut.Width - 20, 40);
             this.lblNewWorlds.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
             this.lblNewWorlds.Font = FontManager.GetFont("Arial", 8f, FontStyle.Regular);
             this.LoginPanelControls_LoggedOut.removeControl(this.lblNewWorlds);
             this.LoginPanelControls_LoggedOut.addControl(this.lblNewWorlds);
         }
         if (this.chkAutoLogin != null)
         {
             this.chkAutoLogin.Visible = false;
         }
         if (Program.mySettings.LastWorldID >= 0)
         {
             string str = "";
             foreach (WorldInfo info2 in worldsBySupportCulture)
             {
                 if (info2.KingdomsWorldID == Program.mySettings.LastWorldID)
                 {
                     str = getWorldShortDesc(info2);
                     break;
                 }
             }
             if (str.Length > 0)
             {
                 if (this.chkAutoLogin != null)
                 {
                     this.LoginPanelControls_LoggedOut.removeControl(this.chkAutoLogin);
                 }
                 this.chkAutoLogin = new CustomSelfDrawPanel.CSDCheckBox();
                 this.chkAutoLogin.CheckedImage = (Image) GFXLibrary.mrhp_world_filter_check[0];
                 this.chkAutoLogin.UncheckedImage = (Image) GFXLibrary.mrhp_world_filter_check[1];
                 this.chkAutoLogin.Position = new Point(10, this.LoginPanelControls_LoggedOut.Height - 90);
                 this.chkAutoLogin.Checked = Program.mySettings.AutoLogin;
                 this.chkAutoLogin.CBLabel.Text = SK.Text("LOGIN_Auto_Load", "Auto Connect to : ") + str;
                 this.chkAutoLogin.CBLabel.Color = ARGBColors.Black;
                 this.chkAutoLogin.CBLabel.Position = new Point(20, -1);
                 this.chkAutoLogin.CBLabel.Size = new Size(this.LoginPanelControls_LoggedOut.Width, 0x19);
                 this.chkAutoLogin.CBLabel.Font = FontManager.GetFont("Arial", 8f, FontStyle.Regular);
                 this.chkAutoLogin.setCheckChangedDelegate(new CustomSelfDrawPanel.CSDCheckBox.CSD_CheckChangedDelegate(this.autoLoadToggled));
                 this.chkAutoLogin.Visible = true;
                 this.LoginPanelControls_LoggedOut.addControl(this.chkAutoLogin);
                 this.LoginPanelControls_LoggedOut.Invalidate();
             }
         }
     }
 }
 public void init(bool createMode)
 {
     CustomSelfDrawPanel.CSDControl.CSD_MouseOverDelegate overDelegate = null;
     CustomSelfDrawPanel.CSDControl.CSD_MouseOverDelegate leaveDelegate = null;
     CustomSelfDrawPanel.CSDControl.CSD_MouseOverDelegate delegate4 = null;
     CustomSelfDrawPanel.CSDControl.CSD_MouseOverDelegate delegate5 = null;
     CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate newDelegate = null;
     CustomSelfDrawPanel.CSDControl.CSD_MouseOverDelegate delegate7 = null;
     CustomSelfDrawPanel.CSDControl.CSD_MouseOverDelegate delegate8 = null;
     this.m_createMode = createMode;
     base.clearControls();
     base.Controls.Clear();
     this.BackColor = ARGBColors.White;
     int num = 0;
     int num2 = 0;
     if (!Program.steamActive)
     {
         num2 = -15;
     }
     else if (!this.m_createMode)
     {
         num2 = 30;
     }
     if (Program.gamersFirstInstall)
     {
         this.TextEmail = SK.Text("SIGNUP_GF_Email", "GamersFirst Gamer ID / Email");
         this.TextUsername = SK.Text("SIGNUP_GF_Username", "Choose a Stronghold Kingdoms Username");
     }
     else if (Program.arcInstall)
     {
         this.TextEmail = SK.Text("SIGNUP_Arc_Email", "Arc ID");
         this.TextUsername = SK.Text("SIGNUP_GF_Username", "Choose a Stronghold Kingdoms Username");
     }
     else if (this.m_createMode)
     {
         num = -20;
     }
     int x = 200;
     int num4 = (100 + num2) + num;
     int num5 = 0x17;
     int num6 = 14;
     int height = 12;
     this.HeaderTitle = new CustomSelfDrawPanel.CSDImage();
     if (this.m_createMode)
     {
         this.HeaderTitle.Image = this.HeaderImage;
     }
     else
     {
         this.HeaderTitle.Image = this.HeaderTranferImage;
     }
     this.HeaderTitle.Position = new Point((base.Width - this.HeaderTitle.Width) / 2, 0x20 + num2);
     this.lblEmail = new CustomSelfDrawPanel.CSDLabel();
     this.lblEmail.Position = new Point(x, num4 - 10);
     this.lblEmail.Text = this.TextEmail;
     this.lblEmail.Size = new Size(300, height);
     this.lblEmail.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
     this.txtEmail = new TextBox();
     this.txtEmail.ForeColor = ARGBColors.Black;
     this.txtEmail.BackColor = ARGBColors.White;
     this.txtEmail.Location = new Point(x, (num4 + num6) - 10);
     this.txtEmail.Size = new Size(300, this.txtEmail.Height);
     this.fillEmailValid = new CustomSelfDrawPanel.CSDFill();
     this.fillEmailValid.Position = new Point((x + 300) + 5, this.txtEmail.Location.Y);
     this.fillEmailValid.Size = new Size(this.txtEmail.Height, this.txtEmail.Height);
     this.fillEmailValid.FillColor = ARGBColors.Red;
     if (this.m_createMode)
     {
         this.lblEmailconfirm = new CustomSelfDrawPanel.CSDLabel();
         this.lblEmailconfirm.Position = new Point(this.txtEmail.Location.X, this.txtEmail.Location.Y + num5);
         this.lblEmailconfirm.Text = this.TextEmailConfirm;
         this.lblEmailconfirm.Size = new Size(300, height);
         this.lblEmailconfirm.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
         this.txtEmailconfirm = new TextBox();
         this.txtEmailconfirm.ForeColor = ARGBColors.Black;
         this.txtEmailconfirm.BackColor = ARGBColors.White;
         this.txtEmailconfirm.Location = new Point(this.lblEmailconfirm.Position.X, this.lblEmailconfirm.Position.Y + num6);
         this.txtEmailconfirm.Size = new Size(300, this.txtEmailconfirm.Height);
         this.fillEmailConfirmValid = new CustomSelfDrawPanel.CSDFill();
         this.fillEmailConfirmValid.Position = new Point((x + 300) + 5, this.txtEmailconfirm.Location.Y);
         this.fillEmailConfirmValid.Size = new Size(this.txtEmailconfirm.Height, this.txtEmailconfirm.Height);
         this.fillEmailConfirmValid.FillColor = ARGBColors.Red;
         if (Program.gamersFirstInstall || Program.arcInstall)
         {
             this.lblEmailconfirm.Visible = false;
             this.txtEmailconfirm.Visible = false;
             this.fillEmailConfirmValid.Visible = false;
             this.txtEmail.Visible = false;
             this.lblEmail.Visible = false;
         }
         this.lblUsername = new CustomSelfDrawPanel.CSDLabel();
         this.lblUsername.Position = new Point(this.txtEmailconfirm.Location.X, this.txtEmailconfirm.Location.Y + num5);
         this.lblUsername.Text = this.TextUsername;
         this.lblUsername.Size = new Size(300, height);
         this.lblUsername.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
         this.txtUsername = new TextBox();
         this.txtUsername.ForeColor = ARGBColors.Black;
         this.txtUsername.BackColor = ARGBColors.White;
         this.txtUsername.Location = new Point(this.lblUsername.Position.X, this.lblUsername.Position.Y + num6);
         this.txtUsername.Size = new Size(300, this.txtUsername.Height);
         this.fillUsernameValid = new CustomSelfDrawPanel.CSDFill();
         this.fillUsernameValid.Position = new Point((x + 300) + 5, this.txtUsername.Location.Y);
         this.fillUsernameValid.Size = new Size(this.txtUsername.Height, this.txtUsername.Height);
         this.fillUsernameValid.FillColor = ARGBColors.Red;
     }
     this.lblPassword = new CustomSelfDrawPanel.CSDLabel();
     if (this.m_createMode)
     {
         this.lblPassword.Position = new Point(this.txtUsername.Location.X, this.txtUsername.Location.Y + num5);
         this.lblPassword.Text = this.TextPassword;
     }
     else
     {
         this.lblPassword.Position = new Point(this.txtEmail.Location.X, this.txtEmail.Location.Y + num5);
         this.lblPassword.Text = this.TextPasswordMerge;
     }
     this.lblPassword.Size = new Size(300, height);
     this.lblPassword.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
     this.txtPassword = new TextBox();
     this.txtPassword.ForeColor = ARGBColors.Black;
     this.txtPassword.PasswordChar = '*';
     this.txtPassword.BackColor = ARGBColors.White;
     this.txtPassword.Location = new Point(this.lblPassword.Position.X, this.lblPassword.Position.Y + num6);
     this.txtPassword.Size = new Size(300, this.txtPassword.Height);
     this.fillPasswordValid = new CustomSelfDrawPanel.CSDFill();
     this.fillPasswordValid.Position = new Point((x + 300) + 5, this.txtPassword.Location.Y);
     this.fillPasswordValid.Size = new Size(this.txtPassword.Height, this.txtPassword.Height);
     this.fillPasswordValid.FillColor = ARGBColors.Red;
     if (this.m_createMode)
     {
         this.lblPasswordconfirm = new CustomSelfDrawPanel.CSDLabel();
         this.lblPasswordconfirm.Position = new Point(this.txtPassword.Location.X, this.txtPassword.Location.Y + num5);
         this.lblPasswordconfirm.Text = this.TextPasswordConfirm;
         this.lblPasswordconfirm.Size = new Size(300, height);
         this.lblPasswordconfirm.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
         this.txtPasswordconfirm = new TextBox();
         this.txtPasswordconfirm.ForeColor = ARGBColors.Black;
         this.txtPasswordconfirm.PasswordChar = '*';
         this.txtPasswordconfirm.BackColor = ARGBColors.White;
         this.txtPasswordconfirm.Location = new Point(this.lblPasswordconfirm.Position.X, this.lblPasswordconfirm.Position.Y + num6);
         this.txtPasswordconfirm.Size = new Size(300, this.txtPasswordconfirm.Height);
         this.fillPasswordConfirmValid = new CustomSelfDrawPanel.CSDFill();
         this.fillPasswordConfirmValid.Position = new Point((x + 300) + 5, this.txtPasswordconfirm.Location.Y);
         this.fillPasswordConfirmValid.Size = new Size(this.txtPasswordconfirm.Height, this.txtPasswordconfirm.Height);
         this.fillPasswordConfirmValid.FillColor = ARGBColors.Red;
         if (Program.gamersFirstInstall || Program.arcInstall)
         {
             this.lblPasswordconfirm.Visible = false;
             this.txtPasswordconfirm.Visible = false;
             this.fillPasswordConfirmValid.Visible = false;
         }
     }
     if (Program.gamersFirstInstall || Program.arcInstall)
     {
         this.lblPassword.Visible = false;
         this.txtPassword.Visible = false;
         this.fillPasswordValid.Visible = false;
         this.txtEmail.ReadOnly = true;
         this.fillEmailValid.Visible = false;
     }
     else
     {
         this.newsletterCheck = new CustomSelfDrawPanel.CSDCheckBox();
         this.newsletterCheck.CheckedImage = (Image) GFXLibrary.reports_checkbox_checked;
         this.newsletterCheck.UncheckedImage = (Image) GFXLibrary.reports_checkbox_empty;
         this.newsletterCheck.Position = new Point((x + 5) + 60, (this.txtPasswordconfirm.Location.Y + 0x19) + 4);
         this.newsletterCheck.Checked = false;
         this.newsletterCheck.CBLabel.Text = SK.Text("Create_Subscribe Newsletter", "Subscribe to Newsletter");
         this.newsletterCheck.CBLabel.Color = ARGBColors.Black;
         this.newsletterCheck.CBLabel.Position = new Point(20, -1);
         this.newsletterCheck.CBLabel.Size = new Size(360, 0x23);
         this.newsletterCheck.CBLabel.Font = FontManager.GetFont("Arial", 8.25f, FontStyle.Regular);
         this.AddControlToPanel(this.newsletterCheck);
     }
     this.NextButton = new CustomSelfDrawPanel.CSDImage();
     if (this.m_createMode)
     {
         this.NextButton.Image = this.NextImage;
         if (overDelegate == null)
         {
             overDelegate = delegate {
                 this.NextButton.Image = this.NextImageOver;
                 this.Cursor = Cursors.Hand;
             };
         }
         if (leaveDelegate == null)
         {
             leaveDelegate = delegate {
                 this.NextButton.Image = this.NextImage;
                 this.Cursor = Cursors.Default;
             };
         }
         this.NextButton.setMouseOverDelegate(overDelegate, leaveDelegate);
         this.NextButton.Position = new Point(this.txtPasswordconfirm.Location.X, ((this.txtPasswordconfirm.Location.Y + num5) + 10) - num);
     }
     else
     {
         this.NextButton.Image = this.TransferImage;
         if (delegate4 == null)
         {
             delegate4 = delegate {
                 this.NextButton.Image = this.TransferImageOver;
                 this.Cursor = Cursors.Hand;
             };
         }
         if (delegate5 == null)
         {
             delegate5 = delegate {
                 this.NextButton.Image = this.TransferImage;
                 this.Cursor = Cursors.Default;
             };
         }
         this.NextButton.setMouseOverDelegate(delegate4, delegate5);
         this.NextButton.Position = new Point(this.txtPasswordconfirm.Location.X, ((this.txtPasswordconfirm.Location.Y + num5) + 10) - 60);
     }
     this.NextButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.NextClicked), "CreatePopupPanel_next");
     if ((!Program.steamActive || !this.m_createMode) && (!Program.gamersFirstInstall && !Program.arcInstall))
     {
         CustomSelfDrawPanel.CSDButton c = new CustomSelfDrawPanel.CSDButton {
             ImageNorm = this.CloseImage,
             ImageOver = this.CloseImageOver,
             Position = new Point(480, 410)
         };
         c.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.closeClick), "CreatePopupPanel_close");
         this.AddControlToPanel(c);
     }
     if (HintBoxImage == null)
     {
         HintBoxImage = new Bitmap(500, 100);
         Graphics graphics = Graphics.FromImage(HintBoxImage);
         graphics.Clear(ARGBColors.White);
         graphics.DrawRectangle(Pens.LightGray, new Rectangle(0, 0, 500, 100));
         graphics.FillRectangle(Brushes.LightGray, new Rectangle(0, 0x60, 500, 4));
         graphics.FillRectangle(Brushes.LightGray, new Rectangle(0x1f0, 0, 4, 100));
         graphics.Dispose();
     }
     this.HintBox = new CustomSelfDrawPanel.CSDImage();
     this.HintBox.Image = HintBoxImage;
     this.HintBox.Width = HintBoxImage.Width;
     this.HintBox.Height = HintBoxImage.Height;
     if (this.m_createMode)
     {
         this.HintBox.Position = new Point(this.HeaderTitle.Position.X, (this.NextButton.Position.Y + num5) + 8);
     }
     else
     {
         this.HintBox.Position = new Point(this.HeaderTitle.Position.X + 50, (this.NextButton.Position.Y + num5) + 8);
     }
     this.HintBoxLabel = new CustomSelfDrawPanel.CSDLabel();
     this.HintBoxLabel.Width = HintBoxImage.Width - 0x20;
     this.HintBoxLabel.Height = ((HintBoxImage.Height - 0x20) / 2) + 8;
     this.HintBoxLabel.Position = new Point(this.HintBox.Position.X + 0x10, this.HintBox.Position.Y + 0x10);
     this.FeedbackLabel = new CustomSelfDrawPanel.CSDLabel();
     this.FeedbackLabel.Width = this.HintBoxLabel.Width;
     this.FeedbackLabel.Height = this.HintBoxLabel.Height;
     this.FeedbackLabel.Position = new Point(this.HintBoxLabel.Position.X, this.HintBoxLabel.Position.Y + this.HintBoxLabel.Height);
     this.FeedbackLabel.Color = ARGBColors.Red;
     this.tandcLabel = new CustomSelfDrawPanel.CSDLabel();
     this.tandcLabel.Text = SK.Text("MENU_TandC", "Terms & Conditions").Replace("&amp;", "&");
     if (Program.mySettings.LanguageIdent == "de")
     {
         this.tandcLabel.Size = new Size(270, 20);
         this.tandcLabel.Position = new Point(30, 0x193);
     }
     else
     {
         this.tandcLabel.Size = new Size(170, 20);
         this.tandcLabel.Position = new Point(100, 0x193);
     }
     this.tandcLabel.Font = FontManager.GetFont("Arial", 8f, FontStyle.Regular);
     this.tandcLabel.Color = ARGBColors.Black;
     this.tandcLabel.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.tcClicked));
     this.tandcLabel.setMouseOverDelegate(() => this.tandcLabel.Color = ARGBColors.Red, () => this.tandcLabel.Color = ARGBColors.Black);
     this.tandcLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
     this.AddControlToPanel(this.tandcLabel);
     this.privacyLabel = new CustomSelfDrawPanel.CSDLabel();
     this.privacyLabel.Text = SK.Text("MENU_Privacy", "Privacy Policy");
     this.privacyLabel.Size = new Size(base.Width - 0x19e, 20);
     this.privacyLabel.Position = new Point(0xcf, 0x193);
     this.privacyLabel.Font = FontManager.GetFont("Arial", 8f, FontStyle.Regular);
     this.privacyLabel.Color = ARGBColors.Black;
     this.privacyLabel.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.privacyClicked));
     this.privacyLabel.setMouseOverDelegate(() => this.privacyLabel.Color = ARGBColors.Red, () => this.privacyLabel.Color = ARGBColors.Black);
     this.privacyLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
     this.AddControlToPanel(this.privacyLabel);
     if (Program.steamActive && this.m_createMode)
     {
         this.alreadyLabel = new CustomSelfDrawPanel.CSDLabel();
         this.alreadyLabel.Text = SK.Text("Steam_already", "Already have a Stronghold Kingdoms account? Click Here.");
         this.alreadyLabel.Size = new Size(base.Width - 20, 20);
         this.alreadyLabel.Position = new Point(10, base.Height - 20);
         this.alreadyLabel.Font = FontManager.GetFont("Arial", 8f, FontStyle.Regular);
         this.alreadyLabel.Color = ARGBColors.Black;
         if (newDelegate == null)
         {
             newDelegate = () => this.init(false);
         }
         this.alreadyLabel.setClickDelegate(newDelegate);
         if (delegate7 == null)
         {
             delegate7 = () => this.alreadyLabel.Color = ARGBColors.Red;
         }
         if (delegate8 == null)
         {
             delegate8 = () => this.alreadyLabel.Color = ARGBColors.Black;
         }
         this.alreadyLabel.setMouseOverDelegate(delegate7, delegate8);
         this.alreadyLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
         this.AddControlToPanel(this.alreadyLabel);
     }
     this.AddControlToPanel(this.HeaderTitle);
     this.AddControlToPanel(this.lblEmail);
     if (!Program.gamersFirstInstall && !Program.arcInstall)
     {
         base.Controls.Add(this.txtEmail);
     }
     if (this.m_createMode)
     {
         this.AddControlToPanel(this.fillEmailValid);
     }
     if (this.m_createMode)
     {
         if (!Program.gamersFirstInstall && !Program.arcInstall)
         {
             this.AddControlToPanel(this.lblEmailconfirm);
             base.Controls.Add(this.txtEmailconfirm);
             this.AddControlToPanel(this.fillEmailConfirmValid);
         }
         this.AddControlToPanel(this.lblUsername);
         base.Controls.Add(this.txtUsername);
         this.txtUsername.MaxLength = 0x12;
         this.AddControlToPanel(this.fillUsernameValid);
     }
     this.AddControlToPanel(this.lblPassword);
     base.Controls.Add(this.txtPassword);
     if (this.m_createMode)
     {
         this.AddControlToPanel(this.fillPasswordValid);
     }
     if ((this.m_createMode && !Program.gamersFirstInstall) && !Program.arcInstall)
     {
         this.AddControlToPanel(this.lblPasswordconfirm);
         base.Controls.Add(this.txtPasswordconfirm);
         this.AddControlToPanel(this.fillPasswordConfirmValid);
     }
     if (Program.gamersFirstInstall || Program.arcInstall)
     {
         base.Controls.Add(this.txtEmail);
     }
     this.AddControlToPanel(this.NextButton);
     this.AddControlToPanel(this.HintBox);
     this.AddControlToPanel(this.HintBoxLabel);
     this.AddControlToPanel(this.FeedbackLabel);
     this.txtEmail.Name = "txtEmail";
     if (!Program.gamersFirstInstall && !Program.arcInstall)
     {
         this.txtEmail.GotFocus += new EventHandler(this.txtEmail_GotFocus);
     }
     this.txtPassword.Name = "txtPassword";
     this.txtPassword.GotFocus += new EventHandler(this.txtPassword_GotFocus);
     this.txtEmail.TextChanged += new EventHandler(this.txtEmail_TextChanged);
     this.txtPassword.TextChanged += new EventHandler(this.txtPassword_TextChanged);
     if (this.m_createMode)
     {
         this.txtEmailconfirm.Name = "txtEmailConfirm";
         this.txtEmailconfirm.GotFocus += new EventHandler(this.txtEmailconfirm_GotFocus);
         this.txtUsername.Name = "txtUsername";
         this.txtUsername.GotFocus += new EventHandler(this.txtUsername_GotFocus);
         this.txtPasswordconfirm.Name = "txtPasswordConfirm";
         this.txtPasswordconfirm.GotFocus += new EventHandler(this.txtPasswordconfirm_GotFocus);
         this.txtEmailconfirm.TextChanged += new EventHandler(this.txtEmailconfirm_TextChanged);
         this.txtUsername.TextChanged += new EventHandler(this.txtUsername_TextChanged);
         this.txtPasswordconfirm.TextChanged += new EventHandler(this.txtPasswordconfirm_TextChanged);
     }
     base.BringToFront();
     base.Focus();
     if (Program.gamersFirstInstall || Program.arcInstall)
     {
         this.txtUsername.Focus();
     }
     else
     {
         this.txtEmail.Focus();
     }
     this.emailValid = false;
     this.emailconfirmvalid = false;
     this.passwordvalid = false;
     this.passwordconfirmvalid = false;
     this.lastUsernameValid = false;
     this.usernameValidationInProgress = false;
     this.lastUsernameChecked = string.Empty;
     this.usernameNotChecked = false;
     if (Program.gamersFirstInstall || Program.arcInstall)
     {
         this.passwordconfirmvalid = this.passwordvalid = true;
         this.emailValid = this.emailconfirmvalid = true;
         this.txtEmail.Text = ProfileLoginWindow.gfEmail;
         this.txtPassword.Text = ProfileLoginWindow.gfPW;
         this.txtUsername.Focus();
     }
     this.ValidateNextButton();
     this.txtEmail.KeyUp += new KeyEventHandler(this.Tabfix);
     base.Invalidate();
 }
 public void init(int cardSection)
 {
     CustomSelfDrawPanel.CSDImage image2;
     CustomSelfDrawPanel.CSDControl.CSD_MouseOverDelegate overDelegate = null;
     CustomSelfDrawPanel.CSDControl.CSD_MouseOverDelegate leaveDelegate = null;
     this.currentCardSection = cardSection;
     base.clearControls();
     this.mainBackgroundImage.Image = GFXLibrary.dummy;
     this.mainBackgroundImage.Position = new Point(0, 0);
     this.mainBackgroundImage.Size = base.Size;
     this.mainBackgroundImage.Tile = true;
     base.addControl(this.mainBackgroundImage);
     this.ContentWidth = base.Width - (2 * BorderPadding);
     this.AvailablePanelWidth = 800;
     this.InplayPanelWidth = (this.ContentWidth - BorderPadding) - this.AvailablePanelWidth;
     CustomSelfDrawPanel.CSDExtendingPanel panel = new CustomSelfDrawPanel.CSDExtendingPanel {
         Size = base.Size,
         Position = new Point(0, 0)
     };
     this.mainBackgroundImage.addControl(panel);
     panel.Create((Image) GFXLibrary.cardpanel_panel_back_top_left, (Image) GFXLibrary.cardpanel_panel_back_top_mid, (Image) GFXLibrary.cardpanel_panel_back_top_right, (Image) GFXLibrary.cardpanel_panel_back_mid_left, (Image) GFXLibrary.cardpanel_panel_back_mid_mid, (Image) GFXLibrary.cardpanel_panel_back_mid_right, (Image) GFXLibrary.cardpanel_panel_back_bottom_left, (Image) GFXLibrary.cardpanel_panel_back_bottom_mid, (Image) GFXLibrary.cardpanel_panel_back_bottom_right);
     CustomSelfDrawPanel.CSDImage image = new CustomSelfDrawPanel.CSDImage {
         Image = (Image) GFXLibrary.cardpanel_panel_gradient_top_left,
         Size = GFXLibrary.cardpanel_panel_gradient_top_left.Size,
         Position = new Point(0, 0)
     };
     panel.addControl(image);
     image2 = new CustomSelfDrawPanel.CSDImage {
         Image = (Image) GFXLibrary.cardpanel_panel_gradient_bottom_right,
         Size = GFXLibrary.cardpanel_panel_gradient_bottom_right.Size,
         Position = new Point((panel.Width - ((Image) GFXLibrary.cardpanel_panel_gradient_bottom_right).Width) - 6, (panel.Height - ((Image) GFXLibrary.cardpanel_panel_gradient_bottom_right).Height) - 6)
     };
     panel.addControl(image2);
     this.AvailablePanel = new CustomSelfDrawPanel.CSDExtendingPanel();
     this.AvailablePanel.Size = new Size(this.AvailablePanelWidth, 0x177);
     this.AvailablePanel.Position = new Point(8, (base.Height - 8) - 0x177);
     this.AvailablePanel.Alpha = 0.8f;
     this.mainBackgroundImage.addControl(this.AvailablePanel);
     this.AvailablePanel.Create((Image) GFXLibrary.cardpanel_panel_black_top_left, (Image) GFXLibrary.cardpanel_panel_black_top_mid, (Image) GFXLibrary.cardpanel_panel_black_top_right, (Image) GFXLibrary.cardpanel_panel_black_mid_left, (Image) GFXLibrary.cardpanel_panel_black_mid_mid, (Image) GFXLibrary.cardpanel_panel_black_mid_right, (Image) GFXLibrary.cardpanel_panel_black_bottom_left, (Image) GFXLibrary.cardpanel_panel_black_bottom_mid, (Image) GFXLibrary.cardpanel_panel_black_bottom_right);
     int width = base.Width;
     int borderPadding = BorderPadding;
     int num3 = this.AvailablePanel.Width;
     this.closeImage.Image = (Image) GFXLibrary.cardpanel_button_close_normal;
     this.closeImage.Size = this.closeImage.Image.Size;
     this.closeImage.setMouseOverDelegate(() => this.closeImage.Image = (Image) GFXLibrary.cardpanel_button_close_over, () => this.closeImage.Image = (Image) GFXLibrary.cardpanel_button_close_normal);
     this.closeImage.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.closeClick), "Cards_Close");
     this.closeImage.CustomTooltipID = 0x2774;
     this.closeImage.Position = new Point((base.Width - 14) - 0x11, 10);
     this.mainBackgroundImage.addControl(this.closeImage);
     CustomSelfDrawPanel.WikiLinkControl.init(this.mainBackgroundImage, 40, new Point((((base.Width - 1) - 0x11) - 50) + 3, 5), true);
     CustomSelfDrawPanel.CSDFill fill = new CustomSelfDrawPanel.CSDFill {
         FillColor = Color.FromArgb(0xff, 130, 0x81, 0x7e),
         Size = new Size(base.Width - 10, 1),
         Position = new Point(5, 0x22)
     };
     this.mainBackgroundImage.addControl(fill);
     this.cardsButtons = new CustomSelfDrawPanel.UICardsButtons((PlayCardsWindow) base.ParentForm);
     this.cardsButtons.Position = new Point(0x328, 0x25);
     this.mainBackgroundImage.addControl(this.cardsButtons);
     this.labelTitle.Position = new Point(0x1b, 8);
     this.labelTitle.Size = new Size(600, 0x40);
     this.labelTitle.Text = "";
     this.labelTitle.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
     this.labelTitle.Font = FontManager.GetFont("Arial", 16f, FontStyle.Bold);
     this.labelTitle.Color = ARGBColors.Black;
     this.mainBackgroundImage.addControl(this.labelTitle);
     this.labelTitlePoints.Position = new Point(0x1b, 8);
     this.labelTitlePoints.Size = new Size(600, 0x40);
     this.labelTitlePoints.Text = "";
     this.labelTitlePoints.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
     this.labelTitlePoints.Font = FontManager.GetFont("Arial", 16f, FontStyle.Bold);
     this.labelTitlePoints.Color = ARGBColors.Black;
     this.mainBackgroundImage.addControl(this.labelTitlePoints);
     this.imageTitlePoints.Image = (Image) GFXLibrary.cardpanel_manage_card_points_icon;
     this.imageTitlePoints.Position = new Point(400, 5);
     this.mainBackgroundImage.addControl(this.imageTitlePoints);
     this.searchButton.ImageNorm = (Image) GFXLibrary.int_statsscreen_search_button_normal;
     this.searchButton.ImageOver = (Image) GFXLibrary.int_statsscreen_search_button_over;
     this.searchButton.ImageClick = (Image) GFXLibrary.int_statsscreen_search_button_pushed;
     this.searchButton.Position = new Point(0x32b, 7);
     this.searchButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.searchClicked), "StatsPanel_search");
     this.searchButton.CustomTooltipID = 0x284f;
     this.searchButton.Visible = true;
     this.mainBackgroundImage.addControl(this.searchButton);
     this.clearSearchButton.ImageNorm = (Image) GFXLibrary.int_statsscreen_search_clear_button_normal;
     this.clearSearchButton.ImageOver = (Image) GFXLibrary.int_statsscreen_search_clear_button_over;
     this.clearSearchButton.ImageClick = (Image) GFXLibrary.int_statsscreen_search_clear_button_pushed;
     this.clearSearchButton.Position = new Point(740, 7);
     this.clearSearchButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.clearSearchClicked), "StatsPanel_clear_search");
     this.clearSearchButton.Visible = false;
     this.clearSearchButton.CustomTooltipID = 0x2850;
     this.mainBackgroundImage.addControl(this.clearSearchButton);
     this.addPointsData();
     CustomSelfDrawPanel.CSDLabel label = new CustomSelfDrawPanel.CSDLabel {
         Position = new Point((2 * BorderPadding) + this.AvailablePanelWidth, BorderPadding),
         Size = new Size(300, 0x40),
         Text = SK.Text("ManageCandsPanel_Cards_In_Play", "Cards In Play"),
         Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT,
         Font = FontManager.GetFont("Arial", 16f, FontStyle.Bold),
         Color = ARGBColors.White,
         DropShadowColor = ARGBColors.Black
     };
     this.cardTitle = new CustomSelfDrawPanel.CSDLabel();
     this.cardTitle.Position = new Point(0x10, 40);
     this.cardTitle.Size = new Size(600, 0x40);
     this.cardTitle.Text = string.Empty;
     this.cardTitle.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
     this.cardTitle.Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold);
     this.cardTitle.Color = ARGBColors.White;
     this.cardTitle.DropShadowColor = ARGBColors.Black;
     this.mainBackgroundImage.addControl(this.cardTitle);
     this.labelFeedback = new CustomSelfDrawPanel.CSDLabel();
     this.labelFeedback.Position = new Point(0x10, 500);
     this.labelFeedback.Size = new Size(600, 0x40);
     this.labelFeedback.Text = "";
     this.labelFeedback.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
     this.labelFeedback.Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold);
     this.labelFeedback.Color = ARGBColors.White;
     this.labelFeedback.DropShadowColor = ARGBColors.Black;
     this.mainBackgroundImage.addControl(this.labelFeedback);
     this.buttonCash = new CustomSelfDrawPanel.CSDImage();
     this.buttonBonus = new CustomSelfDrawPanel.CSDImage();
     this.buttonCatalog = new CustomSelfDrawPanel.CSDImage();
     this.buttonCash.Image = (Image) GFXLibrary.cardpanel_button_blue_normal;
     this.buttonCash.Size = this.buttonCash.Image.Size;
     this.buttonBonus.Image = (Image) GFXLibrary.cardpanel_button_blue_normal;
     this.buttonBonus.Size = this.buttonBonus.Image.Size;
     this.buttonCatalog.Image = (Image) GFXLibrary.cardpanel_button_blue_normal;
     this.buttonCatalog.Size = this.buttonCash.Image.Size;
     this.buttonCash.Position = new Point((this.AvailablePanel.X + (this.AvailablePanel.Width / 2)) - this.buttonCash.Width, this.cardsButtons.Y + 4);
     this.buttonBonus.Position = new Point(this.buttonCash.X, this.buttonCash.Y);
     this.buttonCatalog.Position = new Point(this.buttonCash.X - this.buttonCash.Width, this.buttonCash.Y);
     this.buttonBonus.setMouseOverDelegate(() => this.buttonBonus.Image = (Image) GFXLibrary.cardpanel_button_blue_over, () => this.buttonBonus.Image = (Image) GFXLibrary.cardpanel_button_blue_normal);
     this.buttonCash.setMouseOverDelegate(() => this.buttonCash.Image = (Image) GFXLibrary.cardpanel_button_blue_over, () => this.buttonCash.Image = (Image) GFXLibrary.cardpanel_button_blue_normal);
     this.buttonCatalog.setMouseOverDelegate(() => this.buttonCatalog.Image = (Image) GFXLibrary.cardpanel_button_blue_over, () => this.buttonCatalog.Image = (Image) GFXLibrary.cardpanel_button_blue_normal);
     this.buttonBonus.Visible = false;
     this.buttonCash.Visible = true;
     this.fastCashIn = Program.mySettings.fastCashIn;
     this.fastCashInCheckBox = new CustomSelfDrawPanel.CSDCheckBox();
     this.fastCashInCheckBox.CheckedImage = (Image) GFXLibrary.reports_checkbox_checked;
     this.fastCashInCheckBox.UncheckedImage = (Image) GFXLibrary.reports_checkbox_empty;
     this.fastCashInCheckBox.Position = new Point(this.AvailablePanel.X + 590, this.cardsButtons.Y + 160);
     this.fastCashInCheckBox.Checked = this.fastCashIn;
     this.fastCashInCheckBox.CBLabel.Text = SK.Text("ManageCards_multicashin", "Multi-Cash In");
     this.fastCashInCheckBox.CBLabel.Color = ARGBColors.Black;
     this.fastCashInCheckBox.CBLabel.Position = new Point(20, -1);
     this.fastCashInCheckBox.CBLabel.Size = new Size(250, 0x19);
     this.fastCashInCheckBox.CBLabel.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     this.fastCashInCheckBox.setCheckChangedDelegate(delegate {
         Program.mySettings.fastCashIn = this.fastCashIn = this.fastCashInCheckBox.Checked;
         this.RefreshSet();
     });
     this.mainBackgroundImage.addControl(this.fastCashInCheckBox);
     this.buyAndPlayCheckBox = new CustomSelfDrawPanel.CSDCheckBox();
     this.buyAndPlayCheckBox.CheckedImage = (Image) GFXLibrary.reports_checkbox_checked;
     this.buyAndPlayCheckBox.UncheckedImage = (Image) GFXLibrary.reports_checkbox_empty;
     this.buyAndPlayCheckBox.Position = new Point(this.AvailablePanel.X + 100, this.cardsButtons.Y + 0x5c);
     this.buyAndPlayCheckBox.Checked = false;
     this.buyAndPlayCheckBox.Visible = false;
     this.buyAndPlayCheckBox.CBLabel.Text = SK.Text("ManageCards_buyAndPlay", "Play Card Immediately");
     this.buyAndPlayCheckBox.CBLabel.Color = ARGBColors.Black;
     this.buyAndPlayCheckBox.CBLabel.Position = new Point(20, -1);
     this.buyAndPlayCheckBox.CBLabel.Size = new Size(250, 0x19);
     this.buyAndPlayCheckBox.CBLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
     this.buyAndPlayCheckBox.setCheckChangedDelegate(new CustomSelfDrawPanel.CSDCheckBox.CSD_CheckChangedDelegate(this.buyAndPlayCheckChanged));
     this.mainBackgroundImage.addControl(this.buyAndPlayCheckBox);
     CustomSelfDrawPanel.CSDLabel label2 = new CustomSelfDrawPanel.CSDLabel {
         Position = new Point(0, -2),
         Size = this.buttonCash.Size,
         Text = SK.Text("ManageCandsPanel_Cash_In", "Cash In"),
         Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER,
         Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular),
         Color = ARGBColors.Black
     };
     this.buttonCash.addControl(label2);
     CustomSelfDrawPanel.CSDLabel label3 = new CustomSelfDrawPanel.CSDLabel {
         Position = new Point(0, -2),
         Size = this.buttonCash.Size,
         Text = SK.Text("ManageCandsPanel_Cash_In", "Cash In"),
         Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER,
         Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular),
         Color = ARGBColors.Black
     };
     this.buttonBonus.addControl(label3);
     this.labelBuyCash = new CustomSelfDrawPanel.CSDLabel();
     this.labelBuyCash.Position = new Point(0, -2);
     this.labelBuyCash.Size = this.buttonCash.Size;
     this.labelBuyCash.Text = SK.Text("ManageCandsPanel_Get_Cards", "Get Cards");
     this.labelBuyCash.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     this.labelBuyCash.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     this.labelBuyCash.Color = ARGBColors.Black;
     this.LabelClickToRemove = new CustomSelfDrawPanel.CSDLabel();
     this.LabelClickToRemove.Position = new Point(this.AvailablePanel.X, this.cardsButtons.Y);
     this.LabelClickToRemove.Size = new Size(600, 0x12);
     this.LabelClickToRemove.Text = "";
     this.LabelClickToRemove.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
     this.LabelClickToRemove.Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold);
     this.LabelClickToRemove.Color = ARGBColors.Black;
     this.mainBackgroundImage.addControl(this.LabelClickToRemove);
     this.buttonCatalog.addControl(this.labelBuyCash);
     this.buttonCatalog.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.SwitchToBuy), "ManageCardsPanel_switch_to_buy_cards");
     if (GameEngine.Instance.World.ProfileCardsSet.Count < 5)
     {
         this.buttonCash.Colorise = ARGBColors.Gray;
         this.buttonCash.setMouseOverDelegate(null, null);
         this.buttonCash.setClickDelegate(null);
     }
     else
     {
         this.buttonCash.Colorise = ARGBColors.White;
         if (overDelegate == null)
         {
             overDelegate = () => this.buttonCash.Image = (Image) GFXLibrary.cardpanel_button_blue_over;
         }
         if (leaveDelegate == null)
         {
             leaveDelegate = () => this.buttonCash.Image = (Image) GFXLibrary.cardpanel_button_blue_normal;
         }
         this.buttonCash.setMouseOverDelegate(overDelegate, leaveDelegate);
         this.buttonCash.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.CashClick), "ManageCardsPanel_switch_to_cash_in");
     }
     this.LayoutPanelMode = this.PanelMode = PANEL_MODE_CASH;
     CardTypes.CardDefinition filter = new CardTypes.CardDefinition();
     GameEngine.Instance.World.searchProfileCards(filter, "", ((PlayCardsWindow) base.ParentForm).getNameSearchText());
     ((PlayCardsWindow) base.ParentForm).tbSearchBox.Visible = false;
     this.ResizeAvailable(0x177);
     this.GetCardsAvailable(false);
     this.RenderCards(this.UICardList);
     this.InitEmptyCards();
     this.RefreshSet();
     this.InitDynamicPanel();
     this.CatalogFilterDefinition.cardCategory = 0;
     this.CatalogFilterDefinition.cardColour = 0;
     this.InitCatalog();
     CustomSelfDrawPanel.CSDControl control = new CustomSelfDrawPanel.CSDControl {
         Position = new Point(0, 0),
         Size = base.Size
     };
     this.mainBackgroundImage.addControl(control);
     this.mainBackgroundImage.setMouseWheelDelegate(new CustomSelfDrawPanel.CSDControl.CSD_MouseWheelDelegate(this.mouseWheelHandler));
     this.InitFilters();
     this.InitTabs();
     this.mainBackgroundImage.invalidate();
     GameEngine.shiftPressedAlways = false;
 }