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 closeNoVillagePopup(bool pendingVillage)
 {
     if (this.noVillagePopup != null)
     {
         InterfaceMgr.Instance.ParentForm.Enabled = true;
         this.noVillagePopup.closePopup();
         this.noVillagePopup.Close();
         this.noVillagePopup = null;
         InterfaceMgr.Instance.closeGreyOut();
     }
     if (this.lostVillagePopup != null)
     {
         if (this.lostVillagePopup.isCardsPopup())
         {
             this.lostVillagePopup.closePopup();
             this.lostVillagePopup.Close();
             this.lostVillagePopup = null;
         }
         else
         {
             InterfaceMgr.Instance.ParentForm.Enabled = true;
             this.lostVillagePopup.closePopup();
             this.lostVillagePopup.Close();
             this.lostVillagePopup = null;
             InterfaceMgr.Instance.closeGreyOut();
         }
     }
     if (this.noAutoVillagePopup != null)
     {
         InterfaceMgr.Instance.ParentForm.Enabled = true;
         this.noAutoVillagePopup.closePopup();
         this.noAutoVillagePopup.Close();
         this.noAutoVillagePopup = null;
         InterfaceMgr.Instance.closeGreyOut();
     }
     if (pendingVillage)
     {
         this.pendingUserVillageZoom = true;
     }
 }
        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 openAdvancedSelectVillage()
 {
     InterfaceMgr.Instance.openGreyOutWindow(false);
     InterfaceMgr.Instance.ParentForm.Enabled = false;
     this.noVillagePopup = new NewSelectVillageAreaWindow();
     this.noVillagePopup.init(this.tryingToJoinCounty);
     this.noVillagePopup.Show(InterfaceMgr.Instance.getGreyOutWindow());
 }