public void closePopup()
 {
     if (this.m_popup != null)
     {
         this.m_popup.Close();
         this.m_popup = null;
     }
 }
 public void closePopup()
 {
     if (this.m_popup != null)
     {
         this.m_popup.Close();
         this.m_popup = null;
     }
 }
 private void enterGameClicked()
 {
     GameEngine.Instance.playInterfaceSound("AutoSelectVillageAreaPopup_random");
     this.closePopup();
     this.m_popup = new JoiningWorldPopup();
     this.m_popup.init(-1, "");
     this.m_popup.Show(this);
     this.btnEnterGame.Enabled = false;
     this.btnAdvanced.Enabled  = false;
     this.retries = 0;
     RemoteServices.Instance.set_SetStartingCounty_UserCallBack(new RemoteServices.SetStartingCounty_UserCallBack(this.SetStartingCountyCallback));
     RemoteServices.Instance.SetStartingCounty(0x270f);
 }
 private void btnEnterGame_Click()
 {
     if (this.selectedCounty >= 0)
     {
         GameEngine.Instance.playInterfaceSound("SelectVillageAreaPopup_enter_game");
         this.closePopup();
         this.m_popup = new JoiningWorldPopup();
         this.m_popup.init(this.selectedCounty, "");
         this.m_popup.Show(this);
         this.btnEnterGame.Enabled = false;
         this.retries = 0;
         RemoteServices.Instance.set_SetStartingCounty_UserCallBack(new RemoteServices.SetStartingCounty_UserCallBack(this.SetStartingCountyCallback));
         RemoteServices.Instance.SetStartingCounty(this.selectedCounty);
     }
 }
 public void init(int tryingToJoinCounty, NewAutoSelectVillageWindow parent)
 {
     this.m_parent = parent;
     base.clearControls();
     this.transparentBackground.Size      = base.Size;
     this.transparentBackground.FillColor = Color.FromArgb(0xff, 0, 0xff);
     base.addControl(this.transparentBackground);
     this.background.Position = new Point(0, 0);
     this.background.Image    = (Image)GFXLibrary.worldSelect_Background;
     this.background.Size     = new Size(this.background.Image.Width, this.background.Image.Height);
     base.addControl(this.background);
     this.backgroundArea.Position = new Point(0, 0);
     this.backgroundArea.Size     = new Size(0x271, 0x29c);
     this.background.addControl(this.backgroundArea);
     if (((Program.mySettings.LanguageIdent == "en") || (Program.mySettings.LanguageIdent == "fr")) || (Program.mySettings.LanguageIdent == "de"))
     {
         this.header1Label.Text            = SK.Text("WorldSelect_Place_Your_Village1", "Place");
         this.header1Label.Position        = new Point(0x6c, 170);
         this.header1Label.Size            = new Size(this.backgroundArea.Width - 200, 150);
         this.header1Label.Font            = FontManager.GetFont("Arial", 24f, FontStyle.Regular);
         this.header1Label.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
         this.header1Label.Color           = ARGBColors.Black;
         this.header1Label.DropShadowColor = ARGBColors.LightGray;
         this.backgroundArea.addControl(this.header1Label);
     }
     this.header2Label.Text            = SK.Text("WorldSelect_Place_Your_Village2", "Your");
     this.header2Label.Position        = new Point(0x6c, 0xd7);
     this.header2Label.Size            = new Size(this.backgroundArea.Width - 200, 150);
     this.header2Label.Font            = FontManager.GetFont("Arial", 24f, FontStyle.Regular);
     this.header2Label.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
     this.header2Label.Color           = ARGBColors.Black;
     this.header2Label.DropShadowColor = ARGBColors.LightGray;
     this.backgroundArea.addControl(this.header2Label);
     this.header3Label.Text            = SK.Text("WorldSelect_Place_Your_Village3", "Village");
     this.header3Label.Position        = new Point(0x6c, 260);
     this.header3Label.Size            = new Size(this.backgroundArea.Width - 200, 150);
     this.header3Label.Font            = FontManager.GetFont("Arial", 24f, FontStyle.Regular);
     this.header3Label.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
     this.header3Label.Color           = ARGBColors.Black;
     this.header3Label.DropShadowColor = ARGBColors.LightGray;
     this.backgroundArea.addControl(this.header3Label);
     this.btnEnterGame.ImageNorm            = (Image)GFXLibrary.worldSelect_random_norm;
     this.btnEnterGame.ImageOver            = (Image)GFXLibrary.worldSelect_random_over;
     this.btnEnterGame.ImageClick           = (Image)GFXLibrary.worldSelect_random_pushed;
     this.btnEnterGame.Position             = new Point(0xc1, 0x13c);
     this.btnEnterGame.Text.Text            = SK.Text("WorldSelect_Random", "Random");
     this.btnEnterGame.TextYOffset          = -2;
     this.btnEnterGame.Text.Color           = ARGBColors.White;
     this.btnEnterGame.Text.DropShadowColor = ARGBColors.Black;
     this.btnEnterGame.Text.Font            = FontManager.GetFont("Arial", 20f, FontStyle.Regular);
     this.btnEnterGame.Text.Position        = new Point(-3, 0);
     this.btnEnterGame.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.enterGameClicked));
     this.btnEnterGame.Enabled         = true;
     this.btnEnterGame.CustomTooltipID = 0x708;
     this.backgroundArea.addControl(this.btnEnterGame);
     this.btnAdvanced.ImageNorm            = (Image)GFXLibrary.worldSelect_manual_norm;
     this.btnAdvanced.ImageOver            = (Image)GFXLibrary.worldSelect_manual_over;
     this.btnAdvanced.ImageClick           = (Image)GFXLibrary.worldSelect_manual_pushed;
     this.btnAdvanced.Position             = new Point(0xc1, 0x1a0);
     this.btnAdvanced.Text.Text            = SK.Text("WorldSelect_Manual", "Manual");
     this.btnAdvanced.TextYOffset          = -2;
     this.btnAdvanced.Text.Color           = ARGBColors.White;
     this.btnAdvanced.Text.DropShadowColor = ARGBColors.Black;
     this.btnAdvanced.Text.Font            = FontManager.GetFont("Arial", 20f, FontStyle.Regular);
     this.btnAdvanced.Text.Position        = new Point(-3, 0);
     this.btnAdvanced.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.advancedClicked));
     this.btnAdvanced.Enabled         = true;
     this.btnAdvanced.CustomTooltipID = 0x709;
     this.backgroundArea.addControl(this.btnAdvanced);
     if (GameEngine.Instance.LocalWorldData.AIWorld)
     {
         this.btnAdvanced.Visible = false;
     }
     else
     {
         this.btnAdvanced.Visible = true;
     }
     this.btnLogout.ImageNorm            = (Image)GFXLibrary.worldSelect_swap_norm;
     this.btnLogout.ImageOver            = (Image)GFXLibrary.worldSelect_swap_over;
     this.btnLogout.ImageClick           = (Image)GFXLibrary.worldSelect_swap_pushed;
     this.btnLogout.Position             = new Point(0xf5, 0x204);
     this.btnLogout.Text.Text            = SK.Text("LogoutPanel_Swap_Worlds", "Swap Worlds");
     this.btnLogout.TextYOffset          = -2;
     this.btnLogout.Text.Color           = ARGBColors.White;
     this.btnLogout.Text.DropShadowColor = ARGBColors.Black;
     this.btnLogout.Text.Font            = FontManager.GetFont("Arial", 11f, FontStyle.Regular);
     this.btnLogout.Text.Position        = new Point(-3, 0);
     this.btnLogout.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.logoutClick));
     this.btnLogout.Enabled         = true;
     this.btnLogout.CustomTooltipID = 0x70a;
     this.backgroundArea.addControl(this.btnLogout);
     this.delayedRetry = DateTime.MinValue;
     if (tryingToJoinCounty >= -1)
     {
         this.closePopup();
         this.m_popup = new JoiningWorldPopup();
         this.m_popup.init(-1, "");
         this.m_popup.Show(this);
         this.btnEnterGame.Enabled = false;
         this.delayedRetry         = DateTime.Now.AddSeconds(-25.0);
         GameEngine.Instance.tryingToJoinCounty = -2;
     }
 }
        public void init(int tryingToJoinCounty, NewSelectVillageAreaWindow parent)
        {
            this.m_parent = parent;
            base.clearControls();
            this.transparentBackground.Size      = base.Size;
            this.transparentBackground.FillColor = Color.FromArgb(0xff, 0, 0xff);
            base.addControl(this.transparentBackground);
            this.background.Position = new Point(0, 0);
            this.background.Size     = new Size(base.Width, base.Height);
            base.addControl(this.background);
            this.background.Create((Image)GFXLibrary._9sclice_fancy_top_left, (Image)GFXLibrary._9sclice_fancy_top_mid, (Image)GFXLibrary._9sclice_fancy_top_right, (Image)GFXLibrary._9sclice_fancy_mid_left, (Image)GFXLibrary._9sclice_fancy_mid_mid, (Image)GFXLibrary._9sclice_fancy_mid_right, (Image)GFXLibrary._9sclice_fancy_bottom_left, (Image)GFXLibrary._9sclice_fancy_bottom_mid, (Image)GFXLibrary._9sclice_fancy_bottom_right);
            this.background.ForceTiling();
            this.backgroundArea.Position = new Point(0xce, 0x35);
            this.backgroundArea.Size     = new Size(0x202, 340);
            base.addControl(this.backgroundArea);
            int y = 0;

            this.divider = 5f;
            switch (GameEngine.Instance.World.WorldMapType)
            {
            case 1:
                this.mapImage.Image = (Image)GFXLibrary.world_select_map_de;
                break;

            case 3:
                this.mapImage.Image = (Image)GFXLibrary.world_select_map_fr;
                break;

            case 4:
                this.mapImage.Image = (Image)GFXLibrary.world_select_map_ru;
                break;

            case 5:
                this.mapImage.Image = (Image)GFXLibrary.world_select_map_sa;
                this.divider        = 6f;
                y = 10;
                break;

            case 6:
                this.mapImage.Image = (Image)GFXLibrary.world_select_map_es;
                this.divider        = 5.5f;
                y = 0x68;
                break;

            case 7:
                this.mapImage.Image = (Image)GFXLibrary.world_select_map_pl;
                y = 50;
                break;

            case 8:
                this.mapImage.Image = (Image)GFXLibrary.world_select_map_eu;
                y            = 0x42;
                this.divider = 5.5f;
                break;

            case 9:
                this.mapImage.Image = (Image)GFXLibrary.world_select_map_tr;
                this.divider        = 5.5f;
                y = 190;
                break;

            case 10:
                this.mapImage.Image = (Image)GFXLibrary.world_select_map_us;
                this.divider        = 5.5f;
                y = 130;
                break;

            case 11:
                this.mapImage.Image = (Image)GFXLibrary.world_select_map_it;
                y = 0x55;
                break;

            default:
                this.mapImage.Image = (Image)GFXLibrary.world_select_map_en;
                break;
            }
            this.mapImage.Position = new Point(0, y);
            this.backgroundArea.addControl(this.mapImage);
            this.mapBorder.Position  = new Point(0, y);
            this.mapBorder.Size      = new Size(this.mapImage.Width, this.mapImage.Height);
            this.mapBorder.LineColor = ARGBColors.Black;
            this.backgroundArea.addControl(this.mapBorder);
            this.btnEnterGame.ImageNorm            = (Image)GFXLibrary.worldSelect_swap_norm;
            this.btnEnterGame.ImageOver            = (Image)GFXLibrary.worldSelect_swap_over;
            this.btnEnterGame.ImageClick           = (Image)GFXLibrary.worldSelect_swap_pushed;
            this.btnEnterGame.Position             = new Point(0x235, 60);
            this.btnEnterGame.Text.Text            = SK.Text("SelectVillageAreaPopup_Enter_Game", "Enter Game");
            this.btnEnterGame.TextYOffset          = -2;
            this.btnEnterGame.Text.Color           = ARGBColors.White;
            this.btnEnterGame.Text.DropShadowColor = ARGBColors.Black;
            this.btnEnterGame.Text.Font            = FontManager.GetFont("Arial", 11f, FontStyle.Regular);
            this.btnEnterGame.Text.Position        = new Point(-3, 0);
            this.btnEnterGame.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.btnEnterGame_Click));
            this.btnEnterGame.Enabled = false;
            this.backgroundArea.addControl(this.btnEnterGame);
            this.btnBack.ImageNorm            = (Image)GFXLibrary.worldSelect_swap_norm;
            this.btnBack.ImageOver            = (Image)GFXLibrary.worldSelect_swap_over;
            this.btnBack.ImageClick           = (Image)GFXLibrary.worldSelect_swap_pushed;
            this.btnBack.Position             = new Point(0x235, 540);
            this.btnBack.Text.Text            = SK.Text("FORUMS_Back", "Back");
            this.btnBack.TextYOffset          = -2;
            this.btnBack.Text.Color           = ARGBColors.White;
            this.btnBack.Text.DropShadowColor = ARGBColors.Black;
            this.btnBack.Text.Font            = FontManager.GetFont("Arial", 11f, FontStyle.Regular);
            this.btnBack.Text.Position        = new Point(-3, 0);
            this.btnBack.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.btnBack_Click));
            this.btnBack.Enabled = true;
            this.backgroundArea.addControl(this.btnBack);
            this.btnLogout.ImageNorm            = (Image)GFXLibrary.worldSelect_swap_norm;
            this.btnLogout.ImageOver            = (Image)GFXLibrary.worldSelect_swap_over;
            this.btnLogout.ImageClick           = (Image)GFXLibrary.worldSelect_swap_pushed;
            this.btnLogout.Position             = new Point(0x235, 500);
            this.btnLogout.Text.Text            = SK.Text("LogoutPanel_Swap_Worlds", "Swap Worlds");
            this.btnLogout.TextYOffset          = -2;
            this.btnLogout.Text.Color           = ARGBColors.White;
            this.btnLogout.Text.DropShadowColor = ARGBColors.Black;
            this.btnLogout.Text.Font            = FontManager.GetFont("Arial", 11f, FontStyle.Regular);
            this.btnLogout.Text.Position        = new Point(-3, 0);
            this.btnLogout.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.logoutClick));
            this.btnLogout.Enabled = true;
            this.backgroundArea.addControl(this.btnLogout);
            this.headerLabel.Text            = SK.Text("SelectVillageAreaPopup_Select_Village_Location", "Select Village Location");
            this.headerLabel.Position        = new Point(0, 1);
            this.headerLabel.Size            = new Size(this.background.Width, 150);
            this.headerLabel.Font            = FontManager.GetFont("Arial", 14f, FontStyle.Bold);
            this.headerLabel.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
            this.headerLabel.Color           = ARGBColors.Black;
            this.headerLabel.DropShadowColor = ARGBColors.LightGray;
            this.background.addControl(this.headerLabel);
            this.loadingLabel.Text            = SK.Text("SelectVillageAreaPopup_Downloading", "Downloading") + " .....";
            this.loadingLabel.Position        = new Point((this.btnEnterGame.Position.X + (this.btnEnterGame.Width / 2)) - 100, this.btnEnterGame.Position.Y + 50);
            this.loadingLabel.Size            = new Size(200, 200);
            this.loadingLabel.Font            = FontManager.GetFont("Arial", 14f, FontStyle.Regular);
            this.loadingLabel.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
            this.loadingLabel.Color           = ARGBColors.Black;
            this.loadingLabel.DropShadowColor = ARGBColors.LightGray;
            this.backgroundArea.addControl(this.loadingLabel);
            this.populationLabel.Text            = SK.Text("SelectVillagePopup_Population", "Population");
            this.populationLabel.Position        = new Point(0x23e, 0xf5);
            this.populationLabel.Size            = new Size(150, 30);
            this.populationLabel.Font            = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
            this.populationLabel.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
            this.populationLabel.Color           = ARGBColors.Black;
            this.populationLabel.DropShadowColor = ARGBColors.LightGray;
            this.backgroundArea.addControl(this.populationLabel);
            this.lowImage.Image    = (Image)GFXLibrary.selector_square_normal;
            this.lowImage.Position = new Point(0x23e, 270);
            this.backgroundArea.addControl(this.lowImage);
            this.lowLabel.Text            = SK.Text("SelectVillagePopup_Low", "Low");
            this.lowLabel.Position        = new Point(0x252, 270);
            this.lowLabel.Size            = new Size(150, 30);
            this.lowLabel.Font            = FontManager.GetFont("Arial", 11f, FontStyle.Regular);
            this.lowLabel.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
            this.lowLabel.Color           = ARGBColors.Black;
            this.lowLabel.DropShadowColor = ARGBColors.LightGray;
            this.backgroundArea.addControl(this.lowLabel);
            this.medImage.Image    = (Image)GFXLibrary.selector_square_orange_normal;
            this.medImage.Position = new Point(0x23e, 0x127);
            this.backgroundArea.addControl(this.medImage);
            this.medLabel.Text            = SK.Text("SelectVillagePopup_Medium", "Medium");
            this.medLabel.Position        = new Point(0x252, 0x127);
            this.medLabel.Size            = new Size(150, 30);
            this.medLabel.Font            = FontManager.GetFont("Arial", 11f, FontStyle.Regular);
            this.medLabel.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
            this.medLabel.Color           = ARGBColors.Black;
            this.medLabel.DropShadowColor = ARGBColors.LightGray;
            this.backgroundArea.addControl(this.medLabel);
            this.highImage.Image    = (Image)GFXLibrary.selector_square_red_normal;
            this.highImage.Position = new Point(0x23e, 320);
            this.backgroundArea.addControl(this.highImage);
            this.highLabel.Text            = SK.Text("SelectVillagePopup_High", "High");
            this.highLabel.Position        = new Point(0x252, 320);
            this.highLabel.Size            = new Size(150, 30);
            this.highLabel.Font            = FontManager.GetFont("Arial", 11f, FontStyle.Regular);
            this.highLabel.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
            this.highLabel.Color           = ARGBColors.Black;
            this.highLabel.DropShadowColor = ARGBColors.LightGray;
            this.backgroundArea.addControl(this.highLabel);
            RemoteServices.Instance.set_GetVillageStartLocations_UserCallBack(new RemoteServices.GetVillageStartLocations_UserCallBack(this.GetVillageStartLocationsCallback));
            RemoteServices.Instance.GetVillageStartLocations();
            if (tryingToJoinCounty >= 0)
            {
                this.closePopup();
                this.m_popup = new JoiningWorldPopup();
                this.m_popup.init(tryingToJoinCounty, "");
                this.m_popup.Show(this);
                this.btnEnterGame.Enabled = false;
                this.delayedRetry         = DateTime.Now.AddSeconds(-25.0);
                GameEngine.Instance.tryingToJoinCounty = -2;
            }
        }
        public void init(int tryingToJoinCounty, NewSelectVillageAreaWindow parent)
        {
            this.m_parent = parent;
            base.clearControls();
            this.transparentBackground.Size = base.Size;
            this.transparentBackground.FillColor = Color.FromArgb(0xff, 0, 0xff);
            base.addControl(this.transparentBackground);
            this.background.Position = new Point(0, 0);
            this.background.Size = new Size(base.Width, base.Height);
            base.addControl(this.background);
            this.background.Create((Image) GFXLibrary._9sclice_fancy_top_left, (Image) GFXLibrary._9sclice_fancy_top_mid, (Image) GFXLibrary._9sclice_fancy_top_right, (Image) GFXLibrary._9sclice_fancy_mid_left, (Image) GFXLibrary._9sclice_fancy_mid_mid, (Image) GFXLibrary._9sclice_fancy_mid_right, (Image) GFXLibrary._9sclice_fancy_bottom_left, (Image) GFXLibrary._9sclice_fancy_bottom_mid, (Image) GFXLibrary._9sclice_fancy_bottom_right);
            this.background.ForceTiling();
            this.backgroundArea.Position = new Point(0xce, 0x35);
            this.backgroundArea.Size = new Size(0x202, 340);
            base.addControl(this.backgroundArea);
            int y = 0;
            this.divider = 5f;
            switch (GameEngine.Instance.World.WorldMapType)
            {
                case 1:
                    this.mapImage.Image = (Image) GFXLibrary.world_select_map_de;
                    break;

                case 3:
                    this.mapImage.Image = (Image) GFXLibrary.world_select_map_fr;
                    break;

                case 4:
                    this.mapImage.Image = (Image) GFXLibrary.world_select_map_ru;
                    break;

                case 5:
                    this.mapImage.Image = (Image) GFXLibrary.world_select_map_sa;
                    this.divider = 6f;
                    y = 10;
                    break;

                case 6:
                    this.mapImage.Image = (Image) GFXLibrary.world_select_map_es;
                    this.divider = 5.5f;
                    y = 0x68;
                    break;

                case 7:
                    this.mapImage.Image = (Image) GFXLibrary.world_select_map_pl;
                    y = 50;
                    break;

                case 8:
                    this.mapImage.Image = (Image) GFXLibrary.world_select_map_eu;
                    y = 0x42;
                    this.divider = 5.5f;
                    break;

                case 9:
                    this.mapImage.Image = (Image) GFXLibrary.world_select_map_tr;
                    this.divider = 5.5f;
                    y = 190;
                    break;

                case 10:
                    this.mapImage.Image = (Image) GFXLibrary.world_select_map_us;
                    this.divider = 5.5f;
                    y = 130;
                    break;

                case 11:
                    this.mapImage.Image = (Image) GFXLibrary.world_select_map_it;
                    y = 0x55;
                    break;

                default:
                    this.mapImage.Image = (Image) GFXLibrary.world_select_map_en;
                    break;
            }
            this.mapImage.Position = new Point(0, y);
            this.backgroundArea.addControl(this.mapImage);
            this.mapBorder.Position = new Point(0, y);
            this.mapBorder.Size = new Size(this.mapImage.Width, this.mapImage.Height);
            this.mapBorder.LineColor = ARGBColors.Black;
            this.backgroundArea.addControl(this.mapBorder);
            this.btnEnterGame.ImageNorm = (Image) GFXLibrary.worldSelect_swap_norm;
            this.btnEnterGame.ImageOver = (Image) GFXLibrary.worldSelect_swap_over;
            this.btnEnterGame.ImageClick = (Image) GFXLibrary.worldSelect_swap_pushed;
            this.btnEnterGame.Position = new Point(0x235, 60);
            this.btnEnterGame.Text.Text = SK.Text("SelectVillageAreaPopup_Enter_Game", "Enter Game");
            this.btnEnterGame.TextYOffset = -2;
            this.btnEnterGame.Text.Color = ARGBColors.White;
            this.btnEnterGame.Text.DropShadowColor = ARGBColors.Black;
            this.btnEnterGame.Text.Font = FontManager.GetFont("Arial", 11f, FontStyle.Regular);
            this.btnEnterGame.Text.Position = new Point(-3, 0);
            this.btnEnterGame.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.btnEnterGame_Click));
            this.btnEnterGame.Enabled = false;
            this.backgroundArea.addControl(this.btnEnterGame);
            this.btnBack.ImageNorm = (Image) GFXLibrary.worldSelect_swap_norm;
            this.btnBack.ImageOver = (Image) GFXLibrary.worldSelect_swap_over;
            this.btnBack.ImageClick = (Image) GFXLibrary.worldSelect_swap_pushed;
            this.btnBack.Position = new Point(0x235, 540);
            this.btnBack.Text.Text = SK.Text("FORUMS_Back", "Back");
            this.btnBack.TextYOffset = -2;
            this.btnBack.Text.Color = ARGBColors.White;
            this.btnBack.Text.DropShadowColor = ARGBColors.Black;
            this.btnBack.Text.Font = FontManager.GetFont("Arial", 11f, FontStyle.Regular);
            this.btnBack.Text.Position = new Point(-3, 0);
            this.btnBack.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.btnBack_Click));
            this.btnBack.Enabled = true;
            this.backgroundArea.addControl(this.btnBack);
            this.btnLogout.ImageNorm = (Image) GFXLibrary.worldSelect_swap_norm;
            this.btnLogout.ImageOver = (Image) GFXLibrary.worldSelect_swap_over;
            this.btnLogout.ImageClick = (Image) GFXLibrary.worldSelect_swap_pushed;
            this.btnLogout.Position = new Point(0x235, 500);
            this.btnLogout.Text.Text = SK.Text("LogoutPanel_Swap_Worlds", "Swap Worlds");
            this.btnLogout.TextYOffset = -2;
            this.btnLogout.Text.Color = ARGBColors.White;
            this.btnLogout.Text.DropShadowColor = ARGBColors.Black;
            this.btnLogout.Text.Font = FontManager.GetFont("Arial", 11f, FontStyle.Regular);
            this.btnLogout.Text.Position = new Point(-3, 0);
            this.btnLogout.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.logoutClick));
            this.btnLogout.Enabled = true;
            this.backgroundArea.addControl(this.btnLogout);
            this.headerLabel.Text = SK.Text("SelectVillageAreaPopup_Select_Village_Location", "Select Village Location");
            this.headerLabel.Position = new Point(0, 1);
            this.headerLabel.Size = new Size(this.background.Width, 150);
            this.headerLabel.Font = FontManager.GetFont("Arial", 14f, FontStyle.Bold);
            this.headerLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
            this.headerLabel.Color = ARGBColors.Black;
            this.headerLabel.DropShadowColor = ARGBColors.LightGray;
            this.background.addControl(this.headerLabel);
            this.loadingLabel.Text = SK.Text("SelectVillageAreaPopup_Downloading", "Downloading") + " .....";
            this.loadingLabel.Position = new Point((this.btnEnterGame.Position.X + (this.btnEnterGame.Width / 2)) - 100, this.btnEnterGame.Position.Y + 50);
            this.loadingLabel.Size = new Size(200, 200);
            this.loadingLabel.Font = FontManager.GetFont("Arial", 14f, FontStyle.Regular);
            this.loadingLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
            this.loadingLabel.Color = ARGBColors.Black;
            this.loadingLabel.DropShadowColor = ARGBColors.LightGray;
            this.backgroundArea.addControl(this.loadingLabel);
            this.populationLabel.Text = SK.Text("SelectVillagePopup_Population", "Population");
            this.populationLabel.Position = new Point(0x23e, 0xf5);
            this.populationLabel.Size = new Size(150, 30);
            this.populationLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
            this.populationLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
            this.populationLabel.Color = ARGBColors.Black;
            this.populationLabel.DropShadowColor = ARGBColors.LightGray;
            this.backgroundArea.addControl(this.populationLabel);
            this.lowImage.Image = (Image) GFXLibrary.selector_square_normal;
            this.lowImage.Position = new Point(0x23e, 270);
            this.backgroundArea.addControl(this.lowImage);
            this.lowLabel.Text = SK.Text("SelectVillagePopup_Low", "Low");
            this.lowLabel.Position = new Point(0x252, 270);
            this.lowLabel.Size = new Size(150, 30);
            this.lowLabel.Font = FontManager.GetFont("Arial", 11f, FontStyle.Regular);
            this.lowLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
            this.lowLabel.Color = ARGBColors.Black;
            this.lowLabel.DropShadowColor = ARGBColors.LightGray;
            this.backgroundArea.addControl(this.lowLabel);
            this.medImage.Image = (Image) GFXLibrary.selector_square_orange_normal;
            this.medImage.Position = new Point(0x23e, 0x127);
            this.backgroundArea.addControl(this.medImage);
            this.medLabel.Text = SK.Text("SelectVillagePopup_Medium", "Medium");
            this.medLabel.Position = new Point(0x252, 0x127);
            this.medLabel.Size = new Size(150, 30);
            this.medLabel.Font = FontManager.GetFont("Arial", 11f, FontStyle.Regular);
            this.medLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
            this.medLabel.Color = ARGBColors.Black;
            this.medLabel.DropShadowColor = ARGBColors.LightGray;
            this.backgroundArea.addControl(this.medLabel);
            this.highImage.Image = (Image) GFXLibrary.selector_square_red_normal;
            this.highImage.Position = new Point(0x23e, 320);
            this.backgroundArea.addControl(this.highImage);
            this.highLabel.Text = SK.Text("SelectVillagePopup_High", "High");
            this.highLabel.Position = new Point(0x252, 320);
            this.highLabel.Size = new Size(150, 30);
            this.highLabel.Font = FontManager.GetFont("Arial", 11f, FontStyle.Regular);
            this.highLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
            this.highLabel.Color = ARGBColors.Black;
            this.highLabel.DropShadowColor = ARGBColors.LightGray;
            this.backgroundArea.addControl(this.highLabel);
            RemoteServices.Instance.set_GetVillageStartLocations_UserCallBack(new RemoteServices.GetVillageStartLocations_UserCallBack(this.GetVillageStartLocationsCallback));
            RemoteServices.Instance.GetVillageStartLocations();
            if (tryingToJoinCounty >= 0)
            {
                this.closePopup();
                this.m_popup = new JoiningWorldPopup();
                this.m_popup.init(tryingToJoinCounty, "");
                this.m_popup.Show(this);
                this.btnEnterGame.Enabled = false;
                this.delayedRetry = DateTime.Now.AddSeconds(-25.0);
                GameEngine.Instance.tryingToJoinCounty = -2;
            }
        }
 private void btnEnterGame_Click()
 {
     if (this.selectedCounty >= 0)
     {
         GameEngine.Instance.playInterfaceSound("SelectVillageAreaPopup_enter_game");
         this.closePopup();
         this.m_popup = new JoiningWorldPopup();
         this.m_popup.init(this.selectedCounty, "");
         this.m_popup.Show(this);
         this.btnEnterGame.Enabled = false;
         this.retries = 0;
         RemoteServices.Instance.set_SetStartingCounty_UserCallBack(new RemoteServices.SetStartingCounty_UserCallBack(this.SetStartingCountyCallback));
         RemoteServices.Instance.SetStartingCounty(this.selectedCounty);
     }
 }
 public void init(int tryingToJoinCounty, NewAutoSelectVillageWindow parent)
 {
     this.m_parent = parent;
     base.clearControls();
     this.transparentBackground.Size = base.Size;
     this.transparentBackground.FillColor = Color.FromArgb(0xff, 0, 0xff);
     base.addControl(this.transparentBackground);
     this.background.Position = new Point(0, 0);
     this.background.Image = (Image) GFXLibrary.worldSelect_Background;
     this.background.Size = new Size(this.background.Image.Width, this.background.Image.Height);
     base.addControl(this.background);
     this.backgroundArea.Position = new Point(0, 0);
     this.backgroundArea.Size = new Size(0x271, 0x29c);
     this.background.addControl(this.backgroundArea);
     if (((Program.mySettings.LanguageIdent == "en") || (Program.mySettings.LanguageIdent == "fr")) || (Program.mySettings.LanguageIdent == "de"))
     {
         this.header1Label.Text = SK.Text("WorldSelect_Place_Your_Village1", "Place");
         this.header1Label.Position = new Point(0x6c, 170);
         this.header1Label.Size = new Size(this.backgroundArea.Width - 200, 150);
         this.header1Label.Font = FontManager.GetFont("Arial", 24f, FontStyle.Regular);
         this.header1Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
         this.header1Label.Color = ARGBColors.Black;
         this.header1Label.DropShadowColor = ARGBColors.LightGray;
         this.backgroundArea.addControl(this.header1Label);
     }
     this.header2Label.Text = SK.Text("WorldSelect_Place_Your_Village2", "Your");
     this.header2Label.Position = new Point(0x6c, 0xd7);
     this.header2Label.Size = new Size(this.backgroundArea.Width - 200, 150);
     this.header2Label.Font = FontManager.GetFont("Arial", 24f, FontStyle.Regular);
     this.header2Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
     this.header2Label.Color = ARGBColors.Black;
     this.header2Label.DropShadowColor = ARGBColors.LightGray;
     this.backgroundArea.addControl(this.header2Label);
     this.header3Label.Text = SK.Text("WorldSelect_Place_Your_Village3", "Village");
     this.header3Label.Position = new Point(0x6c, 260);
     this.header3Label.Size = new Size(this.backgroundArea.Width - 200, 150);
     this.header3Label.Font = FontManager.GetFont("Arial", 24f, FontStyle.Regular);
     this.header3Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
     this.header3Label.Color = ARGBColors.Black;
     this.header3Label.DropShadowColor = ARGBColors.LightGray;
     this.backgroundArea.addControl(this.header3Label);
     this.btnEnterGame.ImageNorm = (Image) GFXLibrary.worldSelect_random_norm;
     this.btnEnterGame.ImageOver = (Image) GFXLibrary.worldSelect_random_over;
     this.btnEnterGame.ImageClick = (Image) GFXLibrary.worldSelect_random_pushed;
     this.btnEnterGame.Position = new Point(0xc1, 0x13c);
     this.btnEnterGame.Text.Text = SK.Text("WorldSelect_Random", "Random");
     this.btnEnterGame.TextYOffset = -2;
     this.btnEnterGame.Text.Color = ARGBColors.White;
     this.btnEnterGame.Text.DropShadowColor = ARGBColors.Black;
     this.btnEnterGame.Text.Font = FontManager.GetFont("Arial", 20f, FontStyle.Regular);
     this.btnEnterGame.Text.Position = new Point(-3, 0);
     this.btnEnterGame.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.enterGameClicked));
     this.btnEnterGame.Enabled = true;
     this.btnEnterGame.CustomTooltipID = 0x708;
     this.backgroundArea.addControl(this.btnEnterGame);
     this.btnAdvanced.ImageNorm = (Image) GFXLibrary.worldSelect_manual_norm;
     this.btnAdvanced.ImageOver = (Image) GFXLibrary.worldSelect_manual_over;
     this.btnAdvanced.ImageClick = (Image) GFXLibrary.worldSelect_manual_pushed;
     this.btnAdvanced.Position = new Point(0xc1, 0x1a0);
     this.btnAdvanced.Text.Text = SK.Text("WorldSelect_Manual", "Manual");
     this.btnAdvanced.TextYOffset = -2;
     this.btnAdvanced.Text.Color = ARGBColors.White;
     this.btnAdvanced.Text.DropShadowColor = ARGBColors.Black;
     this.btnAdvanced.Text.Font = FontManager.GetFont("Arial", 20f, FontStyle.Regular);
     this.btnAdvanced.Text.Position = new Point(-3, 0);
     this.btnAdvanced.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.advancedClicked));
     this.btnAdvanced.Enabled = true;
     this.btnAdvanced.CustomTooltipID = 0x709;
     this.backgroundArea.addControl(this.btnAdvanced);
     if (GameEngine.Instance.LocalWorldData.AIWorld)
     {
         this.btnAdvanced.Visible = false;
     }
     else
     {
         this.btnAdvanced.Visible = true;
     }
     this.btnLogout.ImageNorm = (Image) GFXLibrary.worldSelect_swap_norm;
     this.btnLogout.ImageOver = (Image) GFXLibrary.worldSelect_swap_over;
     this.btnLogout.ImageClick = (Image) GFXLibrary.worldSelect_swap_pushed;
     this.btnLogout.Position = new Point(0xf5, 0x204);
     this.btnLogout.Text.Text = SK.Text("LogoutPanel_Swap_Worlds", "Swap Worlds");
     this.btnLogout.TextYOffset = -2;
     this.btnLogout.Text.Color = ARGBColors.White;
     this.btnLogout.Text.DropShadowColor = ARGBColors.Black;
     this.btnLogout.Text.Font = FontManager.GetFont("Arial", 11f, FontStyle.Regular);
     this.btnLogout.Text.Position = new Point(-3, 0);
     this.btnLogout.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.logoutClick));
     this.btnLogout.Enabled = true;
     this.btnLogout.CustomTooltipID = 0x70a;
     this.backgroundArea.addControl(this.btnLogout);
     this.delayedRetry = DateTime.MinValue;
     if (tryingToJoinCounty >= -1)
     {
         this.closePopup();
         this.m_popup = new JoiningWorldPopup();
         this.m_popup.init(-1, "");
         this.m_popup.Show(this);
         this.btnEnterGame.Enabled = false;
         this.delayedRetry = DateTime.Now.AddSeconds(-25.0);
         GameEngine.Instance.tryingToJoinCounty = -2;
     }
 }
 private void enterGameClicked()
 {
     GameEngine.Instance.playInterfaceSound("AutoSelectVillageAreaPopup_random");
     this.closePopup();
     this.m_popup = new JoiningWorldPopup();
     this.m_popup.init(-1, "");
     this.m_popup.Show(this);
     this.btnEnterGame.Enabled = false;
     this.btnAdvanced.Enabled = false;
     this.retries = 0;
     RemoteServices.Instance.set_SetStartingCounty_UserCallBack(new RemoteServices.SetStartingCounty_UserCallBack(this.SetStartingCountyCallback));
     RemoteServices.Instance.SetStartingCounty(0x270f);
 }