public void init()
 {
     base.clearControls();
     this.backImage = this.backGround.init(false, 0x5dd);
     base.addControl(this.backGround);
     this.tradeButton.ImageNorm = (Image) GFXLibrary.mrhp_world_icons_rhs_array[0];
     this.tradeButton.ImageOver = (Image) GFXLibrary.mrhp_world_icons_rhs_array[7];
     this.tradeButton.ImageClick = (Image) GFXLibrary.mrhp_world_icons_rhs_array[14];
     this.tradeButton.Position = new Point(10, 0x31);
     this.tradeButton.Enabled = false;
     this.tradeButton.CustomTooltipID = 0x96a;
     this.tradeButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.btnTradeWith_Click), "CountyCapitalVillagePanel2_trade");
     this.backImage.addControl(this.tradeButton);
     this.attackButton.ImageNorm = (Image) GFXLibrary.mrhp_world_icons_rhs_array[1];
     this.attackButton.ImageOver = (Image) GFXLibrary.mrhp_world_icons_rhs_array[8];
     this.attackButton.ImageClick = (Image) GFXLibrary.mrhp_world_icons_rhs_array[15];
     this.attackButton.Position = new Point(0x2d, 0x31);
     this.attackButton.Enabled = false;
     this.attackButton.CustomTooltipID = 0x96b;
     this.attackButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.btnAttack_Click), "CountyCapitalVillagePanel2_attack");
     this.backImage.addControl(this.attackButton);
     this.scoutButton.ImageNorm = (Image) GFXLibrary.mrhp_world_icons_rhs_array[3];
     this.scoutButton.ImageOver = (Image) GFXLibrary.mrhp_world_icons_rhs_array[10];
     this.scoutButton.ImageClick = (Image) GFXLibrary.mrhp_world_icons_rhs_array[0x11];
     this.scoutButton.Position = new Point(80, 0x31);
     this.scoutButton.Enabled = false;
     this.scoutButton.CustomTooltipID = 0x96c;
     this.scoutButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.btnScout_Click), "CountyCapitalVillagePanel2_scout");
     this.backImage.addControl(this.scoutButton);
     this.reinforceButton.ImageNorm = (Image) GFXLibrary.mrhp_world_icons_rhs_array[2];
     this.reinforceButton.ImageOver = (Image) GFXLibrary.mrhp_world_icons_rhs_array[9];
     this.reinforceButton.ImageClick = (Image) GFXLibrary.mrhp_world_icons_rhs_array[0x10];
     this.reinforceButton.Position = new Point(0x73, 0x31);
     this.reinforceButton.Enabled = false;
     this.reinforceButton.CustomTooltipID = 0x96d;
     this.reinforceButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.btnSendTroops_Click), "CountyCapitalVillagePanel2_reinforce");
     this.backImage.addControl(this.reinforceButton);
     this.monkButton.ImageNorm = (Image) GFXLibrary.mrhp_world_icons_rhs_array[4];
     this.monkButton.ImageOver = (Image) GFXLibrary.mrhp_world_icons_rhs_array[11];
     this.monkButton.ImageClick = (Image) GFXLibrary.mrhp_world_icons_rhs_array[0x12];
     this.monkButton.Position = new Point(150, 0x31);
     this.monkButton.Enabled = false;
     this.monkButton.CustomTooltipID = 0x96e;
     this.monkButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.btnSendMonks_Click), "CountyCapitalVillagePanel2_sendmonks");
     this.backImage.addControl(this.monkButton);
     this.lblProtectionType.Text = "";
     this.lblProtectionType.Color = ARGBColors.Black;
     this.lblProtectionType.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.lblProtectionType.Position = new Point(0, 0x26);
     this.lblProtectionType.Size = new Size(this.backImage.Width, 0x17);
     this.lblProtectionType.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     this.backImage.addControl(this.lblProtectionType);
     this.lblProtected.Text = "";
     this.lblProtected.Color = ARGBColors.Black;
     this.lblProtected.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.lblProtected.Position = new Point(6, 0x30);
     this.lblProtected.Size = new Size(this.backImage.Width - 12, 0x4a);
     this.lblProtected.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     this.backImage.addControl(this.lblProtected);
 }
 public void init()
 {
     base.clearControls();
     this.backImage = this.backGround.init(true, 0x2710);
     base.addControl(this.backGround);
     this.tradeButton.ImageNorm = (Image) GFXLibrary.mrhp_world_icons_rhs_array[0];
     this.tradeButton.ImageOver = (Image) GFXLibrary.mrhp_world_icons_rhs_array[7];
     this.tradeButton.ImageClick = (Image) GFXLibrary.mrhp_world_icons_rhs_array[14];
     this.tradeButton.Position = new Point(80, 0x8e);
     this.tradeButton.CustomTooltipID = 0x989;
     this.tradeButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.tradeClick), "OwnProvinceCapitalPanel2_trade");
     this.backImage.addControl(this.tradeButton);
     this.villageButton.ImageNorm = (Image) GFXLibrary.int_world_icon_village;
     this.villageButton.OverBrighten = true;
     this.villageButton.MoveOnClick = true;
     this.villageButton.Position = new Point(0x1d, 0x70);
     this.villageButton.CustomTooltipID = 0x985;
     this.villageButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.villageClick), "OwnProvinceCapitalPanel2_view_village");
     this.backImage.addControl(this.villageButton);
     this.castleButton.ImageNorm = (Image) GFXLibrary.int_world_icon_castle;
     this.castleButton.OverBrighten = true;
     this.castleButton.MoveOnClick = true;
     this.castleButton.Position = new Point(0x40, 0x70);
     this.castleButton.CustomTooltipID = 0x986;
     this.castleButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.castleClick), "OwnProvinceCapitalPanel2_view_castle");
     this.backImage.addControl(this.castleButton);
     this.resourcesButton.ImageNorm = (Image) GFXLibrary.int_world_icon_resource;
     this.resourcesButton.OverBrighten = true;
     this.resourcesButton.MoveOnClick = true;
     this.resourcesButton.Position = new Point(0x63, 0x70);
     this.resourcesButton.CustomTooltipID = 0x987;
     this.resourcesButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.resourcesClick), "OwnProvinceCapitalPanel2_view_resources");
     this.backImage.addControl(this.resourcesButton);
     this.troopsButton.ImageNorm = (Image) GFXLibrary.int_world_icon_troops;
     this.troopsButton.OverBrighten = true;
     this.troopsButton.MoveOnClick = true;
     this.troopsButton.Position = new Point(0x86, 0x70);
     this.troopsButton.CustomTooltipID = 0x98a;
     this.troopsButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.troopsClick), "OwnProvinceCapitalPanel2_make_troops");
     this.backImage.addControl(this.troopsButton);
     this.lblProtectionType.Text = "";
     this.lblProtectionType.Color = ARGBColors.Black;
     this.lblProtectionType.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.lblProtectionType.Position = new Point(0, 0x26);
     this.lblProtectionType.Size = new Size(this.backImage.Width, 0x17);
     this.lblProtectionType.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     this.backImage.addControl(this.lblProtectionType);
     this.lblProtected.Text = "";
     this.lblProtected.Color = ARGBColors.Black;
     this.lblProtected.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.lblProtected.Position = new Point(6, 0x30);
     this.lblProtected.Size = new Size(this.backImage.Width - 12, 0x4a);
     this.lblProtected.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     this.backImage.addControl(this.lblProtected);
 }
 public void init(int cardSection)
 {
     CustomSelfDrawPanel.CSDImage image2;
     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;
     CustomSelfDrawPanel.CSDExtendingPanel control = new CustomSelfDrawPanel.CSDExtendingPanel {
         Size = base.Size,
         Position = new Point(0, 0)
     };
     this.mainBackgroundImage.addControl(control);
     control.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)
     };
     control.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((control.Width - ((Image) GFXLibrary.cardpanel_panel_gradient_bottom_right).Width) - 6, (control.Height - ((Image) GFXLibrary.cardpanel_panel_gradient_bottom_right).Height) - 6)
     };
     control.addControl(image2);
     this.AvailablePanel = new CustomSelfDrawPanel.CSDExtendingPanel();
     this.AvailablePanel.Size = new Size(this.AvailablePanelWidth, 550);
     this.AvailablePanel.Position = new Point(8, (base.Height - 8) - 550);
     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);
     this.cardsInPlay.init(cardSection, 0x70, false, 14, 3, 0);
     this.cardsInPlay.Position = new Point(0, 5);
     this.AvailablePanel.addControl(this.cardsInPlay);
     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));
     this.closeImage.Position = new Point((base.Width - 14) - 0x11, 10);
     this.mainBackgroundImage.addControl(this.closeImage);
     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.greyout.FillColor = Color.FromArgb(0xd7, 0x19, 0x19, 0x19);
     this.greyout.Size = new Size(this.mainBackgroundImage.Width, this.AvailablePanel.Y + this.AvailablePanel.Height);
     this.greyout.Position = new Point(0, 0);
     this.greyout.setClickDelegate(delegate {
     });
     CustomSelfDrawPanel.CSDImage closeGrey = new CustomSelfDrawPanel.CSDImage {
         Image = (Image) GFXLibrary.cardpanel_button_close_normal,
         Size = this.closeImage.Image.Size
     };
     closeGrey.setMouseOverDelegate(() => closeGrey.Image = (Image) GFXLibrary.cardpanel_button_close_over, () => closeGrey.Image = (Image) GFXLibrary.cardpanel_button_close_normal);
     closeGrey.Position = new Point((base.Width - 14) - 0x11, 10);
     this.greyout.addControl(closeGrey);
     this.labelTitle.Position = new Point(0x1b, 8);
     this.labelTitle.Size = new Size(0x3a7, 0x40);
     this.labelTitle.Text = SK.Text("ViewAllCardsPanel_Cards_In_Play", "Cards In Play");
     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);
     CustomSelfDrawPanel.UICardsButtons buttons = new CustomSelfDrawPanel.UICardsButtons((PlayCardsWindow) base.ParentForm) {
         Position = new Point(0x328, 0x25)
     };
     this.mainBackgroundImage.addControl(buttons);
     this.cardButtons = buttons;
     if (cardSection != 0)
     {
         CustomSelfDrawPanel.CSDButton button = new CustomSelfDrawPanel.CSDButton {
             ImageNorm = (Image) GFXLibrary.button_cards_all_normal,
             ImageOver = (Image) GFXLibrary.button_cards_all_over,
             ImageClick = (Image) GFXLibrary.button_cards_all_over,
             Position = new Point(750, 0)
         };
         button.Text.Text = SK.Text("PlayCardsPanel_All_Your_Cards", "All Your Cards");
         button.TextYOffset = -3;
         button.Text.Color = ARGBColors.Black;
         button.Text.Size = new Size(button.Size.Width - 0x2d, button.Size.Height);
         button.Text.Position = new Point(0x2d, 0);
         button.Text.Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold);
         button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.showAllCardsClick), "PlayCardsPanel_show_all_cards");
         this.mainBackgroundImage.addControl(button);
     }
     CustomSelfDrawPanel.CSDButton button2 = new CustomSelfDrawPanel.CSDButton {
         ImageNorm = (Image) GFXLibrary.misc_button_blue_210wide_normal,
         ImageOver = (Image) GFXLibrary.misc_button_blue_210wide_over,
         ImageClick = (Image) GFXLibrary.misc_button_blue_210wide_pushed,
         Position = new Point(580, 0x203)
     };
     button2.Text.Text = SK.Text("PlayCardsPanel_Return", "Back To Play Cards");
     button2.TextYOffset = -2;
     button2.Text.Color = ARGBColors.Black;
     if ((Program.mySettings.LanguageIdent == "it") || (Program.mySettings.LanguageIdent == "tr"))
     {
         button2.Text.Font = FontManager.GetFont("Arial", 11f, FontStyle.Bold);
     }
     else
     {
         button2.Text.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
     }
     button2.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.returnClicked), "PlayCardsPanel_Back_To_PlayCards");
     this.AvailablePanel.addControl(button2);
     CustomSelfDrawPanel.CSDLabel label = new CustomSelfDrawPanel.CSDLabel {
         Position = new Point(0x1b, 0x233),
         Size = new Size(0x3a7, 0x40),
         Text = SK.Text("ViewAllCardsPanel_Cancel", "Click on a Card Circle to cancel that card."),
         Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT,
         Font = FontManager.GetFont("Arial", 14f, FontStyle.Regular),
         Color = ARGBColors.White
     };
     this.mainBackgroundImage.addControl(label);
     this.mainBackgroundImage.invalidate();
 }
Esempio n. 4
0
        public void init()
        {
            this.thirdAge = GameEngine.Instance.World.ThirdAgeWorld;
            int num = 100;
            int num2 = 0x3e8;
            int num3 = 0x2710;
            int num4 = 0x186a0;
            int aiWorldGloryWinLevel = 0xf4240;
            if (GameEngine.Instance.LocalWorldData.AIWorld)
            {
                num = 0x3e8;
                num2 = 0x2710;
                num3 = 0x186a0;
                num4 = 0xf4240;
                aiWorldGloryWinLevel = GameEngine.Instance.World.aiWorldGloryWinLevel;
            }
            else if (GameEngine.Instance.LocalWorldData.Alternate_Ruleset == 1)
            {
                num = 0x3e8;
                num2 = 0x2710;
                num3 = 0x186a0;
                num4 = 0xf4240;
                aiWorldGloryWinLevel = 0x2faf080;
            }
            else if (this.thirdAge)
            {
                num = 0x3e8;
                num2 = 0x2710;
                num3 = 0x186a0;
                num4 = 0xf4240;
                aiWorldGloryWinLevel = 0x3d0900;
            }
            if (GameEngine.Instance.World.testGloryPointsUpdate())
            {
                RemoteServices.Instance.set_GetHouseGloryPoints_UserCallBack(new RemoteServices.GetHouseGloryPoints_UserCallBack(this.GetHouseGloryPointsCallBack));
                RemoteServices.Instance.GetHouseGloryPoints();
            }
            int num6 = 0;
            int num7 = 0;
            for (int i = 0; i < 20; i++)
            {
                if (!GameEngine.Instance.World.HouseInfo[i + 1].loser)
                {
                    this.lastHousePoints[i, 0] = GameEngine.Instance.World.HouseGloryPoints[i + 1];
                    if (this.lastHousePoints[i, 0] > num6)
                    {
                        num6 = this.lastHousePoints[i, 0];
                    }
                }
                else
                {
                    this.lastHousePoints[i, 0] = -1;
                    num7++;
                }
                this.lastHousePoints[i, 1] = i;
            }
            for (int j = 0; j < 0x13; j++)
            {
                for (int n = 0; n < 0x13; n++)
                {
                    if (this.lastHousePoints[n, 0] < this.lastHousePoints[n + 1, 0])
                    {
                        int num11 = this.lastHousePoints[n, 0];
                        this.lastHousePoints[n, 0] = this.lastHousePoints[n + 1, 0];
                        this.lastHousePoints[n + 1, 0] = num11;
                        num11 = this.lastHousePoints[n, 1];
                        this.lastHousePoints[n, 1] = this.lastHousePoints[n + 1, 1];
                        this.lastHousePoints[n + 1, 1] = num11;
                    }
                }
            }
            base.clearControls();
            this.mainBackgroundImage.Image = (Image) GFXLibrary.glory_background;
            this.mainBackgroundImage.Width = 0x640;
            this.mainBackgroundImage.Height = 0x400;
            int width = base.Width;
            int height = base.Height;
            this.mainBackgroundImage.Position = new Point((width - 0x640) / 2, -(0x400 - height));
            base.addControl(this.mainBackgroundImage);
            this.viewableArea.Position = new Point((0x640 - width) / 2, 0x400 - height);
            this.viewableArea.Size = new Size(base.Size.Width, base.Size.Height - 50);
            this.mainBackgroundImage.addControl(this.viewableArea);
            int y = 0x19;
            height -= 50;
            CustomSelfDrawPanel.WikiLinkControl.init(this.viewableArea, 0x16, new Point(base.Width - 0x26, 0x1a));
            if ((GameEngine.Instance.World.HouseGloryRoundData != null) && (GameEngine.Instance.World.HouseGloryRoundData.winnerHouseID > 0))
            {
                this.gloryWinnerButton.Position = new Point(((this.viewableArea.Width - 200) - 15) - 30, y);
                this.gloryWinnerButton.Size = new Size(200, 0x26);
                this.gloryWinnerButton.Text.Text = SK.Text("TEMP_ViewWinner", "Last Glory Round Result");
                this.gloryWinnerButton.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
                if (Program.mySettings.LanguageIdent == "it")
                {
                    this.gloryWinnerButton.Text.Font = FontManager.GetFont("Arial", 8f, FontStyle.Bold);
                }
                else
                {
                    this.gloryWinnerButton.Text.Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold);
                }
                this.gloryWinnerButton.TextYOffset = -1;
                this.gloryWinnerButton.Text.Color = ARGBColors.Black;
                this.gloryWinnerButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.gloryWinnerClick), "Glory_view_result");
                this.viewableArea.addControl(this.gloryWinnerButton);
                this.gloryWinnerButton.setNormalExtImage((Image) GFXLibrary.int_buttonbar_left_normal, (Image) GFXLibrary.int_buttonbar_middle_normal, (Image) GFXLibrary.int_buttonbar_right_normal);
                this.gloryWinnerButton.setOverExtImage((Image) GFXLibrary.int_buttonbar_left_over, (Image) GFXLibrary.int_buttonbar_middle_over, (Image) GFXLibrary.int_buttonbar_right_over);
            }
            if (num6 >= aiWorldGloryWinLevel)
            {
                DateTime time = VillageMap.getCurrentServerTime();
                DateTime time2 = new DateTime(time.Year, time.Month, time.Day, 8, 0, 0);
                if (time > time2)
                {
                    time2 = time2.AddDays(1.0);
                }
                TimeSpan span = (TimeSpan) (time2 - time);
                int totalHours = (int) span.TotalHours;
                string str = SK.Text("GloryPanel_EndingSoon", "Glory Round Ending Soon");
                if (totalHours > 1)
                {
                    string str2 = str;
                    str = (str2 + " ( " + SK.Text("GloryPanel_Approximately", "Approximately") + " : " + totalHours.ToString() + " ") + SK.Text("Reports_Hours", "hours") + " )";
                }
                this.gloryRoundEnding.Text = str;
                this.gloryRoundEnding.Color = ARGBColors.White;
                this.gloryRoundEnding.DropShadowColor = ARGBColors.Black;
                this.gloryRoundEnding.Position = new Point(100, 2);
                this.gloryRoundEnding.Size = new Size(700, 20);
                this.gloryRoundEnding.Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold);
                this.gloryRoundEnding.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.BOTTOM_LEFT;
                this.viewableArea.addControl(this.gloryRoundEnding);
            }
            this.scaleVertLine.Position = new Point(0x41, y);
            this.scaleVertLine.Size = new Size(0, height - y);
            this.scaleVertLine.LineColor = ARGBColors.Black;
            this.viewableArea.addControl(this.scaleVertLine);
            this.scaleMark0LineS.Position = new Point(0x3b, height - 1);
            this.scaleMark0LineS.Size = new Size(6, 0);
            this.scaleMark0LineS.LineColor = ARGBColors.Black;
            this.viewableArea.addControl(this.scaleMark0LineS);
            int num16 = ((height - y) * this.markPositionPercents[1]) / 100;
            this.scaleMark100Line.Position = new Point(0x3b, height - num16);
            this.scaleMark100Line.Size = new Size(6, 0);
            this.scaleMark100Line.LineColor = ARGBColors.Black;
            this.viewableArea.addControl(this.scaleMark100Line);
            num16 = ((height - y) * (this.markPositionPercents[1] + this.markPositionPercents[2])) / 100;
            this.scaleMark1000Line.Position = new Point(0x3b, height - num16);
            this.scaleMark1000Line.Size = new Size(6, 0);
            this.scaleMark1000Line.LineColor = ARGBColors.Black;
            this.viewableArea.addControl(this.scaleMark1000Line);
            num16 = ((height - y) * ((this.markPositionPercents[1] + this.markPositionPercents[2]) + this.markPositionPercents[3])) / 100;
            this.scaleMark10000Line.Position = new Point(0x3b, height - num16);
            this.scaleMark10000Line.Size = new Size(6, 0);
            this.scaleMark10000Line.LineColor = ARGBColors.Black;
            this.viewableArea.addControl(this.scaleMark10000Line);
            num16 = ((height - y) * (((this.markPositionPercents[1] + this.markPositionPercents[2]) + this.markPositionPercents[3]) + this.markPositionPercents[4])) / 100;
            this.scaleMark100000Line.Position = new Point(0x3b, height - num16);
            this.scaleMark100000Line.Size = new Size(6, 0);
            this.scaleMark100000Line.LineColor = ARGBColors.Black;
            this.viewableArea.addControl(this.scaleMark100000Line);
            num16 = height - y;
            this.scaleMark1000000Line.Position = new Point(0x3b, height - num16);
            this.scaleMark1000000Line.Size = new Size(6, 0);
            this.scaleMark1000000Line.LineColor = ARGBColors.Black;
            this.viewableArea.addControl(this.scaleMark1000000Line);
            this.scaleVertLineS.Position = new Point(0x40, y - 1);
            this.scaleVertLineS.Size = new Size(0, height - y);
            this.scaleVertLineS.LineColor = ARGBColors.White;
            this.viewableArea.addControl(this.scaleVertLineS);
            this.topLineS.Position = new Point(0x42, y - 1);
            this.topLineS.Size = new Size((base.Width - 0x41) - 1, 0);
            this.topLineS.LineColor = ARGBColors.Yellow;
            this.viewableArea.addControl(this.topLineS);
            this.bottomLineS.Position = new Point(0x42, height - 1);
            this.bottomLineS.Size = new Size((base.Width - 0x41) - 1, 0);
            this.bottomLineS.LineColor = ARGBColors.Yellow;
            this.viewableArea.addControl(this.bottomLineS);
            this.scaleMark0Line.Position = new Point(0x3a, (height - 1) - 1);
            this.scaleMark0Line.Size = new Size(6, 0);
            this.scaleMark0Line.LineColor = ARGBColors.White;
            this.viewableArea.addControl(this.scaleMark0Line);
            this.bandYPos0 = height;
            this.mark0Label.Text = "0";
            this.mark0Label.Color = ARGBColors.White;
            this.mark0Label.DropShadowColor = ARGBColors.Black;
            this.mark0Label.Position = new Point(0, (height - 20) + 2);
            this.mark0Label.Size = new Size(0x3b, 20);
            this.mark0Label.Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold);
            this.mark0Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.BOTTOM_RIGHT;
            this.viewableArea.addControl(this.mark0Label);
            num16 = ((height - y) * this.markPositionPercents[1]) / 100;
            this.bandYPos100 = this.bandYPos0 - num16;
            this.scaleMark100LineS.Position = new Point(0x3a, (height - num16) - 1);
            this.scaleMark100LineS.Size = new Size(6, 0);
            this.scaleMark100LineS.LineColor = ARGBColors.White;
            this.viewableArea.addControl(this.scaleMark100LineS);
            this.mark100Label.Text = num.ToString();
            this.mark100Label.Color = ARGBColors.White;
            this.mark100Label.DropShadowColor = ARGBColors.Black;
            this.mark100Label.Position = new Point(0, (height - num16) - 9);
            this.mark100Label.Size = new Size(0x3b, 20);
            this.mark100Label.Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold);
            this.mark100Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.BOTTOM_RIGHT;
            this.viewableArea.addControl(this.mark100Label);
            num16 = ((height - y) * (this.markPositionPercents[1] + this.markPositionPercents[2])) / 100;
            this.bandYPos1000 = this.bandYPos0 - num16;
            this.scaleMark1000LineS.Position = new Point(0x3a, (height - num16) - 1);
            this.scaleMark1000LineS.Size = new Size(6, 0);
            this.scaleMark1000LineS.LineColor = ARGBColors.White;
            this.viewableArea.addControl(this.scaleMark1000LineS);
            this.mark1000Label.Text = num2.ToString();
            this.mark1000Label.Color = ARGBColors.White;
            this.mark1000Label.DropShadowColor = ARGBColors.Black;
            this.mark1000Label.Position = new Point(0, (height - num16) - 9);
            this.mark1000Label.Size = new Size(0x3b, 20);
            this.mark1000Label.Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold);
            this.mark1000Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.BOTTOM_RIGHT;
            this.viewableArea.addControl(this.mark1000Label);
            num16 = ((height - y) * ((this.markPositionPercents[1] + this.markPositionPercents[2]) + this.markPositionPercents[3])) / 100;
            this.bandYPos10000 = this.bandYPos0 - num16;
            this.scaleMark10000LineS.Position = new Point(0x3a, (height - num16) - 1);
            this.scaleMark10000LineS.Size = new Size(6, 0);
            this.scaleMark10000LineS.LineColor = ARGBColors.White;
            this.viewableArea.addControl(this.scaleMark10000LineS);
            this.mark10000Label.Text = num3.ToString();
            this.mark10000Label.Color = ARGBColors.White;
            this.mark10000Label.DropShadowColor = ARGBColors.Black;
            this.mark10000Label.Position = new Point(0, (height - num16) - 9);
            this.mark10000Label.Size = new Size(0x3b, 20);
            this.mark10000Label.Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold);
            this.mark10000Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.BOTTOM_RIGHT;
            this.viewableArea.addControl(this.mark10000Label);
            num16 = ((height - y) * (((this.markPositionPercents[1] + this.markPositionPercents[2]) + this.markPositionPercents[3]) + this.markPositionPercents[4])) / 100;
            this.bandYPos100000 = this.bandYPos0 - num16;
            this.scaleMark100000LineS.Position = new Point(0x3a, (height - num16) - 1);
            this.scaleMark100000LineS.Size = new Size(6, 0);
            this.scaleMark100000LineS.LineColor = ARGBColors.White;
            this.viewableArea.addControl(this.scaleMark100000LineS);
            this.mark100000Label.Text = num4.ToString();
            this.mark100000Label.Color = ARGBColors.White;
            this.mark100000Label.DropShadowColor = ARGBColors.Black;
            this.mark100000Label.Position = new Point(0, (height - num16) - 9);
            this.mark100000Label.Size = new Size(0x3b, 20);
            this.mark100000Label.Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold);
            this.mark100000Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.BOTTOM_RIGHT;
            this.viewableArea.addControl(this.mark100000Label);
            num16 = height - y;
            this.bandYPos1000000 = this.bandYPos0 - num16;
            this.scaleMark1000000LineS.Position = new Point(0x3a, (height - num16) - 1);
            this.scaleMark1000000LineS.Size = new Size(6, 0);
            this.scaleMark1000000LineS.LineColor = ARGBColors.White;
            this.viewableArea.addControl(this.scaleMark1000000LineS);
            this.mark1000000Label.Text = aiWorldGloryWinLevel.ToString();
            this.mark1000000Label.Color = ARGBColors.White;
            this.mark1000000Label.DropShadowColor = ARGBColors.Black;
            if (aiWorldGloryWinLevel >= 0x989680)
            {
                this.mark1000000Label.Position = new Point(-11, (height - num16) - 9);
                this.mark1000000Label.Size = new Size(0x45, 20);
            }
            else
            {
                this.mark1000000Label.Position = new Point(0, (height - num16) - 9);
                this.mark1000000Label.Size = new Size(0x3b, 20);
            }
            this.mark1000000Label.Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold);
            this.mark1000000Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.BOTTOM_RIGHT;
            this.viewableArea.addControl(this.mark1000000Label);
            int num17 = ((base.Width - 0x41) - 5) - 5;
            num17 += num7 * 0x2d;
            this.makeSizes();
            int index = 14;
            for (int k = 0; k < 15; k++)
            {
                if (num17 < this.filledBands[k][20])
                {
                    index = k - 1;
                    break;
                }
            }
            int x = 70;
            int num21 = num7 / 2;
            int num22 = 20 - (num7 - num21);
            for (int m = num21; m < num22; m++)
            {
                int num24 = this.lastHousePoints[this.readOrder[m], 1] + 1;
                int num25 = this.lastHousePoints[this.readOrder[m], 0];
                int num26 = num25;
                int num27 = 0;
                if (num25 < num)
                {
                    num27 = this.bandYPos0;
                    num25 *= this.bandYPos0 - this.bandYPos100;
                    num25 /= num;
                    num27 -= num25;
                }
                else if (num25 < num2)
                {
                    num27 = this.bandYPos100;
                    num25 -= num;
                    num25 *= this.bandYPos100 - this.bandYPos1000;
                    num25 /= num2 - num;
                    num27 -= num25;
                }
                else if (num25 < num3)
                {
                    num27 = this.bandYPos1000;
                    num25 -= num2;
                    num25 *= this.bandYPos1000 - this.bandYPos10000;
                    num25 /= num3 - num2;
                    num27 -= num25;
                }
                else if (num25 < num4)
                {
                    num27 = this.bandYPos10000;
                    num25 -= num3;
                    num25 *= this.bandYPos10000 - this.bandYPos100000;
                    num25 /= num4 - num3;
                    num27 -= num25;
                }
                else if (num25 < aiWorldGloryWinLevel)
                {
                    num27 = this.bandYPos100000;
                    num25 -= num4;
                    num25 *= this.bandYPos100000 - this.bandYPos1000000;
                    num25 /= aiWorldGloryWinLevel - num4;
                    num27 -= num25;
                }
                else
                {
                    num27 = this.bandYPos1000000;
                }
                int num28 = this.filledBands[index][this.readOrder[m]];
                CustomSelfDrawPanel.CSDImage control = this.getFlagImage(m);
                control.Position = new Point(x, num27);
                CustomSelfDrawPanel.CSDImage image2 = this.getFlagpoleImage(m);
                int numVictories = GameEngine.Instance.World.HouseInfo[num24].numVictories;
                int num30 = numVictories;
                if (numVictories > 5)
                {
                    numVictories = 5;
                }
                BaseImage image3 = null;
                int num31 = 0;
                int num32 = 0;
                int num33 = 0;
                int num34 = x;
                switch (num28)
                {
                    case 0:
                        image2.Position = new Point((x + 11) + 1, num27 + 500);
                        x += 0x2d;
                        control.Image = (Image) GFXLibrary.glory_flags_small[num24 - 1];
                        image2.Image = (Image) GFXLibrary.glory_thin_pole;
                        image3 = GFXLibrary.glory_star_small;
                        num31 = 14;
                        num32 = 9;
                        num33 = 4;
                        break;

                    case 1:
                        image2.Position = new Point(x + 0x13, num27 + 500);
                        x += 60;
                        control.Image = (Image) GFXLibrary.glory_flags_med[num24 - 1];
                        image2.Image = (Image) GFXLibrary.glory_thin_pole;
                        image3 = GFXLibrary.glory_star_small;
                        num31 = 20;
                        num32 = 12;
                        num33 = 4;
                        break;

                    case 2:
                        image2.Position = new Point((x + 30) - 5, num27 + 500);
                        x += 90;
                        control.Image = (Image) GFXLibrary.glory_flags_large[num24 - 1];
                        image2.Image = (Image) GFXLibrary.glory_thick_pole;
                        image3 = GFXLibrary.glory_star_large;
                        num31 = 0x1d;
                        num32 = 0x10;
                        num33 = 7;
                        break;

                    case 3:
                        image2.Position = new Point((x + 40) - 6, num27 + 500);
                        x += 110;
                        control.Image = (Image) GFXLibrary.glory_flags_largest[num24 - 1];
                        image2.Image = (Image) GFXLibrary.glory_thick_pole;
                        image3 = GFXLibrary.glory_star_large;
                        num31 = 0x27;
                        num32 = 20;
                        num33 = 7;
                        break;
                }
                control.CustomTooltipID = (0x6a4 + num24) - 1;
                control.CustomTooltipData = num26;
                control.Data = num24;
                control.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.viewHouse), "GloryPanel_view_house");
                this.viewableArea.addControl(image2);
                this.viewableArea.addControl(control);
                for (int num35 = 0; num35 < numVictories; num35++)
                {
                    CustomSelfDrawPanel.CSDImage image4 = this.getStar(num24 - 1, num35);
                    image4.Image = (Image) image3;
                    image4.Position = new Point((num34 + num31) + (this.starSteps[num35] * num32), num27 - num33);
                    this.viewableArea.addControl(image4);
                    CustomSelfDrawPanel.CSDImage image5 = image4;
                    int num36 = 5;
                    for (int num37 = 5; num36 < 100; num37 *= -1)
                    {
                        if (((num35 + num36) + 1) <= num30)
                        {
                            CustomSelfDrawPanel.CSDImage image6 = new CustomSelfDrawPanel.CSDImage {
                                Image = (Image) image3,
                                Position = new Point(num37, -8)
                            };
                            image5.addControl(image6);
                            image5 = image6;
                        }
                        num36 += 5;
                    }
                }
            }
            base.Invalidate();
        }
 public void init()
 {
     base.clearControls();
     this.backImage = this.backGround.init(true, 0x2710);
     base.addControl(this.backGround);
     this.tradeButton.ImageNorm = (Image) GFXLibrary.mrhp_world_icons_rhs_array[0];
     this.tradeButton.ImageOver = (Image) GFXLibrary.mrhp_world_icons_rhs_array[7];
     this.tradeButton.ImageClick = (Image) GFXLibrary.mrhp_world_icons_rhs_array[14];
     this.tradeButton.Position = new Point(10, 0x8e);
     this.tradeButton.CustomTooltipID = 0x96a;
     this.tradeButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.sendResources), "OtherVillagePanel2_trade");
     this.backImage.addControl(this.tradeButton);
     this.attackButton.ImageNorm = (Image) GFXLibrary.mrhp_world_icons_rhs_array[1];
     this.attackButton.ImageOver = (Image) GFXLibrary.mrhp_world_icons_rhs_array[8];
     this.attackButton.ImageClick = (Image) GFXLibrary.mrhp_world_icons_rhs_array[15];
     this.attackButton.Position = new Point(0x2d, 0x8e);
     this.attackButton.CustomTooltipID = 0x96b;
     this.attackButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.sendTroops), "OtherVillagePanel2_attack");
     this.backImage.addControl(this.attackButton);
     this.scoutButton.ImageNorm = (Image) GFXLibrary.mrhp_world_icons_rhs_array[3];
     this.scoutButton.ImageOver = (Image) GFXLibrary.mrhp_world_icons_rhs_array[10];
     this.scoutButton.ImageClick = (Image) GFXLibrary.mrhp_world_icons_rhs_array[0x11];
     this.scoutButton.Position = new Point(80, 0x8e);
     this.scoutButton.CustomTooltipID = 0x96c;
     this.scoutButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.sendScouts), "OtherVillagePanel2_scout");
     this.backImage.addControl(this.scoutButton);
     this.reinforceButton.ImageNorm = (Image) GFXLibrary.mrhp_world_icons_rhs_array[2];
     this.reinforceButton.ImageOver = (Image) GFXLibrary.mrhp_world_icons_rhs_array[9];
     this.reinforceButton.ImageClick = (Image) GFXLibrary.mrhp_world_icons_rhs_array[0x10];
     this.reinforceButton.Position = new Point(0x73, 0x8e);
     this.reinforceButton.CustomTooltipID = 0x96d;
     this.reinforceButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.sendReinforcements), "OtherVillagePanel2_reinforce");
     this.backImage.addControl(this.reinforceButton);
     this.monkButton.ImageNorm = (Image) GFXLibrary.mrhp_world_icons_rhs_array[4];
     this.monkButton.ImageOver = (Image) GFXLibrary.mrhp_world_icons_rhs_array[11];
     this.monkButton.ImageClick = (Image) GFXLibrary.mrhp_world_icons_rhs_array[0x12];
     this.monkButton.Position = new Point(150, 0x8e);
     this.monkButton.CustomTooltipID = 0x96e;
     this.monkButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.sendMonks), "OtherVillagePanel2_sendmonks");
     this.backImage.addControl(this.monkButton);
     this.vassalButton.ImageNorm = (Image) GFXLibrary.mrhp_world_icons_rhs_array[5];
     this.vassalButton.ImageOver = (Image) GFXLibrary.mrhp_world_icons_rhs_array[12];
     this.vassalButton.ImageClick = (Image) GFXLibrary.mrhp_world_icons_rhs_array[0x13];
     this.vassalButton.Position = new Point(0x73, 0x70);
     this.vassalButton.CustomTooltipID = 0x98e;
     this.vassalButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.vassalClick), "OtherVillagePanel2_make_vassal");
     this.backImage.addControl(this.vassalButton);
     this.castleButton.ImageNorm = (Image) GFXLibrary.mrhp_reports;
     this.castleButton.OverBrighten = true;
     this.castleButton.MoveOnClick = true;
     this.castleButton.Position = new Point(0x40, 0x70);
     this.castleButton.CustomTooltipID = 0x98d;
     this.castleButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.castleClick), "OtherVillagePanel2_view_castle");
     this.backImage.addControl(this.castleButton);
     if (RemoteServices.Instance.Admin || RemoteServices.Instance.Moderator)
     {
         this.renameButton.ImageNorm = (Image) GFXLibrary.faction_pen;
         this.renameButton.OverBrighten = true;
         this.renameButton.MoveOnClick = true;
         this.renameButton.Position = new Point(0x8b, 0x39);
         this.renameButton.CustomTooltipID = 0x2896;
         this.renameButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.resetNameClick));
         this.backImage.addControl(this.renameButton);
     }
     this.lblProtectionType.Text = "";
     this.lblProtectionType.Color = ARGBColors.Black;
     this.lblProtectionType.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.lblProtectionType.Position = new Point(0, 0x26);
     this.lblProtectionType.Size = new Size(this.backImage.Width, 0x17);
     this.lblProtectionType.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     this.backImage.addControl(this.lblProtectionType);
     this.lblProtected.Text = "";
     this.lblProtected.Color = ARGBColors.Black;
     this.lblProtected.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.lblProtected.Position = new Point(6, 0x30);
     this.lblProtected.Size = new Size(this.backImage.Width - 12, 0x4a);
     this.lblProtected.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     this.backImage.addControl(this.lblProtected);
     this.leftButton.ImageNorm = (Image) GFXLibrary.r_arrow_small_left_norm;
     this.leftButton.ImageOver = (Image) GFXLibrary.r_arrow_small_left_over;
     this.leftButton.Position = new Point(5, 50);
     this.leftButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.infoLeft), "OtherVillagePanel2_protection_left");
     this.leftButton.Visible = false;
     this.backImage.addControl(this.leftButton);
     this.rightButton.ImageNorm = (Image) GFXLibrary.r_arrow_small_right_norm;
     this.rightButton.ImageOver = (Image) GFXLibrary.r_arrow_small_right_over;
     this.rightButton.Position = new Point(170, 50);
     this.rightButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.infoRight), "OtherVillagePanel2_protection_right");
     this.rightButton.Visible = false;
     this.backImage.addControl(this.rightButton);
     this.updateSize();
     this.numInfos = 0;
     this.selectedProtection = 0;
 }
 public void init(int cardSection)
 {
     CustomSelfDrawPanel.CSDImage image2;
     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;
     CustomSelfDrawPanel.CSDExtendingPanel control = new CustomSelfDrawPanel.CSDExtendingPanel {
         Size = base.Size,
         Position = new Point(0, 0)
     };
     this.mainBackgroundImage.addControl(control);
     control.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)
     };
     control.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((control.Width - ((Image) GFXLibrary.cardpanel_panel_gradient_bottom_right).Width) - 6, (control.Height - ((Image) GFXLibrary.cardpanel_panel_gradient_bottom_right).Height) - 6)
     };
     control.addControl(image2);
     this.AvailablePanel = new CustomSelfDrawPanel.CSDExtendingPanel();
     this.AvailablePanel.Size = new Size(this.AvailablePanelWidth, 550);
     this.AvailablePanel.Position = new Point(8, (base.Height - 8) - 550);
     this.AvailablePanel.Alpha = 0.8f;
     int width = base.Width;
     int borderPadding = BorderPadding;
     int num9 = 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));
     this.closeImage.Position = new Point((base.Width - 14) - 0x11, 10);
     this.mainBackgroundImage.addControl(this.closeImage);
     CustomSelfDrawPanel.WikiLinkControl.init(this.mainBackgroundImage, 0x26, 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.greyout.FillColor = Color.FromArgb(0xd7, 0x19, 0x19, 0x19);
     this.greyout.Size = new Size(this.mainBackgroundImage.Width, this.AvailablePanel.Y + this.AvailablePanel.Height);
     this.greyout.Position = new Point(0, 0);
     this.greyout.setClickDelegate(delegate {
     });
     CustomSelfDrawPanel.CSDImage closeGrey = new CustomSelfDrawPanel.CSDImage {
         Image = (Image) GFXLibrary.cardpanel_button_close_normal,
         Size = this.closeImage.Image.Size
     };
     closeGrey.setMouseOverDelegate(() => closeGrey.Image = (Image) GFXLibrary.cardpanel_button_close_over, () => closeGrey.Image = (Image) GFXLibrary.cardpanel_button_close_normal);
     closeGrey.Position = new Point((base.Width - 14) - 0x11, 10);
     this.greyout.addControl(closeGrey);
     this.labelTitle.Position = new Point(0x1b, 8);
     this.labelTitle.Size = new Size(0x3a7, 0x40);
     this.labelTitle.Text = SK.Text("BuyCrownsPanel_Buy_Crowns", "Buy Crowns");
     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);
     CustomSelfDrawPanel.UICardsButtons buttons = new CustomSelfDrawPanel.UICardsButtons((PlayCardsWindow) base.ParentForm) {
         Position = new Point(0x328, 0x25)
     };
     this.mainBackgroundImage.addControl(buttons);
     this.cardButtons = buttons;
     List<ProductInfo> productList = new List<ProductInfo>();
     if (Program.steamActive)
     {
         this.PlayerCountry = "UK";
         this.PlayerCurrency = "GBP";
         this.PlayerLanguage = MySettings.load().LanguageIdent;
         XmlRpcAuthProvider provider = XmlRpcAuthProvider.CreateForEndpoint(URLs.ProfileProtocol, URLs.ProfileServerAddressLogin, URLs.ProfileServerPort, URLs.ProfilePath);
         XmlRpcAuthRequest req = new XmlRpcAuthRequest(RemoteServices.Instance.UserGuid.ToString().Replace("-", ""), "", "", "", null, null, null, null) {
             SteamID = Program.steamID,
             SessionID = RemoteServices.Instance.SessionGuid.ToString().Replace("-", ""),
             Culture = this.PlayerLanguage,
             Currency = this.PlayerCurrency,
             Country = this.PlayerCountry
         };
         productList = provider.SteamGetProductList(req, null, this, 0x3a98).ProductList;
     }
     else if (Program.aeriaInstall)
     {
         XmlRpcAuthProvider provider2 = XmlRpcAuthProvider.CreateForEndpoint(URLs.ProfileProtocol, URLs.ProfileServerAddressLogin, URLs.ProfileServerPort, URLs.ProfilePath);
         XmlRpcAuthRequest request2 = new XmlRpcAuthRequest(RemoteServices.Instance.UserGuid.ToString().Replace("-", ""), "", "", "", null, null, null, null);
         XmlRpcAuthResponse response = null;
         this.storedAeriaPoints = provider2.AeriaGetBalance(request2, null, this, 0x3a98, ref response);
         productList = response.ProductList;
         this.buyAPButton.ImageNorm = (Image) GFXLibrary.misc_button_blue_210wide_normal;
         this.buyAPButton.ImageOver = (Image) GFXLibrary.misc_button_blue_210wide_over;
         this.buyAPButton.ImageClick = (Image) GFXLibrary.misc_button_blue_210wide_pushed;
         this.buyAPButton.Position = new Point(0x13d, 0x49);
         this.buyAPButton.Text.Text = this.storedAeriaPoints.ToString();
         this.buyAPButton.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_RIGHT;
         this.buyAPButton.Text.Size = new Size((this.buyAPButton.Width / 2) - 3, this.buyAPButton.Height);
         this.buyAPButton.TextYOffset = -2;
         this.buyAPButton.Text.Color = ARGBColors.Black;
         this.buyAPButton.ImageIcon = (Image) GFXLibrary.aeriaPoints;
         this.buyAPButton.ImageIconPosition = new Point((this.buyAPButton.Width / 2) + 3, 1);
         this.buyAPButton.Text.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
         this.buyAPButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.purchaseAP));
         this.buyAPButton.CustomTooltipID = 0x286e;
         this.mainBackgroundImage.addControl(this.buyAPButton);
     }
     int y = 0x42;
     int num2 = 0x5e;
     int num3 = -1;
     if (Program.aeriaInstall)
     {
         y = 0x84;
     }
     NumberFormatInfo nFI = GameEngine.NFI;
     NumberFormatInfo info2 = GameEngine.NFI_D2;
     foreach (ProductInfo info3 in productList)
     {
         num3++;
         int x = num2;
         if (Program.steamActive)
         {
             if (num3 > 3)
             {
                 if (num3 == 4)
                 {
                     y = 0x84;
                 }
                 x += 350;
             }
         }
         else if (Program.aeriaInstall && (num3 > 2))
         {
             if (num3 == 3)
             {
                 y = 0x84;
             }
             x += 350;
         }
         CustomSelfDrawPanel.CSDLabel label = new CustomSelfDrawPanel.CSDLabel();
         CustomSelfDrawPanel.CSDLabel label2 = new CustomSelfDrawPanel.CSDLabel();
         CustomSelfDrawPanel.CSDLabel label3 = new CustomSelfDrawPanel.CSDLabel();
         CustomSelfDrawPanel.CSDLabel label4 = new CustomSelfDrawPanel.CSDLabel();
         CustomSelfDrawPanel.CSDLabel label5 = new CustomSelfDrawPanel.CSDLabel();
         CustomSelfDrawPanel.CSDImage image3 = new CustomSelfDrawPanel.CSDImage();
         CustomSelfDrawPanel.CSDImage crownsbutton = new CustomSelfDrawPanel.CSDImage();
         CustomSelfDrawPanel.CSDImage orderbutton = new CustomSelfDrawPanel.CSDImage();
         crownsbutton.Image = (Image) GFXLibrary.cardpanel_payment_button_crowns_normal;
         crownsbutton.Position = new Point(x, y);
         crownsbutton.Height = crownsbutton.Image.Height;
         crownsbutton.Width = crownsbutton.Image.Width;
         crownsbutton.setMouseOverDelegate(() => crownsbutton.Image = (Image) GFXLibrary.cardpanel_payment_button_crowns_over, () => crownsbutton.Image = (Image) GFXLibrary.cardpanel_payment_button_crowns_normal);
         crownsbutton.Tag = info3;
         crownsbutton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.productclick));
         this.mainBackgroundImage.addControl(crownsbutton);
         x += crownsbutton.Width + 0x20;
         orderbutton.Image = (Image) GFXLibrary.cardpanel_payment_button_greywhite_normal;
         orderbutton.Position = new Point(x, (y + 0x12) + 3);
         orderbutton.Height = orderbutton.Image.Height;
         orderbutton.Width = orderbutton.Image.Width;
         orderbutton.setMouseOverDelegate(() => orderbutton.Image = (Image) GFXLibrary.cardpanel_payment_button_greywhite_over, () => orderbutton.Image = (Image) GFXLibrary.cardpanel_payment_button_greywhite_normal);
         orderbutton.Tag = info3;
         orderbutton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.productclick));
         label5.Text = this.strOrderNow;
         label5.Position = new Point(0, 0);
         label5.Width = orderbutton.Width;
         label5.Height = orderbutton.Height;
         label5.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
         label5.Font = FontManager.GetFont("Arial", 14f, FontStyle.Bold);
         orderbutton.addControl(label5);
         label5.Tag = info3;
         label5.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.productclick));
         int num5 = 14;
         int num6 = 0;
         if (Program.mySettings.LanguageIdent == "fr")
         {
             num5 = 13;
             num6 = -5;
         }
         label.Text = info3.Strikethrough.ToString();
         label.Position = new Point(0x74 + num6, 0x15);
         label.Width = 300;
         label.Height = 0x18;
         label.Font = FontManager.GetFont("Arial", (float) num5, FontStyle.Strikeout);
         label.Color = ARGBColors.Black;
         crownsbutton.addControl(label);
         label.Tag = info3;
         label.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.productclick));
         label.Size = label.TextSizeX;
         label2.Text = info3.Crowns.ToString();
         label2.Position = new Point(label.X + label.Width, label.Y);
         label2.Font = FontManager.GetFont("Arial", (float) num5, FontStyle.Bold);
         label2.Color = ARGBColors.Purple;
         label2.Width = 300;
         label2.Height = 0x18;
         crownsbutton.addControl(label2);
         label2.Tag = info3;
         label2.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.productclick));
         label2.Size = label2.TextSizeX;
         label3.Text = this.strCrowns;
         label3.Position = new Point((label2.X + label2.Width) + num6, label2.Y);
         label3.Font = FontManager.GetFont("Arial", (float) num5, FontStyle.Bold);
         label3.Color = ARGBColors.Black;
         label3.Size = new Size(300, 0x18);
         crownsbutton.addControl(label3);
         label3.Tag = info3;
         label3.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.productclick));
         label3.Size = label3.TextSizeX;
         if (Program.aeriaInstall)
         {
             label4.Text = " " + ((int) info3.Cost).ToString("F", nFI);
         }
         else
         {
             label4.Text = info3.Currency + " " + info3.Cost.ToString("F", info2);
         }
         label4.Position = new Point(label.X, (label.Y + label.Height) + 4);
         label4.Font = FontManager.GetFont("Arial", 14f, FontStyle.Bold);
         label4.Color = ARGBColors.Black;
         label4.Size = new Size(300, 0x18);
         crownsbutton.addControl(label4);
         label4.Tag = info3;
         label4.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.productclick));
         label4.Size = label4.TextSizeX;
         if (Program.aeriaInstall)
         {
             image3.Image = (Image) GFXLibrary.aeriaPoints;
             label4.Position = new Point(label.X + 20, label.Y + label.Height);
             image3.Position = new Point(label.X, (((label.Y + label.Height) + 4) - 2) - 3);
             image3.Tag = info3;
             crownsbutton.addControl(image3);
         }
         y += crownsbutton.Height + 40;
     }
     this.mainBackgroundImage.invalidate();
 }
 public void init()
 {
     base.clearControls();
     this.backImage = this.backGround.init(true, 0x2710);
     base.addControl(this.backGround);
     this.tradeButton.ImageNorm = (Image) GFXLibrary.mrhp_world_icons_rhs_array[0];
     this.tradeButton.ImageOver = (Image) GFXLibrary.mrhp_world_icons_rhs_array[7];
     this.tradeButton.ImageClick = (Image) GFXLibrary.mrhp_world_icons_rhs_array[14];
     this.tradeButton.Position = new Point(10, 0x8e);
     this.tradeButton.CustomTooltipID = 0x97f;
     this.tradeButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.sendResources), "OwnVillagePanel2_trade");
     this.backImage.addControl(this.tradeButton);
     this.attackButton.ImageNorm = (Image) GFXLibrary.mrhp_world_icons_rhs_array[1];
     this.attackButton.ImageOver = (Image) GFXLibrary.mrhp_world_icons_rhs_array[8];
     this.attackButton.ImageClick = (Image) GFXLibrary.mrhp_world_icons_rhs_array[15];
     this.attackButton.Position = new Point(0x2d, 0x8e);
     this.attackButton.CustomTooltipID = 0x980;
     this.attackButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.sendTroops), "OwnVillagePanel2_attack");
     this.backImage.addControl(this.attackButton);
     this.scoutButton.ImageNorm = (Image) GFXLibrary.mrhp_world_icons_rhs_array[3];
     this.scoutButton.ImageOver = (Image) GFXLibrary.mrhp_world_icons_rhs_array[10];
     this.scoutButton.ImageClick = (Image) GFXLibrary.mrhp_world_icons_rhs_array[0x11];
     this.scoutButton.Position = new Point(80, 0x8e);
     this.scoutButton.CustomTooltipID = 0x981;
     this.scoutButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.sendScouts), "OwnVillagePanel2_scouts");
     this.backImage.addControl(this.scoutButton);
     this.reinforceButton.ImageNorm = (Image) GFXLibrary.mrhp_world_icons_rhs_array[2];
     this.reinforceButton.ImageOver = (Image) GFXLibrary.mrhp_world_icons_rhs_array[9];
     this.reinforceButton.ImageClick = (Image) GFXLibrary.mrhp_world_icons_rhs_array[0x10];
     this.reinforceButton.Position = new Point(0x73, 0x8e);
     this.reinforceButton.CustomTooltipID = 0x982;
     this.reinforceButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.sendReinforcements), "OwnVillagePanel2_reinforcements");
     this.backImage.addControl(this.reinforceButton);
     this.monkButton.ImageNorm = (Image) GFXLibrary.mrhp_world_icons_rhs_array[4];
     this.monkButton.ImageOver = (Image) GFXLibrary.mrhp_world_icons_rhs_array[11];
     this.monkButton.ImageClick = (Image) GFXLibrary.mrhp_world_icons_rhs_array[0x12];
     this.monkButton.Position = new Point(150, 0x8e);
     this.monkButton.CustomTooltipID = 0x983;
     this.monkButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.sendMonks), "OwnVillagePanel2_monks");
     this.backImage.addControl(this.monkButton);
     this.villageButton.ImageNorm = (Image) GFXLibrary.int_world_icon_village;
     this.villageButton.OverBrighten = true;
     this.villageButton.MoveOnClick = true;
     this.villageButton.Position = new Point(0x1d, 0x70);
     this.villageButton.CustomTooltipID = 0x985;
     this.villageButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.villageClick), "OwnVillagePanel2_village");
     this.backImage.addControl(this.villageButton);
     this.castleButton.ImageNorm = (Image) GFXLibrary.int_world_icon_castle;
     this.castleButton.OverBrighten = true;
     this.castleButton.MoveOnClick = true;
     this.castleButton.Position = new Point(0x40, 0x70);
     this.castleButton.CustomTooltipID = 0x986;
     this.castleButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.castleClick), "OwnVillagePanel2_castle");
     this.backImage.addControl(this.castleButton);
     this.resourcesButton.ImageNorm = (Image) GFXLibrary.int_world_icon_resource;
     this.resourcesButton.OverBrighten = true;
     this.resourcesButton.MoveOnClick = true;
     this.resourcesButton.Position = new Point(0x63, 0x70);
     this.resourcesButton.CustomTooltipID = 0x987;
     this.resourcesButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.resourcesClick), "OwnVillagePanel2_resources");
     this.backImage.addControl(this.resourcesButton);
     this.troopsButton.ImageNorm = (Image) GFXLibrary.int_world_icon_troops;
     this.troopsButton.OverBrighten = true;
     this.troopsButton.MoveOnClick = true;
     this.troopsButton.Position = new Point(0x86, 0x70);
     this.troopsButton.CustomTooltipID = 0x988;
     this.troopsButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.troopsClick), "OwnVillagePanel2_troops");
     this.backImage.addControl(this.troopsButton);
     this.lblProtectionType.Text = "";
     this.lblProtectionType.Color = ARGBColors.Black;
     this.lblProtectionType.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.lblProtectionType.Position = new Point(0, 0x26);
     this.lblProtectionType.Size = new Size(this.backImage.Width, 0x17);
     this.lblProtectionType.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     this.backImage.addControl(this.lblProtectionType);
     this.lblProtected.Text = "";
     this.lblProtected.Color = ARGBColors.Black;
     this.lblProtected.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.lblProtected.Position = new Point(6, 0x30);
     this.lblProtected.Size = new Size(this.backImage.Width - 12, 0x4a);
     this.lblProtected.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     this.backImage.addControl(this.lblProtected);
     this.leftButton.ImageNorm = (Image) GFXLibrary.r_arrow_small_left_norm;
     this.leftButton.ImageOver = (Image) GFXLibrary.r_arrow_small_left_over;
     this.leftButton.Position = new Point(5, 50);
     this.leftButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.infoLeft), "OwnVillagePanel2_protection_left");
     this.leftButton.Visible = false;
     this.backImage.addControl(this.leftButton);
     this.rightButton.ImageNorm = (Image) GFXLibrary.r_arrow_small_right_norm;
     this.rightButton.ImageOver = (Image) GFXLibrary.r_arrow_small_right_over;
     this.rightButton.Position = new Point(170, 50);
     this.rightButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.infoRight), "OwnVillagePanel2_protection_right");
     this.rightButton.Visible = false;
     this.backImage.addControl(this.rightButton);
     this.updateSize();
     this.numInfos = 0;
     this.selectedProtection = 0;
 }
        public void AddControls()
        {
            this.pnlWorlds.Controls.Clear();
            this.pnlLogin.Controls.Clear();
            this.pnlFeedback.Controls.Clear();
            this.pnlTabs.Controls.Clear();
            this.allButtons = new List<CustomSelfDrawPanel.CSDControl>();
            this.txtEmail = new TextBox();
            this.lblEmailSteam = new CustomSelfDrawPanel.CSDLabel();
            this.lblEmail = new CustomSelfDrawPanel.CSDLabel();
            if (Program.gamersFirstInstall || Program.arcInstall)
            {
                this.lblEmail.Text = "";
            }
            else if (!Program.bigpointInstall)
            {
                this.lblEmail.Text = this.strEmailAddress;
            }
            else
            {
                this.lblEmail.Text = SK.Text("Login_BigPoint_username", "Stronghold Kingdoms Username");
            }
            this.lblEmail.Width = 300;
            this.lblEmail.Height = 0x12;
            this.txtPassword = new TextBox();
            this.lblPassword = new CustomSelfDrawPanel.CSDLabel();
            if (Program.gamersFirstInstall || Program.arcInstall)
            {
                this.lblPassword.Text = "";
            }
            else if (!Program.bigpointInstall)
            {
                this.lblPassword.Text = this.strPassword;
            }
            else
            {
                this.lblPassword.Text = SK.Text("Login_BigPoint_Password", "Your Bigpoint Password");
            }
            this.lblPassword.Width = 300;
            this.lblPassword.Height = 0x12;
            this.LoginPanelControls_LoggedOut = new CustomSelfDrawPanel();
            this.LoginPanelControls_LoggedOut.AutoScaleMode = AutoScaleMode.None;
            this.LoginPanelControls_LoggedOut.forceStyle();
            this.btnLogin = new CustomSelfDrawPanel.CSDImage();
            this.allButtons.Add(this.btnLogin);
            this.btnLogin.Image = this.LoginImage;
            this.btnLogin.Width = this.btnLogin.Image.Width;
            this.btnLogin.Height = this.btnLogin.Image.Height;
            this.btnLogin.Enabled = false;
            this.lblLoginError = new CustomSelfDrawPanel.CSDLabel();
            this.lblLoginError.Color = ARGBColors.Red;
            this.lblLoginError.Visible = false;
            this.lblLoginError.Text = "ERROR:";
            this.lblLoginError.Width = this.pnlLogin.Width;
            this.lblEmail.Position = new Point(4, this.pnlTabs.Height - 0x1d);
            this.txtEmail.Location = new Point(4, this.lblEmail.Y + this.lblEmail.Height);
            this.lblEmailSteam.Position = new Point(4, this.lblEmail.Y + this.lblEmail.Height);
            this.lblPassword.Position = new Point(4, this.txtEmail.Bottom + 2);
            this.txtPassword.Location = new Point(4, this.lblPassword.Y + this.lblPassword.Height);
            this.txtPassword.Width = this.pnlLogin.Width - 8;
            this.txtEmail.Width = this.pnlLogin.Width - 8;
            this.lblEmailSteam.Width = this.pnlLogin.Width - 8;
            this.lblEmailSteam.Height = this.lblEmail.Height;
            this.txtPassword.PasswordChar = '*';
            this.btnLogin.Position = new Point(4, this.txtPassword.Bottom + 4);
            this.lblLoginError.Position = new Point(4, this.btnLogin.Y + this.btnLogin.Height);
            this.btnLogin.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.btnLogin_Click), "ProfileLoginWindow_login");
            this.btnLogin.setMouseOverDelegate(new CustomSelfDrawPanel.CSDControl.CSD_MouseOverDelegate(this.loginOver), new CustomSelfDrawPanel.CSDControl.CSD_MouseOverDelegate(this.loginOut));
            this.txtEmail.TextChanged += new EventHandler(this.txtLoginField_Validate_email);
            this.txtPassword.TextChanged += new EventHandler(this.txtLoginField_Validate);
            this.btnLoginFB = new CustomSelfDrawPanel.CSDButton();
            this.allButtons.Add(this.btnLoginFB);
            switch (Program.mySettings.LanguageIdent)
            {
                case "fr":
                    this.btnLoginFB.ImageNorm = (Image) GFXLibrary.facebookLogin_EN;
                    break;

                case "de":
                    this.btnLoginFB.ImageNorm = (Image) GFXLibrary.facebookLogin_DE;
                    break;

                case "ru":
                    this.btnLoginFB.ImageNorm = (Image) GFXLibrary.facebookLogin_RU;
                    break;

                case "es":
                    this.btnLoginFB.ImageNorm = (Image) GFXLibrary.facebookLogin_ES;
                    break;

                case "pl":
                    this.btnLoginFB.ImageNorm = (Image) GFXLibrary.facebookLogin_PL;
                    break;

                case "tr":
                    this.btnLoginFB.ImageNorm = (Image) GFXLibrary.facebookLogin_TR;
                    break;

                case "it":
                    this.btnLoginFB.ImageNorm = (Image) GFXLibrary.facebookLogin_IT;
                    break;

                case "pt":
                    this.btnLoginFB.ImageNorm = (Image) GFXLibrary.facebookLogin_PT;
                    break;

                default:
                    this.btnLoginFB.ImageNorm = (Image) GFXLibrary.facebookLogin_EN;
                    break;
            }
            this.btnLoginFB.OverBrighten = true;
            this.btnLoginFB.MoveOnClick = true;
            this.btnLoginFB.Enabled = false;
            this.btnLoginFB.Position = new Point((4 + this.btnLogin.Image.Width) + 4, this.txtPassword.Bottom + 4);
            this.lblLoginError.Position = new Point(4, this.btnLoginFB.Y + this.btnLoginFB.Height);
            this.btnLoginFB.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.btnLoginFB_Click), "ProfileLoginWindow_login");
            this.txtEmail.KeyPress += new KeyPressEventHandler(this.txtEmail_KeyPress);
            this.txtPassword.KeyPress += new KeyPressEventHandler(this.txtEmail_KeyPress);
            this.LoginPanelControls_LoggedOut.addControl(this.lblEmail);
            this.LoginPanelControls_LoggedOut.Controls.Add(this.txtEmail);
            this.LoginPanelControls_LoggedOut.addControl(this.lblEmailSteam);
            if ((Program.steamInstall && Program.steamActive) && Program.kingdomsAccountFound)
            {
                this.txtEmail.Visible = false;
                this.lblEmailSteam.Visible = true;
                this.lblEmailSteam.Text = Program.steamEmail;
                this.btnLoginFB.Visible = false;
            }
            else if ((Program.steamInstall && Program.steamActive) && !Program.kingdomsAccountFound)
            {
                this.txtEmail.Visible = false;
                this.lblEmailSteam.Visible = true;
                this.ShowCreateUserForm();
                this.btnLoginFB.Visible = false;
            }
            else if (Program.aeriaInstall || Program.bigpointInstall)
            {
                this.txtEmail.Visible = false;
                this.lblEmail.Visible = false;
                this.txtPassword.Visible = false;
                this.lblPassword.Visible = false;
                this.btnLogin.Visible = false;
                this.btnLoginFB.Visible = false;
            }
            if (Program.bigpointPartnerInstall)
            {
                this.txtEmail.Visible = false;
                this.lblEmail.Visible = false;
                this.txtPassword.Visible = false;
                this.lblPassword.Visible = false;
                this.btnLogin.Visible = true;
                this.btnLoginFB.Visible = false;
                this.btnLogin.Position = new Point(0x54, (this.txtPassword.Bottom + 4) - 30);
                this.bp2_loginMode = 0;
            }
            this.LoginPanelControls_LoggedOut.addControl(this.lblPassword);
            this.LoginPanelControls_LoggedOut.Controls.Add(this.txtPassword);
            this.LoginPanelControls_LoggedOut.addControl(this.btnLogin);
            this.LoginPanelControls_LoggedOut.addControl(this.btnLoginFB);
            this.LoginPanelControls_LoggedOut.addControl(this.lblLoginError);
            this.LoginPanelControls_LoggedOut.Size = this.pnlLogin.Size;
            this.LoginPanelControls_LoggedOut.Visible = true;
            this.pnlLogin.Controls.Add(this.LoginPanelControls_LoggedOut);
            this.LoginPanelControls_LoggedIn = new CustomSelfDrawPanel();
            this.LoginPanelControls_LoggedIn.AutoScaleMode = AutoScaleMode.None;
            this.LoginPanelControls_LoggedIn.forceStyle();
            this.LoginPanelControls_LoggedIn.Size = this.pnlLogin.Size;
            this.btnClientLogout = new CustomSelfDrawPanel.CSDImage();
            this.allButtons.Add(this.btnClientLogout);
            this.btnClientLogout.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.btnClientLogout_Click), "ProfileLoginWindow_logout");
            this.btnClientLogout.setMouseOverDelegate(new CustomSelfDrawPanel.CSDControl.CSD_MouseOverDelegate(this.logoutOver), new CustomSelfDrawPanel.CSDControl.CSD_MouseOverDelegate(this.logoutOut));
            this.btnClientLogout.Image = this.LogoutImage;
            this.btnClientLogout.Width = this.btnClientLogout.Image.Width;
            this.btnClientLogout.Height = this.btnClientLogout.Image.Height;
            if (((!Program.steamActive && !Program.aeriaInstall) && (!Program.gamersFirstInstall && !Program.arcInstall)) && !Program.bigpointInstall)
            {
                this.LoginPanelControls_LoggedIn.addControl(this.btnClientLogout);
            }
            this.pnlLogin.Controls.Add(this.LoginPanelControls_LoggedIn);
            this.btnShieldDesigner = new CustomSelfDrawPanel.CSDImage();
            this.allButtons.Add(this.btnShieldDesigner);
            this.lblUsername = new CustomSelfDrawPanel.CSDImage();
            this.LoginPanelControls_LoggedIn.addControl(this.btnShieldDesigner);
            this.LoginPanelControls_LoggedIn.addControl(this.lblUsername);
            this.btnShieldDesigner.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.LoadShieldDesigner), "ProfileLoginWindow_shield_designer");
            this.btnClientLogout.Y = this.pnlTabs.Height - 0x1d;
            this.btnClientLogout.X = (this.LoginPanelControls_LoggedIn.Width - this.btnClientLogout.Width) - 4;
            this.lblUsername.X = 4;
            this.lblUsername.Y = this.btnClientLogout.Y;
            this.WorldsPanelcontrols_LoggedOut = new CustomSelfDrawPanel();
            this.WorldsPanelcontrols_LoggedOut.AutoScaleMode = AutoScaleMode.None;
            this.WorldsPanelcontrols_LoggedOut.forceStyle();
            this.WorldsPanelcontrols_LoggedOut.Size = this.pnlWorlds.Size;
            this.lblWorldsOfflineError = new CustomSelfDrawPanel.CSDLabel();
            this.lblWorldsOfflineError.Color = ARGBColors.Red;
            this.WorldsPanelcontrols_LoggedOut.addControl(this.lblWorldsOfflineError);
            this.WorldsPanelcontrols_LoggedOut.Visible = false;
            this.pnlWorlds.Controls.Add(this.WorldsPanelcontrols_LoggedOut);
            this.WorldsPanelcontrols_LoggedIn = new CustomSelfDrawPanel();
            this.WorldsPanelcontrols_LoggedIn.forceStyle();
            this.WorldsPanelcontrols_LoggedIn.AutoScaleMode = AutoScaleMode.None;
            this.WorldsPanelcontrols_LoggedIn.Size = this.pnlWorlds.Size;
            this.lblWorldsOnlineError = new CustomSelfDrawPanel.CSDLabel();
            this.lblWorldsOnlineError.Color = ARGBColors.Red;
            this.WorldsPanelcontrols_LoggedIn.addControl(this.lblWorldsOnlineError);
            this.WorldsPanelcontrols_LoggedIn.Visible = false;
            this.pnlWorlds.Controls.Add(this.WorldsPanelcontrols_LoggedIn);
            this.BrowserTabsControls = new CustomSelfDrawPanel();
            this.BrowserTabsControls.forceStyle();
            this.BrowserTabsControls.AutoScaleMode = AutoScaleMode.None;
            this.BrowserTabsControls.Size = this.pnlTabs.Size;
            this.pnlTabs.Controls.Add(this.BrowserTabsControls);
            this.btnExit.GotFocus += new EventHandler(this.btnExit_GotFocus);
            if (Program.mySettings.Username.Trim().Length > 0)
            {
                this.ignoreEmailChange = true;
                this.txtEmail.Text = Program.mySettings.Username;
                this.ignoreEmailChange = false;
                if (Program.steamActive)
                {
                    this.lblEmailSteam.Text = Program.steamEmail;
                    this.txtPassword.Visible = false;
                    this.lblPassword.Visible = false;
                    this.btnLogin.Visible = false;
                    this.btnLoginFB.Visible = false;
                }
                this.txtPassword.Focus();
            }
            else
            {
                this.txtEmail.Focus();
            }
            this.LoginPanelControls_Feedback = new CustomSelfDrawPanel();
            this.LoginPanelControls_Feedback.forceStyle();
            this.LoginPanelControls_Feedback.Location = new Point(0, 0);
            this.LoginPanelControls_Feedback.AutoScaleMode = AutoScaleMode.None;
            this.LoginPanelControls_Feedback.Size = this.pnlFeedback.Size;
            this.feedbackProgressArea = new CustomSelfDrawPanel.CSDArea();
            this.feedbackProgressArea.Size = this.LoginPanelControls_Feedback.Size;
            this.LoginPanelControls_Feedback.addControl(this.feedbackProgressArea);
            this.feedbackProgress = new CustomSelfDrawPanel.CSDFill();
            this.feedbackProgress.FillColor = Color.FromArgb(0xff, 0xb6, 0);
            this.feedbackProgress.Size = new Size(0, this.pnlFeedback.Height);
            this.feedbackProgressArea.addControl(this.feedbackProgress);
            this.feedbackLine = new CustomSelfDrawPanel.CSDLine();
            this.feedbackLine.Position = new Point(0, 0);
            this.feedbackLine.Size = new Size(this.pnlFeedback.Width, 0);
            this.feedbackLine.LineColor = ARGBColors.Black;
            this.feedbackProgressArea.addControl(this.feedbackLine);
            this.exitButton = new CustomSelfDrawPanel.CSDImage();
            this.allButtons.Add(this.exitButton);
            this.exitButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.btnExit_Click), "ProfileLoginWindow_exit");
            this.exitButton.setMouseOverDelegate(new CustomSelfDrawPanel.CSDControl.CSD_MouseOverDelegate(this.exitOver), new CustomSelfDrawPanel.CSDControl.CSD_MouseOverDelegate(this.exitOut));
            this.exitButton.Image = this.ExitImage;
            this.exitButton.Width = this.exitButton.Image.Width;
            this.exitButton.Height = this.exitButton.Image.Height;
            this.exitButton.Position = new Point(0x337, 5);
            this.feedbackProgressArea.addControl(this.exitButton);
            this.cancelButton = new CustomSelfDrawPanel.CSDImage();
            this.cancelButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.cancelClick), "ProfileLoginWindow_cancel");
            this.cancelButton.setMouseOverDelegate(new CustomSelfDrawPanel.CSDControl.CSD_MouseOverDelegate(this.cancelOver), new CustomSelfDrawPanel.CSDControl.CSD_MouseOverDelegate(this.cancelOut));
            this.cancelButton.Image = this.CancelImage;
            this.cancelButton.Width = this.cancelButton.Image.Width;
            this.cancelButton.Height = this.cancelButton.Image.Height;
            this.cancelButton.Position = new Point(4, 5);
            this.cancelButton.Visible = false;
            this.feedbackProgressArea.addControl(this.cancelButton);
            this.lblRetrieving = new CustomSelfDrawPanel.CSDLabel();
            this.lblRetrieving.Text = "";
            this.lblRetrieving.Position = new Point(0x70, 10);
            this.lblRetrieving.Size = new Size(600, 20);
            this.lblRetrieving.Font = FontManager.GetFont("Microsoft Sans Serif", 8.25f);
            this.lblRetrieving.Color = ARGBColors.Black;
            this.lblRetrieving.Visible = false;
            this.Text = this.defaultWindowTitle;
            this.feedbackProgressArea.addControl(this.lblRetrieving);
            this.lblVersion = new CustomSelfDrawPanel.CSDLabel();
            this.lblVersion.Text = "";
            this.lblVersion.Position = new Point(640, 10);
            this.lblVersion.Size = new Size(0xa8, 20);
            this.lblVersion.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_RIGHT;
            this.lblVersion.Font = FontManager.GetFont("Microsoft Sans Serif", 8.25f);
            this.lblVersion.Color = ARGBColors.Black;
            this.lblVersion.Visible = false;
            this.feedbackProgressArea.addControl(this.lblVersion);
            this.tandcLabel = new CustomSelfDrawPanel.CSDLabel();
            this.tandcLabel.Text = SK.Text("MENU_TandC", "Terms & Conditions").Replace("&amp;", "&");
            this.tandcLabel.Size = new Size(270, 15);
            this.tandcLabel.Position = new Point(40, 10);
            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.tandcLabel.Visible = true;
            this.feedbackProgressArea.addControl(this.tandcLabel);
            this.gameRulesLabel = new CustomSelfDrawPanel.CSDLabel();
            this.gameRulesLabel.Text = SK.Text("MENU_Game_Rules", "Game Rules");
            this.gameRulesLabel.Size = new Size(300, 15);
            if (Program.mySettings.languageIdent == "de")
            {
                this.gameRulesLabel.Position = new Point(0xfd, 10);
            }
            else
            {
                this.gameRulesLabel.Position = new Point(0xcd, 10);
            }
            this.gameRulesLabel.Font = FontManager.GetFont("Arial", 8f, FontStyle.Regular);
            this.gameRulesLabel.Color = ARGBColors.Black;
            this.gameRulesLabel.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.gameRulesClicked));
            this.gameRulesLabel.setMouseOverDelegate(() => this.gameRulesLabel.Color = ARGBColors.Red, () => this.gameRulesLabel.Color = ARGBColors.Black);
            this.gameRulesLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
            this.gameRulesLabel.Visible = true;
            this.feedbackProgressArea.addControl(this.gameRulesLabel);
            this.forumLabel = new CustomSelfDrawPanel.CSDLabel();
            this.forumLabel.Text = SK.Text("MENU_Forum", "Forum");
            this.forumLabel.Size = new Size(300, 15);
            this.forumLabel.Position = new Point(370, 10);
            this.forumLabel.Font = FontManager.GetFont("Arial", 8f, FontStyle.Regular);
            this.forumLabel.Color = ARGBColors.Black;
            this.forumLabel.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.forumClicked));
            this.forumLabel.setMouseOverDelegate(() => this.forumLabel.Color = ARGBColors.Red, () => this.forumLabel.Color = ARGBColors.Black);
            this.forumLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
            if (Program.bigpointInstall || Program.bigpointPartnerInstall)
            {
                this.forumLabel.Visible = false;
            }
            else
            {
                this.forumLabel.Visible = true;
            }
            this.feedbackProgressArea.addControl(this.forumLabel);
            this.supportLabel = new CustomSelfDrawPanel.CSDLabel();
            this.supportLabel.Text = SK.Text("MENU_Support", "Support");
            this.supportLabel.Size = new Size(100, 15);
            this.supportLabel.Position = new Point(0x217, 10);
            this.supportLabel.Font = FontManager.GetFont("Arial", 8f, FontStyle.Regular);
            this.supportLabel.Color = ARGBColors.Black;
            this.supportLabel.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.supportClicked));
            this.supportLabel.setMouseOverDelegate(() => this.supportLabel.Color = ARGBColors.Red, () => this.supportLabel.Color = ARGBColors.Black);
            this.supportLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
            this.supportLabel.Visible = true;
            this.feedbackProgressArea.addControl(this.supportLabel);
            this.pnlFeedback.Controls.Add(this.LoginPanelControls_Feedback);
            this.GreyoutWorlds = this.MakeGreyoutImage(this.pnlWorlds);
            this.GreyoutLogin = this.MakeGreyoutImage(this.pnlLogin);
            this.GreyoutTabs = this.MakeGreyoutImage(this.pnlFeedback);
            if (Program.steamActive)
            {
                this.lblEmail.Visible = false;
                this.lblPassword.Visible = false;
                this.txtPassword.Visible = false;
            }
            if ((Program.steamInstall && Program.steamActive) && (Program.kingdomsAccountFound && !successfulAutoLogin))
            {
                this.btnLogin_Click();
            }
            if (Program.gamersFirstInstall || Program.arcInstall)
            {
                this.lblEmail.Visible = false;
                this.lblPassword.Visible = false;
                this.txtPassword.Visible = false;
                this.txtEmail.Visible = false;
                this.btnLogin.Visible = false;
                this.btnLoginFB.Visible = false;
                Program.mySettings.AutoLogin = false;
                if (!successfulAutoLogin)
                {
                    this.btnLogin_Click();
                }
            }
        }
 public void init(int secondsLeft, int secondsLeftToCancel, bool canCancel)
 {
     secondsLeft += 30;
     secondsLeftToCancel += 30;
     this.m_secondsLeft = secondsLeft;
     this.m_secondsLeftToCancel = secondsLeftToCancel;
     base.clearControls();
     base.Controls.Clear();
     this.BackColor = ARGBColors.White;
     this.HeaderTitle = new CustomSelfDrawPanel.CSDImage();
     this.HeaderTitle.Image = this.HeaderImage;
     this.HeaderTitle.Position = new Point((base.Width - this.HeaderTitle.Width) / 2, 0x20);
     this.AddControlToPanel(this.HeaderTitle);
     this.expiresInLabel.Text = SK.Text("VACATION_Expires_In", "Vacation Mode Expires in") + " - " + VillageMap.createBuildTimeString(secondsLeft);
     this.expiresInLabel.Position = new Point(0, 120);
     this.expiresInLabel.Size = new Size(base.Width, 30);
     this.expiresInLabel.Color = ARGBColors.Black;
     this.expiresInLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Regular);
     this.expiresInLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
     this.AddControlToPanel(this.expiresInLabel);
     this.cancelButton.ImageNorm = this.CancelImage;
     this.cancelButton.ImageOver = this.CancelImageOver;
     this.cancelButton.Position = new Point(0x6b, 200);
     this.cancelButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.cancelClick));
     this.cancelButton.Visible = false;
     this.AddControlToPanel(this.cancelButton);
     if (canCancel)
     {
         this.cancelButton.Visible = false;
     }
     else
     {
         this.cancelInLabel.Text = SK.Text("VACATION_Cancel_In", "You can cancel in") + " - " + VillageMap.createBuildTimeString(secondsLeftToCancel);
         this.cancelInLabel.Position = new Point(0, 200);
         this.cancelInLabel.Size = new Size(base.Width, 30);
         this.cancelInLabel.Color = ARGBColors.Black;
         this.cancelInLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Regular);
         this.cancelInLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
         this.cancelInLabel.Visible = true;
         this.AddControlToPanel(this.cancelInLabel);
     }
     CustomSelfDrawPanel.CSDButton c = new CustomSelfDrawPanel.CSDButton {
         ImageNorm = this.CloseImage,
         ImageOver = this.CloseImageOver,
         Position = new Point(400, 300)
     };
     c.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.closeClick));
     this.AddControlToPanel(c);
     base.Invalidate();
 }
        public void BuildOnlineWorldList(List<WorldInfo> list)
        {
            if ((this.loggedInWorldControls != null) && (this.loggedInWorldControls.Count > 0))
            {
                foreach (CustomSelfDrawPanel.CSDControl control in this.loggedInWorldControls)
                {
                    this.WorldsPanelcontrols_LoggedIn.removeControl(control);
                }
                this.loggedInWorldControls.Clear();
            }
            else if (this.loggedInWorldControls == null)
            {
                this.loggedInWorldControls = new List<CustomSelfDrawPanel.CSDControl>();
            }
            int lastWorldID = Program.mySettings.LastWorldID;
            string str = SK.Text("LOGIN_LastWorld", "Last World Played");
            int num2 = 0;
            for (int i = 0; i < list.Count; i++)
            {
                if (list[i].Playing)
                {
                    num2++;
                }
            }
            int num4 = -1;
            if (num2 == 0)
            {
                if (this.chkAutoLogin != null)
                {
                    this.chkAutoLogin.Checked = false;
                }
                Program.mySettings.AutoLogin = false;
                str = SK.Text("LOGIN_Recommended_Server", "Recommended World");
                bool flag = false;
                int num5 = 0;
                int kingdomsWorldID = lastWorldID;
                for (int k = 0; k < list.Count; k++)
                {
                    if (list[k].Supportculture == Program.mySettings.LanguageIdent)
                    {
                        flag = true;
                    }
                    if (list[k].NewWorld)
                    {
                        num5++;
                        kingdomsWorldID = list[k].KingdomsWorldID;
                        if (((list[k].KingdomsWorldID >= 700) && (list[k].KingdomsWorldID < 0x31f)) || ((list[k].KingdomsWorldID >= 0x4b0) && (list[k].KingdomsWorldID < 0x513)))
                        {
                            num4 = list[k].KingdomsWorldID;
                        }
                    }
                }
                if (num5 == 1)
                {
                    lastWorldID = kingdomsWorldID;
                }
                else
                {
                    bool flag2 = false;
                    string languageIdent = Program.mySettings.LanguageIdent;
                    if (!flag)
                    {
                        languageIdent = "en";
                    }
                    bool flag3 = false;
                    int num8 = -1;
                    if (languageIdent == "en")
                    {
                        uint systemDefaultLangID = 0;
                        try
                        {
                            systemDefaultLangID = GetSystemDefaultLangID();
                        }
                        catch (Exception)
                        {
                        }
                        if (systemDefaultLangID == 0x409)
                        {
                            for (int m = 0; m < list.Count; m++)
                            {
                                if ((((list[m].Supportculture == languageIdent) && (list[m].KingdomsWorldID >= 900)) && ((list[m].KingdomsWorldID < 0x3e8) && list[m].NewWorld)) && (list[m].Online && list[m].AvailableToJoin))
                                {
                                    flag3 = true;
                                    lastWorldID = list[m].KingdomsWorldID;
                                    flag2 = true;
                                    break;
                                }
                            }
                        }
                    }
                    else if (!(languageIdent == "es"))
                    {
                        if (languageIdent == "pt")
                        {
                            uint num13 = 0;
                            try
                            {
                                num13 = GetSystemDefaultLangID();
                            }
                            catch (Exception)
                            {
                            }
                            if (num13 == 0x816)
                            {
                                languageIdent = "es";
                            }
                            else
                            {
                                bool flag4 = false;
                                for (int n = 0; n < list.Count; n++)
                                {
                                    if (list[n].Supportculture == "pt")
                                    {
                                        flag4 = true;
                                        break;
                                    }
                                }
                                if (!flag4)
                                {
                                    languageIdent = "es";
                                }
                            }
                        }
                    }
                    else
                    {
                        uint num11 = 0;
                        try
                        {
                            num11 = GetSystemDefaultLangID();
                        }
                        catch (Exception)
                        {
                        }
                        switch (num11)
                        {
                            case 0x140a:
                            case 0x180a:
                            case 0x80a:
                            case 0x100a:
                            case 0x1c0a:
                            case 0x200a:
                            case 0x240a:
                            case 0x280a:
                            case 0x2c0a:
                            case 0x380a:
                            case 0x3c0a:
                            case 0x400a:
                            case 0x300a:
                            case 0x340a:
                            case 0x4c0a:
                            case 0x500a:
                            case 0x540a:
                            case 0x440a:
                            case 0x480a:
                                for (int num12 = 0; num12 < list.Count; num12++)
                                {
                                    if (list[num12].Supportculture == "pt")
                                    {
                                        languageIdent = "pt";
                                        break;
                                    }
                                }
                                break;
                        }
                    }
                    if (!flag3)
                    {
                        bool flag5 = false;
                        for (int num15 = 0; num15 < list.Count; num15++)
                        {
                            if ((list[num15].Supportculture == languageIdent) && ((languageIdent != "en") || (list[num15].KingdomsWorldID < 200)))
                            {
                                if (((list[num15].KingdomsWorldID > num8) && (list[num15].Online || !flag2)) && list[num15].AvailableToJoin)
                                {
                                    lastWorldID = list[num15].KingdomsWorldID;
                                    num8 = list[num15].KingdomsWorldID;
                                    if (list[num15].Online)
                                    {
                                        flag2 = true;
                                    }
                                }
                                if ((list[num15].NewWorld && list[num15].Online) && list[num15].AvailableToJoin)
                                {
                                    lastWorldID = list[num15].KingdomsWorldID;
                                    flag2 = true;
                                    flag5 = true;
                                    break;
                                }
                            }
                        }
                        if (!flag5 && (num4 >= 0))
                        {
                            lastWorldID = num4;
                        }
                    }
                }
            }
            LastNumberOfWorldsPlaying = num2;
            DateTime time = new DateTime(0x7de, 2, 20, 0, 0, 0);
            CustomSelfDrawPanel.CSDLabel statusLinkLabel = new CustomSelfDrawPanel.CSDLabel {
                Text = SK.Text("LOGIN_WORLDS_STATUS_PAGE", "Live Status Webpage"),
                Color = ARGBColors.Black,
                Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular),
                Position = new Point(0, 0xaf),
                Size = new Size(this.WorldsPanelcontrols_LoggedOut.Width, 0x19),
                Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER
            };
            statusLinkLabel.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.statusPageClicked));
            statusLinkLabel.setMouseOverDelegate(() => statusLinkLabel.Color = ARGBColors.Red, () => statusLinkLabel.Color = ARGBColors.Black);
            this.loggedInWorldControls.Add(statusLinkLabel);
            for (int j = 0; j < list.Count; j++)
            {
                if ((list[j].KingdomsWorldID != lastWorldID) || ((num2 != 0) && !list[j].Playing))
                {
                    continue;
                }
                CustomSelfDrawPanel.CSDLabel label = new CustomSelfDrawPanel.CSDLabel();
                CustomSelfDrawPanel.CSDImage image = new CustomSelfDrawPanel.CSDImage();
                CustomSelfDrawPanel.CSDImage image2 = new CustomSelfDrawPanel.CSDImage();
                CustomSelfDrawPanel.CSDLabel label2 = new CustomSelfDrawPanel.CSDLabel();
                CustomSelfDrawPanel.CSDLabel label3 = new CustomSelfDrawPanel.CSDLabel {
                    Text = str,
                    Position = new Point(0, 10),
                    Size = new Size(this.WorldsPanelcontrols_LoggedIn.Width, 60),
                    Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular),
                    Color = ARGBColors.Black,
                    Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER
                };
                this.loggedInWorldControls.Add(label3);
                int num17 = 70;
                image.Y = num17;
                image2.Y = num17;
                label.Y = num17;
                label2.Y = num17;
                label.Width = (this.worldControlWidth + 8) + 8;
                label.Height = this.worldControlHeight;
                label2.Width = this.worldControlWidth - 8;
                label2.Height = this.worldControlHeight;
                switch (list[j].Supportculture)
                {
                    case "en":
                        image.CustomTooltipID = 0xfa1;
                        break;

                    case "de":
                        image.CustomTooltipID = 0xfa2;
                        break;

                    case "fr":
                        image.CustomTooltipID = 0xfa3;
                        break;

                    case "ru":
                        image.CustomTooltipID = 0xfa4;
                        break;

                    case "es":
                        image.CustomTooltipID = 0xfb0;
                        break;

                    case "pl":
                        image.CustomTooltipID = 0xfb4;
                        break;

                    case "tr":
                        image.CustomTooltipID = 0xfb7;
                        break;

                    case "it":
                        image.CustomTooltipID = 0xfbb;
                        break;

                    case "pt":
                        image.CustomTooltipID = 0xfc3;
                        break;

                    case "eu":
                        image.CustomTooltipID = 0xfbf;
                        break;
                }
                switch (list[j].MapCulture)
                {
                    case "en":
                        image2.CustomTooltipID = 0xfa5;
                        break;

                    case "de":
                        image2.CustomTooltipID = 0xfa6;
                        break;

                    case "fr":
                        image2.CustomTooltipID = 0xfa7;
                        break;

                    case "ru":
                        image2.CustomTooltipID = 0xfa8;
                        break;

                    case "es":
                        image2.CustomTooltipID = 0xfb1;
                        break;

                    case "pl":
                        image2.CustomTooltipID = 0xfb5;
                        break;

                    case "tr":
                        image2.CustomTooltipID = 0xfb8;
                        break;

                    case "it":
                        image2.CustomTooltipID = 0xfbc;
                        break;

                    case "us":
                        image2.CustomTooltipID = 0xfbe;
                        break;

                    case "eu":
                        image2.CustomTooltipID = 0xfc0;
                        break;

                    case "pt":
                        image2.CustomTooltipID = 0xfc4;
                        break;
                }
                label.Text = getWorldShortDesc(list[j]);
                image.Image = (Image) GFXLibrary.getLoginWorldFlag(list[j].Supportculture);
                image.Width = image.Image.Width;
                image.Height = image.Image.Height;
                image2.Image = (Image) GFXLibrary.getLoginWorldMap(list[j].MapCulture);
                image2.Width = image2.Image.Width;
                image2.Height = image2.Image.Height;
                label.X = 3;
                image.X = (label.X + label.Width) + 8;
                image2.X = (image.X + image.Width) + 8;
                label2.X = (image2.X + image2.Width) + 8;
                if (list[j].Online)
                {
                    label2.Text = this.strOnline;
                    label2.Color = ARGBColors.Green;
                    CustomSelfDrawPanel.CSDImage image3 = new CustomSelfDrawPanel.CSDImage();
                    this.allButtons.Add(image3);
                    image3.Width = this.worldControlWidth;
                    image3.Height = this.worldControlHeight;
                    image3.Y = num17;
                    image3.Tag = list[j];
                    image3.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.btnWorldAction_Click), "ProfileLoginWindow_enter_world");
                    image3.setMouseOverDelegate(new CustomSelfDrawPanel.CSDControl.CSD_MouseOverDelegate(this.btnWorldAction_mouseOver), new CustomSelfDrawPanel.CSDControl.CSD_MouseOverDelegate(this.btnWorldAction_mouseOut));
                    if (list[j].Playing)
                    {
                        image3.Image = this.PlayImage;
                    }
                    else if (list[j].AvailableToJoin)
                    {
                        image3.Image = this.JoinImage;
                    }
                    else
                    {
                        image3.Image = this.ClosedImage;
                        image3.setClickDelegate(null);
                        image3.setMouseOverDelegate(null, null);
                    }
                    image3.Width = image3.Image.Width;
                    image3.Height = image3.Image.Height;
                    image3.X = (this.pnlWorlds.Width - 4) - image3.Width;
                    this.loggedInWorldControls.Add(image3);
                    label2.CustomTooltipID = 0xfaa;
                }
                else
                {
                    if ((list[j].KingdomsWorldID == 0x9c4) && (DateTime.UtcNow > time))
                    {
                        label2.Text = this.strWorldEnded;
                        label2.Width = 0x80;
                    }
                    else
                    {
                        label2.Text = this.strOffline;
                        label2.Color = ARGBColors.Red;
                    }
                    label2.CustomTooltipID = 0xfa9;
                }
                this.loggedInWorldControls.Add(image);
                this.loggedInWorldControls.Add(image2);
                this.loggedInWorldControls.Add(label);
                this.loggedInWorldControls.Add(label2);
                break;
            }
            CustomSelfDrawPanel.CSDButton item = new CustomSelfDrawPanel.CSDButton {
                ImageNorm = this.SelectImage,
                ImageOver = this.SelectImageOver,
                Position = new Point(0x17, 120)
            };
            item.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.ShowWorldSelect), "ProfileLoginWindow_show_worlds");
            this.loggedInWorldControls.Add(item);
            if (NewWorldsAvailable)
            {
                CustomSelfDrawPanel.CSDLabel label4 = new CustomSelfDrawPanel.CSDLabel {
                    Text = SK.Text("LOGIN_New_Worlds", "A New World is available!"),
                    Color = ARGBColors.Green,
                    Position = new Point(0, 0x9b),
                    Size = new Size(this.WorldsPanelcontrols_LoggedIn.Width, 60),
                    Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular),
                    Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER
                };
                this.loggedInWorldControls.Add(label4);
            }
            foreach (CustomSelfDrawPanel.CSDControl control2 in this.loggedInWorldControls)
            {
                this.WorldsPanelcontrols_LoggedIn.addControl(control2);
            }
            this.WorldsPanelcontrols_LoggedIn.Invalidate(true);
        }
 public void ShowTabs()
 {
     this.BrowserTabsControls.clearControls();
     bool flag = this.isPlayerLoggedIn();
     int num = 8;
     int num2 = this.BrowserTabsControls.Height - 0x1d;
     CustomSelfDrawPanel.CSDImage btnNews = new CustomSelfDrawPanel.CSDImage();
     this.allButtons.Add(btnNews);
     btnNews.Image = this.NewsImage;
     btnNews.Height = btnNews.Image.Height;
     btnNews.Width = btnNews.Image.Width;
     btnNews.X = num;
     btnNews.Y = num2;
     this.BrowserTabsControls.addControl(btnNews);
     num += btnNews.Width + 2;
     btnNews.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.btnNews_Click), "ProfileLoginWindow_news");
     btnNews.setMouseOverDelegate(() => btnNews.Image = this.NewsImageOver, () => btnNews.Image = this.NewsImage);
     if (!Program.bigpointPartnerInstall)
     {
         if (Program.mySettings.LanguageIdent == "ru")
         {
             this.imgSHKRu.ImageNorm = (Image) GFXLibrary.vk;
             this.imgSHKRu.OverBrighten = true;
             this.imgSHKRu.Size = new Size(0x20, 0x20);
             this.imgSHKRu.Position = new Point(0x10c, 5);
             this.imgSHKRu.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.shkruClick));
             this.BrowserTabsControls.addControl(this.imgSHKRu);
             this.imgTwitter.ImageNorm = (Image) GFXLibrary.twitter;
             this.imgTwitter.OverBrighten = true;
             this.imgTwitter.Size = new Size(0x20, 0x20);
             this.imgTwitter.Position = new Point(0x131, 5);
             this.imgTwitter.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.twitterClick));
             this.BrowserTabsControls.addControl(this.imgTwitter);
             this.imgYoutube.ImageNorm = (Image) GFXLibrary.youtube;
             this.imgYoutube.OverBrighten = true;
             this.imgYoutube.Position = new Point(0x156, 5);
             this.imgYoutube.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.youtubeClick));
             this.BrowserTabsControls.addControl(this.imgYoutube);
         }
         else
         {
             this.imgTwitter.ImageNorm = (Image) GFXLibrary.twitter;
             this.imgTwitter.OverBrighten = true;
             this.imgTwitter.Size = new Size(0x20, 0x20);
             this.imgTwitter.Position = new Point(0x10c, 5);
             this.imgTwitter.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.twitterClick));
             this.BrowserTabsControls.addControl(this.imgTwitter);
             this.imgFacebook.ImageNorm = (Image) GFXLibrary.facebook;
             this.imgFacebook.OverBrighten = true;
             this.imgFacebook.Size = new Size(0x20, 0x20);
             this.imgFacebook.Position = new Point(0x131, 5);
             this.imgFacebook.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.facebookClick));
             this.BrowserTabsControls.addControl(this.imgFacebook);
             this.imgYoutube.ImageNorm = (Image) GFXLibrary.youtube;
             this.imgYoutube.OverBrighten = true;
             this.imgYoutube.Position = new Point(0x156, 5);
             this.imgYoutube.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.youtubeClick));
             this.BrowserTabsControls.addControl(this.imgYoutube);
         }
     }
     if (flag)
     {
         CustomSelfDrawPanel.CSDImage btnAccountDetails = new CustomSelfDrawPanel.CSDImage();
         this.allButtons.Add(btnAccountDetails);
         btnAccountDetails.Image = this.AccountImage;
         btnAccountDetails.Height = btnAccountDetails.Image.Height;
         btnAccountDetails.Width = btnAccountDetails.Image.Width;
         btnAccountDetails.X = num;
         btnAccountDetails.Y = num2;
         this.BrowserTabsControls.addControl(btnAccountDetails);
         num += btnAccountDetails.Width + 2;
         btnAccountDetails.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.btnAccountDetails_Click), "ProfileLoginWindow_account_details");
         btnAccountDetails.setMouseOverDelegate(() => btnAccountDetails.Image = this.AccountImageOver, () => btnAccountDetails.Image = this.AccountImage);
         CustomSelfDrawPanel.CSDImage btnCreateAccount = new CustomSelfDrawPanel.CSDImage();
         this.allButtons.Add(btnCreateAccount);
         btnCreateAccount.Image = this.OptionsImage;
         btnCreateAccount.X = 400;
         btnCreateAccount.Height = btnCreateAccount.Image.Height;
         btnCreateAccount.Width = btnCreateAccount.Image.Width;
         btnCreateAccount.Y = num2;
         this.BrowserTabsControls.addControl(btnCreateAccount);
         btnCreateAccount.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.options_Click), "ProfileLoginWindow_create_account");
         btnCreateAccount.setMouseOverDelegate(() => btnCreateAccount.Image = this.OptionsImageOver, () => btnCreateAccount.Image = this.OptionsImage);
     }
     else
     {
         if (((!Program.steamActive && !Program.aeriaInstall) && (!Program.gamersFirstInstall && !Program.arcInstall)) && (!Program.bigpointInstall && !Program.bigpointPartnerInstall))
         {
             CustomSelfDrawPanel.CSDImage btnCreateAccount = new CustomSelfDrawPanel.CSDImage();
             this.allButtons.Add(btnCreateAccount);
             if ((!Program.mySettings.hasLoggedIn() && !Program.bigpointInstall) && (!Program.aeriaInstall && !Program.bigpointPartnerInstall))
             {
                 btnCreateAccount.Image = this.CreateAccountImage;
             }
             else
             {
                 btnCreateAccount.Image = this.CreateAccountImage2;
             }
             btnCreateAccount.X = 400;
             btnCreateAccount.Height = btnCreateAccount.Image.Height;
             btnCreateAccount.Width = btnCreateAccount.Image.Width;
             btnCreateAccount.Y = num2;
             this.BrowserTabsControls.addControl(btnCreateAccount);
             btnCreateAccount.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.btnCreateAccount_Click), "ProfileLoginWindow_create_account");
             btnCreateAccount.setMouseOverDelegate(delegate {
                 if ((!Program.mySettings.hasLoggedIn() && !Program.bigpointInstall) && (!Program.aeriaInstall && !Program.bigpointPartnerInstall))
                 {
                     btnCreateAccount.Image = this.CreateAccountImageOver;
                 }
                 else
                 {
                     btnCreateAccount.Image = this.CreateAccountImageOver2;
                 }
             }, delegate {
                 if ((!Program.mySettings.hasLoggedIn() && !Program.bigpointInstall) && (!Program.aeriaInstall && !Program.bigpointPartnerInstall))
                 {
                     btnCreateAccount.Image = this.CreateAccountImage;
                 }
                 else
                 {
                     btnCreateAccount.Image = this.CreateAccountImage2;
                 }
             });
         }
         if (((!Program.bigpointInstall && !Program.aeriaInstall) && (!Program.gamersFirstInstall && !Program.bigpointPartnerInstall)) && !Program.arcInstall)
         {
             CustomSelfDrawPanel.CSDImage btnForgottenPassword = new CustomSelfDrawPanel.CSDImage();
             this.allButtons.Add(btnForgottenPassword);
             btnForgottenPassword.Image = this.ForgottenImage;
             btnForgottenPassword.Height = btnForgottenPassword.Image.Height;
             btnForgottenPassword.Width = btnForgottenPassword.Image.Width;
             btnForgottenPassword.X = num;
             btnForgottenPassword.Y = num2;
             this.BrowserTabsControls.addControl(btnForgottenPassword);
             num += btnForgottenPassword.Width + 2;
             btnForgottenPassword.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.btnForgotten_Click), "ProfileLoginWindow_forgotten_password");
             btnForgottenPassword.setMouseOverDelegate(() => btnForgottenPassword.Image = this.ForgottenImageOver, () => btnForgottenPassword.Image = this.forgottenImage);
         }
     }
 }
 public void init(bool initialCall)
 {
     CustomSelfDrawPanel.CSDImage image2;
     Instance = this;
     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.MainPanel.Size = base.Size;
     this.MainPanel.Position = new Point(0, 0);
     this.mainBackgroundImage.addControl(this.MainPanel);
     this.MainPanel.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 control = new CustomSelfDrawPanel.CSDImage {
         Image = (Image) GFXLibrary.cardpanel_panel_gradient_top_left,
         Size = GFXLibrary.cardpanel_panel_gradient_top_left.Size,
         Position = new Point(0, 0)
     };
     this.MainPanel.addControl(control);
     image2 = new CustomSelfDrawPanel.CSDImage {
         Image = (Image) GFXLibrary.cardpanel_panel_gradient_bottom_right,
         Size = GFXLibrary.cardpanel_panel_gradient_bottom_right.Size,
         Position = new Point((this.MainPanel.Width - ((Image)GFXLibrary.cardpanel_panel_gradient_bottom_right).Width) - 6, (this.MainPanel.Height - ((Image) GFXLibrary.cardpanel_panel_gradient_bottom_right).Height) - 6)
     };
     this.MainPanel.addControl(image2);
     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.Position = new Point((base.Width - 14) - 0x11, 10);
     this.closeImage.CustomTooltipID = 0x2774;
     this.mainBackgroundImage.addControl(this.closeImage);
     CustomSelfDrawPanel.WikiLinkControl.init(this.mainBackgroundImage, 0x20, new Point((base.Width - 40) - 40, 2));
     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);
     int x = 10;
     int num2 = 0x2d;
     int num3 = 160;
     int y = 110;
     this.questWheelButton.ImageNorm = (Image) GFXLibrary.wheel_spinButton_royal[0];
     this.questWheelButton.ImageOver = (Image) GFXLibrary.wheel_spinButton_royal[1];
     this.questWheelButton.Data = -1;
     this.questWheelButton.MoveOnClick = false;
     this.questWheelButton.Position = new Point(x, y);
     this.questWheelButton.Text.Text = GameEngine.Instance.World.getTickets(this.questWheelButton.Data).ToString();
     this.questWheelButton.TextYOffset = 0x20;
     this.questWheelButton.Text.Color = ARGBColors.Black;
     this.questWheelButton.Text.DropShadowColor = Color.FromArgb(160, 160, 160);
     this.questWheelButton.Text.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
     this.questWheelButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.openWheel));
     this.mainBackgroundImage.addControl(this.questWheelButton);
     this.questWheelButton.Enabled = GameEngine.Instance.World.getTickets(this.questWheelButton.Data) > 0;
     this.treasure1WheelButton.ImageNorm = (Image) GFXLibrary.wheel_spinButton_royal[0];
     this.treasure1WheelButton.ImageOver = (Image) GFXLibrary.wheel_spinButton_royal[1];
     this.treasure1WheelButton.Data = 0;
     this.treasure1WheelButton.MoveOnClick = false;
     this.treasure1WheelButton.Position = new Point((x + num2) + num3, y);
     this.treasure1WheelButton.Text.Text = GameEngine.Instance.World.getTickets(this.treasure1WheelButton.Data).ToString();
     this.treasure1WheelButton.TextYOffset = 0x20;
     this.treasure1WheelButton.Text.Color = ARGBColors.Black;
     this.treasure1WheelButton.Text.DropShadowColor = Color.FromArgb(160, 160, 160);
     this.treasure1WheelButton.Text.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
     this.treasure1WheelButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.openWheel));
     this.mainBackgroundImage.addControl(this.treasure1WheelButton);
     this.treasure1WheelButton.Enabled = GameEngine.Instance.World.getTickets(this.treasure1WheelButton.Data) > 0;
     this.treasure2WheelButton.ImageNorm = (Image) GFXLibrary.wheel_spinButton_royal[0];
     this.treasure2WheelButton.ImageOver = (Image) GFXLibrary.wheel_spinButton_royal[1];
     this.treasure2WheelButton.Data = 1;
     this.treasure2WheelButton.MoveOnClick = false;
     this.treasure2WheelButton.Position = new Point((x + num2) + (num3 * 2), y);
     this.treasure2WheelButton.Text.Text = GameEngine.Instance.World.getTickets(this.treasure2WheelButton.Data).ToString();
     this.treasure2WheelButton.TextYOffset = 0x20;
     this.treasure2WheelButton.Text.Color = ARGBColors.Black;
     this.treasure2WheelButton.Text.DropShadowColor = Color.FromArgb(160, 160, 160);
     this.treasure2WheelButton.Text.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
     this.treasure2WheelButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.openWheel));
     this.mainBackgroundImage.addControl(this.treasure2WheelButton);
     this.treasure2WheelButton.Enabled = GameEngine.Instance.World.getTickets(this.treasure2WheelButton.Data) > 0;
     this.treasure3WheelButton.ImageNorm = (Image) GFXLibrary.wheel_spinButton_royal[0];
     this.treasure3WheelButton.ImageOver = (Image) GFXLibrary.wheel_spinButton_royal[1];
     this.treasure3WheelButton.Data = 2;
     this.treasure3WheelButton.MoveOnClick = false;
     this.treasure3WheelButton.Position = new Point((x + num2) + (num3 * 3), y);
     this.treasure3WheelButton.Text.Text = GameEngine.Instance.World.getTickets(this.treasure3WheelButton.Data).ToString();
     this.treasure3WheelButton.TextYOffset = 0x20;
     this.treasure3WheelButton.Text.Color = ARGBColors.Black;
     this.treasure3WheelButton.Text.DropShadowColor = Color.FromArgb(160, 160, 160);
     this.treasure3WheelButton.Text.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
     this.treasure3WheelButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.openWheel));
     this.mainBackgroundImage.addControl(this.treasure3WheelButton);
     this.treasure3WheelButton.Enabled = GameEngine.Instance.World.getTickets(this.treasure3WheelButton.Data) > 0;
     this.treasure4WheelButton.ImageNorm = (Image) GFXLibrary.wheel_spinButton_royal[0];
     this.treasure4WheelButton.ImageOver = (Image) GFXLibrary.wheel_spinButton_royal[1];
     this.treasure4WheelButton.Data = 3;
     this.treasure4WheelButton.MoveOnClick = false;
     this.treasure4WheelButton.Position = new Point((x + num2) + (num3 * 4), y);
     this.treasure4WheelButton.Text.Text = GameEngine.Instance.World.getTickets(this.treasure4WheelButton.Data).ToString();
     this.treasure4WheelButton.TextYOffset = 0x20;
     this.treasure4WheelButton.Text.Color = ARGBColors.Black;
     this.treasure4WheelButton.Text.DropShadowColor = Color.FromArgb(160, 160, 160);
     this.treasure4WheelButton.Text.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
     this.treasure4WheelButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.openWheel));
     this.mainBackgroundImage.addControl(this.treasure4WheelButton);
     this.treasure4WheelButton.Enabled = GameEngine.Instance.World.getTickets(this.treasure4WheelButton.Data) > 0;
     this.treasure5WheelButton.ImageNorm = (Image) GFXLibrary.wheel_spinButton_royal[0];
     this.treasure5WheelButton.ImageOver = (Image) GFXLibrary.wheel_spinButton_royal[1];
     this.treasure5WheelButton.Data = 4;
     this.treasure5WheelButton.MoveOnClick = false;
     this.treasure5WheelButton.Position = new Point((x + num2) + (num3 * 5), y);
     this.treasure5WheelButton.Text.Text = GameEngine.Instance.World.getTickets(this.treasure5WheelButton.Data).ToString();
     this.treasure5WheelButton.TextYOffset = 0x20;
     this.treasure5WheelButton.Text.Color = ARGBColors.Black;
     this.treasure5WheelButton.Text.DropShadowColor = Color.FromArgb(160, 160, 160);
     this.treasure5WheelButton.Text.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
     this.treasure5WheelButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.openWheel));
     this.mainBackgroundImage.addControl(this.treasure5WheelButton);
     this.treasure5WheelButton.Enabled = GameEngine.Instance.World.getTickets(this.treasure5WheelButton.Data) > 0;
     this.labelTitle.Text = SK.Text("WheelSelectPanel_SelectType", "Select Wheel Type");
     this.labelTitle.Position = new Point(0, 5);
     this.labelTitle.Size = new Size(base.Width, 0x40);
     this.labelTitle.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
     this.labelTitle.Font = FontManager.GetFont("Arial", 18f, FontStyle.Bold);
     this.labelTitle.Color = ARGBColors.Black;
     this.mainBackgroundImage.addControl(this.labelTitle);
     this.questLabel.Text = SK.Text("WheelSelectPanel_Quest", "Quest");
     this.questLabel.Position = new Point(this.questWheelButton.X - 8, 50);
     this.questLabel.Size = new Size(150, 0x40);
     this.questLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
     this.questLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
     this.questLabel.Color = ARGBColors.Black;
     this.mainBackgroundImage.addControl(this.questLabel);
     this.treasureLabel.Text = SK.Text("WheelSelectPanel_Treasure", "Treasure Castle");
     this.treasureLabel.Position = new Point(0xca, 50);
     this.treasureLabel.Size = new Size(800, 0x40);
     this.treasureLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
     this.treasureLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
     this.treasureLabel.Color = ARGBColors.Black;
     this.mainBackgroundImage.addControl(this.treasureLabel);
     this.treasureTier1Label.Text = SK.Text("WheelSelectPanel_Tier1", "Tier 1");
     this.treasureTier1Label.Position = new Point(this.treasure1WheelButton.X - 8, 80);
     this.treasureTier1Label.Size = new Size(150, 0x40);
     this.treasureTier1Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
     this.treasureTier1Label.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
     this.treasureTier1Label.Color = ARGBColors.Black;
     this.mainBackgroundImage.addControl(this.treasureTier1Label);
     this.treasureTier2Label.Text = SK.Text("WheelSelectPanel_Tier2", "Tier 2");
     this.treasureTier2Label.Position = new Point(this.treasure2WheelButton.X - 8, 80);
     this.treasureTier2Label.Size = new Size(150, 0x40);
     this.treasureTier2Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
     this.treasureTier2Label.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
     this.treasureTier2Label.Color = ARGBColors.Black;
     this.mainBackgroundImage.addControl(this.treasureTier2Label);
     this.treasureTier3Label.Text = SK.Text("WheelSelectPanel_Tier3", "Tier 3");
     this.treasureTier3Label.Position = new Point(this.treasure3WheelButton.X - 8, 80);
     this.treasureTier3Label.Size = new Size(150, 0x40);
     this.treasureTier3Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
     this.treasureTier3Label.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
     this.treasureTier3Label.Color = ARGBColors.Black;
     this.mainBackgroundImage.addControl(this.treasureTier3Label);
     this.treasureTier4Label.Text = SK.Text("WheelSelectPanel_Tier4", "Tier 4");
     this.treasureTier4Label.Position = new Point(this.treasure4WheelButton.X - 8, 80);
     this.treasureTier4Label.Size = new Size(150, 0x40);
     this.treasureTier4Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
     this.treasureTier4Label.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
     this.treasureTier4Label.Color = ARGBColors.Black;
     this.mainBackgroundImage.addControl(this.treasureTier4Label);
     this.treasureTier5Label.Text = SK.Text("WheelSelectPanel_Tier5", "Tier 5");
     this.treasureTier5Label.Position = new Point(this.treasure5WheelButton.X - 8, 80);
     this.treasureTier5Label.Size = new Size(150, 0x40);
     this.treasureTier5Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
     this.treasureTier5Label.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
     this.treasureTier5Label.Color = ARGBColors.Black;
     this.mainBackgroundImage.addControl(this.treasureTier5Label);
 }
        public void init(bool initialCall)
        {
            CustomSelfDrawPanel.CSDImage image2;
            Instance = this;
            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.MainPanel.Size     = base.Size;
            this.MainPanel.Position = new Point(0, 0);
            this.mainBackgroundImage.addControl(this.MainPanel);
            this.MainPanel.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 control = new CustomSelfDrawPanel.CSDImage {
                Image    = (Image)GFXLibrary.cardpanel_panel_gradient_top_left,
                Size     = GFXLibrary.cardpanel_panel_gradient_top_left.Size,
                Position = new Point(0, 0)
            };
            this.MainPanel.addControl(control);
            image2 = new CustomSelfDrawPanel.CSDImage {
                Image    = (Image)GFXLibrary.cardpanel_panel_gradient_bottom_right,
                Size     = GFXLibrary.cardpanel_panel_gradient_bottom_right.Size,
                Position = new Point((this.MainPanel.Width - ((Image)GFXLibrary.cardpanel_panel_gradient_bottom_right).Width) - 6, (this.MainPanel.Height - ((Image)GFXLibrary.cardpanel_panel_gradient_bottom_right).Height) - 6)
            };
            this.MainPanel.addControl(image2);
            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.Position        = new Point((base.Width - 14) - 0x11, 10);
            this.closeImage.CustomTooltipID = 0x2774;
            this.mainBackgroundImage.addControl(this.closeImage);
            CustomSelfDrawPanel.WikiLinkControl.init(this.mainBackgroundImage, 0x20, new Point((base.Width - 40) - 40, 2));
            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);
            int x    = 10;
            int num2 = 0x2d;
            int num3 = 160;
            int y    = 110;

            this.questWheelButton.ImageNorm            = (Image)GFXLibrary.wheel_spinButton_royal[0];
            this.questWheelButton.ImageOver            = (Image)GFXLibrary.wheel_spinButton_royal[1];
            this.questWheelButton.Data                 = -1;
            this.questWheelButton.MoveOnClick          = false;
            this.questWheelButton.Position             = new Point(x, y);
            this.questWheelButton.Text.Text            = GameEngine.Instance.World.getTickets(this.questWheelButton.Data).ToString();
            this.questWheelButton.TextYOffset          = 0x20;
            this.questWheelButton.Text.Color           = ARGBColors.Black;
            this.questWheelButton.Text.DropShadowColor = Color.FromArgb(160, 160, 160);
            this.questWheelButton.Text.Font            = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
            this.questWheelButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.openWheel));
            this.mainBackgroundImage.addControl(this.questWheelButton);
            this.questWheelButton.Enabled                  = GameEngine.Instance.World.getTickets(this.questWheelButton.Data) > 0;
            this.treasure1WheelButton.ImageNorm            = (Image)GFXLibrary.wheel_spinButton_royal[0];
            this.treasure1WheelButton.ImageOver            = (Image)GFXLibrary.wheel_spinButton_royal[1];
            this.treasure1WheelButton.Data                 = 0;
            this.treasure1WheelButton.MoveOnClick          = false;
            this.treasure1WheelButton.Position             = new Point((x + num2) + num3, y);
            this.treasure1WheelButton.Text.Text            = GameEngine.Instance.World.getTickets(this.treasure1WheelButton.Data).ToString();
            this.treasure1WheelButton.TextYOffset          = 0x20;
            this.treasure1WheelButton.Text.Color           = ARGBColors.Black;
            this.treasure1WheelButton.Text.DropShadowColor = Color.FromArgb(160, 160, 160);
            this.treasure1WheelButton.Text.Font            = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
            this.treasure1WheelButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.openWheel));
            this.mainBackgroundImage.addControl(this.treasure1WheelButton);
            this.treasure1WheelButton.Enabled              = GameEngine.Instance.World.getTickets(this.treasure1WheelButton.Data) > 0;
            this.treasure2WheelButton.ImageNorm            = (Image)GFXLibrary.wheel_spinButton_royal[0];
            this.treasure2WheelButton.ImageOver            = (Image)GFXLibrary.wheel_spinButton_royal[1];
            this.treasure2WheelButton.Data                 = 1;
            this.treasure2WheelButton.MoveOnClick          = false;
            this.treasure2WheelButton.Position             = new Point((x + num2) + (num3 * 2), y);
            this.treasure2WheelButton.Text.Text            = GameEngine.Instance.World.getTickets(this.treasure2WheelButton.Data).ToString();
            this.treasure2WheelButton.TextYOffset          = 0x20;
            this.treasure2WheelButton.Text.Color           = ARGBColors.Black;
            this.treasure2WheelButton.Text.DropShadowColor = Color.FromArgb(160, 160, 160);
            this.treasure2WheelButton.Text.Font            = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
            this.treasure2WheelButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.openWheel));
            this.mainBackgroundImage.addControl(this.treasure2WheelButton);
            this.treasure2WheelButton.Enabled              = GameEngine.Instance.World.getTickets(this.treasure2WheelButton.Data) > 0;
            this.treasure3WheelButton.ImageNorm            = (Image)GFXLibrary.wheel_spinButton_royal[0];
            this.treasure3WheelButton.ImageOver            = (Image)GFXLibrary.wheel_spinButton_royal[1];
            this.treasure3WheelButton.Data                 = 2;
            this.treasure3WheelButton.MoveOnClick          = false;
            this.treasure3WheelButton.Position             = new Point((x + num2) + (num3 * 3), y);
            this.treasure3WheelButton.Text.Text            = GameEngine.Instance.World.getTickets(this.treasure3WheelButton.Data).ToString();
            this.treasure3WheelButton.TextYOffset          = 0x20;
            this.treasure3WheelButton.Text.Color           = ARGBColors.Black;
            this.treasure3WheelButton.Text.DropShadowColor = Color.FromArgb(160, 160, 160);
            this.treasure3WheelButton.Text.Font            = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
            this.treasure3WheelButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.openWheel));
            this.mainBackgroundImage.addControl(this.treasure3WheelButton);
            this.treasure3WheelButton.Enabled              = GameEngine.Instance.World.getTickets(this.treasure3WheelButton.Data) > 0;
            this.treasure4WheelButton.ImageNorm            = (Image)GFXLibrary.wheel_spinButton_royal[0];
            this.treasure4WheelButton.ImageOver            = (Image)GFXLibrary.wheel_spinButton_royal[1];
            this.treasure4WheelButton.Data                 = 3;
            this.treasure4WheelButton.MoveOnClick          = false;
            this.treasure4WheelButton.Position             = new Point((x + num2) + (num3 * 4), y);
            this.treasure4WheelButton.Text.Text            = GameEngine.Instance.World.getTickets(this.treasure4WheelButton.Data).ToString();
            this.treasure4WheelButton.TextYOffset          = 0x20;
            this.treasure4WheelButton.Text.Color           = ARGBColors.Black;
            this.treasure4WheelButton.Text.DropShadowColor = Color.FromArgb(160, 160, 160);
            this.treasure4WheelButton.Text.Font            = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
            this.treasure4WheelButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.openWheel));
            this.mainBackgroundImage.addControl(this.treasure4WheelButton);
            this.treasure4WheelButton.Enabled              = GameEngine.Instance.World.getTickets(this.treasure4WheelButton.Data) > 0;
            this.treasure5WheelButton.ImageNorm            = (Image)GFXLibrary.wheel_spinButton_royal[0];
            this.treasure5WheelButton.ImageOver            = (Image)GFXLibrary.wheel_spinButton_royal[1];
            this.treasure5WheelButton.Data                 = 4;
            this.treasure5WheelButton.MoveOnClick          = false;
            this.treasure5WheelButton.Position             = new Point((x + num2) + (num3 * 5), y);
            this.treasure5WheelButton.Text.Text            = GameEngine.Instance.World.getTickets(this.treasure5WheelButton.Data).ToString();
            this.treasure5WheelButton.TextYOffset          = 0x20;
            this.treasure5WheelButton.Text.Color           = ARGBColors.Black;
            this.treasure5WheelButton.Text.DropShadowColor = Color.FromArgb(160, 160, 160);
            this.treasure5WheelButton.Text.Font            = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
            this.treasure5WheelButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.openWheel));
            this.mainBackgroundImage.addControl(this.treasure5WheelButton);
            this.treasure5WheelButton.Enabled = GameEngine.Instance.World.getTickets(this.treasure5WheelButton.Data) > 0;
            this.labelTitle.Text      = SK.Text("WheelSelectPanel_SelectType", "Select Wheel Type");
            this.labelTitle.Position  = new Point(0, 5);
            this.labelTitle.Size      = new Size(base.Width, 0x40);
            this.labelTitle.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
            this.labelTitle.Font      = FontManager.GetFont("Arial", 18f, FontStyle.Bold);
            this.labelTitle.Color     = ARGBColors.Black;
            this.mainBackgroundImage.addControl(this.labelTitle);
            this.questLabel.Text      = SK.Text("WheelSelectPanel_Quest", "Quest");
            this.questLabel.Position  = new Point(this.questWheelButton.X - 8, 50);
            this.questLabel.Size      = new Size(150, 0x40);
            this.questLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
            this.questLabel.Font      = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
            this.questLabel.Color     = ARGBColors.Black;
            this.mainBackgroundImage.addControl(this.questLabel);
            this.treasureLabel.Text      = SK.Text("WheelSelectPanel_Treasure", "Treasure Castle");
            this.treasureLabel.Position  = new Point(0xca, 50);
            this.treasureLabel.Size      = new Size(800, 0x40);
            this.treasureLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
            this.treasureLabel.Font      = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
            this.treasureLabel.Color     = ARGBColors.Black;
            this.mainBackgroundImage.addControl(this.treasureLabel);
            this.treasureTier1Label.Text      = SK.Text("WheelSelectPanel_Tier1", "Tier 1");
            this.treasureTier1Label.Position  = new Point(this.treasure1WheelButton.X - 8, 80);
            this.treasureTier1Label.Size      = new Size(150, 0x40);
            this.treasureTier1Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
            this.treasureTier1Label.Font      = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
            this.treasureTier1Label.Color     = ARGBColors.Black;
            this.mainBackgroundImage.addControl(this.treasureTier1Label);
            this.treasureTier2Label.Text      = SK.Text("WheelSelectPanel_Tier2", "Tier 2");
            this.treasureTier2Label.Position  = new Point(this.treasure2WheelButton.X - 8, 80);
            this.treasureTier2Label.Size      = new Size(150, 0x40);
            this.treasureTier2Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
            this.treasureTier2Label.Font      = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
            this.treasureTier2Label.Color     = ARGBColors.Black;
            this.mainBackgroundImage.addControl(this.treasureTier2Label);
            this.treasureTier3Label.Text      = SK.Text("WheelSelectPanel_Tier3", "Tier 3");
            this.treasureTier3Label.Position  = new Point(this.treasure3WheelButton.X - 8, 80);
            this.treasureTier3Label.Size      = new Size(150, 0x40);
            this.treasureTier3Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
            this.treasureTier3Label.Font      = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
            this.treasureTier3Label.Color     = ARGBColors.Black;
            this.mainBackgroundImage.addControl(this.treasureTier3Label);
            this.treasureTier4Label.Text      = SK.Text("WheelSelectPanel_Tier4", "Tier 4");
            this.treasureTier4Label.Position  = new Point(this.treasure4WheelButton.X - 8, 80);
            this.treasureTier4Label.Size      = new Size(150, 0x40);
            this.treasureTier4Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
            this.treasureTier4Label.Font      = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
            this.treasureTier4Label.Color     = ARGBColors.Black;
            this.mainBackgroundImage.addControl(this.treasureTier4Label);
            this.treasureTier5Label.Text      = SK.Text("WheelSelectPanel_Tier5", "Tier 5");
            this.treasureTier5Label.Position  = new Point(this.treasure5WheelButton.X - 8, 80);
            this.treasureTier5Label.Size      = new Size(150, 0x40);
            this.treasureTier5Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
            this.treasureTier5Label.Font      = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
            this.treasureTier5Label.Color     = ARGBColors.Black;
            this.mainBackgroundImage.addControl(this.treasureTier5Label);
        }
Esempio n. 14
0
 private CustomSelfDrawPanel.CSDImage addRow(int index, int buildingType, int amount, int resource)
 {
     int num = GFXLibrary.parishwall_tan_bar_01_short.Height + 3;
     CustomSelfDrawPanel.CSDImage image = new CustomSelfDrawPanel.CSDImage {
         Image = (Image) GFXLibrary.parishwall_tan_bar_01_short,
         Position = new Point(10, 10 + (num * index))
     };
     CustomSelfDrawPanel.CSDLabel control = new CustomSelfDrawPanel.CSDLabel {
         Text = VillageBuildingsData.getBuildingName(buildingType),
         Color = ARGBColors.Black,
         Position = new Point(10, 0),
         Size = new Size(image.Width - 20, image.Height),
         Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular),
         Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT
     };
     image.addControl(control);
     CustomSelfDrawPanel.CSDLabel label2 = new CustomSelfDrawPanel.CSDLabel {
         Text = amount.ToString(),
         Color = ARGBColors.Black,
         Position = new Point(10, 0),
         Size = new Size(image.Width - 60, image.Height),
         Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular),
         Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_RIGHT
     };
     image.addControl(label2);
     CustomSelfDrawPanel.CSDImage image2 = new CustomSelfDrawPanel.CSDImage {
         Image = (Image) GFXLibrary.getCommodity32Image(resource),
         Position = new Point(image.Width - 0x2d, 2)
     };
     image.addControl(image2);
     return image;
 }
 public void init()
 {
     base.clearControls();
     this.backImage = this.backGround.init(true, 0x2710);
     base.addControl(this.backGround);
     this.tradeButton.ImageNorm       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[0];
     this.tradeButton.ImageOver       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[7];
     this.tradeButton.ImageClick      = (Image)GFXLibrary.mrhp_world_icons_rhs_array[14];
     this.tradeButton.Position        = new Point(10, 0x31);
     this.tradeButton.Enabled         = false;
     this.tradeButton.CustomTooltipID = 0x96a;
     this.tradeButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.btnTradeWith_Click), "ParishCapitalVillagePanel2_trade");
     this.backImage.addControl(this.tradeButton);
     this.attackButton.ImageNorm       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[1];
     this.attackButton.ImageOver       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[8];
     this.attackButton.ImageClick      = (Image)GFXLibrary.mrhp_world_icons_rhs_array[15];
     this.attackButton.Position        = new Point(0x2d, 0x31);
     this.attackButton.Enabled         = false;
     this.attackButton.CustomTooltipID = 0x96b;
     this.attackButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.btnAttack_Click), "ParishCapitalVillagePanel2_attack");
     this.backImage.addControl(this.attackButton);
     this.scoutButton.ImageNorm       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[3];
     this.scoutButton.ImageOver       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[10];
     this.scoutButton.ImageClick      = (Image)GFXLibrary.mrhp_world_icons_rhs_array[0x11];
     this.scoutButton.Position        = new Point(80, 0x31);
     this.scoutButton.Enabled         = false;
     this.scoutButton.CustomTooltipID = 0x96c;
     this.scoutButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.btnScout_Click), "ParishCapitalVillagePanel2_scout");
     this.backImage.addControl(this.scoutButton);
     this.reinforceButton.ImageNorm       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[2];
     this.reinforceButton.ImageOver       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[9];
     this.reinforceButton.ImageClick      = (Image)GFXLibrary.mrhp_world_icons_rhs_array[0x10];
     this.reinforceButton.Position        = new Point(0x73, 0x31);
     this.reinforceButton.Enabled         = false;
     this.reinforceButton.CustomTooltipID = 0x96d;
     this.reinforceButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.btnSendTroops_Click), "ParishCapitalVillagePanel2_reinforce");
     this.backImage.addControl(this.reinforceButton);
     this.monkButton.ImageNorm       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[4];
     this.monkButton.ImageOver       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[11];
     this.monkButton.ImageClick      = (Image)GFXLibrary.mrhp_world_icons_rhs_array[0x12];
     this.monkButton.Position        = new Point(150, 0x31);
     this.monkButton.Enabled         = false;
     this.monkButton.CustomTooltipID = 0x96e;
     this.monkButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.btnSendMonks_Click), "ParishCapitalVillagePanel2_sendmonks");
     this.backImage.addControl(this.monkButton);
     this.castleButton.ImageNorm       = (Image)GFXLibrary.mrhp_reports;
     this.castleButton.OverBrighten    = true;
     this.castleButton.MoveOnClick     = true;
     this.castleButton.Position        = new Point(0x52, 0x70);
     this.castleButton.CustomTooltipID = 0x98d;
     this.castleButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.castleClick), "ParishCapitalVillagePanel2_view_castle");
     this.backImage.addControl(this.castleButton);
     if (GameEngine.Instance.World.MapEditing)
     {
         this.mapEdit.ImageNorm    = (Image)GFXLibrary.faction_pen;
         this.mapEdit.ImageOver    = (Image)GFXLibrary.faction_pen;
         this.mapEdit.ImageClick   = (Image)GFXLibrary.faction_pen;
         this.mapEdit.MoveOnClick  = true;
         this.mapEdit.OverBrighten = true;
         this.mapEdit.Position     = new Point(0xa8, 0x70);
         this.mapEdit.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.mapEditClicked));
         this.backImage.addControl(this.mapEdit);
     }
     this.lblProtectionType.Text      = "";
     this.lblProtectionType.Color     = ARGBColors.Black;
     this.lblProtectionType.Font      = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.lblProtectionType.Position  = new Point(0, 0x26);
     this.lblProtectionType.Size      = new Size(this.backImage.Width, 0x17);
     this.lblProtectionType.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     this.backImage.addControl(this.lblProtectionType);
     this.lblProtected.Text      = "";
     this.lblProtected.Color     = ARGBColors.Black;
     this.lblProtected.Font      = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.lblProtected.Position  = new Point(6, 0x30);
     this.lblProtected.Size      = new Size(this.backImage.Width - 12, 0x4a);
     this.lblProtected.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     this.backImage.addControl(this.lblProtected);
     this.leftButton.ImageNorm = (Image)GFXLibrary.r_arrow_small_left_norm;
     this.leftButton.ImageOver = (Image)GFXLibrary.r_arrow_small_left_over;
     this.leftButton.Position  = new Point(5, 50);
     this.leftButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.infoLeft), "ParishCapitalVillagePanel2_protection_left");
     this.leftButton.Visible = false;
     this.backImage.addControl(this.leftButton);
     this.rightButton.ImageNorm = (Image)GFXLibrary.r_arrow_small_right_norm;
     this.rightButton.ImageOver = (Image)GFXLibrary.r_arrow_small_right_over;
     this.rightButton.Position  = new Point(170, 50);
     this.rightButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.infoRight), "ParishCapitalVillagePanel2_protection_right");
     this.rightButton.Visible = false;
     this.backImage.addControl(this.rightButton);
     this.lblPlagueValue.Text      = "";
     this.lblPlagueValue.Color     = ARGBColors.Black;
     this.lblPlagueValue.Font      = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
     this.lblPlagueValue.Position  = new Point(0x52, 10);
     this.lblPlagueValue.Size      = new Size(0x30, 0x16);
     this.lblPlagueValue.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     this.backImage.addControl(this.lblPlagueValue);
     this.lastPlague         = -100;
     this.numInfos           = 0;
     this.selectedProtection = 0;
 }
 public void init(FormationPopup parent)
 {
     this.m_parent = parent;
     base.Size = this.m_parent.Size;
     this.BackColor = ARGBColors.Transparent;
     CustomSelfDrawPanel.CSDImage control = new CustomSelfDrawPanel.CSDImage {
         Alpha = 0.1f,
         Image = (Image) GFXLibrary.formations_img,
         Scale = 5.0,
         Position = new Point(0, 0),
         Size = base.Size
     };
     base.addControl(control);
     this.manageLabel.Text = SK.Text("Formations_Manage_Box", "Manage Formations");
     this.manageLabel.Color = ARGBColors.White;
     this.manageLabel.DropShadowColor = ARGBColors.Black;
     this.manageLabel.Position = new Point(base.Width / 3, 5);
     this.manageLabel.Size = new Size(base.Width / 3, 0x18);
     this.manageLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
     this.manageLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
     base.addControl(this.manageLabel);
     this.storedLabel.Text = SK.Text("Formations_Stored", "Stored Formations");
     this.storedLabel.Color = ARGBColors.White;
     this.storedLabel.DropShadowColor = ARGBColors.Black;
     this.storedLabel.Position = new Point(base.Width / 3, 0x19);
     this.storedLabel.Size = new Size(base.Width / 3, 0x18);
     this.storedLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
     this.storedLabel.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     base.addControl(this.storedLabel);
     this.storedList.Size = new Size(190, 0xd8);
     this.storedList.Position = new Point((base.Width / 2) - (this.storedList.Width / 2), 0x2d);
     base.addControl(this.storedList);
     this.storedList.Create(12, 0x12);
     this.storedList.setLineClickedDelegate(new CustomSelfDrawPanel.CSDListBox.CSD_LineClickedDelegate(this.listClick));
     this.storedList.setDoubleClickedDelegate(new CustomSelfDrawPanel.CSDListBox.CSD_LineClickedDelegate(this.listDoubleClick));
     this.loadButton.ImageNorm = (Image) GFXLibrary.button_132_normal;
     this.loadButton.ImageOver = (Image) GFXLibrary.button_132_over;
     this.loadButton.ImageClick = (Image) GFXLibrary.button_132_in;
     this.loadButton.setSizeToImage();
     this.loadButton.Position = new Point((base.Width / 2) - (this.loadButton.Width / 2), this.storedList.Rectangle.Bottom + 5);
     this.loadButton.Text.Text = SK.Text("Formations_Load", "Load Formation");
     this.loadButton.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.loadButton.TextYOffset = -2;
     this.loadButton.Text.Color = ARGBColors.Black;
     this.loadButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.loadClick), "Formation_Load");
     this.loadButton.Enabled = true;
     base.addControl(this.loadButton);
     this.deleteButton.ImageNorm = (Image) GFXLibrary.button_132_normal;
     this.deleteButton.ImageOver = (Image) GFXLibrary.button_132_over;
     this.deleteButton.ImageClick = (Image) GFXLibrary.button_132_in;
     this.deleteButton.setSizeToImage();
     this.deleteButton.Position = new Point(this.loadButton.Position.X, this.loadButton.Rectangle.Bottom + 5);
     this.deleteButton.Text.Text = SK.Text("Formations_Delete", "Delete Formation");
     this.deleteButton.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.deleteButton.TextYOffset = -2;
     this.deleteButton.Text.Color = ARGBColors.Black;
     this.deleteButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.deleteClick), "Formation_Delete");
     this.deleteButton.Enabled = true;
     base.addControl(this.deleteButton);
     this.renameButton.ImageNorm = (Image) GFXLibrary.button_132_normal;
     this.renameButton.ImageOver = (Image) GFXLibrary.button_132_over;
     this.renameButton.ImageClick = (Image) GFXLibrary.button_132_in;
     this.renameButton.setSizeToImage();
     this.renameButton.Position = new Point(this.loadButton.Position.X, this.deleteButton.Rectangle.Bottom + 30);
     this.renameButton.Text.Text = SK.Text("Formations_Rename", "Rename Formation");
     this.renameButton.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.renameButton.TextYOffset = -2;
     this.renameButton.Text.Color = ARGBColors.Black;
     this.renameButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.renameClick), "Formation_Rename");
     this.renameButton.Enabled = true;
     base.addControl(this.renameButton);
     this.clearButton.ImageNorm = (Image) GFXLibrary.button_132_normal;
     this.clearButton.ImageOver = (Image) GFXLibrary.button_132_over;
     this.clearButton.ImageClick = (Image) GFXLibrary.button_132_in;
     this.clearButton.setSizeToImage();
     this.clearButton.Position = new Point(((5 * base.Width) / 6) - (this.clearButton.Width / 2), this.renameButton.Y);
     this.clearButton.Text.Text = SK.Text("Formations_Clear", "Clear Deployment");
     this.clearButton.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.clearButton.TextYOffset = -2;
     this.clearButton.Text.Color = ARGBColors.Black;
     this.clearButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.clearClick), "Formation_Clear");
     this.clearButton.Enabled = true;
     base.addControl(this.clearButton);
     this.totalsButton.ImageNorm = (Image) GFXLibrary.button_132_normal;
     this.totalsButton.ImageOver = (Image) GFXLibrary.button_132_over;
     this.totalsButton.ImageClick = (Image) GFXLibrary.button_132_in;
     this.totalsButton.setSizeToImage();
     this.totalsButton.Position = new Point(((5 * base.Width) / 6) - (this.totalsButton.Width / 2), this.deleteButton.Y);
     this.totalsButton.Text.Text = SK.Text("Formations_CurrentTotals", "Current Totals");
     this.totalsButton.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.totalsButton.TextYOffset = -2;
     this.totalsButton.Text.Color = ARGBColors.Black;
     this.totalsButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.totalsClick), "Formation_CurrentTotals");
     this.totalsButton.Enabled = true;
     base.addControl(this.totalsButton);
     this.formationImage.Image = (Image) GFXLibrary.formations_img;
     this.formationImage.setSizeToImage();
     this.formationImage.Position = new Point((base.Width / 6) - (this.formationImage.Width / 2), (this.storedList.Y + (this.storedList.Height / 2)) - (this.formationImage.Height / 2));
     base.addControl(this.formationImage);
     this.createLabel.Text = SK.Text("Formations_New_Box", "Create New Formation");
     this.createLabel.Color = ARGBColors.White;
     this.createLabel.DropShadowColor = ARGBColors.Black;
     this.createLabel.Position = new Point(0, this.deleteButton.Y);
     this.createLabel.Size = new Size(base.Width / 3, this.deleteButton.Height);
     this.createLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.BOTTOM_CENTER;
     this.createLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
     base.addControl(this.createLabel);
     this.createNameLabel.Text = SK.Text("Formations_Name", "Formation Name");
     this.createNameLabel.Color = ARGBColors.White;
     this.createNameLabel.DropShadowColor = ARGBColors.Black;
     this.createNameLabel.Position = new Point(0, this.deleteButton.Y);
     this.createNameLabel.Size = new Size(base.Width / 3, this.deleteButton.Height);
     this.createNameLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.BOTTOM_CENTER;
     this.createNameLabel.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     this.createButton.ImageNorm = (Image) GFXLibrary.button_132_normal;
     this.createButton.ImageOver = (Image) GFXLibrary.button_132_over;
     this.createButton.ImageClick = (Image) GFXLibrary.button_132_in;
     this.createButton.setSizeToImage();
     this.createButton.Position = new Point((base.Width / 6) - (this.createButton.Width / 2), this.renameButton.Y);
     this.createButton.Text.Text = SK.Text("Formations_Save", "Save Formation");
     this.createButton.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.createButton.TextYOffset = -2;
     this.createButton.Text.Color = ARGBColors.Black;
     this.createButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.createClick), "Formation_Create");
     this.createButton.Enabled = true;
     base.addControl(this.createButton);
     this.castlePlacePeasantButton.ImageNorm = (Image) GFXLibrary.r_building_miltary_peasent;
     this.castlePlacePeasantButton.ImageOver = (Image) GFXLibrary.r_building_miltary_peasent;
     this.castlePlacePeasantButton.setSizeToImage();
     this.castlePlacePeasantButton.Position = new Point((((5 * base.Width) / 6) - this.castlePlacePeasantButton.Width) - 10, this.storedLabel.Y);
     this.castlePlacePeasantButton.Data = 90;
     this.castlePlacePeasantButton.ClickArea = new Rectangle(10, 10, 0x55, 0x55);
     this.castlePlacePeasantInset.Image = (Image) GFXLibrary.castlescreen_unit_capsule;
     this.castlePlacePeasantInset.Position = new Point(0x37, 0x37);
     this.castlePlacePeasantLabel.Text = "0";
     this.castlePlacePeasantLabel.Color = Color.FromArgb(0xfe, 0xf8, 0xe5);
     this.castlePlacePeasantLabel.Position = new Point(0, -1);
     this.castlePlacePeasantLabel.Size = this.castlePlacePeasantInset.Size;
     this.castlePlacePeasantLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     base.addControl(this.castlePlacePeasantButton);
     this.castlePlacePeasantInset.addControl(this.castlePlacePeasantLabel);
     this.castlePlacePeasantButton.addControl(this.castlePlacePeasantInset);
     this.castlePlacePeasantButton.Active = false;
     this.castlePlaceArcherButton.ImageNorm = (Image) GFXLibrary.r_building_miltary_archer;
     this.castlePlaceArcherButton.ImageOver = (Image) GFXLibrary.r_building_miltary_archer;
     this.castlePlaceArcherButton.setSizeToImage();
     this.castlePlaceArcherButton.Position = new Point(this.castlePlacePeasantButton.Rectangle.Right - 10, this.castlePlacePeasantButton.Position.Y);
     this.castlePlaceArcherButton.Data = 0x5c;
     this.castlePlaceArcherButton.ClickArea = new Rectangle(10, 10, 0x55, 0x55);
     this.castlePlaceArcherInset.Image = (Image) GFXLibrary.castlescreen_unit_capsule;
     this.castlePlaceArcherInset.Position = new Point(0x37, 0x37);
     this.castlePlaceArcherLabel.Text = "0";
     this.castlePlaceArcherLabel.Color = Color.FromArgb(0xfe, 0xf8, 0xe5);
     this.castlePlaceArcherLabel.Position = new Point(0, -1);
     this.castlePlaceArcherLabel.Size = this.castlePlaceArcherInset.Size;
     this.castlePlaceArcherLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     base.addControl(this.castlePlaceArcherButton);
     this.castlePlaceArcherInset.addControl(this.castlePlaceArcherLabel);
     this.castlePlaceArcherButton.addControl(this.castlePlaceArcherInset);
     this.castlePlaceArcherButton.Active = false;
     this.castlePlacePikemanButton.ImageNorm = (Image) GFXLibrary.r_building_miltary_pikemen;
     this.castlePlacePikemanButton.ImageOver = (Image) GFXLibrary.r_building_miltary_pikemen;
     this.castlePlacePikemanButton.setSizeToImage();
     this.castlePlacePikemanButton.Position = new Point(this.castlePlacePeasantButton.Position.X, this.castlePlacePeasantButton.Rectangle.Bottom - 0x22);
     this.castlePlacePikemanButton.Data = 0x5d;
     this.castlePlacePikemanButton.ClickArea = new Rectangle(10, 10, 0x55, 0x55);
     this.castlePlacePikemanInset.Image = (Image) GFXLibrary.castlescreen_unit_capsule;
     this.castlePlacePikemanInset.Position = new Point(0x37, 0x37);
     this.castlePlacePikemanLabel.Text = "0";
     this.castlePlacePikemanLabel.Color = Color.FromArgb(0xfe, 0xf8, 0xe5);
     this.castlePlacePikemanLabel.Position = new Point(0, -1);
     this.castlePlacePikemanLabel.Size = this.castlePlacePikemanInset.Size;
     this.castlePlacePikemanLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     base.addControl(this.castlePlacePikemanButton);
     this.castlePlacePikemanInset.addControl(this.castlePlacePikemanLabel);
     this.castlePlacePikemanButton.addControl(this.castlePlacePikemanInset);
     this.castlePlacePikemanButton.Active = false;
     this.castlePlaceSwordsmanButton.ImageNorm = (Image) GFXLibrary.r_building_miltary_swordsman;
     this.castlePlaceSwordsmanButton.ImageOver = (Image) GFXLibrary.r_building_miltary_swordsman;
     this.castlePlaceSwordsmanButton.setSizeToImage();
     this.castlePlaceSwordsmanButton.Position = new Point(this.castlePlaceArcherButton.Position.X, this.castlePlacePikemanButton.Y);
     this.castlePlaceSwordsmanButton.Data = 0x5b;
     this.castlePlaceSwordsmanButton.ClickArea = new Rectangle(10, 10, 0x55, 0x55);
     this.castlePlaceSwordsmanInset.Image = (Image) GFXLibrary.castlescreen_unit_capsule;
     this.castlePlaceSwordsmanInset.Position = new Point(0x37, 0x37);
     this.castlePlaceSwordsmanLabel.Text = "0";
     this.castlePlaceSwordsmanLabel.Color = Color.FromArgb(0xfe, 0xf8, 0xe5);
     this.castlePlaceSwordsmanLabel.Position = new Point(0, -1);
     this.castlePlaceSwordsmanLabel.Size = this.castlePlaceSwordsmanInset.Size;
     this.castlePlaceSwordsmanLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     base.addControl(this.castlePlaceSwordsmanButton);
     this.castlePlaceSwordsmanInset.addControl(this.castlePlaceSwordsmanLabel);
     this.castlePlaceSwordsmanButton.addControl(this.castlePlaceSwordsmanInset);
     this.castlePlaceSwordsmanButton.Active = false;
     this.castlePlaceCatapultButton.ImageNorm = (Image) GFXLibrary.r_building_miltary_catapult;
     this.castlePlaceCatapultButton.ImageOver = (Image) GFXLibrary.r_building_miltary_catapult;
     this.castlePlaceCatapultButton.setSizeToImage();
     this.castlePlaceCatapultButton.Position = new Point(this.castlePlacePeasantButton.Position.X, this.castlePlacePikemanButton.Rectangle.Bottom - 0x22);
     this.castlePlaceCatapultButton.Data = 0x5e;
     this.castlePlaceCatapultButton.ClickArea = new Rectangle(10, 10, 0x55, 0x55);
     this.castlePlaceCatapultInset.Image = (Image) GFXLibrary.castlescreen_unit_capsule;
     this.castlePlaceCatapultInset.Position = new Point(0x37, 0x41);
     this.castlePlaceCatapultLabel.Text = "0";
     this.castlePlaceCatapultLabel.Color = Color.FromArgb(0xfe, 0xf8, 0xe5);
     this.castlePlaceCatapultLabel.Position = new Point(0, -1);
     this.castlePlaceCatapultLabel.Size = this.castlePlaceCatapultInset.Size;
     this.castlePlaceCatapultLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     base.addControl(this.castlePlaceCatapultButton);
     this.castlePlaceCatapultInset.addControl(this.castlePlaceCatapultLabel);
     this.castlePlaceCatapultButton.addControl(this.castlePlaceCatapultInset);
     this.castlePlaceCatapultButton.Active = false;
     this.castlePlaceCaptainButton.ImageNorm = (Image) GFXLibrary.r_building_miltary_captain_normal;
     this.castlePlaceCaptainButton.ImageOver = (Image) GFXLibrary.r_building_miltary_captain_normal;
     this.castlePlaceCaptainButton.setSizeToImage();
     this.castlePlaceCaptainButton.Position = new Point(this.castlePlaceArcherButton.Position.X, this.castlePlaceCatapultButton.Position.Y);
     this.castlePlaceCaptainButton.Data = 0x5e;
     this.castlePlaceCaptainButton.ClickArea = new Rectangle(10, 10, 0x55, 0x55);
     this.castlePlaceCaptainInset.Image = (Image) GFXLibrary.castlescreen_unit_capsule;
     this.castlePlaceCaptainInset.Position = new Point(0x37, 0x41);
     this.castlePlaceCaptainLabel.Text = "0";
     this.castlePlaceCaptainLabel.Color = Color.FromArgb(0xfe, 0xf8, 0xe5);
     this.castlePlaceCaptainLabel.Position = new Point(0, -1);
     this.castlePlaceCaptainLabel.Size = this.castlePlaceCaptainInset.Size;
     this.castlePlaceCaptainLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     base.addControl(this.castlePlaceCaptainButton);
     this.castlePlaceCaptainInset.addControl(this.castlePlaceCaptainLabel);
     this.castlePlaceCaptainButton.addControl(this.castlePlaceCaptainInset);
     this.castlePlaceCaptainButton.Active = false;
     this.selectedTitleLabel.Text = "";
     this.selectedTitleLabel.Color = ARGBColors.White;
     this.selectedTitleLabel.DropShadowColor = ARGBColors.Black;
     this.selectedTitleLabel.Position = new Point((2 * base.Width) / 3, this.manageLabel.Y);
     this.selectedTitleLabel.Size = new Size(base.Width / 3, 0x18);
     this.selectedTitleLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
     this.selectedTitleLabel.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     base.addControl(this.selectedTitleLabel);
     this.selectedTroopCountLabel.Text = "";
     this.selectedTroopCountLabel.Color = ARGBColors.White;
     this.selectedTroopCountLabel.DropShadowColor = ARGBColors.Black;
     this.selectedTroopCountLabel.Position = new Point((2 * base.Width) / 3, this.storedLabel.Y);
     this.selectedTroopCountLabel.Size = new Size(base.Width / 3, 0x18);
     this.selectedTroopCountLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
     this.selectedTroopCountLabel.Font = FontManager.GetFont("Arial", 8f, FontStyle.Regular);
     base.addControl(this.selectedTroopCountLabel);
     if (!Program.mySettings.AttackSetupsUpdated)
     {
         GameEngine.Instance.CastleAttackerSetup.cleanUpAttackSaveNames();
         Program.mySettings.AttackSetupsUpdated = true;
     }
     this.loadNames();
     this.initTotals();
 }
Esempio n. 17
0
 private void createRows(int startColumn, int startRow, int dx, int dy, int[] layout, CustomSelfDrawPanel.CSDImage[][] rows, int numRows, int numColumns)
 {
     GameEngine.Instance.World.getRank();
     for (int i = 0; i < numRows; i++)
     {
         int researchType = layout[i * 2];
         int num3 = layout[(i * 2) + 1];
         int num4 = 1;
         if (researchType >= 0)
         {
             num4 += ResearchData.getNumLevels(researchType, 0x16, GameEngine.Instance.LocalWorldData);
         }
         int y = (((i * dy) + startRow) * 110) + 40;
         rows[i] = new CustomSelfDrawPanel.CSDImage[numColumns];
         for (int j = 0; j < num4; j++)
         {
             int x = ((((j + num3) * dx) + startColumn) * 150) + 40;
             CustomSelfDrawPanel.CSDImage image = new CustomSelfDrawPanel.CSDImage {
                 Position = new Point(x, y)
             };
             rows[i][j + num3] = image;
             if (j == 0)
             {
                 image.Data = 0;
                 switch (num3)
                 {
                     case 0:
                     {
                         continue;
                     }
                     case 1:
                     {
                         x = (((((j - 1) + num3) * dx) + startColumn) * 150) + 40;
                         CustomSelfDrawPanel.CSDImage image2 = new CustomSelfDrawPanel.CSDImage {
                             Position = new Point(x, y)
                         };
                         rows[i][(j - 1) + num3] = image2;
                         for (int m = i - 1; m > 0; m--)
                         {
                             if (rows[m][(j - 1) + num3] != null)
                             {
                                 break;
                             }
                             int num9 = (((m * dy) + startRow) * 110) + 40;
                             CustomSelfDrawPanel.CSDImage image3 = new CustomSelfDrawPanel.CSDImage {
                                 Position = new Point(x, num9),
                                 Data = 1
                             };
                             rows[m][(j - 1) + num3] = image3;
                         }
                         continue;
                     }
                 }
                 for (int k = i - 1; k > 0; k--)
                 {
                     if (rows[k][j + num3] != null)
                     {
                         break;
                     }
                     int num11 = (((k * dy) + startRow) * 110) + 40;
                     CustomSelfDrawPanel.CSDImage image4 = new CustomSelfDrawPanel.CSDImage {
                         Position = new Point(x, num11),
                         Data = 1
                     };
                     rows[k][j + num3] = image4;
                 }
             }
             else
             {
                 image.Data = 2;
             }
         }
     }
 }
 public void init(AttackTargetsPopup parent)
 {
     this.m_parent = parent;
     base.Size = this.m_parent.Size;
     this.BackColor = ARGBColors.Transparent;
     CustomSelfDrawPanel.CSDImage control = new CustomSelfDrawPanel.CSDImage {
         Alpha = 0.1f,
         Image = (Image) GFXLibrary.formations_img,
         Scale = 5.0,
         Position = new Point(0, 0),
         Size = base.Size
     };
     base.addControl(control);
     this.favouritesHeader.Text = SK.Text("Attack_Targets_Favourites", "Favourite Targets");
     this.favouritesHeader.Color = ARGBColors.White;
     this.favouritesHeader.Position = new Point(30, 0);
     this.favouritesHeader.Size = new Size(300, 30);
     this.favouritesHeader.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     this.favouritesHeader.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     control.addControl(this.favouritesHeader);
     this.recentHeader.Text = SK.Text("Attack_Targets_Recent", "Recent Targets");
     this.recentHeader.Color = ARGBColors.White;
     this.recentHeader.Position = new Point(370, 0);
     this.recentHeader.Size = new Size(300, 30);
     this.recentHeader.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     this.recentHeader.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     control.addControl(this.recentHeader);
     this.favouritesList.Size = new Size(300, 0x156);
     this.favouritesList.Position = new Point(30, 30);
     control.addControl(this.favouritesList);
     this.favouritesList.Create(0x13, 0x12);
     this.favouritesList.setLineClickedDelegate(new CustomSelfDrawPanel.CSDListBox.CSD_LineClickedDelegate(this.favouriteClick));
     this.favouritesList.setDoubleClickedDelegate(new CustomSelfDrawPanel.CSDListBox.CSD_LineClickedDelegate(this.favouriteDoubleClick));
     this.recentList.Size = new Size(300, 0x156);
     this.recentList.Position = new Point(370, 30);
     control.addControl(this.recentList);
     this.recentList.Create(0x13, 0x12);
     this.recentList.setLineClickedDelegate(new CustomSelfDrawPanel.CSDListBox.CSD_LineClickedDelegate(this.recentClick));
     this.recentList.setDoubleClickedDelegate(new CustomSelfDrawPanel.CSDListBox.CSD_LineClickedDelegate(this.recentDoubleClick));
     this.closeButton.ImageNorm = (Image) GFXLibrary.mail2_button_blue_141wide_normal;
     this.closeButton.ImageOver = (Image) GFXLibrary.mail2_button_blue_141wide_over;
     this.closeButton.ImageClick = (Image) GFXLibrary.mail2_button_blue_141wide_pushed;
     this.closeButton.Position = new Point(540, base.Height - 70);
     this.closeButton.Text.Text = SK.Text("GENERIC_Close", "Close");
     this.closeButton.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
     this.closeButton.TextYOffset = -3;
     this.closeButton.Text.Color = ARGBColors.Black;
     this.closeButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.closeClick));
     control.addControl(this.closeButton);
     this.attackButton.ImageNorm = (Image) GFXLibrary.mail2_button_blue_141wide_normal;
     this.attackButton.ImageOver = (Image) GFXLibrary.mail2_button_blue_141wide_over;
     this.attackButton.ImageClick = (Image) GFXLibrary.mail2_button_blue_141wide_pushed;
     this.attackButton.Position = new Point(380, base.Height - 70);
     this.attackButton.Text.Text = SK.Text("GENERIC_Attack", "Attack");
     this.attackButton.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
     this.attackButton.TextYOffset = -3;
     this.attackButton.Text.Color = ARGBColors.Black;
     this.attackButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.attackClicked));
     this.attackButton.Enabled = false;
     control.addControl(this.attackButton);
     this.scoutButton.ImageNorm = (Image) GFXLibrary.mail2_button_blue_141wide_normal;
     this.scoutButton.ImageOver = (Image) GFXLibrary.mail2_button_blue_141wide_over;
     this.scoutButton.ImageClick = (Image) GFXLibrary.mail2_button_blue_141wide_pushed;
     this.scoutButton.Position = new Point(220, base.Height - 70);
     this.scoutButton.Text.Text = SK.Text("GENERIC_Scout", "Scout");
     this.scoutButton.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
     this.scoutButton.TextYOffset = -3;
     this.scoutButton.Text.Color = ARGBColors.Black;
     this.scoutButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.scoutClicked));
     this.scoutButton.Enabled = false;
     control.addControl(this.scoutButton);
     this.removeButton.ImageNorm = (Image) GFXLibrary.mail2_button_blue_141wide_normal;
     this.removeButton.ImageOver = (Image) GFXLibrary.mail2_button_blue_141wide_over;
     this.removeButton.ImageClick = (Image) GFXLibrary.mail2_button_blue_141wide_pushed;
     this.removeButton.Position = new Point(30, base.Height - 70);
     this.removeButton.Text.Text = SK.Text("MailScreen_Remove", "Remove");
     this.removeButton.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
     this.removeButton.TextYOffset = -3;
     this.removeButton.Text.Color = ARGBColors.Black;
     this.removeButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.removeClicked));
     this.removeButton.Visible = false;
     control.addControl(this.removeButton);
     this.fillBoxes();
 }
        public void init()
        {
            base.clearControls();
            this.backImage = this.backGround.init(true, 0x5e2);
            this.backGround.updateHeading(SK.Text("MapFilterSelectPanel_Map_Filtering", "Map Filtering"));
            base.addControl(this.backGround);
            this.backGround.stretchBackground();
            this.selectedImage.Image = (Image) GFXLibrary.mrhp_world_icons_filter_selected;
            this.selectedImage.Position = new Point(6, 0x2d);
            this.selectedImage.Visible = false;
            this.backImage.addControl(this.selectedImage);
            this.tradeButton.ImageNorm = (Image) GFXLibrary.mrhp_world_icons_rhs_array[0];
            this.tradeButton.ImageOver = (Image) GFXLibrary.mrhp_world_icons_rhs_array[7];
            this.tradeButton.ImageClick = (Image) GFXLibrary.mrhp_world_icons_rhs_array[14];
            this.tradeButton.Position = new Point(0x73, 0x2a);
            this.tradeButton.CustomTooltipID = 0x996;
            this.tradeButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.tradeClick), "MapFilterPanel2_trade");
            this.backImage.addControl(this.tradeButton);
            this.attackButton.ImageNorm = (Image) GFXLibrary.mrhp_world_icons_rhs_array[1];
            this.attackButton.ImageOver = (Image) GFXLibrary.mrhp_world_icons_rhs_array[8];
            this.attackButton.ImageClick = (Image) GFXLibrary.mrhp_world_icons_rhs_array[15];
            this.attackButton.Position = new Point(80, 0x4c);
            this.attackButton.CustomTooltipID = 0x997;
            this.attackButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.attackClick), "MapFilterPanel2_attack");
            this.backImage.addControl(this.attackButton);
            this.scoutButton.ImageNorm = (Image) GFXLibrary.mrhp_world_icons_rhs_array[3];
            this.scoutButton.ImageOver = (Image) GFXLibrary.mrhp_world_icons_rhs_array[10];
            this.scoutButton.ImageClick = (Image) GFXLibrary.mrhp_world_icons_rhs_array[0x11];
            this.scoutButton.Position = new Point(0x2d, 0x4c);
            this.scoutButton.CustomTooltipID = 0x998;
            this.scoutButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.scoutsClick), "MapFilterPanel2_scout");
            this.backImage.addControl(this.scoutButton);
            this.houseButton.ImageNorm = (Image) GFXLibrary.mrhp_world_icons_rhs_array[6];
            this.houseButton.ImageOver = (Image) GFXLibrary.mrhp_world_icons_rhs_array[13];
            this.houseButton.ImageClick = (Image) GFXLibrary.mrhp_world_icons_rhs_array[20];
            this.houseButton.Position = new Point(0x2d, 0x2a);
            this.houseButton.CustomTooltipID = 0x999;
            this.houseButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.houseClick), "MapFilterPanel2_house");
            this.backImage.addControl(this.houseButton);
            this.factionButton.ImageNorm = (Image) GFXLibrary.mrhp_world_icons_rhs_array[0x24];
            this.factionButton.ImageOver = (Image) GFXLibrary.mrhp_world_icons_rhs_array[0x25];
            this.factionButton.ImageClick = (Image) GFXLibrary.mrhp_world_icons_rhs_array[0x26];
            this.factionButton.Position = new Point(80, 0x2a);
            if (RemoteServices.Instance.UserFactionID >= 0)
            {
                this.factionButton.CustomTooltipID = 0x99a;
            }
            else
            {
                this.factionButton.CustomTooltipID = 0x99d;
            }
            this.factionButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.factionClick), "MapFilterPanel2_faction");
            this.backImage.addControl(this.factionButton);
            this.aiButton.ImageNorm = (Image) GFXLibrary.mrhp_button_filter_ai[0];
            this.aiButton.ImageOver = (Image) GFXLibrary.mrhp_button_filter_ai[1];
            this.aiButton.ImageClick = (Image) GFXLibrary.mrhp_button_filter_ai[2];
            this.aiButton.Position = new Point(0x73, 0x4c);
            this.aiButton.CustomTooltipID = 0x99e;
            this.aiButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.aiClick), "MapFilterPanel2_ai");
            this.backImage.addControl(this.aiButton);
            this.yourVillages.CheckedImage = (Image) GFXLibrary.mrhp_world_filter_check[0];
            this.yourVillages.UncheckedImage = (Image) GFXLibrary.mrhp_world_filter_check[1];
            this.yourVillages.Position = new Point(15, 0x75);
            this.yourVillages.Checked = GameEngine.Instance.World.worldMapFilter.FilterAlwaysShowYourVillages;
            this.yourVillages.CBLabel.Text = SK.Text("MapFilterPanel_Always_Show_Your_Villages", "Always Show Your Villages");
            this.yourVillages.CBLabel.Color = ARGBColors.Black;
            this.yourVillages.CBLabel.Position = new Point(20, -1);
            this.yourVillages.CBLabel.Size = new Size(180, 0x19);
            this.yourVillages.CBLabel.Font = FontManager.GetFont("Arial", 8f, FontStyle.Regular);
            this.yourVillages.setCheckChangedDelegate(new CustomSelfDrawPanel.CSDCheckBox.CSD_CheckChangedDelegate(this.yourToggled));
            this.backImage.addControl(this.yourVillages);
            this.diplomacyLabel.Text = SK.Text("MapFilterPanel_Diplomacy", "Diplomacy Symbols");
            this.diplomacyLabel.Position = new Point(5, 0x89);
            this.diplomacyLabel.Color = ARGBColors.Black;
            this.diplomacyLabel.Size = new Size(180, 0x19);
            this.diplomacyLabel.Font = FontManager.GetFont("Arial", 8f, FontStyle.Bold);
            this.diplomacyLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
            this.backImage.addControl(this.diplomacyLabel);
            this.houseSymbols.CheckedImage = (Image) GFXLibrary.mrhp_world_filter_check[0];
            this.houseSymbols.UncheckedImage = (Image) GFXLibrary.mrhp_world_filter_check[1];
            this.houseSymbols.Position = new Point(15, 0x9d);
            this.houseSymbols.Checked = GameEngine.Instance.World.worldMapFilter.FilterShowHouseSymbols;
            this.houseSymbols.CBLabel.Text = SK.Text("MapFilterPanel_Show_House_Symbols", "Show House Symbols");
            this.houseSymbols.CBLabel.Color = ARGBColors.Black;
            this.houseSymbols.CBLabel.Position = new Point(20, -1);
            this.houseSymbols.CBLabel.Size = new Size(180, 0x19);
            this.houseSymbols.CBLabel.Font = FontManager.GetFont("Arial", 8f, FontStyle.Regular);
            this.houseSymbols.setCheckChangedDelegate(new CustomSelfDrawPanel.CSDCheckBox.CSD_CheckChangedDelegate(this.houseToggled));
            this.backImage.addControl(this.houseSymbols);
            this.factionSymbols.CheckedImage = (Image) GFXLibrary.mrhp_world_filter_check[0];
            this.factionSymbols.UncheckedImage = (Image) GFXLibrary.mrhp_world_filter_check[1];
            this.factionSymbols.Position = new Point(15, 0xb1);
            this.factionSymbols.Checked = GameEngine.Instance.World.worldMapFilter.FilterShowFactionSymbols;
            this.factionSymbols.CBLabel.Text = SK.Text("MapFilterPanel_Show_Faction_Symbols", "Show Faction Symbols");
            this.factionSymbols.CBLabel.Color = ARGBColors.Black;
            this.factionSymbols.CBLabel.Position = new Point(20, -1);
            this.factionSymbols.CBLabel.Size = new Size(180, 0x19);
            this.factionSymbols.CBLabel.Font = FontManager.GetFont("Arial", 8f, FontStyle.Regular);
            this.factionSymbols.Data = 0;
            this.factionSymbols.setCheckChangedDelegate(new CustomSelfDrawPanel.CSDCheckBox.CSD_CheckChangedDelegate(this.factionToggled));
            this.backImage.addControl(this.factionSymbols);
            this.userSymbols.CheckedImage = (Image) GFXLibrary.mrhp_world_filter_check[0];
            this.userSymbols.UncheckedImage = (Image) GFXLibrary.mrhp_world_filter_check[1];
            this.userSymbols.Position = new Point(15, 0xc5);
            this.userSymbols.Checked = GameEngine.Instance.World.worldMapFilter.FilterShowUserSymbols;
            this.userSymbols.CBLabel.Text = SK.Text("MapFilterPanel_Show_User_Symbols", "Show Player Symbols");
            this.userSymbols.CBLabel.Color = ARGBColors.Black;
            this.userSymbols.CBLabel.Position = new Point(20, -1);
            this.userSymbols.CBLabel.Size = new Size(180, 0x19);
            this.userSymbols.CBLabel.Font = FontManager.GetFont("Arial", 8f, FontStyle.Regular);
            this.userSymbols.Data = 0;
            this.userSymbols.setCheckChangedDelegate(new CustomSelfDrawPanel.CSDCheckBox.CSD_CheckChangedDelegate(this.userToggled));
            this.backImage.addControl(this.userSymbols);
            this.searchButton.ImageNorm = (Image) GFXLibrary.mrhp_button_filter_search[0];
            this.searchButton.ImageOver = (Image) GFXLibrary.mrhp_button_filter_search[1];
            this.searchButton.ImageClick = (Image) GFXLibrary.mrhp_button_filter_search[2];
            this.searchButton.Position = new Point(0x67, 0xd7);
            this.searchButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.searchFilter), "StatsPanel_search");
            this.searchButton.CustomTooltipID = 0x99c;
            this.backImage.addControl(this.searchButton);
            this.clearButton.ImageNorm = (Image) GFXLibrary.mrhp_button_filter_off[0];
            this.clearButton.ImageOver = (Image) GFXLibrary.mrhp_button_filter_off[1];
            this.clearButton.ImageClick = (Image) GFXLibrary.mrhp_button_filter_off[2];
            this.clearButton.Position = new Point(0x13, 0xd7);
            this.clearButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.clearFilter), "MapFilterPanel2_clear");
            this.clearButton.CustomTooltipID = 0x99b;
            this.backImage.addControl(this.clearButton);
            this.cancelButton.ImageNorm = (Image) GFXLibrary.mrhp_button_80_normal;
            this.cancelButton.ImageOver = (Image) GFXLibrary.mrhp_button_80_over;
            this.cancelButton.ImageClick = (Image) GFXLibrary.mrhp_button_80_pushed;
            this.cancelButton.Position = new Point(0x67, 0xd7);
            this.cancelButton.Text.Text = SK.Text("GENERIC_Close", "Close");
            this.cancelButton.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
            this.cancelButton.Text.Size = new Size(this.cancelButton.ImageNorm.Size.Width - 6, this.cancelButton.ImageNorm.Size.Height);
            this.cancelButton.TextYOffset = -3;
            this.cancelButton.Text.Color = ARGBColors.Black;
            this.cancelButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.closeClick), "MapFilterPanel2_close");
            this.backImage.invalidate();
            InterfaceMgr.Instance.closeArmySelectedPanel();
            InterfaceMgr.Instance.closeTraderInfoPanel();
            InterfaceMgr.Instance.closeReinforcementSelectedPanel();
            InterfaceMgr.Instance.closePersonInfoPanel();
            InterfaceMgr.Instance.closeSelectedVillagePanel();
            int filterMode = GameEngine.Instance.World.worldMapFilter.FilterMode;
            if (GameEngine.Instance.World.worldMapFilter.FilterActive)
            {
                switch (filterMode)
                {
                    case 0:
                        return;

                    case 1:
                    case 7:
                        this.selectedImage.Position = this.factionButton.Position;
                        this.selectedImage.Position = new Point(this.selectedImage.Position.X - 5, this.selectedImage.Position.Y - 5);
                        this.selectedImage.Visible = true;
                        return;

                    case 2:
                        this.selectedImage.Position = this.houseButton.Position;
                        this.selectedImage.Position = new Point(this.selectedImage.Position.X - 5, this.selectedImage.Position.Y - 5);
                        this.selectedImage.Visible = true;
                        return;

                    case 3:
                        this.selectedImage.Position = this.scoutButton.Position;
                        this.selectedImage.Position = new Point(this.selectedImage.Position.X - 5, this.selectedImage.Position.Y - 5);
                        this.selectedImage.Visible = true;
                        return;

                    case 4:
                        this.selectedImage.Position = this.tradeButton.Position;
                        this.selectedImage.Position = new Point(this.selectedImage.Position.X - 5, this.selectedImage.Position.Y - 5);
                        this.selectedImage.Visible = true;
                        return;

                    case 5:
                        this.selectedImage.Position = this.tradeButton.Position;
                        this.selectedImage.Position = new Point(this.selectedImage.Position.X - 5, this.selectedImage.Position.Y - 5);
                        this.selectedImage.Visible = true;
                        return;

                    case 6:
                        this.selectedImage.Position = this.attackButton.Position;
                        this.selectedImage.Position = new Point(this.selectedImage.Position.X - 5, this.selectedImage.Position.Y - 5);
                        this.selectedImage.Visible = true;
                        return;

                    case 8:
                        this.selectedImage.Position = this.aiButton.Position;
                        this.selectedImage.Position = new Point(this.selectedImage.Position.X - 5, this.selectedImage.Position.Y - 5);
                        this.selectedImage.Visible = true;
                        return;
                }
            }
        }
        public void init(int villageID)
        {
            if (!GameEngine.Instance.LocalWorldData.AIWorld)
            {
                if (this.wasAiShort)
                {
                    this.wasAiShort = false;
                    base.Size       = new Size(0xc7, 0x111);
                }
            }
            else
            {
                switch (GameEngine.Instance.World.getSpecial(villageID))
                {
                case 7:
                case 9:
                case 11:
                case 13:
                    this.wasAiShort = true;
                    base.Size       = new Size(0xc7, 0xd5);
                    goto Label_00A8;
                }
                this.wasAiShort = false;
                base.Size       = new Size(0xc7, 0x111);
            }
Label_00A8:
            this.wasTall = this.isTallTreasureChestPanel(villageID);
            int num = 0;

            if (this.wasTall)
            {
                num = 60;
            }
            base.clearControls();
            CustomSelfDrawPanel.CSDImage image = this.backGround_AI.init(this.wasTall, 0x2710);
            base.addControl(this.backGround_AI);
            this.attackButton_AI.ImageNorm       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[1];
            this.attackButton_AI.ImageOver       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[8];
            this.attackButton_AI.ImageClick      = (Image)GFXLibrary.mrhp_world_icons_rhs_array[15];
            this.attackButton_AI.Position        = new Point(0x40, 0x4f + num);
            this.attackButton_AI.CustomTooltipID = 0x96b;
            this.attackButton_AI.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.btnAttack_Click), "EmptyVillagePanel2_attack");
            image.addControl(this.attackButton_AI);
            this.scoutButton_AI.ImageNorm       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[3];
            this.scoutButton_AI.ImageOver       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[10];
            this.scoutButton_AI.ImageClick      = (Image)GFXLibrary.mrhp_world_icons_rhs_array[0x11];
            this.scoutButton_AI.Position        = new Point(0x63, 0x4f + num);
            this.scoutButton_AI.CustomTooltipID = 0x96c;
            this.scoutButton_AI.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.btnScout_Click), "EmptyVillagePanel2_scout");
            image.addControl(this.scoutButton_AI);
            this.castleButton_AI.ImageNorm       = (Image)GFXLibrary.mrhp_reports;
            this.castleButton_AI.OverBrighten    = true;
            this.castleButton_AI.MoveOnClick     = true;
            this.castleButton_AI.Position        = new Point(80, 0x2f + num);
            this.castleButton_AI.CustomTooltipID = 0x98d;
            this.castleButton_AI.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.castleClick), "EmptyVillagePanel2_castle");
            image.addControl(this.castleButton_AI);
            this.treasureCastleTimeoutLabel.Text      = "";
            this.treasureCastleTimeoutLabel.Color     = ARGBColors.Black;
            this.treasureCastleTimeoutLabel.Font      = FontManager.GetFont("Arial", 8f, FontStyle.Regular);
            this.treasureCastleTimeoutLabel.Position  = new Point(10, 50);
            this.treasureCastleTimeoutLabel.Size      = new Size(image.Width - 20, 80);
            this.treasureCastleTimeoutLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
            this.treasureCastleTimeoutLabel.Visible   = false;
            image.addControl(this.treasureCastleTimeoutLabel);
            if (!this.wasTall)
            {
                image.Image = (Image)GFXLibrary.mrhp_world_panel_132;
            }
            image = this.backGround_Enemy.init(false, 0x2710);
            base.addControl(this.backGround_Enemy);
            this.backGround_Enemy.hideBackground();
            this.invasionLabel.Text      = "";
            this.invasionLabel.Color     = ARGBColors.Black;
            this.invasionLabel.Font      = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
            this.invasionLabel.Position  = new Point(0x39, 0x21);
            this.invasionLabel.Size      = new Size(this.backGround_Enemy.Width - 20, 80);
            this.invasionLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
            this.invasionLabel.Visible   = false;
            this.backGround_Enemy.addControl(this.invasionLabel);
            image = this.backGround_Resources.init(false, 0x2710);
            base.addControl(this.backGround_Resources);
            this.scoutButton_Resources.ImageNorm       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[3];
            this.scoutButton_Resources.ImageOver       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[10];
            this.scoutButton_Resources.ImageClick      = (Image)GFXLibrary.mrhp_world_icons_rhs_array[0x11];
            this.scoutButton_Resources.Position        = new Point(80, 0x31);
            this.scoutButton_Resources.Enabled         = false;
            this.scoutButton_Resources.CustomTooltipID = 0x98b;
            this.scoutButton_Resources.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.btnScout_Click), "EmptyVillagePanel2_scout_stash");
            image.addControl(this.scoutButton_Resources);
            image = this.backGround_Charter.init(true, 0x2710);
            base.addControl(this.backGround_Charter);
            this.charterLabel.Text      = SK.Text("EmptyVillagePanel_Cost", "Cost to found this village");
            this.charterLabel.Color     = ARGBColors.Black;
            this.charterLabel.Font      = FontManager.GetFont("Arial", 8f, FontStyle.Regular);
            this.charterLabel.Position  = new Point(0, 0x2a);
            this.charterLabel.Size      = new Size(image.Width, 40);
            this.charterLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
            image.addControl(this.charterLabel);
            this.goldImage.Image    = (Image)GFXLibrary.com_32_money;
            this.goldImage.Position = new Point(0x69, 0x3a);
            image.addControl(this.goldImage);
            this.goldLabel.Text      = "0,000,000";
            this.goldLabel.Color     = ARGBColors.Black;
            this.goldLabel.Font      = FontManager.GetFont("Arial", 8f, FontStyle.Regular);
            this.goldLabel.Position  = new Point(0, 0x42);
            this.goldLabel.Size      = new Size(100, 40);
            this.goldLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_RIGHT;
            image.addControl(this.goldLabel);
            this.honourImage.Image    = (Image)GFXLibrary.com_32_honour;
            this.honourImage.Position = new Point(0x69, 0x62);
            image.addControl(this.honourImage);
            this.honourLabel.Text      = "0,000,000";
            this.honourLabel.Color     = ARGBColors.Black;
            this.honourLabel.Font      = FontManager.GetFont("Arial", 8f, FontStyle.Regular);
            this.honourLabel.Position  = new Point(0, 0x6a);
            this.honourLabel.Size      = new Size(100, 40);
            this.honourLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_RIGHT;
            image.addControl(this.honourLabel);
            this.travelTimeDescLabel.Text      = SK.Text("EmptyVillagePanel_TravelTime", "Time to reach this Charter");
            this.travelTimeDescLabel.Color     = ARGBColors.Black;
            this.travelTimeDescLabel.Font      = FontManager.GetFont("Arial", 8f, FontStyle.Regular);
            this.travelTimeDescLabel.Position  = new Point(0, 0x94);
            this.travelTimeDescLabel.Size      = new Size(image.Width, 40);
            this.travelTimeDescLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
            image.addControl(this.travelTimeDescLabel);
            this.travelTimeLabel.Text      = "0:00";
            this.travelTimeLabel.Color     = ARGBColors.Black;
            this.travelTimeLabel.Font      = FontManager.GetFont("Arial", 8f, FontStyle.Regular);
            this.travelTimeLabel.Position  = new Point(0, 0xb1);
            this.travelTimeLabel.Size      = new Size(100, 40);
            this.travelTimeLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_RIGHT;
            image.addControl(this.travelTimeLabel);
            this.travelImage.Image    = (Image)GFXLibrary.wl_moving_unit_icons[0x20];
            this.travelImage.Position = new Point(0x69, 0xa1);
            image.addControl(this.travelImage);
            this.buyVillageButton.ImageNorm   = (Image)GFXLibrary.mrhp_button_150x25[0];
            this.buyVillageButton.ImageOver   = (Image)GFXLibrary.mrhp_button_150x25[1];
            this.buyVillageButton.ImageClick  = (Image)GFXLibrary.mrhp_button_150x25[2];
            this.buyVillageButton.Position    = new Point(0x1a, 0xd7);
            this.buyVillageButton.Text.Text   = SK.Text("EmptyVillagePanel_Buy_Village", "Purchase");
            this.buyVillageButton.Text.Font   = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
            this.buyVillageButton.TextYOffset = -3;
            this.buyVillageButton.Text.Color  = ARGBColors.Black;
            this.buyVillageButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.btnBuyVillage_Click), "EmptyVillagePanel2_buy_village");
            image.addControl(this.buyVillageButton);
        }
Esempio n. 21
0
        public void UpdatePacks()
        {
            if (packimage == null)
            {
                packimage = new Bitmap(this.packWidth, 0x88);
                using (Graphics graphics = Graphics.FromImage(packimage))
                {
                    graphics.FillRectangle(Brushes.Green, 0, 0, packimage.Width, packimage.Height);
                }
            }
            foreach (CustomSelfDrawPanel.UICardPack pack in this.packControls.Values)
            {
                this.mainBackgroundImage.removeControl(pack);
            }
            this.packControls.Clear();
            this.AvailablePanelContent.invalidate();
            int packWidth = this.packWidth;
            int num2 = 0;
            foreach (CardTypes.UserCardPack pack2 in GameEngine.Instance.World.ProfileUserCardPacks.Values)
            {
                if (!this.packControls.ContainsKey(GameEngine.Instance.World.ProfileCardOffers[pack2.PackID].Category) && (pack2.Count > 0))
                {
                    num2++;
                }
            }
            if (num2 >= 8)
            {
                packWidth = 0x4b;
            }
            foreach (CardTypes.UserCardPack pack3 in GameEngine.Instance.World.ProfileUserCardPacks.Values)
            {
                if (!this.packControls.ContainsKey(GameEngine.Instance.World.ProfileCardOffers[pack3.PackID].Category) && (pack3.Count > 0))
                {
                    CustomSelfDrawPanel.UICardPack packControl = new CustomSelfDrawPanel.UICardPack {
                        baseImage = new CustomSelfDrawPanel.CSDImage()
                    };
                    packControl.baseImage.Image = packimage;
                    packControl.baseImage.Size = packimage.Size;
                    string str = string.Empty;
                    string str2 = string.Empty;
                    string iD = string.Empty;
                    int num3 = -1;
                    switch (GameEngine.Instance.World.ProfileCardOffers[pack3.PackID].Category)
                    {
                        case "FARMING":
                            str2 = "card_pack_food_standard_normal";
                            str = "card_pack_food_standard_over";
                            num3 = 0x283d;
                            iD = "CARD_OFFERS_Food_Pack";
                            break;

                        case "CASTLE":
                            str2 = "card_pack_castle_standard_normal";
                            str = "card_pack_castle_standard_over";
                            num3 = 0x283e;
                            iD = "CARD_OFFERS_Castle_Pack";
                            break;

                        case "DEFENSE":
                        case "DEFENCE":
                            str2 = "card_pack_defence_standard_normal";
                            str = "card_pack_defence_standard_over";
                            num3 = 0x283f;
                            iD = "CARD_OFFERS_Defense_Pack";
                            break;

                        case "ARMY":
                            str2 = "card_pack_army_standard_normal";
                            str = "card_pack_army_standard_over";
                            num3 = 0x2840;
                            iD = "CARD_OFFERS_Army_Pack";
                            break;

                        case "RANDOM":
                            str2 = "card_pack_random_standard_normal";
                            str = "card_pack_random_standard_over";
                            num3 = 0x2841;
                            iD = "CARD_OFFERS_Random_Pack";
                            break;

                        case "INDUSTRY":
                            str2 = "card_pack_Industry_standard_normal";
                            str = "card_pack_Industry_standard_over";
                            num3 = 0x2842;
                            iD = "CARD_OFFERS_Industry_Pack";
                            break;

                        case "EXCLUSIVE":
                            str2 = "card_pack_exclusive_silver_normal";
                            str = "card_pack_exclusive_silver_over";
                            num3 = 0x2844;
                            iD = "CARD_OFFERS_Exclusive_Pack";
                            break;

                        case "RESEARCH":
                            str2 = "card_pack_research_silver_normal";
                            str = "card_pack_research_silver_over";
                            num3 = 0x2843;
                            iD = "CARD_OFFERS_Research_Pack";
                            break;

                        case "SUPERFARMING":
                            str2 = "card_pack_food_silver_normal";
                            str = "card_pack_food_silver_over";
                            iD = "CARD_OFFERS_Super_Food_Pack";
                            num3 = 0x2845;
                            break;

                        case "SUPERDEFENSE":
                        case "SUPERDEFENCE":
                            str2 = "card_pack_defence_silver_normal";
                            str = "card_pack_defence_silver_over";
                            iD = "CARD_OFFERS_Super_Defense_Pack";
                            num3 = 0x2846;
                            break;

                        case "SUPERRANDOM":
                            str2 = "card_pack_random_silver_normal";
                            str = "card_pack_random_silver_over";
                            iD = "CARD_OFFERS_Super_Random_Pack";
                            num3 = 0x2848;
                            break;

                        case "SUPERINDUSTRY":
                            str2 = "card_pack_Industry_silver_normal";
                            str = "card_pack_Industry_silver_over";
                            iD = "CARD_OFFERS_Super_Industry_Pack";
                            num3 = 0x2849;
                            break;

                        case "SUPERARMY":
                            str2 = "card_pack_army_silver_normal";
                            str = "card_pack_army_silver_over";
                            iD = "CARD_OFFERS_Super_Army_Pack";
                            num3 = 0x2847;
                            break;

                        case "ULTIMATEFARMING":
                            str2 = "card_pack_food_gold_normal";
                            str = "card_pack_food_gold_over";
                            iD = "CARD_OFFERS_Ultimate_Food_Pack";
                            num3 = 0x284a;
                            break;

                        case "ULTIMATEDEFENSE":
                        case "ULTIMATEDEFENCE":
                            str2 = "card_pack_defence_gold_normal";
                            str = "card_pack_defence_gold_over";
                            iD = "CARD_OFFERS_Ultimate_Defense_Pack";
                            num3 = 0x284b;
                            break;

                        case "ULTIMATERANDOM":
                            str2 = "card_pack_random_gold_normal";
                            str = "card_pack_random_gold_over";
                            iD = "CARD_OFFERS_Ultimate_Random_Pack";
                            num3 = 0x284d;
                            break;

                        case "ULTIMATEINDUSTRY":
                            str2 = "card_pack_Industry_gold_normal";
                            str = "card_pack_Industry_gold_over";
                            iD = "CARD_OFFERS_Ultimate_Industry_Pack";
                            num3 = 0x284e;
                            break;

                        case "ULTIMATEARMY":
                            str2 = "card_pack_army_gold_normal";
                            str = "card_pack_army_gold_over";
                            iD = "CARD_OFFERS_Ultimate_Army_Pack";
                            num3 = 0x284c;
                            break;

                        case "PLATINUM":
                            str2 = "card_pack_army_gold_normal";
                            str = "card_pack_army_gold_over";
                            iD = "CARD_OFFERS_Platinum_Pack";
                            num3 = 0x2851;
                            break;

                        default:
                            str2 = "card_pack_Industry_standard_normal";
                            str = "card_pack_Industry_standard_over";
                            iD = "CARD_OFFERS_Industry_Pack";
                            break;
                    }
                    packControl.nameText = SK.Text(iD);
                    try
                    {
                        packControl.baseImage.Image = GFXLibrary.CardPackImages[str2];
                    }
                    catch (Exception)
                    {
                        packControl.baseImage.Image = GFXLibrary.CardPackImages["card_pack_open_Industry-Pack"];
                    }
                    try
                    {
                        packControl.overImage.Image = GFXLibrary.CardPackImages[str];
                    }
                    catch (Exception)
                    {
                        packControl.overImage.Image = GFXLibrary.CardPackImages["card_pack_open_Industry-Pack_over"];
                    }
                    packControl.addControl(packControl.baseImage);
                    packControl.addControl(packControl.overImage);
                    packControl.baseImage.Visible = true;
                    packControl.overImage.Visible = false;
                    packControl.CustomTooltipID = num3;
                    packControl.setMouseOverDelegate(delegate {
                        packControl.baseImage.Visible = false;
                        packControl.overImage.Visible = true;
                    }, delegate {
                        packControl.baseImage.Visible = true;
                        packControl.overImage.Visible = false;
                    });
                    packControl.Size = packControl.baseImage.Size;
                    if (this.packControls.Count > 0)
                    {
                        packControl.Position = new Point(this.AvailablePanel.X + ((packWidth + 4) * this.packControls.Count), (base.Height - 4) - packControl.Height);
                    }
                    else
                    {
                        packControl.Position = new Point(this.AvailablePanel.X, (base.Height - 4) - packControl.Height);
                    }
                    packControl.ClickArea = new Rectangle(8, 0, 0x4b, packControl.Height);
                    packControl.PackIDs.Add(pack3.PackID);
                    this.packControls.Add(GameEngine.Instance.World.ProfileCardOffers[pack3.PackID].Category, packControl);
                    continue;
                }
                if (pack3.Count > 0)
                {
                    this.packControls[GameEngine.Instance.World.ProfileCardOffers[pack3.PackID].Category].PackIDs.Add(pack3.PackID);
                }
            }
            foreach (CustomSelfDrawPanel.UICardPack pack4 in this.packControls.Values)
            {
                CustomSelfDrawPanel.CSDImage image;
                image = new CustomSelfDrawPanel.CSDImage {
                    Image = (Image) GFXLibrary.cardpanel_pack_open_circle,
                    Size = ((Image)GFXLibrary.cardpanel_pack_open_circle).Size,
                    Position = new Point((pack4.Width - ((Image)GFXLibrary.cardpanel_pack_open_circle).Width) - 4, (pack4.Height - ((Image)GFXLibrary.cardpanel_pack_open_circle).Height) - (((Image)GFXLibrary.cardpanel_pack_open_circle).Height / 2))
                };
                pack4.addControl(image);
                pack4.nameLabel = new CustomSelfDrawPanel.CSDLabel();
                int num4 = 0;
                foreach (CardTypes.UserCardPack pack5 in GameEngine.Instance.World.ProfileUserCardPacks.Values)
                {
                    if (pack4.PackIDs.Contains(pack5.PackID))
                    {
                        num4 += pack5.Count;
                    }
                }
                pack4.nameLabel.Text = num4.ToString();
                pack4.nameLabel.Position = new Point((image.X - 2) - 50, image.Y - 2);
                pack4.nameLabel.Size = new Size(image.Size.Width + 100, image.Size.Height);
                pack4.nameLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
                pack4.nameLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
                pack4.nameLabel.Color = ARGBColors.Black;
                pack4.addControl(pack4.nameLabel);
                if (pack4.PackIDs.Count > 0)
                {
                    pack4.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.OpenPack));
                    this.mainBackgroundImage.addControl(pack4);
                }
            }
            this.mainBackgroundImage.invalidate();
        }
 public void init()
 {
     base.clearControls();
     this.backImage = this.backGround.init(true, 0x2710);
     base.addControl(this.backGround);
     this.tradeButton.ImageNorm       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[0];
     this.tradeButton.ImageOver       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[7];
     this.tradeButton.ImageClick      = (Image)GFXLibrary.mrhp_world_icons_rhs_array[14];
     this.tradeButton.Position        = new Point(80, 0x8e);
     this.tradeButton.CustomTooltipID = 0x989;
     this.tradeButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.tradeClick), "OwnParishCapitalPanel2_trade");
     this.backImage.addControl(this.tradeButton);
     if (GameEngine.Instance.World.MapEditing)
     {
         this.mapEdit.ImageNorm    = (Image)GFXLibrary.faction_pen;
         this.mapEdit.ImageOver    = (Image)GFXLibrary.faction_pen;
         this.mapEdit.ImageClick   = (Image)GFXLibrary.faction_pen;
         this.mapEdit.MoveOnClick  = true;
         this.mapEdit.OverBrighten = true;
         this.mapEdit.Position     = new Point(150, 0x8e);
         this.mapEdit.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.mapEditClicked));
         this.backImage.addControl(this.mapEdit);
     }
     this.villageButton.ImageNorm       = (Image)GFXLibrary.int_world_icon_village;
     this.villageButton.OverBrighten    = true;
     this.villageButton.MoveOnClick     = true;
     this.villageButton.Position        = new Point(0x1d, 0x70);
     this.villageButton.CustomTooltipID = 0x985;
     this.villageButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.villageClick), "OwnParishCapitalPanel2_view_village");
     this.backImage.addControl(this.villageButton);
     this.castleButton.ImageNorm       = (Image)GFXLibrary.int_world_icon_castle;
     this.castleButton.OverBrighten    = true;
     this.castleButton.MoveOnClick     = true;
     this.castleButton.Position        = new Point(0x40, 0x70);
     this.castleButton.CustomTooltipID = 0x986;
     this.castleButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.castleClick), "OwnParishCapitalPanel2_view_castle");
     this.backImage.addControl(this.castleButton);
     this.resourcesButton.ImageNorm       = (Image)GFXLibrary.int_world_icon_resource;
     this.resourcesButton.OverBrighten    = true;
     this.resourcesButton.MoveOnClick     = true;
     this.resourcesButton.Position        = new Point(0x63, 0x70);
     this.resourcesButton.CustomTooltipID = 0x987;
     this.resourcesButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.resourcesClick), "OwnParishCapitalPanel2_view_resources");
     this.backImage.addControl(this.resourcesButton);
     this.troopsButton.ImageNorm       = (Image)GFXLibrary.int_world_icon_troops;
     this.troopsButton.OverBrighten    = true;
     this.troopsButton.MoveOnClick     = true;
     this.troopsButton.Position        = new Point(0x86, 0x70);
     this.troopsButton.CustomTooltipID = 0x98a;
     this.troopsButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.troopsClick), "OwnParishCapitalPanel2_make_troops");
     this.backImage.addControl(this.troopsButton);
     this.lblPlagueValue.Text      = "";
     this.lblPlagueValue.Color     = ARGBColors.Black;
     this.lblPlagueValue.Font      = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
     this.lblPlagueValue.Position  = new Point(0x52, 10);
     this.lblPlagueValue.Size      = new Size(0x30, 0x16);
     this.lblPlagueValue.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     this.backImage.addControl(this.lblPlagueValue);
     this.lblProtectionType.Text      = "";
     this.lblProtectionType.Color     = ARGBColors.Black;
     this.lblProtectionType.Font      = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.lblProtectionType.Position  = new Point(0, 0x26);
     this.lblProtectionType.Size      = new Size(this.backImage.Width, 0x17);
     this.lblProtectionType.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     this.backImage.addControl(this.lblProtectionType);
     this.lblProtected.Text      = "";
     this.lblProtected.Color     = ARGBColors.Black;
     this.lblProtected.Font      = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.lblProtected.Position  = new Point(6, 0x30);
     this.lblProtected.Size      = new Size(this.backImage.Width - 12, 0x4a);
     this.lblProtected.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     this.backImage.addControl(this.lblProtected);
     this.leftButton.ImageNorm = (Image)GFXLibrary.r_arrow_small_left_norm;
     this.leftButton.ImageOver = (Image)GFXLibrary.r_arrow_small_left_over;
     this.leftButton.Position  = new Point(5, 50);
     this.leftButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.infoLeft), "OwnParishCapitalPanel2_protection_left");
     this.leftButton.Visible = false;
     this.backImage.addControl(this.leftButton);
     this.rightButton.ImageNorm = (Image)GFXLibrary.r_arrow_small_right_norm;
     this.rightButton.ImageOver = (Image)GFXLibrary.r_arrow_small_right_over;
     this.rightButton.Position  = new Point(170, 50);
     this.rightButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.infoRight), "OwnParishCapitalPanel2_protection_right");
     this.rightButton.Visible = false;
     this.backImage.addControl(this.rightButton);
     this.lastPlague         = -100;
     this.numInfos           = 0;
     this.selectedProtection = 0;
 }
Esempio n. 23
0
 public void init(AttackTargetsPopup parent)
 {
     this.m_parent  = parent;
     base.Size      = this.m_parent.Size;
     this.BackColor = ARGBColors.Transparent;
     CustomSelfDrawPanel.CSDImage control = new CustomSelfDrawPanel.CSDImage {
         Alpha    = 0.1f,
         Image    = (Image)GFXLibrary.formations_img,
         Scale    = 5.0,
         Position = new Point(0, 0),
         Size     = base.Size
     };
     base.addControl(control);
     this.favouritesHeader.Text      = SK.Text("Attack_Targets_Favourites", "Favourite Targets");
     this.favouritesHeader.Color     = ARGBColors.White;
     this.favouritesHeader.Position  = new Point(30, 0);
     this.favouritesHeader.Size      = new Size(300, 30);
     this.favouritesHeader.Font      = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     this.favouritesHeader.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     control.addControl(this.favouritesHeader);
     this.recentHeader.Text      = SK.Text("Attack_Targets_Recent", "Recent Targets");
     this.recentHeader.Color     = ARGBColors.White;
     this.recentHeader.Position  = new Point(370, 0);
     this.recentHeader.Size      = new Size(300, 30);
     this.recentHeader.Font      = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     this.recentHeader.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     control.addControl(this.recentHeader);
     this.favouritesList.Size     = new Size(300, 0x156);
     this.favouritesList.Position = new Point(30, 30);
     control.addControl(this.favouritesList);
     this.favouritesList.Create(0x13, 0x12);
     this.favouritesList.setLineClickedDelegate(new CustomSelfDrawPanel.CSDListBox.CSD_LineClickedDelegate(this.favouriteClick));
     this.favouritesList.setDoubleClickedDelegate(new CustomSelfDrawPanel.CSDListBox.CSD_LineClickedDelegate(this.favouriteDoubleClick));
     this.recentList.Size     = new Size(300, 0x156);
     this.recentList.Position = new Point(370, 30);
     control.addControl(this.recentList);
     this.recentList.Create(0x13, 0x12);
     this.recentList.setLineClickedDelegate(new CustomSelfDrawPanel.CSDListBox.CSD_LineClickedDelegate(this.recentClick));
     this.recentList.setDoubleClickedDelegate(new CustomSelfDrawPanel.CSDListBox.CSD_LineClickedDelegate(this.recentDoubleClick));
     this.closeButton.ImageNorm   = (Image)GFXLibrary.mail2_button_blue_141wide_normal;
     this.closeButton.ImageOver   = (Image)GFXLibrary.mail2_button_blue_141wide_over;
     this.closeButton.ImageClick  = (Image)GFXLibrary.mail2_button_blue_141wide_pushed;
     this.closeButton.Position    = new Point(540, base.Height - 70);
     this.closeButton.Text.Text   = SK.Text("GENERIC_Close", "Close");
     this.closeButton.Text.Font   = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
     this.closeButton.TextYOffset = -3;
     this.closeButton.Text.Color  = ARGBColors.Black;
     this.closeButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.closeClick));
     control.addControl(this.closeButton);
     this.attackButton.ImageNorm   = (Image)GFXLibrary.mail2_button_blue_141wide_normal;
     this.attackButton.ImageOver   = (Image)GFXLibrary.mail2_button_blue_141wide_over;
     this.attackButton.ImageClick  = (Image)GFXLibrary.mail2_button_blue_141wide_pushed;
     this.attackButton.Position    = new Point(380, base.Height - 70);
     this.attackButton.Text.Text   = SK.Text("GENERIC_Attack", "Attack");
     this.attackButton.Text.Font   = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
     this.attackButton.TextYOffset = -3;
     this.attackButton.Text.Color  = ARGBColors.Black;
     this.attackButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.attackClicked));
     this.attackButton.Enabled = false;
     control.addControl(this.attackButton);
     this.scoutButton.ImageNorm   = (Image)GFXLibrary.mail2_button_blue_141wide_normal;
     this.scoutButton.ImageOver   = (Image)GFXLibrary.mail2_button_blue_141wide_over;
     this.scoutButton.ImageClick  = (Image)GFXLibrary.mail2_button_blue_141wide_pushed;
     this.scoutButton.Position    = new Point(220, base.Height - 70);
     this.scoutButton.Text.Text   = SK.Text("GENERIC_Scout", "Scout");
     this.scoutButton.Text.Font   = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
     this.scoutButton.TextYOffset = -3;
     this.scoutButton.Text.Color  = ARGBColors.Black;
     this.scoutButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.scoutClicked));
     this.scoutButton.Enabled = false;
     control.addControl(this.scoutButton);
     this.removeButton.ImageNorm   = (Image)GFXLibrary.mail2_button_blue_141wide_normal;
     this.removeButton.ImageOver   = (Image)GFXLibrary.mail2_button_blue_141wide_over;
     this.removeButton.ImageClick  = (Image)GFXLibrary.mail2_button_blue_141wide_pushed;
     this.removeButton.Position    = new Point(30, base.Height - 70);
     this.removeButton.Text.Text   = SK.Text("MailScreen_Remove", "Remove");
     this.removeButton.Text.Font   = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
     this.removeButton.TextYOffset = -3;
     this.removeButton.Text.Color  = ARGBColors.Black;
     this.removeButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.removeClicked));
     this.removeButton.Visible = false;
     control.addControl(this.removeButton);
     this.fillBoxes();
 }
 public void init()
 {
     base.clearControls();
     this.backImage = this.backGround.init(true, 0x2710);
     base.addControl(this.backGround);
     this.tradeButton.ImageNorm       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[0];
     this.tradeButton.ImageOver       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[7];
     this.tradeButton.ImageClick      = (Image)GFXLibrary.mrhp_world_icons_rhs_array[14];
     this.tradeButton.Position        = new Point(10, 0x8e);
     this.tradeButton.CustomTooltipID = 0x96a;
     this.tradeButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.sendResources), "OtherVillagePanel2_trade");
     this.backImage.addControl(this.tradeButton);
     this.attackButton.ImageNorm       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[1];
     this.attackButton.ImageOver       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[8];
     this.attackButton.ImageClick      = (Image)GFXLibrary.mrhp_world_icons_rhs_array[15];
     this.attackButton.Position        = new Point(0x2d, 0x8e);
     this.attackButton.CustomTooltipID = 0x96b;
     this.attackButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.sendTroops), "OtherVillagePanel2_attack");
     this.backImage.addControl(this.attackButton);
     this.scoutButton.ImageNorm       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[3];
     this.scoutButton.ImageOver       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[10];
     this.scoutButton.ImageClick      = (Image)GFXLibrary.mrhp_world_icons_rhs_array[0x11];
     this.scoutButton.Position        = new Point(80, 0x8e);
     this.scoutButton.CustomTooltipID = 0x96c;
     this.scoutButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.sendScouts), "OtherVillagePanel2_scout");
     this.backImage.addControl(this.scoutButton);
     this.reinforceButton.ImageNorm       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[2];
     this.reinforceButton.ImageOver       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[9];
     this.reinforceButton.ImageClick      = (Image)GFXLibrary.mrhp_world_icons_rhs_array[0x10];
     this.reinforceButton.Position        = new Point(0x73, 0x8e);
     this.reinforceButton.CustomTooltipID = 0x96d;
     this.reinforceButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.sendReinforcements), "OtherVillagePanel2_reinforce");
     this.backImage.addControl(this.reinforceButton);
     this.monkButton.ImageNorm       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[4];
     this.monkButton.ImageOver       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[11];
     this.monkButton.ImageClick      = (Image)GFXLibrary.mrhp_world_icons_rhs_array[0x12];
     this.monkButton.Position        = new Point(150, 0x8e);
     this.monkButton.CustomTooltipID = 0x96e;
     this.monkButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.sendMonks), "OtherVillagePanel2_sendmonks");
     this.backImage.addControl(this.monkButton);
     this.vassalButton.ImageNorm       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[5];
     this.vassalButton.ImageOver       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[12];
     this.vassalButton.ImageClick      = (Image)GFXLibrary.mrhp_world_icons_rhs_array[0x13];
     this.vassalButton.Position        = new Point(0x73, 0x70);
     this.vassalButton.CustomTooltipID = 0x98e;
     this.vassalButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.vassalClick), "OtherVillagePanel2_make_vassal");
     this.backImage.addControl(this.vassalButton);
     this.castleButton.ImageNorm       = (Image)GFXLibrary.mrhp_reports;
     this.castleButton.OverBrighten    = true;
     this.castleButton.MoveOnClick     = true;
     this.castleButton.Position        = new Point(0x40, 0x70);
     this.castleButton.CustomTooltipID = 0x98d;
     this.castleButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.castleClick), "OtherVillagePanel2_view_castle");
     this.backImage.addControl(this.castleButton);
     if (RemoteServices.Instance.Admin || RemoteServices.Instance.Moderator)
     {
         this.renameButton.ImageNorm       = (Image)GFXLibrary.faction_pen;
         this.renameButton.OverBrighten    = true;
         this.renameButton.MoveOnClick     = true;
         this.renameButton.Position        = new Point(0x8b, 0x39);
         this.renameButton.CustomTooltipID = 0x2896;
         this.renameButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.resetNameClick));
         this.backImage.addControl(this.renameButton);
     }
     this.lblProtectionType.Text      = "";
     this.lblProtectionType.Color     = ARGBColors.Black;
     this.lblProtectionType.Font      = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.lblProtectionType.Position  = new Point(0, 0x26);
     this.lblProtectionType.Size      = new Size(this.backImage.Width, 0x17);
     this.lblProtectionType.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     this.backImage.addControl(this.lblProtectionType);
     this.lblProtected.Text      = "";
     this.lblProtected.Color     = ARGBColors.Black;
     this.lblProtected.Font      = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.lblProtected.Position  = new Point(6, 0x30);
     this.lblProtected.Size      = new Size(this.backImage.Width - 12, 0x4a);
     this.lblProtected.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     this.backImage.addControl(this.lblProtected);
     this.leftButton.ImageNorm = (Image)GFXLibrary.r_arrow_small_left_norm;
     this.leftButton.ImageOver = (Image)GFXLibrary.r_arrow_small_left_over;
     this.leftButton.Position  = new Point(5, 50);
     this.leftButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.infoLeft), "OtherVillagePanel2_protection_left");
     this.leftButton.Visible = false;
     this.backImage.addControl(this.leftButton);
     this.rightButton.ImageNorm = (Image)GFXLibrary.r_arrow_small_right_norm;
     this.rightButton.ImageOver = (Image)GFXLibrary.r_arrow_small_right_over;
     this.rightButton.Position  = new Point(170, 50);
     this.rightButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.infoRight), "OtherVillagePanel2_protection_right");
     this.rightButton.Visible = false;
     this.backImage.addControl(this.rightButton);
     this.updateSize();
     this.numInfos           = 0;
     this.selectedProtection = 0;
 }
Esempio n. 25
0
 public void init(LostVillageWindow parent, int age, int cardsMode)
 {
     this.m_secondAgeMessage = age;
     this.m_parent           = parent;
     this.m_cardsMode        = cardsMode;
     base.clearControls();
     this.transparentBackground.Size      = base.Size;
     this.transparentBackground.FillColor = Color.FromArgb(0xff, 0, 0xff);
     base.addControl(this.transparentBackground);
     if (age != 0x3e8)
     {
         this.background.Position = new Point(0, 70);
         this.background.Size     = new Size(base.Width, 0x1be);
         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.topImage.Image    = (Image)GFXLibrary._9sclice_fancy_top_mid_over_01;
         this.topImage.Position = new Point((base.Width - this.topImage.Image.Width) / 2, 0);
         base.addControl(this.topImage);
         this.bottomImage.Image    = (Image)GFXLibrary._9sclice_fancy_bottom_mid_over;
         this.bottomImage.Position = new Point((base.Width - this.bottomImage.Image.Width) / 2, (base.Height - this.bottomImage.Image.Height) - 5);
         base.addControl(this.bottomImage);
         this.backgroundArea.Position = new Point(0xab, 0x86);
         this.backgroundArea.Size     = new Size(0x202, 340);
         base.addControl(this.backgroundArea);
     }
     else
     {
         this.backgroundImage.Position = new Point(0, 0);
         this.backgroundImage.Image    = (Image)GFXLibrary.dominationEnd;
         base.addControl(this.backgroundImage);
         this.backgroundArea.Position = new Point(0, 0);
         this.backgroundArea.Size     = this.backgroundImage.Size;
         base.addControl(this.backgroundArea);
     }
     this.btnLogout.ImageNorm  = (Image)GFXLibrary.worldSelect_swap_norm;
     this.btnLogout.ImageOver  = (Image)GFXLibrary.worldSelect_swap_over;
     this.btnLogout.ImageClick = (Image)GFXLibrary.worldSelect_swap_pushed;
     if (age != 0x3e8)
     {
         this.btnLogout.Position = new Point(260 - (this.btnLogout.ImageNorm.Width / 2), 0x147);
     }
     else
     {
         this.btnLogout.Position = new Point((base.Width / 2) - (this.btnLogout.ImageNorm.Width / 2), 0x23d);
     }
     this.btnLogout.Text.Text            = SK.Text("GENERIC_Continue", "Continue");
     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);
     if (cardsMode < 0)
     {
         if (this.m_secondAgeMessage == 0)
         {
             this.headerLabel.Text            = SK.Text("WorldSelect_Villages_Lost", "Your village was lost due to") + " :";
             this.headerLabel.Position        = new Point(-50, 12);
             this.headerLabel.Size            = new Size(this.backgroundArea.Width + 100, 150);
             this.headerLabel.Font            = FontManager.GetFont("Arial", 18f, FontStyle.Regular);
             this.headerLabel.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
             this.headerLabel.Color           = ARGBColors.Black;
             this.headerLabel.DropShadowColor = ARGBColors.LightGray;
             this.backgroundArea.addControl(this.headerLabel);
             if (GameEngine.Instance.World.lastAttacker.Length == 0)
             {
                 this.lostMessageLabel.Text = SK.Text("WorldSelect_Inactivity", "Inactivity");
             }
             else if (GameEngine.Instance.World.lastAttacker == RemoteServices.Instance.UserName)
             {
                 this.lostMessageLabel.Text = SK.Text("WorldSelect_Abandoning", "You Abandoned Your Village");
             }
             else
             {
                 this.lostMessageLabel.Text = SK.Text("WorldSelect_Attacking_Player", "An Attacking Player") + " (" + GameEngine.Instance.World.lastAttacker + ")";
             }
             this.lostMessageLabel.Position        = new Point(0, 0x2f);
             this.lostMessageLabel.Size            = new Size(this.backgroundArea.Width, 240);
             this.lostMessageLabel.Font            = FontManager.GetFont("Arial", 12f, FontStyle.Regular);
             this.lostMessageLabel.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
             this.lostMessageLabel.Color           = ARGBColors.Black;
             this.lostMessageLabel.DropShadowColor = ARGBColors.LightGray;
             this.backgroundArea.addControl(this.lostMessageLabel);
             this.wallOfText.Text            = SK.Text("WorldSelect_wall_of_text1", "Losing your village is all part of the game and this is only the beginning!") + Environment.NewLine + Environment.NewLine + SK.Text("WorldSelect_wall_of_text2", "There are no penalties for losing a village. You have the same amount of Gold, Honour and Faith Points as before and any unused Cards, Card Packs or Premium Tokens remain in your account. Quests, Research and Achievements are all unaffected and your Rank remains the same.") + Environment.NewLine + Environment.NewLine + SK.Text("WorldSelect_wall_of_text3", "With all your resources and abilities intact all that remains is for you to rebuild and rise to fight again!");
             this.wallOfText.Position        = new Point(0, 0x40);
             this.wallOfText.Size            = new Size(this.backgroundArea.Width, 260);
             this.wallOfText.Font            = FontManager.GetFont("Arial", 12f, FontStyle.Regular);
             this.wallOfText.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
             this.wallOfText.Color           = ARGBColors.Black;
             this.wallOfText.DropShadowColor = ARGBColors.LightGray;
             this.backgroundArea.addControl(this.wallOfText);
         }
         else if (this.m_secondAgeMessage == 2)
         {
             this.headerLabel.Text            = SK.Text("WorldSelect_2ndAge_Header", "Welcome to the Second Age!");
             this.headerLabel.Position        = new Point(-50, 12);
             this.headerLabel.Size            = new Size(this.backgroundArea.Width + 100, 150);
             this.headerLabel.Font            = FontManager.GetFont("Arial", 18f, FontStyle.Regular);
             this.headerLabel.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
             this.headerLabel.Color           = ARGBColors.Black;
             this.headerLabel.DropShadowColor = ARGBColors.LightGray;
             this.backgroundArea.addControl(this.headerLabel);
             this.wallOfText.Text     = SK.Text("WorldSelect_2ndAge_body1", "A new rule set is now in effect:") + Environment.NewLine + Environment.NewLine + SK.Text("WorldSelect_2ndAge_body2", "1. Armies move across the world map at double speed.") + Environment.NewLine + SK.Text("WorldSelect_2ndAge_body3", "2. Three times as much Glory is earned for holding territory.") + Environment.NewLine + SK.Text("WorldSelect_2ndAge_body4", "3. Monks can influence voting at county level, with high voting costs and caps at county, province and country level.") + Environment.NewLine + SK.Text("WorldSelect_2ndAge_body5", "4. Interdicting and excommunicating villages costs twice the usual amount.") + Environment.NewLine + SK.Text("WorldSelect_2ndAge_body6", "5. At the end of the Second Age Glory Race players will be given unique treasures for their victory and a 'Champion Pack'.") + Environment.NewLine + Environment.NewLine + SK.Text("WorldSelect_2ndAge_body7", "For more information on the Second Age please check your mail.");
             this.wallOfText.Position = new Point(0, 0x31);
             this.wallOfText.Size     = new Size(this.backgroundArea.Width, 260);
             if ((Program.mySettings.LanguageIdent == "fr") || (Program.mySettings.LanguageIdent == "ru"))
             {
                 this.wallOfText.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
             }
             else
             {
                 this.wallOfText.Font = FontManager.GetFont("Arial", 11f, FontStyle.Regular);
             }
             this.wallOfText.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT;
             this.wallOfText.Color           = ARGBColors.Black;
             this.wallOfText.DropShadowColor = ARGBColors.LightGray;
             this.backgroundArea.addControl(this.wallOfText);
             CustomSelfDrawPanel.WikiLinkControl.init(this.backgroundArea, 0x2d, new Point(0x201, -6));
         }
         else if (this.m_secondAgeMessage == 3)
         {
             this.headerLabel.Text            = SK.Text("WorldSelect_3rdAge_Header", "Welcome to the Third Age!");
             this.headerLabel.Position        = new Point(-50, 12);
             this.headerLabel.Size            = new Size(this.backgroundArea.Width + 100, 150);
             this.headerLabel.Font            = FontManager.GetFont("Arial", 18f, FontStyle.Regular);
             this.headerLabel.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
             this.headerLabel.Color           = ARGBColors.Black;
             this.headerLabel.DropShadowColor = ARGBColors.LightGray;
             this.backgroundArea.addControl(this.headerLabel);
             this.wallOfText.Text            = SK.Text("WorldSelect_2ndAge_body1", "A new rule set is now in effect:") + Environment.NewLine + Environment.NewLine + SK.Text("WorldSelect_3rdAge_body2", "1. Crown Princes may now access up to 30 villages") + Environment.NewLine + SK.Text("WorldSelect_3rdAge_body3", "2. Honour production has been increased by 900% for Banqueting and 300% for Popularity") + Environment.NewLine + SK.Text("WorldSelect_3rdAge_body4", "3. Goods have been cleared from all Markets, with prices reset to their starting levels") + Environment.NewLine + SK.Text("WorldSelect_3rdAge_body5", "4. All in-game Factions and Houses have been disbanded") + Environment.NewLine + SK.Text("WorldSelect_3rdAge_body6", "5. Certain upgradeable parish buildings can now gain additional levels") + Environment.NewLine + SK.Text("WorldSelect_3rdAge_body7", "6. The rate at which Glory is gained has been rebalanced") + Environment.NewLine + Environment.NewLine + SK.Text("WorldSelect_3rdAge_body8", "For more information on the Third Age please check your mail");
             this.wallOfText.Position        = new Point(0, 0x31);
             this.wallOfText.Size            = new Size(this.backgroundArea.Width, 260);
             this.wallOfText.Font            = FontManager.GetFont("Arial", 11f, FontStyle.Regular);
             this.wallOfText.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT;
             this.wallOfText.Color           = ARGBColors.Black;
             this.wallOfText.DropShadowColor = ARGBColors.LightGray;
             this.backgroundArea.addControl(this.wallOfText);
             CustomSelfDrawPanel.WikiLinkControl.init(this.backgroundArea, 0x2e, new Point(0x201, -6));
         }
         else if (this.m_secondAgeMessage == 4)
         {
             this.headerLabel.Text            = SK.Text("WorldSelect_4thAge_Header", "Welcome to the Fourth Age!");
             this.headerLabel.Position        = new Point(-50, 12);
             this.headerLabel.Size            = new Size(this.backgroundArea.Width + 100, 150);
             this.headerLabel.Font            = FontManager.GetFont("Arial", 18f, FontStyle.Regular);
             this.headerLabel.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
             this.headerLabel.Color           = ARGBColors.Black;
             this.headerLabel.DropShadowColor = ARGBColors.LightGray;
             this.backgroundArea.addControl(this.headerLabel);
             this.wallOfText.Text            = SK.Text("WorldSelect_2ndAge_body1", "A new rule set is now in effect:") + Environment.NewLine + Environment.NewLine + SK.Text("WorldSelect_4thAge_body2", "1. Crown Princes may now own up to 40 villages.") + Environment.NewLine + SK.Text("WorldSelect_4thAge_body3", "2. Army and Scout movement speeds are three times faster than in the First Age.") + Environment.NewLine + SK.Text("WorldSelect_4thAge_body4", "3. Weapons can no longer be sold or purchased at Markets.") + Environment.NewLine + SK.Text("WorldSelect_4thAge_body5", "4. Goods have been cleared from all Markets, with prices reset to their starting level.") + Environment.NewLine + SK.Text("WorldSelect_4thAge_body6", "5. The Faith Point cost for Interdiction has been increased.") + Environment.NewLine + SK.Text("WorldSelect_4thAge_body7", "6. A Military School can be built in a parish, which gives access to Bombards.") + Environment.NewLine + SK.Text("WorldSelect_4thAge_body8", "7. Players who own more than 10 villages will no longer have to pay the extra honour cost to regain a village, if one of their villages is captured.") + Environment.NewLine + Environment.NewLine + SK.Text("WorldSelect_4thAge_body9", "For more information on the Fourth Age please check your mail.");
             this.wallOfText.Position        = new Point(0, 0x31);
             this.wallOfText.Size            = new Size(this.backgroundArea.Width, 260);
             this.wallOfText.Font            = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
             this.wallOfText.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT;
             this.wallOfText.Color           = ARGBColors.Black;
             this.wallOfText.DropShadowColor = ARGBColors.LightGray;
             this.backgroundArea.addControl(this.wallOfText);
             CustomSelfDrawPanel.WikiLinkControl.init(this.backgroundArea, 0x30, new Point(0x201, -6));
         }
         else if (this.m_secondAgeMessage == 5)
         {
             this.headerLabel.Text            = SK.Text("WorldSelect_5thAge_Header", "Welcome to the Fifth Age!");
             this.headerLabel.Position        = new Point(-50, 12);
             this.headerLabel.Size            = new Size(this.backgroundArea.Width + 100, 150);
             this.headerLabel.Font            = FontManager.GetFont("Arial", 18f, FontStyle.Regular);
             this.headerLabel.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
             this.headerLabel.Color           = ARGBColors.Black;
             this.headerLabel.DropShadowColor = ARGBColors.LightGray;
             this.backgroundArea.addControl(this.headerLabel);
             this.wallOfText.Text            = SK.Text("WorldSelect_2ndAge_body1", "A new rule set is now in effect:") + Environment.NewLine + Environment.NewLine + SK.Text("FifthAge_Mail_03", "1. Military Schools can be upgraded to level 5.") + Environment.NewLine + SK.Text("FifthAge_Mail_04", "2. Treasure Castles are twice as likely to appear.") + Environment.NewLine + SK.Text("FifthAge_Mail_05", "3. All factions and houses have been disbanded.") + Environment.NewLine + SK.Text("FifthAge_Mail_06", "4. All capital forums and walls have been cleared.") + Environment.NewLine + SK.Text("FifthAge_Mail_07", "5. Only members of a House can be candidates for County elections.") + Environment.NewLine + SK.Text("FifthAge_Mail_08", "6. To be eligible for the office of sheriff, a candidate must belong to a House which controls at least 30% of the parishes in the county.") + Environment.NewLine + SK.Text("WorldSelect_5thAge_body8", "7. Large Houses gain Glory more slowly than small Houses.") + Environment.NewLine + Environment.NewLine + SK.Text("WorldSelect_5thAge_body9", "For more information on the Fifth Age please check your mail.");
             this.wallOfText.Position        = new Point(0, 0x31);
             this.wallOfText.Size            = new Size(this.backgroundArea.Width, 260);
             this.wallOfText.Font            = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
             this.wallOfText.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT;
             this.wallOfText.Color           = ARGBColors.Black;
             this.wallOfText.DropShadowColor = ARGBColors.LightGray;
             this.backgroundArea.addControl(this.wallOfText);
             CustomSelfDrawPanel.WikiLinkControl.init(this.backgroundArea, 0x33, new Point(0x201, -6));
         }
         else if (this.m_secondAgeMessage == 10)
         {
             this.headerLabel.Text            = SK.Text("WorldSelect_Dom_Heading1", "Welcome to Domination World!");
             this.headerLabel.Position        = new Point(-50, 0);
             this.headerLabel.Size            = new Size(this.backgroundArea.Width + 100, 150);
             this.headerLabel.Font            = FontManager.GetFont("Arial", 18f, FontStyle.Regular);
             this.headerLabel.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
             this.headerLabel.Color           = ARGBColors.Black;
             this.headerLabel.DropShadowColor = ARGBColors.LightGray;
             this.backgroundArea.addControl(this.headerLabel);
             this.wallOfText.Text     = SK.Text("WorldSelect_Dom_body2", "New gameplay rules are in effect") + ":" + Environment.NewLine + Environment.NewLine + "1. " + SK.Text("WorldSelect_Dom_body3", "Interdiction cannot be used.") + Environment.NewLine + "2. " + SK.Text("WorldSelect_Dom_body4", "Build speeds quadrupled for buildings and castles in villages and capitals.") + Environment.NewLine + "3. " + SK.Text("WorldSelect_Dom_body5", "Research times reduced by half.") + Environment.NewLine + "4. " + SK.Text("WorldSelect_Dom_body6", "Time limit of 60 days, after which the world ends.") + Environment.NewLine + "5. " + SK.Text("WorldSelect_Dom_body7", "No Glory Rounds or Ages. The House with the most Glory when the world ends wins.") + Environment.NewLine + "6. " + SK.Text("WorldSelect_Dom_body8", "Unique Platinum Card Pack with rare cards for players in the winning House, as well as Ultimate, Super and Random Card Packs.") + Environment.NewLine + "7. " + SK.Text("WorldSelect_Dom_body9", "Other prizes for players who reach the top of each Leaderboard.") + Environment.NewLine + "8. " + SK.Text("WorldSelect_Dom_body10", "New Anglo-Saxon era map borders.") + Environment.NewLine + Environment.NewLine + SK.Text("WorldSelect_Dom_body11", "For more information on Domination World please check your mail.");
             this.wallOfText.Position = new Point(0, 0x20);
             this.wallOfText.Size     = new Size(this.backgroundArea.Width, 0x11d);
             if ((Program.mySettings.LanguageIdent == "de") || (Program.mySettings.LanguageIdent == "ru"))
             {
                 this.wallOfText.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
             }
             else
             {
                 this.wallOfText.Font = FontManager.GetFont("Arial", 11f, FontStyle.Regular);
             }
             this.wallOfText.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT;
             this.wallOfText.Color           = ARGBColors.Black;
             this.wallOfText.DropShadowColor = ARGBColors.LightGray;
             this.backgroundArea.addControl(this.wallOfText);
             CustomSelfDrawPanel.WikiLinkControl.init(this.backgroundArea, 0x2f, new Point(0x201, -6));
         }
         else if (this.m_secondAgeMessage == 0x3e8)
         {
             this.headerLabel.Text            = SK.Text("PT_TUT_header1", "Congratulations!");
             this.headerLabel.Position        = new Point(0, 0x19);
             this.headerLabel.Size            = new Size(this.backgroundArea.Width, 150);
             this.headerLabel.Font            = FontManager.GetFont("Arial", 18f, FontStyle.Regular);
             this.headerLabel.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
             this.headerLabel.DropShadowColor = ARGBColors.Black;
             this.headerLabel.Color           = ARGBColors.LightGray;
             this.backgroundArea.addControl(this.headerLabel);
             this.wallOfText.Text            = SK.Text("DOMINATION_END_MESSAGE", "Goodness my lord! The end of days is now upon us! My how you've grown from that stumbling bumpkin I tutored long ago! It seems that the final reckoning has come and that this world is at its end!  Will your name also be recorded amongst the storied warriors in the Hall of Legends to be remembered for all eternity? This world has been a true test of your mettle and you are to be congratulated for having achieved so much here!");
             this.wallOfText.Position        = new Point(0x70, 250);
             this.wallOfText.Size            = new Size(this.backgroundArea.Width - 0xe0, 300);
             this.wallOfText.Font            = FontManager.GetFont("Arial", 11f, FontStyle.Regular);
             this.wallOfText.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
             this.wallOfText.DropShadowColor = ARGBColors.Black;
             this.wallOfText.Color           = ARGBColors.LightGray;
             this.backgroundArea.addControl(this.wallOfText);
             this.btnLogout.Text.Text                   = SK.Text("LogoutPanel_Swap_Worlds", "Swap Worlds");
             this.btnHallOfLegends.ImageNorm            = (Image)GFXLibrary.HOLlink;
             this.btnHallOfLegends.OverBrighten         = true;
             this.btnHallOfLegends.MoveOnClick          = true;
             this.btnHallOfLegends.Position             = new Point((base.Width / 2) - (this.btnHallOfLegends.ImageNorm.Width / 2), 0x1e3);
             this.btnHallOfLegends.Text.Text            = SK.Text("HALL_OF_LEGENDS", "Hall of Legends");
             this.btnHallOfLegends.TextYOffset          = -2;
             this.btnHallOfLegends.Text.Color           = ARGBColors.White;
             this.btnHallOfLegends.Text.DropShadowColor = ARGBColors.Black;
             this.btnHallOfLegends.Text.Font            = FontManager.GetFont("Arial", 11f, FontStyle.Regular);
             this.btnHallOfLegends.Text.Position        = new Point(-3, 0);
             this.btnHallOfLegends.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.hallOfLegendsClick));
             this.btnHallOfLegends.Enabled = true;
             this.backgroundArea.addControl(this.btnHallOfLegends);
         }
     }
     else
     {
         if (cardsMode == 0)
         {
             this.headerLabel.Text = SK.Text("CARD_OFFERS_Super_Random_Pack", "Super Random Pack");
         }
         else
         {
             this.headerLabel.Text = SK.Text("CARD_OFFERS_Ultimate_Random_Pack", "Ultimate Random Pack");
         }
         this.headerLabel.Position        = new Point(-50, 12);
         this.headerLabel.Size            = new Size(this.backgroundArea.Width + 100, 150);
         this.headerLabel.Font            = FontManager.GetFont("Arial", 18f, FontStyle.Regular);
         this.headerLabel.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
         this.headerLabel.Color           = ARGBColors.Black;
         this.headerLabel.DropShadowColor = ARGBColors.LightGray;
         this.backgroundArea.addControl(this.headerLabel);
         if (cardsMode == 0)
         {
             this.lostMessageLabel.Text = SK.Text("Cards_Super_Explanation", "Super random packs generally contain less silver ranked cards and give you a much greater chance of rare diamond and double diamond cards.");
         }
         else
         {
             this.lostMessageLabel.Text = SK.Text("Cards_Ultimate_Explanation", "Ultimate random packs generally contain far less silver ranked cards and give you a much greater chance of super rare triple diamond and Sapphire cards.");
         }
         this.lostMessageLabel.Position        = new Point(0, 0x2f);
         this.lostMessageLabel.Size            = new Size(this.backgroundArea.Width, 240);
         this.lostMessageLabel.Font            = FontManager.GetFont("Arial", 12f, FontStyle.Regular);
         this.lostMessageLabel.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
         this.lostMessageLabel.Color           = ARGBColors.Black;
         this.lostMessageLabel.DropShadowColor = ARGBColors.LightGray;
         this.backgroundArea.addControl(this.lostMessageLabel);
         this.wallOfText.Text            = SK.Text("Cards_NewPacks", "While one can expect better cards across all ranks, some of the cards in this pack may be suitable only for higher ranked players.");
         this.wallOfText.Position        = new Point(0x19, 250);
         this.wallOfText.Size            = new Size(this.backgroundArea.Width - 50, 60);
         this.wallOfText.Font            = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
         this.wallOfText.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.BOTTOM_CENTER;
         this.wallOfText.Color           = ARGBColors.Black;
         this.wallOfText.DropShadowColor = ARGBColors.LightGray;
         this.backgroundArea.addControl(this.wallOfText);
         CustomSelfDrawPanel.CSDImage control = new CustomSelfDrawPanel.CSDImage();
         if (cardsMode == 0)
         {
             control.Image = (Image)GFXLibrary.SuperFan;
         }
         else
         {
             control.Image = (Image)GFXLibrary.UltimateFan;
         }
         control.Position = new Point(120, 0x69);
         this.backgroundArea.addControl(control);
     }
 }
Esempio n. 26
0
        public void init(int cardSection)
        {
            CustomSelfDrawPanel.CSDImage image2;
            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;
            CustomSelfDrawPanel.CSDExtendingPanel control = new CustomSelfDrawPanel.CSDExtendingPanel {
                Size     = base.Size,
                Position = new Point(0, 0)
            };
            this.mainBackgroundImage.addControl(control);
            control.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)
            };
            control.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((control.Width - ((Image)GFXLibrary.cardpanel_panel_gradient_bottom_right).Width) - 6, (control.Height - ((Image)GFXLibrary.cardpanel_panel_gradient_bottom_right).Height) - 6)
            };
            control.addControl(image2);
            this.AvailablePanel          = new CustomSelfDrawPanel.CSDExtendingPanel();
            this.AvailablePanel.Size     = new Size(this.AvailablePanelWidth, 550);
            this.AvailablePanel.Position = new Point(8, (base.Height - 8) - 550);
            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);
            this.cardsInPlay.init(cardSection, 0x70, false, 14, 3, 0);
            this.cardsInPlay.Position = new Point(0, 5);
            this.AvailablePanel.addControl(this.cardsInPlay);
            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));
            this.closeImage.Position = new Point((base.Width - 14) - 0x11, 10);
            this.mainBackgroundImage.addControl(this.closeImage);
            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.greyout.FillColor = Color.FromArgb(0xd7, 0x19, 0x19, 0x19);
            this.greyout.Size      = new Size(this.mainBackgroundImage.Width, this.AvailablePanel.Y + this.AvailablePanel.Height);
            this.greyout.Position  = new Point(0, 0);
            this.greyout.setClickDelegate(delegate {
            });
            CustomSelfDrawPanel.CSDImage closeGrey = new CustomSelfDrawPanel.CSDImage {
                Image = (Image)GFXLibrary.cardpanel_button_close_normal,
                Size  = this.closeImage.Image.Size
            };
            closeGrey.setMouseOverDelegate(() => closeGrey.Image = (Image)GFXLibrary.cardpanel_button_close_over, () => closeGrey.Image = (Image)GFXLibrary.cardpanel_button_close_normal);
            closeGrey.Position = new Point((base.Width - 14) - 0x11, 10);
            this.greyout.addControl(closeGrey);
            this.labelTitle.Position  = new Point(0x1b, 8);
            this.labelTitle.Size      = new Size(0x3a7, 0x40);
            this.labelTitle.Text      = SK.Text("ViewAllCardsPanel_Cards_In_Play", "Cards In Play");
            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);
            CustomSelfDrawPanel.UICardsButtons buttons = new CustomSelfDrawPanel.UICardsButtons((PlayCardsWindow)base.ParentForm)
            {
                Position = new Point(0x328, 0x25)
            };
            this.mainBackgroundImage.addControl(buttons);
            this.cardButtons = buttons;
            if (cardSection != 0)
            {
                CustomSelfDrawPanel.CSDButton button = new CustomSelfDrawPanel.CSDButton {
                    ImageNorm  = (Image)GFXLibrary.button_cards_all_normal,
                    ImageOver  = (Image)GFXLibrary.button_cards_all_over,
                    ImageClick = (Image)GFXLibrary.button_cards_all_over,
                    Position   = new Point(750, 0)
                };
                button.Text.Text     = SK.Text("PlayCardsPanel_All_Your_Cards", "All Your Cards");
                button.TextYOffset   = -3;
                button.Text.Color    = ARGBColors.Black;
                button.Text.Size     = new Size(button.Size.Width - 0x2d, button.Size.Height);
                button.Text.Position = new Point(0x2d, 0);
                button.Text.Font     = FontManager.GetFont("Arial", 10f, FontStyle.Bold);
                button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.showAllCardsClick), "PlayCardsPanel_show_all_cards");
                this.mainBackgroundImage.addControl(button);
            }
            CustomSelfDrawPanel.CSDButton button2 = new CustomSelfDrawPanel.CSDButton {
                ImageNorm  = (Image)GFXLibrary.misc_button_blue_210wide_normal,
                ImageOver  = (Image)GFXLibrary.misc_button_blue_210wide_over,
                ImageClick = (Image)GFXLibrary.misc_button_blue_210wide_pushed,
                Position   = new Point(580, 0x203)
            };
            button2.Text.Text   = SK.Text("PlayCardsPanel_Return", "Back To Play Cards");
            button2.TextYOffset = -2;
            button2.Text.Color  = ARGBColors.Black;
            if ((Program.mySettings.LanguageIdent == "it") || (Program.mySettings.LanguageIdent == "tr"))
            {
                button2.Text.Font = FontManager.GetFont("Arial", 11f, FontStyle.Bold);
            }
            else
            {
                button2.Text.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
            }
            button2.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.returnClicked), "PlayCardsPanel_Back_To_PlayCards");
            this.AvailablePanel.addControl(button2);
            CustomSelfDrawPanel.CSDLabel label = new CustomSelfDrawPanel.CSDLabel {
                Position  = new Point(0x1b, 0x233),
                Size      = new Size(0x3a7, 0x40),
                Text      = SK.Text("ViewAllCardsPanel_Cancel", "Click on a Card Circle to cancel that card."),
                Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT,
                Font      = FontManager.GetFont("Arial", 14f, FontStyle.Regular),
                Color     = ARGBColors.White
            };
            this.mainBackgroundImage.addControl(label);
            this.mainBackgroundImage.invalidate();
        }
Esempio n. 27
0
 public void init()
 {
     base.clearControls();
     this.backImage = this.backGround.init(true, 0x2710);
     base.addControl(this.backGround);
     this.tradeButton.ImageNorm       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[0];
     this.tradeButton.ImageOver       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[7];
     this.tradeButton.ImageClick      = (Image)GFXLibrary.mrhp_world_icons_rhs_array[14];
     this.tradeButton.Position        = new Point(10, 0x8e);
     this.tradeButton.CustomTooltipID = 0x97f;
     this.tradeButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.sendResources), "OwnVillagePanel2_trade");
     this.backImage.addControl(this.tradeButton);
     this.attackButton.ImageNorm       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[1];
     this.attackButton.ImageOver       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[8];
     this.attackButton.ImageClick      = (Image)GFXLibrary.mrhp_world_icons_rhs_array[15];
     this.attackButton.Position        = new Point(0x2d, 0x8e);
     this.attackButton.CustomTooltipID = 0x980;
     this.attackButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.sendTroops), "OwnVillagePanel2_attack");
     this.backImage.addControl(this.attackButton);
     this.scoutButton.ImageNorm       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[3];
     this.scoutButton.ImageOver       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[10];
     this.scoutButton.ImageClick      = (Image)GFXLibrary.mrhp_world_icons_rhs_array[0x11];
     this.scoutButton.Position        = new Point(80, 0x8e);
     this.scoutButton.CustomTooltipID = 0x981;
     this.scoutButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.sendScouts), "OwnVillagePanel2_scouts");
     this.backImage.addControl(this.scoutButton);
     this.reinforceButton.ImageNorm       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[2];
     this.reinforceButton.ImageOver       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[9];
     this.reinforceButton.ImageClick      = (Image)GFXLibrary.mrhp_world_icons_rhs_array[0x10];
     this.reinforceButton.Position        = new Point(0x73, 0x8e);
     this.reinforceButton.CustomTooltipID = 0x982;
     this.reinforceButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.sendReinforcements), "OwnVillagePanel2_reinforcements");
     this.backImage.addControl(this.reinforceButton);
     this.monkButton.ImageNorm       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[4];
     this.monkButton.ImageOver       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[11];
     this.monkButton.ImageClick      = (Image)GFXLibrary.mrhp_world_icons_rhs_array[0x12];
     this.monkButton.Position        = new Point(150, 0x8e);
     this.monkButton.CustomTooltipID = 0x983;
     this.monkButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.sendMonks), "OwnVillagePanel2_monks");
     this.backImage.addControl(this.monkButton);
     this.villageButton.ImageNorm       = (Image)GFXLibrary.int_world_icon_village;
     this.villageButton.OverBrighten    = true;
     this.villageButton.MoveOnClick     = true;
     this.villageButton.Position        = new Point(0x1d, 0x70);
     this.villageButton.CustomTooltipID = 0x985;
     this.villageButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.villageClick), "OwnVillagePanel2_village");
     this.backImage.addControl(this.villageButton);
     this.castleButton.ImageNorm       = (Image)GFXLibrary.int_world_icon_castle;
     this.castleButton.OverBrighten    = true;
     this.castleButton.MoveOnClick     = true;
     this.castleButton.Position        = new Point(0x40, 0x70);
     this.castleButton.CustomTooltipID = 0x986;
     this.castleButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.castleClick), "OwnVillagePanel2_castle");
     this.backImage.addControl(this.castleButton);
     this.resourcesButton.ImageNorm       = (Image)GFXLibrary.int_world_icon_resource;
     this.resourcesButton.OverBrighten    = true;
     this.resourcesButton.MoveOnClick     = true;
     this.resourcesButton.Position        = new Point(0x63, 0x70);
     this.resourcesButton.CustomTooltipID = 0x987;
     this.resourcesButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.resourcesClick), "OwnVillagePanel2_resources");
     this.backImage.addControl(this.resourcesButton);
     this.troopsButton.ImageNorm       = (Image)GFXLibrary.int_world_icon_troops;
     this.troopsButton.OverBrighten    = true;
     this.troopsButton.MoveOnClick     = true;
     this.troopsButton.Position        = new Point(0x86, 0x70);
     this.troopsButton.CustomTooltipID = 0x988;
     this.troopsButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.troopsClick), "OwnVillagePanel2_troops");
     this.backImage.addControl(this.troopsButton);
     this.lblProtectionType.Text      = "";
     this.lblProtectionType.Color     = ARGBColors.Black;
     this.lblProtectionType.Font      = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.lblProtectionType.Position  = new Point(0, 0x26);
     this.lblProtectionType.Size      = new Size(this.backImage.Width, 0x17);
     this.lblProtectionType.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     this.backImage.addControl(this.lblProtectionType);
     this.lblProtected.Text      = "";
     this.lblProtected.Color     = ARGBColors.Black;
     this.lblProtected.Font      = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.lblProtected.Position  = new Point(6, 0x30);
     this.lblProtected.Size      = new Size(this.backImage.Width - 12, 0x4a);
     this.lblProtected.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     this.backImage.addControl(this.lblProtected);
     this.leftButton.ImageNorm = (Image)GFXLibrary.r_arrow_small_left_norm;
     this.leftButton.ImageOver = (Image)GFXLibrary.r_arrow_small_left_over;
     this.leftButton.Position  = new Point(5, 50);
     this.leftButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.infoLeft), "OwnVillagePanel2_protection_left");
     this.leftButton.Visible = false;
     this.backImage.addControl(this.leftButton);
     this.rightButton.ImageNorm = (Image)GFXLibrary.r_arrow_small_right_norm;
     this.rightButton.ImageOver = (Image)GFXLibrary.r_arrow_small_right_over;
     this.rightButton.Position  = new Point(170, 50);
     this.rightButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.infoRight), "OwnVillagePanel2_protection_right");
     this.rightButton.Visible = false;
     this.backImage.addControl(this.rightButton);
     this.updateSize();
     this.numInfos           = 0;
     this.selectedProtection = 0;
 }
Esempio n. 28
0
 public void init(bool normalLogout, bool advertOnly)
 {
     CustomSelfDrawPanel.CSDImage image2;
     CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate newDelegate = null;
     CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate delegate3 = null;
     CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate delegate4 = null;
     CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate delegate5 = null;
     CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate delegate6 = null;
     CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate delegate7 = null;
     this.m_normalLogout = normalLogout;
     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);
     CustomSelfDrawPanel.CSDExtendingPanel control = new CustomSelfDrawPanel.CSDExtendingPanel {
         Size = base.Size,
         Position = new Point(0, 0)
     };
     this.mainBackgroundImage.addControl(control);
     control.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)
     };
     control.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((control.Width - ((Image) GFXLibrary.cardpanel_panel_gradient_bottom_right).Width) - 6, (control.Height - ((Image) GFXLibrary.cardpanel_panel_gradient_bottom_right).Height) - 6)
     };
     control.addControl(image2);
     if (hrImage == null)
     {
         hrImage = new Bitmap(base.Width - 10, 1);
         using (Graphics graphics = Graphics.FromImage(hrImage))
         {
             graphics.Clear(Color.FromArgb(0xff, 130, 0x81, 0x7e));
         }
     }
     CustomSelfDrawPanel.CSDImage image3 = new CustomSelfDrawPanel.CSDImage {
         Image = hrImage,
         Size = hrImage.Size,
         Position = new Point(5, 0x22)
     };
     this.mainBackgroundImage.addControl(image3);
     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), "LogoutPanel_close");
     this.closeImage.Position = new Point((base.Width - 14) - 0x11, 10);
     this.closeImage.CustomTooltipID = 0x578;
     this.mainBackgroundImage.addControl(this.closeImage);
     CustomSelfDrawPanel.WikiLinkControl.init(this.mainBackgroundImage, 0x29, new Point((((base.Width - 14) - 0x11) - 50) + 3, 5), true);
     CustomSelfDrawPanel.CSDImage image4 = new CustomSelfDrawPanel.CSDImage {
         Image = (Image) GFXLibrary.logout_background_lhs,
         Position = new Point(4, 40)
     };
     control.addControl(image4);
     this.labelTitle.Position = new Point(0x1b, 8);
     this.labelTitle.Size = new Size(600, 0x40);
     if (advertOnly)
     {
         this.labelTitle.Text = SK.Text("LogoutPanel_Expiration", "Premium Token Expired");
     }
     else
     {
         this.labelTitle.Text = SK.Text("LogoutPanel_Logout", "Logout");
     }
     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);
     NumberFormatInfo nFI = GameEngine.NFI;
     this.labelCrowns.Position = new Point(0, 8);
     this.labelCrowns.Size = new Size(900, 0x40);
     this.labelCrowns.Text = SK.Text("LogoutPanel_Crowns_In_Treasury", "Crowns in your treasury") + " : " + GameEngine.Instance.World.ProfileCrowns.ToString("N", nFI);
     this.labelCrowns.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_RIGHT;
     this.labelCrowns.Font = FontManager.GetFont("Arial", 16f, FontStyle.Bold);
     this.labelCrowns.Color = ARGBColors.Black;
     this.mainBackgroundImage.addControl(this.labelCrowns);
     CardData userCardData = GameEngine.Instance.World.UserCardData;
     if (userCardData.premiumCard == 0)
     {
         this.premium = false;
         CustomSelfDrawPanel.CSDButton button = new CustomSelfDrawPanel.CSDButton {
             ImageNorm = (Image) GFXLibrary.logout_ad_1premfor30crown_01,
             ImageOver = (Image) GFXLibrary.logout_ad_1premfor30crown_01_over,
             Position = new Point(0x177, 50)
         };
         button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.cardsClicked), "LogoutPanel_premium");
         this.mainBackgroundImage.addControl(button);
         int num = 0x23;
         int y = 0x35;
         CustomSelfDrawPanel.CSDExtendingPanel panel2 = new CustomSelfDrawPanel.CSDExtendingPanel {
             Size = new Size(0x252, 0x164),
             Position = new Point(image4.Position.X + 0x174, (image4.Position.Y + 0x4c) + 0x13),
             Alpha = 0.1f
         };
         this.mainBackgroundImage.addControl(panel2);
         panel2.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);
         CustomSelfDrawPanel.CSDLabel label = new CustomSelfDrawPanel.CSDLabel {
             Text = SK.Text("LogoutPanel_Premium_1", "With premium you command"),
             Position = new Point(0, 5),
             Color = ARGBColors.Black,
             Size = new Size(panel2.Width, 50),
             Font = FontManager.GetFont("Arial", 14f, FontStyle.Bold),
             Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER
         };
         panel2.addControl(label);
         CustomSelfDrawPanel.CSDLabel label2 = new CustomSelfDrawPanel.CSDLabel {
             Text = SK.Text("LogoutPanel_Premium_2", "even when you are offline!"),
             Position = new Point(0, 0x21),
             Color = ARGBColors.Black,
             Size = new Size(panel2.Width, 50),
             Font = FontManager.GetFont("Arial", 14f, FontStyle.Bold),
             Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER
         };
         panel2.addControl(label2);
         CustomSelfDrawPanel.CSDLabel label3 = new CustomSelfDrawPanel.CSDLabel {
             Text = SK.Text("LogoutPanel_BuildQueue_1", "Build-queue, build up to 5 buildings in your village at one time."),
             Position = new Point(0x41, y),
             Color = ARGBColors.Black,
             Size = new Size(panel2.Width - 0x4b, 50),
             Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold),
             Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT
         };
         panel2.addControl(label3);
         CustomSelfDrawPanel.CSDLabel label4 = new CustomSelfDrawPanel.CSDLabel {
             Text = SK.Text("LogoutPanel_BuildQueue_2", "Research queue, 5 more items can be added to your research queue."),
             Position = new Point(0x41, y + num),
             Color = ARGBColors.Black,
             Size = new Size(panel2.Width - 0x4b, 50),
             Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold),
             Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT
         };
         panel2.addControl(label4);
         CustomSelfDrawPanel.CSDLabel label5 = new CustomSelfDrawPanel.CSDLabel {
             Text = SK.Text("LogoutPanel_Scouting_1", "Use Auto scouting to forage for goods."),
             Position = new Point(0x41, y + (num * 2)),
             Color = ARGBColors.Black,
             Size = new Size(panel2.Width - 0x4b, 50),
             Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold),
             Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT
         };
         panel2.addControl(label5);
         CustomSelfDrawPanel.CSDLabel label6 = new CustomSelfDrawPanel.CSDLabel {
             Text = SK.Text("LogoutPanel_Scouting_2", "Auto Trade - lets you set and trade the surplus of one goods type."),
             Position = new Point(0x41, y + (num * 3)),
             Color = ARGBColors.Black,
             Size = new Size(panel2.Width - 0x4b, 50),
             Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold),
             Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT
         };
         panel2.addControl(label6);
         CustomSelfDrawPanel.CSDLabel label7 = new CustomSelfDrawPanel.CSDLabel {
             Text = SK.Text("LogoutPanel_Attacks_1", "Specify targets and Auto Attack will dispatch your armies."),
             Position = new Point(0x41, y + (num * 4)),
             Color = ARGBColors.Black,
             Size = new Size(panel2.Width - 0x4b, 50),
             Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold),
             Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT
         };
         panel2.addControl(label7);
         CustomSelfDrawPanel.CSDLabel label8 = new CustomSelfDrawPanel.CSDLabel {
             Text = SK.Text("LogoutPanel_Attacks_2", "Keep your army topped up with Auto Recruit."),
             Position = new Point(0x41, y + (num * 5)),
             Color = ARGBColors.Black,
             Size = new Size(panel2.Width - 0x4b, 50),
             Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold),
             Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT
         };
         panel2.addControl(label8);
         CustomSelfDrawPanel.CSDLabel label9 = new CustomSelfDrawPanel.CSDLabel {
             Text = SK.Text("LogoutPanel_Overview", "Keep track of key stats across all your villages with the Village Overview."),
             Position = new Point(0x41, y + (num * 6)),
             Color = ARGBColors.Black,
             Size = new Size(panel2.Width - 0x4b, 50),
             Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold),
             Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT
         };
         panel2.addControl(label9);
         CustomSelfDrawPanel.CSDImage image5 = new CustomSelfDrawPanel.CSDImage {
             Image = (Image) GFXLibrary.icon_building,
             Position = new Point(0x12, y + 7)
         };
         panel2.addControl(image5);
         CustomSelfDrawPanel.CSDImage image6 = new CustomSelfDrawPanel.CSDImage {
             Image = (Image) GFXLibrary.icon_research,
             Position = new Point(0x12, (y + 7) + num)
         };
         panel2.addControl(image6);
         CustomSelfDrawPanel.CSDImage image7 = new CustomSelfDrawPanel.CSDImage {
             Image = (Image) GFXLibrary.wl_moving_unit_icons[2],
             Position = new Point(15, (y + 5) + (num * 2))
         };
         panel2.addControl(image7);
         CustomSelfDrawPanel.CSDImage image8 = new CustomSelfDrawPanel.CSDImage {
             Image = (Image) GFXLibrary.wl_moving_unit_icons[1],
             Position = new Point(15, (y + 5) + (num * 3))
         };
         panel2.addControl(image8);
         CustomSelfDrawPanel.CSDImage image9 = new CustomSelfDrawPanel.CSDImage {
             Image = (Image) GFXLibrary.wl_moving_unit_icons[0],
             Position = new Point(15, (y + 5) + (num * 4))
         };
         panel2.addControl(image9);
         CustomSelfDrawPanel.CSDImage image10 = new CustomSelfDrawPanel.CSDImage {
             Image = (Image) GFXLibrary.wl_moving_unit_icons[0],
             Position = new Point(15, (y + 5) + (num * 5))
         };
         panel2.addControl(image10);
         CustomSelfDrawPanel.CSDImage image11 = new CustomSelfDrawPanel.CSDImage {
             Image = (Image) GFXLibrary.wl_moving_unit_icons[4],
             Position = new Point(15, (y + 5) + (num * 6))
         };
         panel2.addControl(image11);
     }
     else
     {
         this.premium = true;
         CustomSelfDrawPanel.CSDExtendingPanel panel3 = new CustomSelfDrawPanel.CSDExtendingPanel {
             Size = new Size(0x252, 0x1b0),
             Alpha = 0.1f,
             Position = new Point(image4.Position.X + 0x174, image4.Position.Y + 20)
         };
         this.mainBackgroundImage.addControl(panel3);
         panel3.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);
         CustomSelfDrawPanel.CSDImage image12 = new CustomSelfDrawPanel.CSDImage();
         if (userCardData.premiumCard == 0x1012)
         {
             image12.Image = (Image) GFXLibrary.logout_premium_token_30;
         }
         else if (userCardData.premiumCard == 0x1011)
         {
             image12.Image = (Image) GFXLibrary.logout_premium_token_2;
         }
         else if (userCardData.premiumCard == 0x1014)
         {
             image12.Image = (Image) GFXLibrary.logout_premium_token_extendable;
         }
         else
         {
             image12.Image = (Image) GFXLibrary.logout_premium_token;
         }
         image12.Position = new Point(-8, -8);
         image12.CustomTooltipID = 0x58d;
         image4.addControl(image12);
         CustomSelfDrawPanel.CSDImage image13 = new CustomSelfDrawPanel.CSDImage {
             Image = (Image) GFXLibrary.logout_gradation_band,
             Position = new Point(0x26, 30)
         };
         panel3.addControl(image13);
         CustomSelfDrawPanel.CSDImage image14 = new CustomSelfDrawPanel.CSDImage {
             Image = (Image) GFXLibrary.wl_moving_unit_icons[1],
             Position = new Point(-4, -4)
         };
         if (newDelegate == null)
         {
             newDelegate = delegate {
                 this.tradingCheck.Checked = !this.tradingCheck.Checked;
                 this.tradingToggled();
             };
         }
         image14.setClickDelegate(newDelegate, "Generic_check_box_toggled");
         image14.CustomTooltipID = 0x579;
         image13.addControl(image14);
         this.tradingCheck.Position = new Point(-30, 2);
         this.tradingCheck.CheckedImage = (Image) GFXLibrary.checkbox_checked;
         this.tradingCheck.UncheckedImage = (Image) GFXLibrary.checkbox_unchecked;
         this.tradingCheck.Checked = RemoteServices.Instance.UserOptions.autoTrade;
         this.tradingCheck.setCheckChangedDelegate(new CustomSelfDrawPanel.CSDCheckBox.CSD_CheckChangedDelegate(this.tradingToggled));
         this.tradingCheck.CustomTooltipID = 0x579;
         image13.addControl(this.tradingCheck);
         CustomSelfDrawPanel.CSDLabel label10 = new CustomSelfDrawPanel.CSDLabel {
             Text = SK.Text("LogoutPanel_Auto_Trading", "Auto Trading"),
             Position = new Point(40, 0),
             Color = ARGBColors.Black,
             Size = new Size(140, image13.Height),
             Font = FontManager.GetFont("Arial", 8f, FontStyle.Regular),
             Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT
         };
         image13.addControl(label10);
         this.tradingArea.Position = new Point(0x87, -20);
         this.tradingArea.Size = new Size(0x1ac, image13.Height + 0x29);
         this.tradingArea.Visible = this.tradingCheck.Checked;
         image13.addControl(this.tradingArea);
         int autoTradeResource = RemoteServices.Instance.UserOptions.autoTradeResource;
         if (autoTradeResource == -1)
         {
             autoTradeResource = 6;
         }
         this.tradingCircleButton.ImageNorm = (Image) GFXLibrary.logout_bits[7];
         this.tradingCircleButton.ImageOver = (Image) GFXLibrary.logout_bits[8];
         this.tradingCircleButton.Position = new Point(0, 1);
         this.tradingCircleButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.tradingResourceClicked), "LogoutPanel_resources");
         this.tradingCircleButton.CustomTooltipID = 0x57f;
         this.tradingCircleButton.CustomTooltipData = autoTradeResource;
         this.tradingArea.addControl(this.tradingCircleButton);
         this.tradingResourceImage.Image = (Image) GFXLibrary.getCommodity64DSImage(autoTradeResource);
         this.tradingResourceImage.Size = new Size(0x45, 0x45);
         this.tradingResourceImage.Data = autoTradeResource;
         this.tradingResourceImage.Position = new Point(0, 0);
         this.tradingCircleButton.addControl(this.tradingResourceImage);
         this.tradingTrackBar.Position = new Point(0xd7, 0x19);
         this.tradingTrackBar.Margin = new Rectangle(0x49, -4, 0, 0);
         this.tradingTrackBar.Max = 100;
         this.tradingTrackBar.Value = RemoteServices.Instance.UserOptions.autoTradePercent;
         this.tradingTrackBar.setValueChangeDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ValueChangedDelegate(this.tracksMoved));
         this.tradingArea.addControl(this.tradingTrackBar);
         this.tradingTrackBar.CustomTooltipID = 0x580;
         this.tradingTrackBar.Create((Image) GFXLibrary.logout_slider_back, (Image) GFXLibrary.logout_slider_thumb, (Image) GFXLibrary.logout_slider_thumb, (Image) GFXLibrary.logout_slider_thumb, (Image) GFXLibrary.logout_slider_thumb, (Image) GFXLibrary.logout_slider_thumb);
         this.tradingPercentLabel.Text = "0%";
         this.tradingPercentLabel.Position = new Point(0, 0);
         this.tradingPercentLabel.Color = ARGBColors.Black;
         this.tradingPercentLabel.Size = new Size(0x3a, 0x17);
         this.tradingPercentLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
         this.tradingPercentLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
         this.tradingTrackBar.addControl(this.tradingPercentLabel);
         CustomSelfDrawPanel.CSDLabel label11 = new CustomSelfDrawPanel.CSDLabel {
             Text = SK.Text("LogoutPanel_Trade_Over", "Trade Over"),
             Position = new Point(0, 0),
             Color = ARGBColors.Black,
             Size = new Size(210, this.tradingArea.Height),
             Font = FontManager.GetFont("Arial", 8f, FontStyle.Regular),
             Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_RIGHT
         };
         this.tradingArea.addControl(label11);
         this.tracksMoved();
         CustomSelfDrawPanel.CSDImage image15 = new CustomSelfDrawPanel.CSDImage {
             Image = (Image) GFXLibrary.logout_gradation_band,
             Position = new Point(0x26, 100)
         };
         panel3.addControl(image15);
         CustomSelfDrawPanel.CSDImage image16 = new CustomSelfDrawPanel.CSDImage {
             Image = (Image) GFXLibrary.wl_moving_unit_icons[2],
             Position = new Point(-4, -4)
         };
         if (delegate3 == null)
         {
             delegate3 = delegate {
                 this.scoutingCheck.Checked = !this.scoutingCheck.Checked;
                 this.scoutingToggled();
             };
         }
         image16.setClickDelegate(delegate3, "Generic_check_box_toggled");
         image16.CustomTooltipID = 0x57a;
         image15.addControl(image16);
         this.scoutingCheck.Position = new Point(-30, 2);
         this.scoutingCheck.CheckedImage = (Image) GFXLibrary.checkbox_checked;
         this.scoutingCheck.UncheckedImage = (Image) GFXLibrary.checkbox_unchecked;
         this.scoutingCheck.Checked = RemoteServices.Instance.UserOptions.autoScout;
         this.scoutingCheck.setCheckChangedDelegate(new CustomSelfDrawPanel.CSDCheckBox.CSD_CheckChangedDelegate(this.scoutingToggled));
         this.scoutingCheck.CustomTooltipID = 0x57a;
         image15.addControl(this.scoutingCheck);
         CustomSelfDrawPanel.CSDLabel label12 = new CustomSelfDrawPanel.CSDLabel {
             Text = SK.Text("LogoutPanel_Auto_Scouting", "Auto Scouting"),
             Position = new Point(40, 0),
             Color = ARGBColors.Black,
             Size = new Size(140, image15.Height),
             Font = FontManager.GetFont("Arial", 8f, FontStyle.Regular),
             Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT
         };
         image15.addControl(label12);
         this.scoutingArea.Position = new Point(0x87, -20);
         this.scoutingArea.Size = new Size(0x1ac, image15.Height + 0x29);
         this.scoutingArea.Visible = this.scoutingCheck.Checked;
         image15.addControl(this.scoutingArea);
         CustomSelfDrawPanel.CSDLabel label13 = new CustomSelfDrawPanel.CSDLabel {
             Text = SK.Text("LogoutPanel_Auto_Scouting2", "Scout within your Parishes"),
             Position = new Point(0, 0),
             Color = ARGBColors.Black,
             Size = new Size(0x18e, this.scoutingArea.Height),
             Font = FontManager.GetFont("Arial", 8f, FontStyle.Regular),
             Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_RIGHT
         };
         this.scoutingArea.addControl(label13);
         CustomSelfDrawPanel.CSDImage image17 = new CustomSelfDrawPanel.CSDImage {
             Image = (Image) GFXLibrary.logout_bits[14],
             Position = new Point(0, 1)
         };
         this.scoutingArea.addControl(image17);
         CustomSelfDrawPanel.CSDImage image18 = new CustomSelfDrawPanel.CSDImage {
             Image = (Image) GFXLibrary.logout_gradation_band,
             Position = new Point(0x26, 170)
         };
         panel3.addControl(image18);
         CustomSelfDrawPanel.CSDImage image19 = new CustomSelfDrawPanel.CSDImage {
             Image = (Image) GFXLibrary.wl_moving_unit_icons[0x18],
             Position = new Point(-4, -4)
         };
         if (delegate4 == null)
         {
             delegate4 = delegate {
                 this.attackCheck.Checked = !this.attackCheck.Checked;
                 this.attackToggled();
             };
         }
         image19.setClickDelegate(delegate4, "Generic_check_box_toggled");
         image19.CustomTooltipID = 0x57b;
         image18.addControl(image19);
         this.attackCheck.Position = new Point(-30, 2);
         this.attackCheck.CheckedImage = (Image) GFXLibrary.checkbox_checked;
         this.attackCheck.UncheckedImage = (Image) GFXLibrary.checkbox_unchecked;
         this.attackCheck.Checked = RemoteServices.Instance.UserOptions.autoAttack;
         this.attackCheck.setCheckChangedDelegate(new CustomSelfDrawPanel.CSDCheckBox.CSD_CheckChangedDelegate(this.attackToggled));
         this.attackCheck.CustomTooltipID = 0x57b;
         image18.addControl(this.attackCheck);
         CustomSelfDrawPanel.CSDLabel label14 = new CustomSelfDrawPanel.CSDLabel {
             Text = SK.Text("LogoutPanel_Auto_Attack", "Auto Attack"),
             Position = new Point(40, 0),
             Color = ARGBColors.Black,
             Size = new Size(140, image18.Height),
             Font = FontManager.GetFont("Arial", 8f, FontStyle.Regular),
             Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT
         };
         image18.addControl(label14);
         this.attackArea.Position = new Point(0x87, -20);
         this.attackArea.Size = new Size(0x1ac, image18.Height + 40);
         this.attackArea.Visible = this.attackCheck.Checked;
         image18.addControl(this.attackArea);
         this.attackCheck_Bandits.Position = new Point(0, 1);
         this.attackCheck_Bandits.CheckedImage = (Image) GFXLibrary.logout_bits[2];
         this.attackCheck_Bandits.UncheckedImage = (Image) GFXLibrary.logout_bits[0];
         this.attackCheck_Bandits.CheckedOverImage = (Image) GFXLibrary.logout_bits[3];
         this.attackCheck_Bandits.UncheckedOverImage = (Image) GFXLibrary.logout_bits[1];
         this.attackCheck_Bandits.Checked = RemoteServices.Instance.UserOptions.autoAttackBandit;
         this.attackCheck_Bandits.CustomTooltipID = 0x581;
         this.attackArea.addControl(this.attackCheck_Bandits);
         CustomSelfDrawPanel.CSDImage image20 = new CustomSelfDrawPanel.CSDImage {
             Image = (Image) GFXLibrary.scout_screen_icons[0x18],
             Position = new Point(-20, -11)
         };
         this.attackCheck_Bandits.addControl(image20);
         this.attackCheck_Wolves.Position = new Point(0x55, 1);
         this.attackCheck_Wolves.CheckedImage = (Image) GFXLibrary.logout_bits[2];
         this.attackCheck_Wolves.UncheckedImage = (Image) GFXLibrary.logout_bits[0];
         this.attackCheck_Wolves.CheckedOverImage = (Image) GFXLibrary.logout_bits[3];
         this.attackCheck_Wolves.UncheckedOverImage = (Image) GFXLibrary.logout_bits[1];
         this.attackCheck_Wolves.Checked = RemoteServices.Instance.UserOptions.autoAttackWolf;
         this.attackCheck_Wolves.CustomTooltipID = 0x582;
         this.attackArea.addControl(this.attackCheck_Wolves);
         CustomSelfDrawPanel.CSDImage image21 = new CustomSelfDrawPanel.CSDImage {
             Image = (Image) GFXLibrary.scout_screen_icons[0x19],
             Position = new Point(-8, -14)
         };
         this.attackCheck_Wolves.addControl(image21);
         this.attackCheck_AI.Position = new Point(170, 1);
         this.attackCheck_AI.CheckedImage = (Image) GFXLibrary.logout_bits[2];
         this.attackCheck_AI.UncheckedImage = (Image) GFXLibrary.logout_bits[0];
         this.attackCheck_AI.CheckedOverImage = (Image) GFXLibrary.logout_bits[3];
         this.attackCheck_AI.UncheckedOverImage = (Image) GFXLibrary.logout_bits[1];
         this.attackCheck_AI.Checked = RemoteServices.Instance.UserOptions.autoAttackAI;
         this.attackCheck_AI.CustomTooltipID = 0x583;
         this.attackArea.addControl(this.attackCheck_AI);
         CustomSelfDrawPanel.CSDImage image22 = new CustomSelfDrawPanel.CSDImage {
             Image = (Image) GFXLibrary.scout_screen_icons[0x1c],
             Position = new Point(-17, -11)
         };
         this.attackCheck_AI.addControl(image22);
         CustomSelfDrawPanel.CSDImage image23 = new CustomSelfDrawPanel.CSDImage {
             Image = (Image) GFXLibrary.logout_gradation_band,
             Position = new Point(0x26, 240)
         };
         panel3.addControl(image23);
         CustomSelfDrawPanel.CSDImage image24 = new CustomSelfDrawPanel.CSDImage {
             Image = (Image) GFXLibrary.wl_moving_unit_icons[0],
             Position = new Point(-4, -4)
         };
         if (delegate5 == null)
         {
             delegate5 = delegate {
                 this.recruitCheck.Checked = !this.recruitCheck.Checked;
                 this.recruitToggled();
             };
         }
         image24.setClickDelegate(delegate5, "Generic_check_box_toggled");
         image24.CustomTooltipID = 0x57c;
         image23.addControl(image24);
         this.recruitCheck.Position = new Point(-30, 2);
         this.recruitCheck.CheckedImage = (Image) GFXLibrary.checkbox_checked;
         this.recruitCheck.UncheckedImage = (Image) GFXLibrary.checkbox_unchecked;
         this.recruitCheck.Checked = RemoteServices.Instance.UserOptions.autoRecruit;
         this.recruitCheck.setCheckChangedDelegate(new CustomSelfDrawPanel.CSDCheckBox.CSD_CheckChangedDelegate(this.recruitToggled));
         this.recruitCheck.CustomTooltipID = 0x57c;
         image23.addControl(this.recruitCheck);
         CustomSelfDrawPanel.CSDLabel label15 = new CustomSelfDrawPanel.CSDLabel {
             Text = SK.Text("LogoutPanel_Auto_Recruit", "Auto Recruit"),
             Position = new Point(40, 0),
             Color = ARGBColors.Black,
             Size = new Size(140, image23.Height),
             Font = FontManager.GetFont("Arial", 8f, FontStyle.Regular),
             Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT
         };
         image23.addControl(label15);
         this.recruitArea.Position = new Point(0x87, -20);
         this.recruitArea.Size = new Size(0x1ac, ((image23.Height + 40) + 40) + 30);
         this.recruitArea.Visible = this.recruitCheck.Checked;
         image23.addControl(this.recruitArea);
         this.recruitCheck_Peasants.Position = new Point(0, 1);
         this.recruitCheck_Peasants.CheckedImage = (Image) GFXLibrary.logout_bits[2];
         this.recruitCheck_Peasants.UncheckedImage = (Image) GFXLibrary.logout_bits[0];
         this.recruitCheck_Peasants.CheckedOverImage = (Image) GFXLibrary.logout_bits[3];
         this.recruitCheck_Peasants.UncheckedOverImage = (Image) GFXLibrary.logout_bits[1];
         this.recruitCheck_Peasants.Checked = RemoteServices.Instance.UserOptions.autoRecruitPeasants;
         this.recruitCheck_Peasants.setCheckChangedDelegate(new CustomSelfDrawPanel.CSDCheckBox.CSD_CheckChangedDelegate(this.recruitToggledUnit));
         this.recruitCheck_Peasants.CustomTooltipID = 0x584;
         this.recruitArea.addControl(this.recruitCheck_Peasants);
         this.recruitTrackBar_Peasants.Position = new Point(this.recruitCheck_Peasants.Position.X + 3, 0x4b);
         this.recruitTrackBar_Peasants.Margin = new Rectangle(0, -4, 0, 0);
         this.recruitTrackBar_Peasants.Max = 50;
         this.recruitTrackBar_Peasants.Value = RemoteServices.Instance.UserOptions.autoRecruitPeasants_Caps / 10;
         this.recruitTrackBar_Peasants.setValueChangeDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ValueChangedDelegate(this.recruitTracksMoved));
         this.recruitArea.addControl(this.recruitTrackBar_Peasants);
         this.recruitTrackBar_Peasants.Create((Image) GFXLibrary.logout_slider_back2, (Image) GFXLibrary.logout_slider_thumb, (Image) GFXLibrary.logout_slider_thumb, (Image) GFXLibrary.logout_slider_thumb, (Image) GFXLibrary.logout_slider_thumb, (Image) GFXLibrary.logout_slider_thumb);
         this.recruitNumber_Peasants.Text = "0";
         this.recruitNumber_Peasants.Position = new Point(this.recruitCheck_Peasants.Position.X, 0x69);
         this.recruitNumber_Peasants.Color = ARGBColors.Black;
         this.recruitNumber_Peasants.Size = new Size(this.recruitCheck_Peasants.Width, 20);
         this.recruitNumber_Peasants.Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold);
         this.recruitNumber_Peasants.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
         this.recruitArea.addControl(this.recruitNumber_Peasants);
         CustomSelfDrawPanel.CSDImage image25 = new CustomSelfDrawPanel.CSDImage {
             Image = (Image) GFXLibrary.logout_bits[9],
             Position = new Point(0, 0)
         };
         this.recruitCheck_Peasants.addControl(image25);
         this.recruitCheck_Archers.Position = new Point(0x55, 1);
         this.recruitCheck_Archers.CheckedImage = (Image) GFXLibrary.logout_bits[2];
         this.recruitCheck_Archers.UncheckedImage = (Image) GFXLibrary.logout_bits[0];
         this.recruitCheck_Archers.CheckedOverImage = (Image) GFXLibrary.logout_bits[3];
         this.recruitCheck_Archers.UncheckedOverImage = (Image) GFXLibrary.logout_bits[1];
         this.recruitCheck_Archers.Checked = RemoteServices.Instance.UserOptions.autoRecruitArchers;
         this.recruitCheck_Archers.setCheckChangedDelegate(new CustomSelfDrawPanel.CSDCheckBox.CSD_CheckChangedDelegate(this.recruitToggledUnit));
         this.recruitCheck_Archers.CustomTooltipID = 0x585;
         this.recruitArea.addControl(this.recruitCheck_Archers);
         this.recruitTrackBar_Archers.Position = new Point(this.recruitCheck_Archers.Position.X + 3, 0x4b);
         this.recruitTrackBar_Archers.Margin = new Rectangle(0, -4, 0, 0);
         this.recruitTrackBar_Archers.Max = 50;
         this.recruitTrackBar_Archers.Value = RemoteServices.Instance.UserOptions.autoRecruitArchers_Caps / 10;
         this.recruitTrackBar_Archers.setValueChangeDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ValueChangedDelegate(this.recruitTracksMoved));
         this.recruitArea.addControl(this.recruitTrackBar_Archers);
         this.recruitTrackBar_Archers.Create((Image) GFXLibrary.logout_slider_back2, (Image) GFXLibrary.logout_slider_thumb, (Image) GFXLibrary.logout_slider_thumb, (Image) GFXLibrary.logout_slider_thumb, (Image) GFXLibrary.logout_slider_thumb, (Image) GFXLibrary.logout_slider_thumb);
         this.recruitNumber_Archers.Text = "0";
         this.recruitNumber_Archers.Position = new Point(this.recruitCheck_Archers.Position.X, 0x69);
         this.recruitNumber_Archers.Color = ARGBColors.Black;
         this.recruitNumber_Archers.Size = new Size(this.recruitCheck_Archers.Width, 20);
         this.recruitNumber_Archers.Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold);
         this.recruitNumber_Archers.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
         this.recruitArea.addControl(this.recruitNumber_Archers);
         CustomSelfDrawPanel.CSDImage image26 = new CustomSelfDrawPanel.CSDImage {
             Image = (Image) GFXLibrary.logout_bits[10],
             Position = new Point(0, 0)
         };
         this.recruitCheck_Archers.addControl(image26);
         this.recruitCheck_Pikemen.Position = new Point(170, 1);
         this.recruitCheck_Pikemen.CheckedImage = (Image) GFXLibrary.logout_bits[2];
         this.recruitCheck_Pikemen.UncheckedImage = (Image) GFXLibrary.logout_bits[0];
         this.recruitCheck_Pikemen.CheckedOverImage = (Image) GFXLibrary.logout_bits[3];
         this.recruitCheck_Pikemen.UncheckedOverImage = (Image) GFXLibrary.logout_bits[1];
         this.recruitCheck_Pikemen.Checked = RemoteServices.Instance.UserOptions.autoRecruitPikemen;
         this.recruitCheck_Pikemen.setCheckChangedDelegate(new CustomSelfDrawPanel.CSDCheckBox.CSD_CheckChangedDelegate(this.recruitToggledUnit));
         this.recruitCheck_Pikemen.CustomTooltipID = 0x586;
         this.recruitArea.addControl(this.recruitCheck_Pikemen);
         this.recruitTrackBar_Pikemen.Position = new Point(this.recruitCheck_Pikemen.Position.X + 3, 0x4b);
         this.recruitTrackBar_Pikemen.Margin = new Rectangle(0, -4, 0, 0);
         this.recruitTrackBar_Pikemen.Max = 50;
         this.recruitTrackBar_Pikemen.Value = RemoteServices.Instance.UserOptions.autoRecruitPikemen_Caps / 10;
         this.recruitTrackBar_Pikemen.setValueChangeDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ValueChangedDelegate(this.recruitTracksMoved));
         this.recruitArea.addControl(this.recruitTrackBar_Pikemen);
         this.recruitTrackBar_Pikemen.Create((Image) GFXLibrary.logout_slider_back2, (Image) GFXLibrary.logout_slider_thumb, (Image) GFXLibrary.logout_slider_thumb, (Image) GFXLibrary.logout_slider_thumb, (Image) GFXLibrary.logout_slider_thumb, (Image) GFXLibrary.logout_slider_thumb);
         this.recruitNumber_Pikemen.Text = "0";
         this.recruitNumber_Pikemen.Position = new Point(this.recruitCheck_Pikemen.Position.X, 0x69);
         this.recruitNumber_Pikemen.Color = ARGBColors.Black;
         this.recruitNumber_Pikemen.Size = new Size(this.recruitCheck_Pikemen.Width, 20);
         this.recruitNumber_Pikemen.Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold);
         this.recruitNumber_Pikemen.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
         this.recruitArea.addControl(this.recruitNumber_Pikemen);
         CustomSelfDrawPanel.CSDImage image27 = new CustomSelfDrawPanel.CSDImage {
             Image = (Image) GFXLibrary.logout_bits[11],
             Position = new Point(0, 0)
         };
         this.recruitCheck_Pikemen.addControl(image27);
         this.recruitCheck_Swordsmen.Position = new Point(0xff, 1);
         this.recruitCheck_Swordsmen.CheckedImage = (Image) GFXLibrary.logout_bits[2];
         this.recruitCheck_Swordsmen.UncheckedImage = (Image) GFXLibrary.logout_bits[0];
         this.recruitCheck_Swordsmen.CheckedOverImage = (Image) GFXLibrary.logout_bits[3];
         this.recruitCheck_Swordsmen.UncheckedOverImage = (Image) GFXLibrary.logout_bits[1];
         this.recruitCheck_Swordsmen.Checked = RemoteServices.Instance.UserOptions.autoRecruitSwordsmen;
         this.recruitCheck_Swordsmen.setCheckChangedDelegate(new CustomSelfDrawPanel.CSDCheckBox.CSD_CheckChangedDelegate(this.recruitToggledUnit));
         this.recruitCheck_Swordsmen.CustomTooltipID = 0x587;
         this.recruitArea.addControl(this.recruitCheck_Swordsmen);
         this.recruitTrackBar_Swordsmen.Position = new Point(this.recruitCheck_Swordsmen.Position.X + 3, 0x4b);
         this.recruitTrackBar_Swordsmen.Margin = new Rectangle(0, -4, 0, 0);
         this.recruitTrackBar_Swordsmen.Max = 50;
         this.recruitTrackBar_Swordsmen.Value = RemoteServices.Instance.UserOptions.autoRecruitSwordsmen_Caps / 10;
         this.recruitTrackBar_Swordsmen.setValueChangeDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ValueChangedDelegate(this.recruitTracksMoved));
         this.recruitArea.addControl(this.recruitTrackBar_Swordsmen);
         this.recruitTrackBar_Swordsmen.Create((Image) GFXLibrary.logout_slider_back2, (Image) GFXLibrary.logout_slider_thumb, (Image) GFXLibrary.logout_slider_thumb, (Image) GFXLibrary.logout_slider_thumb, (Image) GFXLibrary.logout_slider_thumb, (Image) GFXLibrary.logout_slider_thumb);
         this.recruitNumber_Swordsmen.Text = "0";
         this.recruitNumber_Swordsmen.Position = new Point(this.recruitCheck_Swordsmen.Position.X, 0x69);
         this.recruitNumber_Swordsmen.Color = ARGBColors.Black;
         this.recruitNumber_Swordsmen.Size = new Size(this.recruitCheck_Swordsmen.Width, 20);
         this.recruitNumber_Swordsmen.Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold);
         this.recruitNumber_Swordsmen.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
         this.recruitArea.addControl(this.recruitNumber_Swordsmen);
         CustomSelfDrawPanel.CSDImage image28 = new CustomSelfDrawPanel.CSDImage {
             Image = (Image) GFXLibrary.logout_bits[12],
             Position = new Point(0, 0)
         };
         this.recruitCheck_Swordsmen.addControl(image28);
         this.recruitCheck_Catapults.Position = new Point(340, 1);
         this.recruitCheck_Catapults.CheckedImage = (Image) GFXLibrary.logout_bits[2];
         this.recruitCheck_Catapults.UncheckedImage = (Image) GFXLibrary.logout_bits[0];
         this.recruitCheck_Catapults.CheckedOverImage = (Image) GFXLibrary.logout_bits[3];
         this.recruitCheck_Catapults.UncheckedOverImage = (Image) GFXLibrary.logout_bits[1];
         this.recruitCheck_Catapults.Checked = RemoteServices.Instance.UserOptions.autoRecruitCatapults;
         this.recruitCheck_Catapults.setCheckChangedDelegate(new CustomSelfDrawPanel.CSDCheckBox.CSD_CheckChangedDelegate(this.recruitToggledUnit));
         this.recruitCheck_Catapults.CustomTooltipID = 0x588;
         this.recruitArea.addControl(this.recruitCheck_Catapults);
         this.recruitTrackBar_Catapults.Position = new Point(this.recruitCheck_Catapults.Position.X + 3, 0x4b);
         this.recruitTrackBar_Catapults.Margin = new Rectangle(0, -4, 0, 0);
         this.recruitTrackBar_Catapults.Max = 50;
         this.recruitTrackBar_Catapults.Value = RemoteServices.Instance.UserOptions.autoRecruitCatapults_Caps / 5;
         this.recruitTrackBar_Catapults.setValueChangeDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ValueChangedDelegate(this.recruitTracksMoved));
         this.recruitArea.addControl(this.recruitTrackBar_Catapults);
         this.recruitTrackBar_Catapults.Create((Image) GFXLibrary.logout_slider_back2, (Image) GFXLibrary.logout_slider_thumb, (Image) GFXLibrary.logout_slider_thumb, (Image) GFXLibrary.logout_slider_thumb, (Image) GFXLibrary.logout_slider_thumb, (Image) GFXLibrary.logout_slider_thumb);
         this.recruitNumber_Catapults.Text = "0";
         this.recruitNumber_Catapults.Position = new Point(this.recruitCheck_Catapults.Position.X, 0x69);
         this.recruitNumber_Catapults.Color = ARGBColors.Black;
         this.recruitNumber_Catapults.Size = new Size(this.recruitCheck_Catapults.Width, 20);
         this.recruitNumber_Catapults.Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold);
         this.recruitNumber_Catapults.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
         this.recruitArea.addControl(this.recruitNumber_Catapults);
         CustomSelfDrawPanel.CSDImage image29 = new CustomSelfDrawPanel.CSDImage {
             Image = (Image) GFXLibrary.logout_bits[13],
             Position = new Point(0, 0)
         };
         this.recruitCheck_Catapults.addControl(image29);
         this.recruitmentInfoLabel.Text = SK.Text("Logout_Recruitment_Cap", "Set Recruitment Cap");
         this.recruitmentInfoLabel.Position = new Point(-7, 0x7d);
         this.recruitmentInfoLabel.Color = ARGBColors.Black;
         this.recruitmentInfoLabel.Size = new Size(this.recruitArea.Width, 0x17);
         this.recruitmentInfoLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
         this.recruitmentInfoLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
         this.recruitArea.addControl(this.recruitmentInfoLabel);
         this.recruitTracksMoved();
         this.updateRecruitVisibility();
         CustomSelfDrawPanel.CSDImage image30 = new CustomSelfDrawPanel.CSDImage {
             Image = (Image) GFXLibrary.logout_gradation_band,
             Position = new Point(0x26, 310),
             Visible = false
         };
         panel3.addControl(image30);
         CustomSelfDrawPanel.CSDImage image31 = new CustomSelfDrawPanel.CSDImage {
             Image = (Image) GFXLibrary.wl_moving_unit_icons[1],
             Position = new Point(-4, -4)
         };
         if (delegate6 == null)
         {
             delegate6 = delegate {
                 this.transferCheck.Checked = !this.transferCheck.Checked;
                 this.transferToggled();
             };
         }
         image31.setClickDelegate(delegate6, "Generic_check_box_toggled");
         image31.CustomTooltipID = 0x57e;
         image30.addControl(image31);
         this.transferCheck.Position = new Point(-30, 2);
         this.transferCheck.CheckedImage = (Image) GFXLibrary.checkbox_checked;
         this.transferCheck.UncheckedImage = (Image) GFXLibrary.checkbox_unchecked;
         this.transferCheck.Checked = false;
         this.transferCheck.setCheckChangedDelegate(new CustomSelfDrawPanel.CSDCheckBox.CSD_CheckChangedDelegate(this.transferToggled));
         this.transferCheck.CustomTooltipID = 0x57e;
         image30.addControl(this.transferCheck);
         CustomSelfDrawPanel.CSDLabel label16 = new CustomSelfDrawPanel.CSDLabel {
             Text = SK.Text("LogoutPanel_Auto_transfer", "Auto Transfer"),
             Position = new Point(40, 0),
             Color = ARGBColors.Black,
             Size = new Size(140, image30.Height),
             Font = FontManager.GetFont("Arial", 8f, FontStyle.Regular),
             Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT
         };
         image30.addControl(label16);
         this.transferArea.Position = new Point(0x87, -20);
         this.transferArea.Size = new Size(0x1ac, image30.Height + 40);
         this.transferArea.Visible = this.transferCheck.Checked;
         image30.addControl(this.transferArea);
         CustomSelfDrawPanel.CSDImage image32 = new CustomSelfDrawPanel.CSDImage {
             Image = (Image) GFXLibrary.logout_gradation_band,
             Position = new Point(0x26, 380),
             Visible = false
         };
         panel3.addControl(image32);
         CustomSelfDrawPanel.CSDImage image33 = new CustomSelfDrawPanel.CSDImage {
             Image = (Image) GFXLibrary.wl_moving_unit_icons[0x19],
             Position = new Point(-4, -4)
         };
         if (delegate7 == null)
         {
             delegate7 = delegate {
                 this.repairCheck.Checked = !this.repairCheck.Checked;
                 this.repairToggled();
             };
         }
         image33.setClickDelegate(delegate7, "Generic_check_box_toggled");
         image33.CustomTooltipID = 0x57d;
         image32.addControl(image33);
         this.repairCheck.Position = new Point(-30, 2);
         this.repairCheck.CheckedImage = (Image) GFXLibrary.checkbox_checked;
         this.repairCheck.UncheckedImage = (Image) GFXLibrary.checkbox_unchecked;
         this.repairCheck.Checked = false;
         this.repairCheck.setCheckChangedDelegate(new CustomSelfDrawPanel.CSDCheckBox.CSD_CheckChangedDelegate(this.repairToggled));
         this.repairCheck.CustomTooltipID = 0x57d;
         image32.addControl(this.repairCheck);
         CustomSelfDrawPanel.CSDLabel label17 = new CustomSelfDrawPanel.CSDLabel {
             Text = SK.Text("LogoutPanel_Auto_Rebuild", "Auto Rebuild"),
             Position = new Point(40, 0),
             Color = ARGBColors.Black,
             Size = new Size(140, image32.Height),
             Font = FontManager.GetFont("Arial", 8f, FontStyle.Regular),
             Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT
         };
         image32.addControl(label17);
         this.repairArea.Position = new Point(0x87, -20);
         this.repairArea.Size = new Size(0x1ac, image32.Height + 40);
         this.repairArea.Visible = this.repairCheck.Checked;
         image32.addControl(this.repairArea);
         CustomSelfDrawPanel.CSDImage image34 = new CustomSelfDrawPanel.CSDImage {
             Image = (Image) GFXLibrary.logout_bits[4],
             Position = new Point(0, 0)
         };
         this.repairArea.addControl(image34);
     }
     if ((!GameEngine.Instance.World.isBigpointAccount && !Program.bigpointInstall) && (!Program.aeriaInstall && !Program.bigpointPartnerInstall))
     {
         CustomSelfDrawPanel.CSDButton button2 = new CustomSelfDrawPanel.CSDButton {
             ImageNorm = (Image) GFXLibrary.banner_ad_friend,
             OverBrighten = true,
             Position = new Point(0x177, 0x1f0)
         };
         button2.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.friendClicked), "LogoutPanel_invite_a_friend");
         this.mainBackgroundImage.addControl(button2);
     }
     if (normalLogout && !advertOnly)
     {
         CustomSelfDrawPanel.CSDButton button3 = new CustomSelfDrawPanel.CSDButton {
             ImageNorm = (Image) GFXLibrary.mail2_button_blue_141wide_normal,
             ImageOver = (Image) GFXLibrary.mail2_button_blue_141wide_over,
             ImageClick = (Image) GFXLibrary.mail2_button_blue_141wide_pushed,
             Position = new Point(0x1a7, 0x1c5)
         };
         button3.Text.Text = SK.Text("LogoutPanel_Swap_Worlds", "Swap Worlds");
         button3.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
         button3.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
         button3.TextYOffset = -2;
         button3.Text.Color = ARGBColors.Black;
         button3.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.doLogout), "LogoutPanel_swap_worlds");
         button3.CustomTooltipID = 0x58c;
         control.addControl(button3);
         this.logoutPressed = false;
     }
     if (!advertOnly)
     {
         CustomSelfDrawPanel.CSDButton button4 = new CustomSelfDrawPanel.CSDButton {
             ImageNorm = (Image) GFXLibrary.mail2_button_blue_141wide_normal,
             ImageOver = (Image) GFXLibrary.mail2_button_blue_141wide_over,
             ImageClick = (Image) GFXLibrary.mail2_button_blue_141wide_pushed,
             Position = new Point(0x313, 0x1c5)
         };
         button4.Text.Text = SK.Text("GENERIC_Exit", "Exit");
         button4.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
         button4.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
         button4.TextYOffset = -2;
         button4.Text.Color = ARGBColors.Black;
         button4.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.doQuit), "LogoutPanel_exit");
         button4.CustomTooltipID = 0x58a;
         control.addControl(button4);
     }
     if (normalLogout && !advertOnly)
     {
         CustomSelfDrawPanel.CSDButton button5 = new CustomSelfDrawPanel.CSDButton {
             ImageNorm = (Image) GFXLibrary.mail2_button_blue_141wide_normal,
             ImageOver = (Image) GFXLibrary.mail2_button_blue_141wide_over,
             ImageClick = (Image) GFXLibrary.mail2_button_blue_141wide_pushed,
             Position = new Point(0x25d, 0x1c5)
         };
         button5.Text.Text = SK.Text("GENERIC_Cancel", "Cancel");
         button5.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
         button5.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
         button5.TextYOffset = -2;
         button5.Text.Color = ARGBColors.Black;
         button5.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.closeClick), "LogoutPanel_cancel");
         button5.CustomTooltipID = 0x58b;
         control.addControl(button5);
     }
     else if (advertOnly)
     {
         CustomSelfDrawPanel.CSDButton button6 = new CustomSelfDrawPanel.CSDButton {
             ImageNorm = (Image) GFXLibrary.mail2_button_blue_141wide_normal,
             ImageOver = (Image) GFXLibrary.mail2_button_blue_141wide_over,
             ImageClick = (Image) GFXLibrary.mail2_button_blue_141wide_pushed,
             Position = new Point(0x25d, 0x1c5)
         };
         button6.Text.Text = SK.Text("GENERIC_OK", "OK");
         button6.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
         button6.Text.Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
         button6.TextYOffset = -2;
         button6.Text.Color = ARGBColors.Black;
         button6.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.closeClick), "LogoutPanel_cancel");
         control.addControl(button6);
     }
     this.update();
 }
Esempio n. 29
0
        public void init()
        {
            base.clearControls();
            this.backImage = this.backGround.init(true, 0x5e2);
            this.backGround.updateHeading(SK.Text("MapFilterSelectPanel_Map_Filtering", "Map Filtering"));
            base.addControl(this.backGround);
            this.backGround.stretchBackground();
            this.selectedImage.Image    = (Image)GFXLibrary.mrhp_world_icons_filter_selected;
            this.selectedImage.Position = new Point(6, 0x2d);
            this.selectedImage.Visible  = false;
            this.backImage.addControl(this.selectedImage);
            this.tradeButton.ImageNorm       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[0];
            this.tradeButton.ImageOver       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[7];
            this.tradeButton.ImageClick      = (Image)GFXLibrary.mrhp_world_icons_rhs_array[14];
            this.tradeButton.Position        = new Point(0x73, 0x2a);
            this.tradeButton.CustomTooltipID = 0x996;
            this.tradeButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.tradeClick), "MapFilterPanel2_trade");
            this.backImage.addControl(this.tradeButton);
            this.attackButton.ImageNorm       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[1];
            this.attackButton.ImageOver       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[8];
            this.attackButton.ImageClick      = (Image)GFXLibrary.mrhp_world_icons_rhs_array[15];
            this.attackButton.Position        = new Point(80, 0x4c);
            this.attackButton.CustomTooltipID = 0x997;
            this.attackButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.attackClick), "MapFilterPanel2_attack");
            this.backImage.addControl(this.attackButton);
            this.scoutButton.ImageNorm       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[3];
            this.scoutButton.ImageOver       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[10];
            this.scoutButton.ImageClick      = (Image)GFXLibrary.mrhp_world_icons_rhs_array[0x11];
            this.scoutButton.Position        = new Point(0x2d, 0x4c);
            this.scoutButton.CustomTooltipID = 0x998;
            this.scoutButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.scoutsClick), "MapFilterPanel2_scout");
            this.backImage.addControl(this.scoutButton);
            this.houseButton.ImageNorm       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[6];
            this.houseButton.ImageOver       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[13];
            this.houseButton.ImageClick      = (Image)GFXLibrary.mrhp_world_icons_rhs_array[20];
            this.houseButton.Position        = new Point(0x2d, 0x2a);
            this.houseButton.CustomTooltipID = 0x999;
            this.houseButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.houseClick), "MapFilterPanel2_house");
            this.backImage.addControl(this.houseButton);
            this.factionButton.ImageNorm  = (Image)GFXLibrary.mrhp_world_icons_rhs_array[0x24];
            this.factionButton.ImageOver  = (Image)GFXLibrary.mrhp_world_icons_rhs_array[0x25];
            this.factionButton.ImageClick = (Image)GFXLibrary.mrhp_world_icons_rhs_array[0x26];
            this.factionButton.Position   = new Point(80, 0x2a);
            if (RemoteServices.Instance.UserFactionID >= 0)
            {
                this.factionButton.CustomTooltipID = 0x99a;
            }
            else
            {
                this.factionButton.CustomTooltipID = 0x99d;
            }
            this.factionButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.factionClick), "MapFilterPanel2_faction");
            this.backImage.addControl(this.factionButton);
            this.aiButton.ImageNorm       = (Image)GFXLibrary.mrhp_button_filter_ai[0];
            this.aiButton.ImageOver       = (Image)GFXLibrary.mrhp_button_filter_ai[1];
            this.aiButton.ImageClick      = (Image)GFXLibrary.mrhp_button_filter_ai[2];
            this.aiButton.Position        = new Point(0x73, 0x4c);
            this.aiButton.CustomTooltipID = 0x99e;
            this.aiButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.aiClick), "MapFilterPanel2_ai");
            this.backImage.addControl(this.aiButton);
            this.yourVillages.CheckedImage     = (Image)GFXLibrary.mrhp_world_filter_check[0];
            this.yourVillages.UncheckedImage   = (Image)GFXLibrary.mrhp_world_filter_check[1];
            this.yourVillages.Position         = new Point(15, 0x75);
            this.yourVillages.Checked          = GameEngine.Instance.World.worldMapFilter.FilterAlwaysShowYourVillages;
            this.yourVillages.CBLabel.Text     = SK.Text("MapFilterPanel_Always_Show_Your_Villages", "Always Show Your Villages");
            this.yourVillages.CBLabel.Color    = ARGBColors.Black;
            this.yourVillages.CBLabel.Position = new Point(20, -1);
            this.yourVillages.CBLabel.Size     = new Size(180, 0x19);
            this.yourVillages.CBLabel.Font     = FontManager.GetFont("Arial", 8f, FontStyle.Regular);
            this.yourVillages.setCheckChangedDelegate(new CustomSelfDrawPanel.CSDCheckBox.CSD_CheckChangedDelegate(this.yourToggled));
            this.backImage.addControl(this.yourVillages);
            this.diplomacyLabel.Text      = SK.Text("MapFilterPanel_Diplomacy", "Diplomacy Symbols");
            this.diplomacyLabel.Position  = new Point(5, 0x89);
            this.diplomacyLabel.Color     = ARGBColors.Black;
            this.diplomacyLabel.Size      = new Size(180, 0x19);
            this.diplomacyLabel.Font      = FontManager.GetFont("Arial", 8f, FontStyle.Bold);
            this.diplomacyLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
            this.backImage.addControl(this.diplomacyLabel);
            this.houseSymbols.CheckedImage     = (Image)GFXLibrary.mrhp_world_filter_check[0];
            this.houseSymbols.UncheckedImage   = (Image)GFXLibrary.mrhp_world_filter_check[1];
            this.houseSymbols.Position         = new Point(15, 0x9d);
            this.houseSymbols.Checked          = GameEngine.Instance.World.worldMapFilter.FilterShowHouseSymbols;
            this.houseSymbols.CBLabel.Text     = SK.Text("MapFilterPanel_Show_House_Symbols", "Show House Symbols");
            this.houseSymbols.CBLabel.Color    = ARGBColors.Black;
            this.houseSymbols.CBLabel.Position = new Point(20, -1);
            this.houseSymbols.CBLabel.Size     = new Size(180, 0x19);
            this.houseSymbols.CBLabel.Font     = FontManager.GetFont("Arial", 8f, FontStyle.Regular);
            this.houseSymbols.setCheckChangedDelegate(new CustomSelfDrawPanel.CSDCheckBox.CSD_CheckChangedDelegate(this.houseToggled));
            this.backImage.addControl(this.houseSymbols);
            this.factionSymbols.CheckedImage     = (Image)GFXLibrary.mrhp_world_filter_check[0];
            this.factionSymbols.UncheckedImage   = (Image)GFXLibrary.mrhp_world_filter_check[1];
            this.factionSymbols.Position         = new Point(15, 0xb1);
            this.factionSymbols.Checked          = GameEngine.Instance.World.worldMapFilter.FilterShowFactionSymbols;
            this.factionSymbols.CBLabel.Text     = SK.Text("MapFilterPanel_Show_Faction_Symbols", "Show Faction Symbols");
            this.factionSymbols.CBLabel.Color    = ARGBColors.Black;
            this.factionSymbols.CBLabel.Position = new Point(20, -1);
            this.factionSymbols.CBLabel.Size     = new Size(180, 0x19);
            this.factionSymbols.CBLabel.Font     = FontManager.GetFont("Arial", 8f, FontStyle.Regular);
            this.factionSymbols.Data             = 0;
            this.factionSymbols.setCheckChangedDelegate(new CustomSelfDrawPanel.CSDCheckBox.CSD_CheckChangedDelegate(this.factionToggled));
            this.backImage.addControl(this.factionSymbols);
            this.userSymbols.CheckedImage     = (Image)GFXLibrary.mrhp_world_filter_check[0];
            this.userSymbols.UncheckedImage   = (Image)GFXLibrary.mrhp_world_filter_check[1];
            this.userSymbols.Position         = new Point(15, 0xc5);
            this.userSymbols.Checked          = GameEngine.Instance.World.worldMapFilter.FilterShowUserSymbols;
            this.userSymbols.CBLabel.Text     = SK.Text("MapFilterPanel_Show_User_Symbols", "Show Player Symbols");
            this.userSymbols.CBLabel.Color    = ARGBColors.Black;
            this.userSymbols.CBLabel.Position = new Point(20, -1);
            this.userSymbols.CBLabel.Size     = new Size(180, 0x19);
            this.userSymbols.CBLabel.Font     = FontManager.GetFont("Arial", 8f, FontStyle.Regular);
            this.userSymbols.Data             = 0;
            this.userSymbols.setCheckChangedDelegate(new CustomSelfDrawPanel.CSDCheckBox.CSD_CheckChangedDelegate(this.userToggled));
            this.backImage.addControl(this.userSymbols);
            this.searchButton.ImageNorm  = (Image)GFXLibrary.mrhp_button_filter_search[0];
            this.searchButton.ImageOver  = (Image)GFXLibrary.mrhp_button_filter_search[1];
            this.searchButton.ImageClick = (Image)GFXLibrary.mrhp_button_filter_search[2];
            this.searchButton.Position   = new Point(0x67, 0xd7);
            this.searchButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.searchFilter), "StatsPanel_search");
            this.searchButton.CustomTooltipID = 0x99c;
            this.backImage.addControl(this.searchButton);
            this.clearButton.ImageNorm  = (Image)GFXLibrary.mrhp_button_filter_off[0];
            this.clearButton.ImageOver  = (Image)GFXLibrary.mrhp_button_filter_off[1];
            this.clearButton.ImageClick = (Image)GFXLibrary.mrhp_button_filter_off[2];
            this.clearButton.Position   = new Point(0x13, 0xd7);
            this.clearButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.clearFilter), "MapFilterPanel2_clear");
            this.clearButton.CustomTooltipID = 0x99b;
            this.backImage.addControl(this.clearButton);
            this.cancelButton.ImageNorm   = (Image)GFXLibrary.mrhp_button_80_normal;
            this.cancelButton.ImageOver   = (Image)GFXLibrary.mrhp_button_80_over;
            this.cancelButton.ImageClick  = (Image)GFXLibrary.mrhp_button_80_pushed;
            this.cancelButton.Position    = new Point(0x67, 0xd7);
            this.cancelButton.Text.Text   = SK.Text("GENERIC_Close", "Close");
            this.cancelButton.Text.Font   = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
            this.cancelButton.Text.Size   = new Size(this.cancelButton.ImageNorm.Size.Width - 6, this.cancelButton.ImageNorm.Size.Height);
            this.cancelButton.TextYOffset = -3;
            this.cancelButton.Text.Color  = ARGBColors.Black;
            this.cancelButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.closeClick), "MapFilterPanel2_close");
            this.backImage.invalidate();
            InterfaceMgr.Instance.closeArmySelectedPanel();
            InterfaceMgr.Instance.closeTraderInfoPanel();
            InterfaceMgr.Instance.closeReinforcementSelectedPanel();
            InterfaceMgr.Instance.closePersonInfoPanel();
            InterfaceMgr.Instance.closeSelectedVillagePanel();
            int filterMode = GameEngine.Instance.World.worldMapFilter.FilterMode;

            if (GameEngine.Instance.World.worldMapFilter.FilterActive)
            {
                switch (filterMode)
                {
                case 0:
                    return;

                case 1:
                case 7:
                    this.selectedImage.Position = this.factionButton.Position;
                    this.selectedImage.Position = new Point(this.selectedImage.Position.X - 5, this.selectedImage.Position.Y - 5);
                    this.selectedImage.Visible  = true;
                    return;

                case 2:
                    this.selectedImage.Position = this.houseButton.Position;
                    this.selectedImage.Position = new Point(this.selectedImage.Position.X - 5, this.selectedImage.Position.Y - 5);
                    this.selectedImage.Visible  = true;
                    return;

                case 3:
                    this.selectedImage.Position = this.scoutButton.Position;
                    this.selectedImage.Position = new Point(this.selectedImage.Position.X - 5, this.selectedImage.Position.Y - 5);
                    this.selectedImage.Visible  = true;
                    return;

                case 4:
                    this.selectedImage.Position = this.tradeButton.Position;
                    this.selectedImage.Position = new Point(this.selectedImage.Position.X - 5, this.selectedImage.Position.Y - 5);
                    this.selectedImage.Visible  = true;
                    return;

                case 5:
                    this.selectedImage.Position = this.tradeButton.Position;
                    this.selectedImage.Position = new Point(this.selectedImage.Position.X - 5, this.selectedImage.Position.Y - 5);
                    this.selectedImage.Visible  = true;
                    return;

                case 6:
                    this.selectedImage.Position = this.attackButton.Position;
                    this.selectedImage.Position = new Point(this.selectedImage.Position.X - 5, this.selectedImage.Position.Y - 5);
                    this.selectedImage.Visible  = true;
                    return;

                case 8:
                    this.selectedImage.Position = this.aiButton.Position;
                    this.selectedImage.Position = new Point(this.selectedImage.Position.X - 5, this.selectedImage.Position.Y - 5);
                    this.selectedImage.Visible  = true;
                    return;
                }
            }
        }
 public void init()
 {
     base.clearControls();
     this.backImage = this.backGround.init(true, 0x2710);
     base.addControl(this.backGround);
     this.tradeButton.ImageNorm = (Image) GFXLibrary.mrhp_world_icons_rhs_array[0];
     this.tradeButton.ImageOver = (Image) GFXLibrary.mrhp_world_icons_rhs_array[7];
     this.tradeButton.ImageClick = (Image) GFXLibrary.mrhp_world_icons_rhs_array[14];
     this.tradeButton.Position = new Point(10, 0x31);
     this.tradeButton.Enabled = false;
     this.tradeButton.CustomTooltipID = 0x96a;
     this.tradeButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.btnTradeWith_Click), "ParishCapitalVillagePanel2_trade");
     this.backImage.addControl(this.tradeButton);
     this.attackButton.ImageNorm = (Image) GFXLibrary.mrhp_world_icons_rhs_array[1];
     this.attackButton.ImageOver = (Image) GFXLibrary.mrhp_world_icons_rhs_array[8];
     this.attackButton.ImageClick = (Image) GFXLibrary.mrhp_world_icons_rhs_array[15];
     this.attackButton.Position = new Point(0x2d, 0x31);
     this.attackButton.Enabled = false;
     this.attackButton.CustomTooltipID = 0x96b;
     this.attackButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.btnAttack_Click), "ParishCapitalVillagePanel2_attack");
     this.backImage.addControl(this.attackButton);
     this.scoutButton.ImageNorm = (Image) GFXLibrary.mrhp_world_icons_rhs_array[3];
     this.scoutButton.ImageOver = (Image) GFXLibrary.mrhp_world_icons_rhs_array[10];
     this.scoutButton.ImageClick = (Image) GFXLibrary.mrhp_world_icons_rhs_array[0x11];
     this.scoutButton.Position = new Point(80, 0x31);
     this.scoutButton.Enabled = false;
     this.scoutButton.CustomTooltipID = 0x96c;
     this.scoutButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.btnScout_Click), "ParishCapitalVillagePanel2_scout");
     this.backImage.addControl(this.scoutButton);
     this.reinforceButton.ImageNorm = (Image) GFXLibrary.mrhp_world_icons_rhs_array[2];
     this.reinforceButton.ImageOver = (Image) GFXLibrary.mrhp_world_icons_rhs_array[9];
     this.reinforceButton.ImageClick = (Image) GFXLibrary.mrhp_world_icons_rhs_array[0x10];
     this.reinforceButton.Position = new Point(0x73, 0x31);
     this.reinforceButton.Enabled = false;
     this.reinforceButton.CustomTooltipID = 0x96d;
     this.reinforceButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.btnSendTroops_Click), "ParishCapitalVillagePanel2_reinforce");
     this.backImage.addControl(this.reinforceButton);
     this.monkButton.ImageNorm = (Image) GFXLibrary.mrhp_world_icons_rhs_array[4];
     this.monkButton.ImageOver = (Image) GFXLibrary.mrhp_world_icons_rhs_array[11];
     this.monkButton.ImageClick = (Image) GFXLibrary.mrhp_world_icons_rhs_array[0x12];
     this.monkButton.Position = new Point(150, 0x31);
     this.monkButton.Enabled = false;
     this.monkButton.CustomTooltipID = 0x96e;
     this.monkButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.btnSendMonks_Click), "ParishCapitalVillagePanel2_sendmonks");
     this.backImage.addControl(this.monkButton);
     this.castleButton.ImageNorm = (Image) GFXLibrary.mrhp_reports;
     this.castleButton.OverBrighten = true;
     this.castleButton.MoveOnClick = true;
     this.castleButton.Position = new Point(0x52, 0x70);
     this.castleButton.CustomTooltipID = 0x98d;
     this.castleButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.castleClick), "ParishCapitalVillagePanel2_view_castle");
     this.backImage.addControl(this.castleButton);
     if (GameEngine.Instance.World.MapEditing)
     {
         this.mapEdit.ImageNorm = (Image) GFXLibrary.faction_pen;
         this.mapEdit.ImageOver = (Image) GFXLibrary.faction_pen;
         this.mapEdit.ImageClick = (Image) GFXLibrary.faction_pen;
         this.mapEdit.MoveOnClick = true;
         this.mapEdit.OverBrighten = true;
         this.mapEdit.Position = new Point(0xa8, 0x70);
         this.mapEdit.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.mapEditClicked));
         this.backImage.addControl(this.mapEdit);
     }
     this.lblProtectionType.Text = "";
     this.lblProtectionType.Color = ARGBColors.Black;
     this.lblProtectionType.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.lblProtectionType.Position = new Point(0, 0x26);
     this.lblProtectionType.Size = new Size(this.backImage.Width, 0x17);
     this.lblProtectionType.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     this.backImage.addControl(this.lblProtectionType);
     this.lblProtected.Text = "";
     this.lblProtected.Color = ARGBColors.Black;
     this.lblProtected.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.lblProtected.Position = new Point(6, 0x30);
     this.lblProtected.Size = new Size(this.backImage.Width - 12, 0x4a);
     this.lblProtected.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     this.backImage.addControl(this.lblProtected);
     this.leftButton.ImageNorm = (Image) GFXLibrary.r_arrow_small_left_norm;
     this.leftButton.ImageOver = (Image) GFXLibrary.r_arrow_small_left_over;
     this.leftButton.Position = new Point(5, 50);
     this.leftButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.infoLeft), "ParishCapitalVillagePanel2_protection_left");
     this.leftButton.Visible = false;
     this.backImage.addControl(this.leftButton);
     this.rightButton.ImageNorm = (Image) GFXLibrary.r_arrow_small_right_norm;
     this.rightButton.ImageOver = (Image) GFXLibrary.r_arrow_small_right_over;
     this.rightButton.Position = new Point(170, 50);
     this.rightButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.infoRight), "ParishCapitalVillagePanel2_protection_right");
     this.rightButton.Visible = false;
     this.backImage.addControl(this.rightButton);
     this.lblPlagueValue.Text = "";
     this.lblPlagueValue.Color = ARGBColors.Black;
     this.lblPlagueValue.Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
     this.lblPlagueValue.Position = new Point(0x52, 10);
     this.lblPlagueValue.Size = new Size(0x30, 0x16);
     this.lblPlagueValue.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     this.backImage.addControl(this.lblPlagueValue);
     this.lastPlague = -100;
     this.numInfos = 0;
     this.selectedProtection = 0;
 }
 public void init(LostVillageWindow parent, int age, int cardsMode)
 {
     this.m_secondAgeMessage = age;
     this.m_parent = parent;
     this.m_cardsMode = cardsMode;
     base.clearControls();
     this.transparentBackground.Size = base.Size;
     this.transparentBackground.FillColor = Color.FromArgb(0xff, 0, 0xff);
     base.addControl(this.transparentBackground);
     if (age != 0x3e8)
     {
         this.background.Position = new Point(0, 70);
         this.background.Size = new Size(base.Width, 0x1be);
         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.topImage.Image = (Image) GFXLibrary._9sclice_fancy_top_mid_over_01;
         this.topImage.Position = new Point((base.Width - this.topImage.Image.Width) / 2, 0);
         base.addControl(this.topImage);
         this.bottomImage.Image = (Image) GFXLibrary._9sclice_fancy_bottom_mid_over;
         this.bottomImage.Position = new Point((base.Width - this.bottomImage.Image.Width) / 2, (base.Height - this.bottomImage.Image.Height) - 5);
         base.addControl(this.bottomImage);
         this.backgroundArea.Position = new Point(0xab, 0x86);
         this.backgroundArea.Size = new Size(0x202, 340);
         base.addControl(this.backgroundArea);
     }
     else
     {
         this.backgroundImage.Position = new Point(0, 0);
         this.backgroundImage.Image = (Image) GFXLibrary.dominationEnd;
         base.addControl(this.backgroundImage);
         this.backgroundArea.Position = new Point(0, 0);
         this.backgroundArea.Size = this.backgroundImage.Size;
         base.addControl(this.backgroundArea);
     }
     this.btnLogout.ImageNorm = (Image) GFXLibrary.worldSelect_swap_norm;
     this.btnLogout.ImageOver = (Image) GFXLibrary.worldSelect_swap_over;
     this.btnLogout.ImageClick = (Image) GFXLibrary.worldSelect_swap_pushed;
     if (age != 0x3e8)
     {
         this.btnLogout.Position = new Point(260 - (this.btnLogout.ImageNorm.Width / 2), 0x147);
     }
     else
     {
         this.btnLogout.Position = new Point((base.Width / 2) - (this.btnLogout.ImageNorm.Width / 2), 0x23d);
     }
     this.btnLogout.Text.Text = SK.Text("GENERIC_Continue", "Continue");
     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);
     if (cardsMode < 0)
     {
         if (this.m_secondAgeMessage == 0)
         {
             this.headerLabel.Text = SK.Text("WorldSelect_Villages_Lost", "Your village was lost due to") + " :";
             this.headerLabel.Position = new Point(-50, 12);
             this.headerLabel.Size = new Size(this.backgroundArea.Width + 100, 150);
             this.headerLabel.Font = FontManager.GetFont("Arial", 18f, FontStyle.Regular);
             this.headerLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
             this.headerLabel.Color = ARGBColors.Black;
             this.headerLabel.DropShadowColor = ARGBColors.LightGray;
             this.backgroundArea.addControl(this.headerLabel);
             if (GameEngine.Instance.World.lastAttacker.Length == 0)
             {
                 this.lostMessageLabel.Text = SK.Text("WorldSelect_Inactivity", "Inactivity");
             }
             else if (GameEngine.Instance.World.lastAttacker == RemoteServices.Instance.UserName)
             {
                 this.lostMessageLabel.Text = SK.Text("WorldSelect_Abandoning", "You Abandoned Your Village");
             }
             else
             {
                 this.lostMessageLabel.Text = SK.Text("WorldSelect_Attacking_Player", "An Attacking Player") + " (" + GameEngine.Instance.World.lastAttacker + ")";
             }
             this.lostMessageLabel.Position = new Point(0, 0x2f);
             this.lostMessageLabel.Size = new Size(this.backgroundArea.Width, 240);
             this.lostMessageLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Regular);
             this.lostMessageLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
             this.lostMessageLabel.Color = ARGBColors.Black;
             this.lostMessageLabel.DropShadowColor = ARGBColors.LightGray;
             this.backgroundArea.addControl(this.lostMessageLabel);
             this.wallOfText.Text = SK.Text("WorldSelect_wall_of_text1", "Losing your village is all part of the game and this is only the beginning!") + Environment.NewLine + Environment.NewLine + SK.Text("WorldSelect_wall_of_text2", "There are no penalties for losing a village. You have the same amount of Gold, Honour and Faith Points as before and any unused Cards, Card Packs or Premium Tokens remain in your account. Quests, Research and Achievements are all unaffected and your Rank remains the same.") + Environment.NewLine + Environment.NewLine + SK.Text("WorldSelect_wall_of_text3", "With all your resources and abilities intact all that remains is for you to rebuild and rise to fight again!");
             this.wallOfText.Position = new Point(0, 0x40);
             this.wallOfText.Size = new Size(this.backgroundArea.Width, 260);
             this.wallOfText.Font = FontManager.GetFont("Arial", 12f, FontStyle.Regular);
             this.wallOfText.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
             this.wallOfText.Color = ARGBColors.Black;
             this.wallOfText.DropShadowColor = ARGBColors.LightGray;
             this.backgroundArea.addControl(this.wallOfText);
         }
         else if (this.m_secondAgeMessage == 2)
         {
             this.headerLabel.Text = SK.Text("WorldSelect_2ndAge_Header", "Welcome to the Second Age!");
             this.headerLabel.Position = new Point(-50, 12);
             this.headerLabel.Size = new Size(this.backgroundArea.Width + 100, 150);
             this.headerLabel.Font = FontManager.GetFont("Arial", 18f, FontStyle.Regular);
             this.headerLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
             this.headerLabel.Color = ARGBColors.Black;
             this.headerLabel.DropShadowColor = ARGBColors.LightGray;
             this.backgroundArea.addControl(this.headerLabel);
             this.wallOfText.Text = SK.Text("WorldSelect_2ndAge_body1", "A new rule set is now in effect:") + Environment.NewLine + Environment.NewLine + SK.Text("WorldSelect_2ndAge_body2", "1. Armies move across the world map at double speed.") + Environment.NewLine + SK.Text("WorldSelect_2ndAge_body3", "2. Three times as much Glory is earned for holding territory.") + Environment.NewLine + SK.Text("WorldSelect_2ndAge_body4", "3. Monks can influence voting at county level, with high voting costs and caps at county, province and country level.") + Environment.NewLine + SK.Text("WorldSelect_2ndAge_body5", "4. Interdicting and excommunicating villages costs twice the usual amount.") + Environment.NewLine + SK.Text("WorldSelect_2ndAge_body6", "5. At the end of the Second Age Glory Race players will be given unique treasures for their victory and a 'Champion Pack'.") + Environment.NewLine + Environment.NewLine + SK.Text("WorldSelect_2ndAge_body7", "For more information on the Second Age please check your mail.");
             this.wallOfText.Position = new Point(0, 0x31);
             this.wallOfText.Size = new Size(this.backgroundArea.Width, 260);
             if ((Program.mySettings.LanguageIdent == "fr") || (Program.mySettings.LanguageIdent == "ru"))
             {
                 this.wallOfText.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
             }
             else
             {
                 this.wallOfText.Font = FontManager.GetFont("Arial", 11f, FontStyle.Regular);
             }
             this.wallOfText.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT;
             this.wallOfText.Color = ARGBColors.Black;
             this.wallOfText.DropShadowColor = ARGBColors.LightGray;
             this.backgroundArea.addControl(this.wallOfText);
             CustomSelfDrawPanel.WikiLinkControl.init(this.backgroundArea, 0x2d, new Point(0x201, -6));
         }
         else if (this.m_secondAgeMessage == 3)
         {
             this.headerLabel.Text = SK.Text("WorldSelect_3rdAge_Header", "Welcome to the Third Age!");
             this.headerLabel.Position = new Point(-50, 12);
             this.headerLabel.Size = new Size(this.backgroundArea.Width + 100, 150);
             this.headerLabel.Font = FontManager.GetFont("Arial", 18f, FontStyle.Regular);
             this.headerLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
             this.headerLabel.Color = ARGBColors.Black;
             this.headerLabel.DropShadowColor = ARGBColors.LightGray;
             this.backgroundArea.addControl(this.headerLabel);
             this.wallOfText.Text = SK.Text("WorldSelect_2ndAge_body1", "A new rule set is now in effect:") + Environment.NewLine + Environment.NewLine + SK.Text("WorldSelect_3rdAge_body2", "1. Crown Princes may now access up to 30 villages") + Environment.NewLine + SK.Text("WorldSelect_3rdAge_body3", "2. Honour production has been increased by 900% for Banqueting and 300% for Popularity") + Environment.NewLine + SK.Text("WorldSelect_3rdAge_body4", "3. Goods have been cleared from all Markets, with prices reset to their starting levels") + Environment.NewLine + SK.Text("WorldSelect_3rdAge_body5", "4. All in-game Factions and Houses have been disbanded") + Environment.NewLine + SK.Text("WorldSelect_3rdAge_body6", "5. Certain upgradeable parish buildings can now gain additional levels") + Environment.NewLine + SK.Text("WorldSelect_3rdAge_body7", "6. The rate at which Glory is gained has been rebalanced") + Environment.NewLine + Environment.NewLine + SK.Text("WorldSelect_3rdAge_body8", "For more information on the Third Age please check your mail");
             this.wallOfText.Position = new Point(0, 0x31);
             this.wallOfText.Size = new Size(this.backgroundArea.Width, 260);
             this.wallOfText.Font = FontManager.GetFont("Arial", 11f, FontStyle.Regular);
             this.wallOfText.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT;
             this.wallOfText.Color = ARGBColors.Black;
             this.wallOfText.DropShadowColor = ARGBColors.LightGray;
             this.backgroundArea.addControl(this.wallOfText);
             CustomSelfDrawPanel.WikiLinkControl.init(this.backgroundArea, 0x2e, new Point(0x201, -6));
         }
         else if (this.m_secondAgeMessage == 4)
         {
             this.headerLabel.Text = SK.Text("WorldSelect_4thAge_Header", "Welcome to the Fourth Age!");
             this.headerLabel.Position = new Point(-50, 12);
             this.headerLabel.Size = new Size(this.backgroundArea.Width + 100, 150);
             this.headerLabel.Font = FontManager.GetFont("Arial", 18f, FontStyle.Regular);
             this.headerLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
             this.headerLabel.Color = ARGBColors.Black;
             this.headerLabel.DropShadowColor = ARGBColors.LightGray;
             this.backgroundArea.addControl(this.headerLabel);
             this.wallOfText.Text = SK.Text("WorldSelect_2ndAge_body1", "A new rule set is now in effect:") + Environment.NewLine + Environment.NewLine + SK.Text("WorldSelect_4thAge_body2", "1. Crown Princes may now own up to 40 villages.") + Environment.NewLine + SK.Text("WorldSelect_4thAge_body3", "2. Army and Scout movement speeds are three times faster than in the First Age.") + Environment.NewLine + SK.Text("WorldSelect_4thAge_body4", "3. Weapons can no longer be sold or purchased at Markets.") + Environment.NewLine + SK.Text("WorldSelect_4thAge_body5", "4. Goods have been cleared from all Markets, with prices reset to their starting level.") + Environment.NewLine + SK.Text("WorldSelect_4thAge_body6", "5. The Faith Point cost for Interdiction has been increased.") + Environment.NewLine + SK.Text("WorldSelect_4thAge_body7", "6. A Military School can be built in a parish, which gives access to Bombards.") + Environment.NewLine + SK.Text("WorldSelect_4thAge_body8", "7. Players who own more than 10 villages will no longer have to pay the extra honour cost to regain a village, if one of their villages is captured.") + Environment.NewLine + Environment.NewLine + SK.Text("WorldSelect_4thAge_body9", "For more information on the Fourth Age please check your mail.");
             this.wallOfText.Position = new Point(0, 0x31);
             this.wallOfText.Size = new Size(this.backgroundArea.Width, 260);
             this.wallOfText.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
             this.wallOfText.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT;
             this.wallOfText.Color = ARGBColors.Black;
             this.wallOfText.DropShadowColor = ARGBColors.LightGray;
             this.backgroundArea.addControl(this.wallOfText);
             CustomSelfDrawPanel.WikiLinkControl.init(this.backgroundArea, 0x30, new Point(0x201, -6));
         }
         else if (this.m_secondAgeMessage == 5)
         {
             this.headerLabel.Text = SK.Text("WorldSelect_5thAge_Header", "Welcome to the Fifth Age!");
             this.headerLabel.Position = new Point(-50, 12);
             this.headerLabel.Size = new Size(this.backgroundArea.Width + 100, 150);
             this.headerLabel.Font = FontManager.GetFont("Arial", 18f, FontStyle.Regular);
             this.headerLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
             this.headerLabel.Color = ARGBColors.Black;
             this.headerLabel.DropShadowColor = ARGBColors.LightGray;
             this.backgroundArea.addControl(this.headerLabel);
             this.wallOfText.Text = SK.Text("WorldSelect_2ndAge_body1", "A new rule set is now in effect:") + Environment.NewLine + Environment.NewLine + SK.Text("FifthAge_Mail_03", "1. Military Schools can be upgraded to level 5.") + Environment.NewLine + SK.Text("FifthAge_Mail_04", "2. Treasure Castles are twice as likely to appear.") + Environment.NewLine + SK.Text("FifthAge_Mail_05", "3. All factions and houses have been disbanded.") + Environment.NewLine + SK.Text("FifthAge_Mail_06", "4. All capital forums and walls have been cleared.") + Environment.NewLine + SK.Text("FifthAge_Mail_07", "5. Only members of a House can be candidates for County elections.") + Environment.NewLine + SK.Text("FifthAge_Mail_08", "6. To be eligible for the office of sheriff, a candidate must belong to a House which controls at least 30% of the parishes in the county.") + Environment.NewLine + SK.Text("WorldSelect_5thAge_body8", "7. Large Houses gain Glory more slowly than small Houses.") + Environment.NewLine + Environment.NewLine + SK.Text("WorldSelect_5thAge_body9", "For more information on the Fifth Age please check your mail.");
             this.wallOfText.Position = new Point(0, 0x31);
             this.wallOfText.Size = new Size(this.backgroundArea.Width, 260);
             this.wallOfText.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
             this.wallOfText.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT;
             this.wallOfText.Color = ARGBColors.Black;
             this.wallOfText.DropShadowColor = ARGBColors.LightGray;
             this.backgroundArea.addControl(this.wallOfText);
             CustomSelfDrawPanel.WikiLinkControl.init(this.backgroundArea, 0x33, new Point(0x201, -6));
         }
         else if (this.m_secondAgeMessage == 10)
         {
             this.headerLabel.Text = SK.Text("WorldSelect_Dom_Heading1", "Welcome to Domination World!");
             this.headerLabel.Position = new Point(-50, 0);
             this.headerLabel.Size = new Size(this.backgroundArea.Width + 100, 150);
             this.headerLabel.Font = FontManager.GetFont("Arial", 18f, FontStyle.Regular);
             this.headerLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
             this.headerLabel.Color = ARGBColors.Black;
             this.headerLabel.DropShadowColor = ARGBColors.LightGray;
             this.backgroundArea.addControl(this.headerLabel);
             this.wallOfText.Text = SK.Text("WorldSelect_Dom_body2", "New gameplay rules are in effect") + ":" + Environment.NewLine + Environment.NewLine + "1. " + SK.Text("WorldSelect_Dom_body3", "Interdiction cannot be used.") + Environment.NewLine + "2. " + SK.Text("WorldSelect_Dom_body4", "Build speeds quadrupled for buildings and castles in villages and capitals.") + Environment.NewLine + "3. " + SK.Text("WorldSelect_Dom_body5", "Research times reduced by half.") + Environment.NewLine + "4. " + SK.Text("WorldSelect_Dom_body6", "Time limit of 60 days, after which the world ends.") + Environment.NewLine + "5. " + SK.Text("WorldSelect_Dom_body7", "No Glory Rounds or Ages. The House with the most Glory when the world ends wins.") + Environment.NewLine + "6. " + SK.Text("WorldSelect_Dom_body8", "Unique Platinum Card Pack with rare cards for players in the winning House, as well as Ultimate, Super and Random Card Packs.") + Environment.NewLine + "7. " + SK.Text("WorldSelect_Dom_body9", "Other prizes for players who reach the top of each Leaderboard.") + Environment.NewLine + "8. " + SK.Text("WorldSelect_Dom_body10", "New Anglo-Saxon era map borders.") + Environment.NewLine + Environment.NewLine + SK.Text("WorldSelect_Dom_body11", "For more information on Domination World please check your mail.");
             this.wallOfText.Position = new Point(0, 0x20);
             this.wallOfText.Size = new Size(this.backgroundArea.Width, 0x11d);
             if ((Program.mySettings.LanguageIdent == "de") || (Program.mySettings.LanguageIdent == "ru"))
             {
                 this.wallOfText.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
             }
             else
             {
                 this.wallOfText.Font = FontManager.GetFont("Arial", 11f, FontStyle.Regular);
             }
             this.wallOfText.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT;
             this.wallOfText.Color = ARGBColors.Black;
             this.wallOfText.DropShadowColor = ARGBColors.LightGray;
             this.backgroundArea.addControl(this.wallOfText);
             CustomSelfDrawPanel.WikiLinkControl.init(this.backgroundArea, 0x2f, new Point(0x201, -6));
         }
         else if (this.m_secondAgeMessage == 0x3e8)
         {
             this.headerLabel.Text = SK.Text("PT_TUT_header1", "Congratulations!");
             this.headerLabel.Position = new Point(0, 0x19);
             this.headerLabel.Size = new Size(this.backgroundArea.Width, 150);
             this.headerLabel.Font = FontManager.GetFont("Arial", 18f, FontStyle.Regular);
             this.headerLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
             this.headerLabel.DropShadowColor = ARGBColors.Black;
             this.headerLabel.Color = ARGBColors.LightGray;
             this.backgroundArea.addControl(this.headerLabel);
             this.wallOfText.Text = SK.Text("DOMINATION_END_MESSAGE", "Goodness my lord! The end of days is now upon us! My how you've grown from that stumbling bumpkin I tutored long ago! It seems that the final reckoning has come and that this world is at its end!  Will your name also be recorded amongst the storied warriors in the Hall of Legends to be remembered for all eternity? This world has been a true test of your mettle and you are to be congratulated for having achieved so much here!");
             this.wallOfText.Position = new Point(0x70, 250);
             this.wallOfText.Size = new Size(this.backgroundArea.Width - 0xe0, 300);
             this.wallOfText.Font = FontManager.GetFont("Arial", 11f, FontStyle.Regular);
             this.wallOfText.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
             this.wallOfText.DropShadowColor = ARGBColors.Black;
             this.wallOfText.Color = ARGBColors.LightGray;
             this.backgroundArea.addControl(this.wallOfText);
             this.btnLogout.Text.Text = SK.Text("LogoutPanel_Swap_Worlds", "Swap Worlds");
             this.btnHallOfLegends.ImageNorm = (Image) GFXLibrary.HOLlink;
             this.btnHallOfLegends.OverBrighten = true;
             this.btnHallOfLegends.MoveOnClick = true;
             this.btnHallOfLegends.Position = new Point((base.Width / 2) - (this.btnHallOfLegends.ImageNorm.Width / 2), 0x1e3);
             this.btnHallOfLegends.Text.Text = SK.Text("HALL_OF_LEGENDS", "Hall of Legends");
             this.btnHallOfLegends.TextYOffset = -2;
             this.btnHallOfLegends.Text.Color = ARGBColors.White;
             this.btnHallOfLegends.Text.DropShadowColor = ARGBColors.Black;
             this.btnHallOfLegends.Text.Font = FontManager.GetFont("Arial", 11f, FontStyle.Regular);
             this.btnHallOfLegends.Text.Position = new Point(-3, 0);
             this.btnHallOfLegends.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.hallOfLegendsClick));
             this.btnHallOfLegends.Enabled = true;
             this.backgroundArea.addControl(this.btnHallOfLegends);
         }
     }
     else
     {
         if (cardsMode == 0)
         {
             this.headerLabel.Text = SK.Text("CARD_OFFERS_Super_Random_Pack", "Super Random Pack");
         }
         else
         {
             this.headerLabel.Text = SK.Text("CARD_OFFERS_Ultimate_Random_Pack", "Ultimate Random Pack");
         }
         this.headerLabel.Position = new Point(-50, 12);
         this.headerLabel.Size = new Size(this.backgroundArea.Width + 100, 150);
         this.headerLabel.Font = FontManager.GetFont("Arial", 18f, FontStyle.Regular);
         this.headerLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
         this.headerLabel.Color = ARGBColors.Black;
         this.headerLabel.DropShadowColor = ARGBColors.LightGray;
         this.backgroundArea.addControl(this.headerLabel);
         if (cardsMode == 0)
         {
             this.lostMessageLabel.Text = SK.Text("Cards_Super_Explanation", "Super random packs generally contain less silver ranked cards and give you a much greater chance of rare diamond and double diamond cards.");
         }
         else
         {
             this.lostMessageLabel.Text = SK.Text("Cards_Ultimate_Explanation", "Ultimate random packs generally contain far less silver ranked cards and give you a much greater chance of super rare triple diamond and Sapphire cards.");
         }
         this.lostMessageLabel.Position = new Point(0, 0x2f);
         this.lostMessageLabel.Size = new Size(this.backgroundArea.Width, 240);
         this.lostMessageLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Regular);
         this.lostMessageLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
         this.lostMessageLabel.Color = ARGBColors.Black;
         this.lostMessageLabel.DropShadowColor = ARGBColors.LightGray;
         this.backgroundArea.addControl(this.lostMessageLabel);
         this.wallOfText.Text = SK.Text("Cards_NewPacks", "While one can expect better cards across all ranks, some of the cards in this pack may be suitable only for higher ranked players.");
         this.wallOfText.Position = new Point(0x19, 250);
         this.wallOfText.Size = new Size(this.backgroundArea.Width - 50, 60);
         this.wallOfText.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
         this.wallOfText.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.BOTTOM_CENTER;
         this.wallOfText.Color = ARGBColors.Black;
         this.wallOfText.DropShadowColor = ARGBColors.LightGray;
         this.backgroundArea.addControl(this.wallOfText);
         CustomSelfDrawPanel.CSDImage control = new CustomSelfDrawPanel.CSDImage();
         if (cardsMode == 0)
         {
             control.Image = (Image) GFXLibrary.SuperFan;
         }
         else
         {
             control.Image = (Image) GFXLibrary.UltimateFan;
         }
         control.Position = new Point(120, 0x69);
         this.backgroundArea.addControl(control);
     }
 }
 public void init()
 {
     this.attackMode = false;
     base.clearControls();
     this.backImage         = this.backGround.init(true, 0x2710);
     this.drawArea.Size     = this.backImage.Size;
     this.drawArea.Position = new Point(0, 0);
     this.drawArea.Visible  = true;
     this.backImage.addControl(this.drawArea);
     base.addControl(this.backGround);
     this.tradeButton.ImageNorm       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[0];
     this.tradeButton.ImageOver       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[7];
     this.tradeButton.ImageClick      = (Image)GFXLibrary.mrhp_world_icons_rhs_array[14];
     this.tradeButton.Position        = new Point(0x1d, 0x8e);
     this.tradeButton.CustomTooltipID = 0x96a;
     this.tradeButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.sendResources), "VassalVillagePanel2_trade");
     this.drawArea.addControl(this.tradeButton);
     this.attackButton.ImageNorm       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[1];
     this.attackButton.ImageOver       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[8];
     this.attackButton.ImageClick      = (Image)GFXLibrary.mrhp_world_icons_rhs_array[15];
     this.attackButton.Position        = new Point(0x40, 0x8e);
     this.attackButton.CustomTooltipID = 0x995;
     this.attackButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.sendTroops), "VassalVillagePanel2_attack_from");
     this.drawArea.addControl(this.attackButton);
     this.reinforceButton.ImageNorm       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[2];
     this.reinforceButton.ImageOver       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[9];
     this.reinforceButton.ImageClick      = (Image)GFXLibrary.mrhp_world_icons_rhs_array[0x10];
     this.reinforceButton.Position        = new Point(0x63, 0x8e);
     this.reinforceButton.CustomTooltipID = 0x993;
     this.reinforceButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.sendReinforcements), "VassalVillagePanel2_manage_troops");
     this.drawArea.addControl(this.reinforceButton);
     this.vassalButton.ImageNorm       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[5];
     this.vassalButton.ImageOver       = (Image)GFXLibrary.mrhp_world_icons_rhs_array[12];
     this.vassalButton.ImageClick      = (Image)GFXLibrary.mrhp_world_icons_rhs_array[0x13];
     this.vassalButton.Position        = new Point(0x86, 0x8e);
     this.vassalButton.CustomTooltipID = 0x994;
     this.vassalButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.vassalClick), "VassalVillagePanel2_manage_vassals");
     this.drawArea.addControl(this.vassalButton);
     this.castleButton.ImageNorm       = (Image)GFXLibrary.mrhp_reports;
     this.castleButton.OverBrighten    = true;
     this.castleButton.MoveOnClick     = true;
     this.castleButton.Position        = new Point(80, 0x70);
     this.castleButton.CustomTooltipID = 0x98d;
     this.castleButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.castleClick), "VassalVillagePanel2_view_castle_report");
     this.drawArea.addControl(this.castleButton);
     this.lblProtectionType.Text      = "";
     this.lblProtectionType.Color     = ARGBColors.Black;
     this.lblProtectionType.Font      = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.lblProtectionType.Position  = new Point(0, 0x26);
     this.lblProtectionType.Size      = new Size(this.backImage.Width, 0x17);
     this.lblProtectionType.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     this.drawArea.addControl(this.lblProtectionType);
     this.lblProtected.Text      = "";
     this.lblProtected.Color     = ARGBColors.Black;
     this.lblProtected.Font      = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.lblProtected.Position  = new Point(6, 0x30);
     this.lblProtected.Size      = new Size(this.backImage.Width - 12, 0x4a);
     this.lblProtected.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     this.drawArea.addControl(this.lblProtected);
     this.leftButton.ImageNorm = (Image)GFXLibrary.r_arrow_small_left_norm;
     this.leftButton.ImageOver = (Image)GFXLibrary.r_arrow_small_left_over;
     this.leftButton.Position  = new Point(5, 50);
     this.leftButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.infoLeft), "VassalVillagePanel2_protection_left");
     this.leftButton.Visible = false;
     this.drawArea.addControl(this.leftButton);
     this.rightButton.ImageNorm = (Image)GFXLibrary.r_arrow_small_right_norm;
     this.rightButton.ImageOver = (Image)GFXLibrary.r_arrow_small_right_over;
     this.rightButton.Position  = new Point(170, 50);
     this.rightButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.infoRight), "VassalVillagePanel2_protection_right");
     this.rightButton.Visible = false;
     this.drawArea.addControl(this.rightButton);
     this.updateSize();
     this.numInfos           = 0;
     this.selectedProtection = 0;
 }
 public static CustomSelfDrawPanel.CSDImage createRewardIcon(int iconID, int value, Point Location, int tooltipID)
 {
     CustomSelfDrawPanel.CSDImage image = new CustomSelfDrawPanel.CSDImage {
         Image = (Image) GFXLibrary.quest_rewards[iconID],
         Position = Location,
         CustomTooltipID = tooltipID
     };
     if (value >= 0)
     {
         CustomSelfDrawPanel.CSDLabel control = new CustomSelfDrawPanel.CSDLabel {
             Text = value.ToString(),
             Color = ARGBColors.Black,
             Position = new Point(0x2f, 0),
             Size = new Size(80, image.Image.Height),
             Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold),
             Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT,
             CustomTooltipID = tooltipID
         };
         image.addControl(control);
     }
     return image;
 }
 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();
 }
Esempio n. 35
0
 private CustomSelfDrawPanel.CSDImage getNextImage()
 {
     if (this.curImageID >= this.imageCache.Count)
     {
         CustomSelfDrawPanel.CSDImage item = new CustomSelfDrawPanel.CSDImage();
         this.imageCache.Add(item);
         this.curImageID++;
         return item;
     }
     this.curImageID++;
     return this.imageCache[this.curImageID - 1];
 }
Esempio n. 36
0
 public void init(FormationPopup parent)
 {
     this.m_parent  = parent;
     base.Size      = this.m_parent.Size;
     this.BackColor = ARGBColors.Transparent;
     CustomSelfDrawPanel.CSDImage control = new CustomSelfDrawPanel.CSDImage {
         Alpha    = 0.1f,
         Image    = (Image)GFXLibrary.formations_img,
         Scale    = 5.0,
         Position = new Point(0, 0),
         Size     = base.Size
     };
     base.addControl(control);
     this.manageLabel.Text            = SK.Text("Formations_Manage_Box", "Manage Formations");
     this.manageLabel.Color           = ARGBColors.White;
     this.manageLabel.DropShadowColor = ARGBColors.Black;
     this.manageLabel.Position        = new Point(base.Width / 3, 5);
     this.manageLabel.Size            = new Size(base.Width / 3, 0x18);
     this.manageLabel.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
     this.manageLabel.Font            = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
     base.addControl(this.manageLabel);
     this.storedLabel.Text            = SK.Text("Formations_Stored", "Stored Formations");
     this.storedLabel.Color           = ARGBColors.White;
     this.storedLabel.DropShadowColor = ARGBColors.Black;
     this.storedLabel.Position        = new Point(base.Width / 3, 0x19);
     this.storedLabel.Size            = new Size(base.Width / 3, 0x18);
     this.storedLabel.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
     this.storedLabel.Font            = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     base.addControl(this.storedLabel);
     this.storedList.Size     = new Size(190, 0xd8);
     this.storedList.Position = new Point((base.Width / 2) - (this.storedList.Width / 2), 0x2d);
     base.addControl(this.storedList);
     this.storedList.Create(12, 0x12);
     this.storedList.setLineClickedDelegate(new CustomSelfDrawPanel.CSDListBox.CSD_LineClickedDelegate(this.listClick));
     this.storedList.setDoubleClickedDelegate(new CustomSelfDrawPanel.CSDListBox.CSD_LineClickedDelegate(this.listDoubleClick));
     this.loadButton.ImageNorm  = (Image)GFXLibrary.button_132_normal;
     this.loadButton.ImageOver  = (Image)GFXLibrary.button_132_over;
     this.loadButton.ImageClick = (Image)GFXLibrary.button_132_in;
     this.loadButton.setSizeToImage();
     this.loadButton.Position    = new Point((base.Width / 2) - (this.loadButton.Width / 2), this.storedList.Rectangle.Bottom + 5);
     this.loadButton.Text.Text   = SK.Text("Formations_Load", "Load Formation");
     this.loadButton.Text.Font   = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.loadButton.TextYOffset = -2;
     this.loadButton.Text.Color  = ARGBColors.Black;
     this.loadButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.loadClick), "Formation_Load");
     this.loadButton.Enabled = true;
     base.addControl(this.loadButton);
     this.deleteButton.ImageNorm  = (Image)GFXLibrary.button_132_normal;
     this.deleteButton.ImageOver  = (Image)GFXLibrary.button_132_over;
     this.deleteButton.ImageClick = (Image)GFXLibrary.button_132_in;
     this.deleteButton.setSizeToImage();
     this.deleteButton.Position    = new Point(this.loadButton.Position.X, this.loadButton.Rectangle.Bottom + 5);
     this.deleteButton.Text.Text   = SK.Text("Formations_Delete", "Delete Formation");
     this.deleteButton.Text.Font   = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.deleteButton.TextYOffset = -2;
     this.deleteButton.Text.Color  = ARGBColors.Black;
     this.deleteButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.deleteClick), "Formation_Delete");
     this.deleteButton.Enabled = true;
     base.addControl(this.deleteButton);
     this.renameButton.ImageNorm  = (Image)GFXLibrary.button_132_normal;
     this.renameButton.ImageOver  = (Image)GFXLibrary.button_132_over;
     this.renameButton.ImageClick = (Image)GFXLibrary.button_132_in;
     this.renameButton.setSizeToImage();
     this.renameButton.Position    = new Point(this.loadButton.Position.X, this.deleteButton.Rectangle.Bottom + 30);
     this.renameButton.Text.Text   = SK.Text("Formations_Rename", "Rename Formation");
     this.renameButton.Text.Font   = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.renameButton.TextYOffset = -2;
     this.renameButton.Text.Color  = ARGBColors.Black;
     this.renameButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.renameClick), "Formation_Rename");
     this.renameButton.Enabled = true;
     base.addControl(this.renameButton);
     this.clearButton.ImageNorm  = (Image)GFXLibrary.button_132_normal;
     this.clearButton.ImageOver  = (Image)GFXLibrary.button_132_over;
     this.clearButton.ImageClick = (Image)GFXLibrary.button_132_in;
     this.clearButton.setSizeToImage();
     this.clearButton.Position    = new Point(((5 * base.Width) / 6) - (this.clearButton.Width / 2), this.renameButton.Y);
     this.clearButton.Text.Text   = SK.Text("Formations_Clear", "Clear Deployment");
     this.clearButton.Text.Font   = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.clearButton.TextYOffset = -2;
     this.clearButton.Text.Color  = ARGBColors.Black;
     this.clearButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.clearClick), "Formation_Clear");
     this.clearButton.Enabled = true;
     base.addControl(this.clearButton);
     this.totalsButton.ImageNorm  = (Image)GFXLibrary.button_132_normal;
     this.totalsButton.ImageOver  = (Image)GFXLibrary.button_132_over;
     this.totalsButton.ImageClick = (Image)GFXLibrary.button_132_in;
     this.totalsButton.setSizeToImage();
     this.totalsButton.Position    = new Point(((5 * base.Width) / 6) - (this.totalsButton.Width / 2), this.deleteButton.Y);
     this.totalsButton.Text.Text   = SK.Text("Formations_CurrentTotals", "Current Totals");
     this.totalsButton.Text.Font   = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.totalsButton.TextYOffset = -2;
     this.totalsButton.Text.Color  = ARGBColors.Black;
     this.totalsButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.totalsClick), "Formation_CurrentTotals");
     this.totalsButton.Enabled = true;
     base.addControl(this.totalsButton);
     this.formationImage.Image = (Image)GFXLibrary.formations_img;
     this.formationImage.setSizeToImage();
     this.formationImage.Position = new Point((base.Width / 6) - (this.formationImage.Width / 2), (this.storedList.Y + (this.storedList.Height / 2)) - (this.formationImage.Height / 2));
     base.addControl(this.formationImage);
     this.createLabel.Text            = SK.Text("Formations_New_Box", "Create New Formation");
     this.createLabel.Color           = ARGBColors.White;
     this.createLabel.DropShadowColor = ARGBColors.Black;
     this.createLabel.Position        = new Point(0, this.deleteButton.Y);
     this.createLabel.Size            = new Size(base.Width / 3, this.deleteButton.Height);
     this.createLabel.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.BOTTOM_CENTER;
     this.createLabel.Font            = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
     base.addControl(this.createLabel);
     this.createNameLabel.Text            = SK.Text("Formations_Name", "Formation Name");
     this.createNameLabel.Color           = ARGBColors.White;
     this.createNameLabel.DropShadowColor = ARGBColors.Black;
     this.createNameLabel.Position        = new Point(0, this.deleteButton.Y);
     this.createNameLabel.Size            = new Size(base.Width / 3, this.deleteButton.Height);
     this.createNameLabel.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.BOTTOM_CENTER;
     this.createNameLabel.Font            = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     this.createButton.ImageNorm          = (Image)GFXLibrary.button_132_normal;
     this.createButton.ImageOver          = (Image)GFXLibrary.button_132_over;
     this.createButton.ImageClick         = (Image)GFXLibrary.button_132_in;
     this.createButton.setSizeToImage();
     this.createButton.Position    = new Point((base.Width / 6) - (this.createButton.Width / 2), this.renameButton.Y);
     this.createButton.Text.Text   = SK.Text("Formations_Save", "Save Formation");
     this.createButton.Text.Font   = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.createButton.TextYOffset = -2;
     this.createButton.Text.Color  = ARGBColors.Black;
     this.createButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.createClick), "Formation_Create");
     this.createButton.Enabled = true;
     base.addControl(this.createButton);
     this.castlePlacePeasantButton.ImageNorm = (Image)GFXLibrary.r_building_miltary_peasent;
     this.castlePlacePeasantButton.ImageOver = (Image)GFXLibrary.r_building_miltary_peasent;
     this.castlePlacePeasantButton.setSizeToImage();
     this.castlePlacePeasantButton.Position  = new Point((((5 * base.Width) / 6) - this.castlePlacePeasantButton.Width) - 10, this.storedLabel.Y);
     this.castlePlacePeasantButton.Data      = 90;
     this.castlePlacePeasantButton.ClickArea = new Rectangle(10, 10, 0x55, 0x55);
     this.castlePlacePeasantInset.Image      = (Image)GFXLibrary.castlescreen_unit_capsule;
     this.castlePlacePeasantInset.Position   = new Point(0x37, 0x37);
     this.castlePlacePeasantLabel.Text       = "0";
     this.castlePlacePeasantLabel.Color      = Color.FromArgb(0xfe, 0xf8, 0xe5);
     this.castlePlacePeasantLabel.Position   = new Point(0, -1);
     this.castlePlacePeasantLabel.Size       = this.castlePlacePeasantInset.Size;
     this.castlePlacePeasantLabel.Alignment  = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     base.addControl(this.castlePlacePeasantButton);
     this.castlePlacePeasantInset.addControl(this.castlePlacePeasantLabel);
     this.castlePlacePeasantButton.addControl(this.castlePlacePeasantInset);
     this.castlePlacePeasantButton.Active   = false;
     this.castlePlaceArcherButton.ImageNorm = (Image)GFXLibrary.r_building_miltary_archer;
     this.castlePlaceArcherButton.ImageOver = (Image)GFXLibrary.r_building_miltary_archer;
     this.castlePlaceArcherButton.setSizeToImage();
     this.castlePlaceArcherButton.Position  = new Point(this.castlePlacePeasantButton.Rectangle.Right - 10, this.castlePlacePeasantButton.Position.Y);
     this.castlePlaceArcherButton.Data      = 0x5c;
     this.castlePlaceArcherButton.ClickArea = new Rectangle(10, 10, 0x55, 0x55);
     this.castlePlaceArcherInset.Image      = (Image)GFXLibrary.castlescreen_unit_capsule;
     this.castlePlaceArcherInset.Position   = new Point(0x37, 0x37);
     this.castlePlaceArcherLabel.Text       = "0";
     this.castlePlaceArcherLabel.Color      = Color.FromArgb(0xfe, 0xf8, 0xe5);
     this.castlePlaceArcherLabel.Position   = new Point(0, -1);
     this.castlePlaceArcherLabel.Size       = this.castlePlaceArcherInset.Size;
     this.castlePlaceArcherLabel.Alignment  = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     base.addControl(this.castlePlaceArcherButton);
     this.castlePlaceArcherInset.addControl(this.castlePlaceArcherLabel);
     this.castlePlaceArcherButton.addControl(this.castlePlaceArcherInset);
     this.castlePlaceArcherButton.Active     = false;
     this.castlePlacePikemanButton.ImageNorm = (Image)GFXLibrary.r_building_miltary_pikemen;
     this.castlePlacePikemanButton.ImageOver = (Image)GFXLibrary.r_building_miltary_pikemen;
     this.castlePlacePikemanButton.setSizeToImage();
     this.castlePlacePikemanButton.Position  = new Point(this.castlePlacePeasantButton.Position.X, this.castlePlacePeasantButton.Rectangle.Bottom - 0x22);
     this.castlePlacePikemanButton.Data      = 0x5d;
     this.castlePlacePikemanButton.ClickArea = new Rectangle(10, 10, 0x55, 0x55);
     this.castlePlacePikemanInset.Image      = (Image)GFXLibrary.castlescreen_unit_capsule;
     this.castlePlacePikemanInset.Position   = new Point(0x37, 0x37);
     this.castlePlacePikemanLabel.Text       = "0";
     this.castlePlacePikemanLabel.Color      = Color.FromArgb(0xfe, 0xf8, 0xe5);
     this.castlePlacePikemanLabel.Position   = new Point(0, -1);
     this.castlePlacePikemanLabel.Size       = this.castlePlacePikemanInset.Size;
     this.castlePlacePikemanLabel.Alignment  = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     base.addControl(this.castlePlacePikemanButton);
     this.castlePlacePikemanInset.addControl(this.castlePlacePikemanLabel);
     this.castlePlacePikemanButton.addControl(this.castlePlacePikemanInset);
     this.castlePlacePikemanButton.Active      = false;
     this.castlePlaceSwordsmanButton.ImageNorm = (Image)GFXLibrary.r_building_miltary_swordsman;
     this.castlePlaceSwordsmanButton.ImageOver = (Image)GFXLibrary.r_building_miltary_swordsman;
     this.castlePlaceSwordsmanButton.setSizeToImage();
     this.castlePlaceSwordsmanButton.Position  = new Point(this.castlePlaceArcherButton.Position.X, this.castlePlacePikemanButton.Y);
     this.castlePlaceSwordsmanButton.Data      = 0x5b;
     this.castlePlaceSwordsmanButton.ClickArea = new Rectangle(10, 10, 0x55, 0x55);
     this.castlePlaceSwordsmanInset.Image      = (Image)GFXLibrary.castlescreen_unit_capsule;
     this.castlePlaceSwordsmanInset.Position   = new Point(0x37, 0x37);
     this.castlePlaceSwordsmanLabel.Text       = "0";
     this.castlePlaceSwordsmanLabel.Color      = Color.FromArgb(0xfe, 0xf8, 0xe5);
     this.castlePlaceSwordsmanLabel.Position   = new Point(0, -1);
     this.castlePlaceSwordsmanLabel.Size       = this.castlePlaceSwordsmanInset.Size;
     this.castlePlaceSwordsmanLabel.Alignment  = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     base.addControl(this.castlePlaceSwordsmanButton);
     this.castlePlaceSwordsmanInset.addControl(this.castlePlaceSwordsmanLabel);
     this.castlePlaceSwordsmanButton.addControl(this.castlePlaceSwordsmanInset);
     this.castlePlaceSwordsmanButton.Active   = false;
     this.castlePlaceCatapultButton.ImageNorm = (Image)GFXLibrary.r_building_miltary_catapult;
     this.castlePlaceCatapultButton.ImageOver = (Image)GFXLibrary.r_building_miltary_catapult;
     this.castlePlaceCatapultButton.setSizeToImage();
     this.castlePlaceCatapultButton.Position  = new Point(this.castlePlacePeasantButton.Position.X, this.castlePlacePikemanButton.Rectangle.Bottom - 0x22);
     this.castlePlaceCatapultButton.Data      = 0x5e;
     this.castlePlaceCatapultButton.ClickArea = new Rectangle(10, 10, 0x55, 0x55);
     this.castlePlaceCatapultInset.Image      = (Image)GFXLibrary.castlescreen_unit_capsule;
     this.castlePlaceCatapultInset.Position   = new Point(0x37, 0x41);
     this.castlePlaceCatapultLabel.Text       = "0";
     this.castlePlaceCatapultLabel.Color      = Color.FromArgb(0xfe, 0xf8, 0xe5);
     this.castlePlaceCatapultLabel.Position   = new Point(0, -1);
     this.castlePlaceCatapultLabel.Size       = this.castlePlaceCatapultInset.Size;
     this.castlePlaceCatapultLabel.Alignment  = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     base.addControl(this.castlePlaceCatapultButton);
     this.castlePlaceCatapultInset.addControl(this.castlePlaceCatapultLabel);
     this.castlePlaceCatapultButton.addControl(this.castlePlaceCatapultInset);
     this.castlePlaceCatapultButton.Active   = false;
     this.castlePlaceCaptainButton.ImageNorm = (Image)GFXLibrary.r_building_miltary_captain_normal;
     this.castlePlaceCaptainButton.ImageOver = (Image)GFXLibrary.r_building_miltary_captain_normal;
     this.castlePlaceCaptainButton.setSizeToImage();
     this.castlePlaceCaptainButton.Position  = new Point(this.castlePlaceArcherButton.Position.X, this.castlePlaceCatapultButton.Position.Y);
     this.castlePlaceCaptainButton.Data      = 0x5e;
     this.castlePlaceCaptainButton.ClickArea = new Rectangle(10, 10, 0x55, 0x55);
     this.castlePlaceCaptainInset.Image      = (Image)GFXLibrary.castlescreen_unit_capsule;
     this.castlePlaceCaptainInset.Position   = new Point(0x37, 0x41);
     this.castlePlaceCaptainLabel.Text       = "0";
     this.castlePlaceCaptainLabel.Color      = Color.FromArgb(0xfe, 0xf8, 0xe5);
     this.castlePlaceCaptainLabel.Position   = new Point(0, -1);
     this.castlePlaceCaptainLabel.Size       = this.castlePlaceCaptainInset.Size;
     this.castlePlaceCaptainLabel.Alignment  = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     base.addControl(this.castlePlaceCaptainButton);
     this.castlePlaceCaptainInset.addControl(this.castlePlaceCaptainLabel);
     this.castlePlaceCaptainButton.addControl(this.castlePlaceCaptainInset);
     this.castlePlaceCaptainButton.Active    = false;
     this.selectedTitleLabel.Text            = "";
     this.selectedTitleLabel.Color           = ARGBColors.White;
     this.selectedTitleLabel.DropShadowColor = ARGBColors.Black;
     this.selectedTitleLabel.Position        = new Point((2 * base.Width) / 3, this.manageLabel.Y);
     this.selectedTitleLabel.Size            = new Size(base.Width / 3, 0x18);
     this.selectedTitleLabel.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
     this.selectedTitleLabel.Font            = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     base.addControl(this.selectedTitleLabel);
     this.selectedTroopCountLabel.Text            = "";
     this.selectedTroopCountLabel.Color           = ARGBColors.White;
     this.selectedTroopCountLabel.DropShadowColor = ARGBColors.Black;
     this.selectedTroopCountLabel.Position        = new Point((2 * base.Width) / 3, this.storedLabel.Y);
     this.selectedTroopCountLabel.Size            = new Size(base.Width / 3, 0x18);
     this.selectedTroopCountLabel.Alignment       = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER;
     this.selectedTroopCountLabel.Font            = FontManager.GetFont("Arial", 8f, FontStyle.Regular);
     base.addControl(this.selectedTroopCountLabel);
     if (!Program.mySettings.AttackSetupsUpdated)
     {
         GameEngine.Instance.CastleAttackerSetup.cleanUpAttackSaveNames();
         Program.mySettings.AttackSetupsUpdated = true;
     }
     this.loadNames();
     this.initTotals();
 }
 private void importCounties(List <int> counties)
 {
     this.selectedCounty = -1;
     if (counties != null)
     {
         this.mapImage.clearControls();
         for (int i = 0; i < 2; i++)
         {
             for (int j = 0; j < counties.Count; j += 4)
             {
                 int   countyID = counties[j];
                 int   num4     = counties[j + 1];
                 int   num5     = counties[j + 2];
                 int   local1   = counties[j + 3];
                 Point point    = GameEngine.Instance.World.getCountyMarkerLocation(countyID);
                 if (num4 == -1000)
                 {
                     if (i == 0)
                     {
                         CustomSelfDrawPanel.CSDImage image;
                         image = new CustomSelfDrawPanel.CSDImage {
                             Image           = (Image)GFXLibrary.selector_square_red_normal,
                             Size            = new Size(((Image)GFXLibrary.selector_square_red_normal).Size.Width / 2, ((Image)GFXLibrary.selector_square_red_normal).Size.Height / 2),
                             CustomTooltipID = 0x44d,
                             Position        = new Point(((int)(((float)point.X) / this.divider)) - 4, ((int)(((float)point.Y) / this.divider)) - 4),
                             Colorise        = Color.FromArgb(0xff, 0x80, 0x80, 0x80)
                         };
                         this.mapImage.addControl(image);
                     }
                 }
                 else if (i == 1)
                 {
                     CustomSelfDrawPanel.CSDButton control = new CustomSelfDrawPanel.CSDButton {
                         Position = new Point(((int)(((float)point.X) / this.divider)) - 8, ((int)(((float)point.Y) / this.divider)) - 8)
                     };
                     control.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.iconOver_Click));
                     control.Data            = countyID;
                     control.CustomTooltipID = 0x44c;
                     this.mapImage.addControl(control);
                     if (num4 > (num5 / 2))
                     {
                         control.ImageNorm  = (Image)GFXLibrary.selector_square_normal;
                         control.ImageOver  = (Image)GFXLibrary.selector_square_over;
                         control.ImageClick = (Image)GFXLibrary.selector_square_pressed;
                     }
                     else if (num4 > (num5 / 7))
                     {
                         control.ImageNorm  = (Image)GFXLibrary.selector_square_orange_normal;
                         control.ImageOver  = (Image)GFXLibrary.selector_square_orange_over;
                         control.ImageClick = (Image)GFXLibrary.selector_square_orange_pressed;
                     }
                     else
                     {
                         control.ImageNorm  = (Image)GFXLibrary.selector_square_red_normal;
                         control.ImageOver  = (Image)GFXLibrary.selector_square_red_over;
                         control.ImageClick = (Image)GFXLibrary.selector_square_red_pressed;
                     }
                 }
             }
         }
         this.mapImage.invalidate();
     }
 }
 public void init()
 {
     base.clearControls();
     this.backImage = this.backGround.init(true, 0x2710);
     base.addControl(this.backGround);
     this.tradeButton.ImageNorm = (Image) GFXLibrary.mrhp_world_icons_rhs_array[0];
     this.tradeButton.ImageOver = (Image) GFXLibrary.mrhp_world_icons_rhs_array[7];
     this.tradeButton.ImageClick = (Image) GFXLibrary.mrhp_world_icons_rhs_array[14];
     this.tradeButton.Position = new Point(80, 0x8e);
     this.tradeButton.CustomTooltipID = 0x989;
     this.tradeButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.tradeClick), "OwnParishCapitalPanel2_trade");
     this.backImage.addControl(this.tradeButton);
     if (GameEngine.Instance.World.MapEditing)
     {
         this.mapEdit.ImageNorm = (Image) GFXLibrary.faction_pen;
         this.mapEdit.ImageOver = (Image) GFXLibrary.faction_pen;
         this.mapEdit.ImageClick = (Image) GFXLibrary.faction_pen;
         this.mapEdit.MoveOnClick = true;
         this.mapEdit.OverBrighten = true;
         this.mapEdit.Position = new Point(150, 0x8e);
         this.mapEdit.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.mapEditClicked));
         this.backImage.addControl(this.mapEdit);
     }
     this.villageButton.ImageNorm = (Image) GFXLibrary.int_world_icon_village;
     this.villageButton.OverBrighten = true;
     this.villageButton.MoveOnClick = true;
     this.villageButton.Position = new Point(0x1d, 0x70);
     this.villageButton.CustomTooltipID = 0x985;
     this.villageButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.villageClick), "OwnParishCapitalPanel2_view_village");
     this.backImage.addControl(this.villageButton);
     this.castleButton.ImageNorm = (Image) GFXLibrary.int_world_icon_castle;
     this.castleButton.OverBrighten = true;
     this.castleButton.MoveOnClick = true;
     this.castleButton.Position = new Point(0x40, 0x70);
     this.castleButton.CustomTooltipID = 0x986;
     this.castleButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.castleClick), "OwnParishCapitalPanel2_view_castle");
     this.backImage.addControl(this.castleButton);
     this.resourcesButton.ImageNorm = (Image) GFXLibrary.int_world_icon_resource;
     this.resourcesButton.OverBrighten = true;
     this.resourcesButton.MoveOnClick = true;
     this.resourcesButton.Position = new Point(0x63, 0x70);
     this.resourcesButton.CustomTooltipID = 0x987;
     this.resourcesButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.resourcesClick), "OwnParishCapitalPanel2_view_resources");
     this.backImage.addControl(this.resourcesButton);
     this.troopsButton.ImageNorm = (Image) GFXLibrary.int_world_icon_troops;
     this.troopsButton.OverBrighten = true;
     this.troopsButton.MoveOnClick = true;
     this.troopsButton.Position = new Point(0x86, 0x70);
     this.troopsButton.CustomTooltipID = 0x98a;
     this.troopsButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.troopsClick), "OwnParishCapitalPanel2_make_troops");
     this.backImage.addControl(this.troopsButton);
     this.lblPlagueValue.Text = "";
     this.lblPlagueValue.Color = ARGBColors.Black;
     this.lblPlagueValue.Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
     this.lblPlagueValue.Position = new Point(0x52, 10);
     this.lblPlagueValue.Size = new Size(0x30, 0x16);
     this.lblPlagueValue.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     this.backImage.addControl(this.lblPlagueValue);
     this.lblProtectionType.Text = "";
     this.lblProtectionType.Color = ARGBColors.Black;
     this.lblProtectionType.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.lblProtectionType.Position = new Point(0, 0x26);
     this.lblProtectionType.Size = new Size(this.backImage.Width, 0x17);
     this.lblProtectionType.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     this.backImage.addControl(this.lblProtectionType);
     this.lblProtected.Text = "";
     this.lblProtected.Color = ARGBColors.Black;
     this.lblProtected.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.lblProtected.Position = new Point(6, 0x30);
     this.lblProtected.Size = new Size(this.backImage.Width - 12, 0x4a);
     this.lblProtected.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     this.backImage.addControl(this.lblProtected);
     this.leftButton.ImageNorm = (Image) GFXLibrary.r_arrow_small_left_norm;
     this.leftButton.ImageOver = (Image) GFXLibrary.r_arrow_small_left_over;
     this.leftButton.Position = new Point(5, 50);
     this.leftButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.infoLeft), "OwnParishCapitalPanel2_protection_left");
     this.leftButton.Visible = false;
     this.backImage.addControl(this.leftButton);
     this.rightButton.ImageNorm = (Image) GFXLibrary.r_arrow_small_right_norm;
     this.rightButton.ImageOver = (Image) GFXLibrary.r_arrow_small_right_over;
     this.rightButton.Position = new Point(170, 50);
     this.rightButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.infoRight), "OwnParishCapitalPanel2_protection_right");
     this.rightButton.Visible = false;
     this.backImage.addControl(this.rightButton);
     this.lastPlague = -100;
     this.numInfos = 0;
     this.selectedProtection = 0;
 }
Esempio n. 39
0
 private void cardPlayed(ICardsProvider provider, ICardsResponse response)
 {
     if (!response.SuccessCode.HasValue || (response.SuccessCode.Value != 1))
     {
         GameEngine.Instance.playInterfaceSound("PlayCardsPanel_play_card_failed");
         MyMessageBox.Show(PlayCardsWindow.translateCardError(response.Message, this.clickedCard.Definition.id), SK.Text("BuyCardsPanel_Cannot_Play_Cards", "Could not play card."));
         try
         {
             GameEngine.Instance.World.addProfileCard(this.clickedCard.UserIDList[0], CardTypes.getStringFromCard(this.clickedCard.Definition.id));
         }
         catch (Exception exception)
         {
             MyMessageBox.Show(exception.Message, SK.Text("BuyCardsPanel_Error_Report", "ERROR: Please report this error message"));
         }
     }
     else
     {
         GameEngine.Instance.playInterfaceSound("PlayCardsPanel_play_card_success");
         GameEngine.Instance.World.ProfileCardsSet.Remove(this.clickedCard.UserIDList[0]);
         GameEngine.Instance.addRecentCard(this.clickedCard.Definition.id);
         if (this.clickedCard.UserIDList.Count > 0)
         {
             this.clickedCard.UserID = this.clickedCard.UserIDList[0];
         }
         GameEngine.Instance.World.CardPlayed(this.clickedCard.Definition.cardCategory, this.clickedCard.Definition.id, this.selectedVillage);
         if (this.clickedCard.cardCount > 1)
         {
             this.clickedCard.UserIDList.Remove(this.clickedCard.UserID);
             this.clickedCard.UserID = this.clickedCard.UserIDList[0];
             this.clickedCard.cardCount--;
             this.clickedCard.countLabel.Text = this.clickedCard.cardCount.ToString();
         }
         else
         {
             this.clickedCard.setClickDelegate(null);
             CustomSelfDrawPanel.CSDImage control = new CustomSelfDrawPanel.CSDImage {
                 Position = new Point(0, 0),
                 Size = this.clickedCard.bigImage.Size,
                 Image = (Image) GFXLibrary.CardBackBig
             };
             control.setScale(0.25);
             this.clickedCard.CustomTooltipID = 0;
             this.clickedCard.CustomTooltipData = -1;
             this.clickedCard.addControl(control);
         }
     }
     this.Dirty = true;
     base.invalidate();
     this.clickedCard = null;
     this.waitingResponse = false;
 }
 public void init(int cardSection)
 {
     CustomSelfDrawPanel.CSDImage image2;
     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 control = new CustomSelfDrawPanel.CSDExtendingPanel {
         Size = base.Size,
         Position = new Point(0, 0)
     };
     this.mainBackgroundImage.addControl(control);
     control.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)
     };
     control.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((control.Width - ((Image) GFXLibrary.cardpanel_panel_gradient_bottom_right).Width) - 6, (control.Height - ((Image) GFXLibrary.cardpanel_panel_gradient_bottom_right).Height) - 6)
     };
     control.addControl(image2);
     this.AvailablePanel = new CustomSelfDrawPanel.CSDExtendingPanel();
     this.AvailablePanel.Size = new Size(this.AvailablePanelWidth, 550);
     this.AvailablePanel.Position = new Point(8, (base.Height - 8) - 550);
     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);
     this.sortBack.Image = (Image) GFXLibrary.sort_back;
     this.sortBack.Position = new Point(12, this.AvailablePanel.Height - 0x25);
     this.sortBack.Visible = true;
     this.AvailablePanel.addControl(this.sortBack);
     this.sortByName.ImageNorm = (Image) GFXLibrary.sort_normal;
     this.sortByName.ImageOver = (Image) GFXLibrary.sort_over;
     this.sortByName.ImageClick = (Image) GFXLibrary.sort_in;
     this.sortByName.Position = new Point(7, 4);
     this.sortByName.Text.Text = SK.Text("Card_Sorting_Name", "Sort By Name");
     this.sortByName.Text.Color = ARGBColors.White;
     this.sortByName.Text.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     this.sortByName.TextYOffset = -1;
     this.sortByName.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.sortByNameClicked), "PlayCardsPanel_sort_by_name");
     this.sortBack.addControl(this.sortByName);
     this.sortByType.ImageNorm = (Image) GFXLibrary.sort_normal;
     this.sortByType.ImageOver = (Image) GFXLibrary.sort_over;
     this.sortByType.ImageClick = (Image) GFXLibrary.sort_in;
     this.sortByType.Position = new Point(0xe4, 4);
     this.sortByType.Text.Text = SK.Text("Card_Sorting_Type", "Sort By Type");
     this.sortByType.Text.Color = ARGBColors.White;
     this.sortByType.Text.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     this.sortByType.TextYOffset = -1;
     this.sortByType.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.sortByTypeClicked), "PlayCardsPanel_sort_by_type");
     this.sortBack.addControl(this.sortByType);
     this.sortByQuantity.ImageNorm = (Image) GFXLibrary.sort_normal;
     this.sortByQuantity.ImageOver = (Image) GFXLibrary.sort_over;
     this.sortByQuantity.ImageClick = (Image) GFXLibrary.sort_in;
     this.sortByQuantity.Position = new Point(0x1c1, 4);
     this.sortByQuantity.Text.Text = SK.Text("Card_Sorting_Quantity", "Sort By Quantity");
     this.sortByQuantity.Text.Color = ARGBColors.White;
     this.sortByQuantity.Text.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     this.sortByQuantity.TextYOffset = -1;
     this.sortByQuantity.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.sortByQuantityClicked), "PlayCardsPanel_sort_by_type");
     this.sortBack.addControl(this.sortByQuantity);
     this.sortByRarity.ImageNorm = (Image) GFXLibrary.sort_normal;
     this.sortByRarity.ImageOver = (Image) GFXLibrary.sort_over;
     this.sortByRarity.ImageClick = (Image) GFXLibrary.sort_in;
     this.sortByRarity.Position = new Point(0x170, 4);
     this.sortByRarity.Text.Text = SK.Text("Card_Sorting_Rarity", "Sort By Rarity");
     this.sortByRarity.Text.Color = ARGBColors.White;
     this.sortByRarity.Text.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     this.sortByRarity.TextYOffset = -1;
     this.sortByRarity.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.sortByRarityClicked), "PlayCardsPanel_sort_by_rarity");
     this.compressButton.ImageNorm = (Image) GFXLibrary.r_popularity_panel_but_minus_norm;
     this.compressButton.ImageOver = (Image) GFXLibrary.r_popularity_panel_but_minus_over;
     this.compressButton.ImageClick = (Image) GFXLibrary.r_popularity_panel_but_minus_in;
     this.compressButton.Position = new Point(0x2a5, 0x10);
     this.compressButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.compressClicked), "PlayCardsPanel_compress_cards");
     this.sortBack.addControl(this.compressButton);
     this.expandButton.ImageNorm = (Image) GFXLibrary.r_popularity_panel_but_plus_norm;
     this.expandButton.ImageOver = (Image) GFXLibrary.r_popularity_panel_but_plus_over;
     this.expandButton.ImageClick = (Image) GFXLibrary.r_popularity_panel_but_plus_in;
     this.expandButton.Position = new Point(0x2a5, -2);
     this.expandButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.expandClicked), "PlayCardsPanel_expand_cards");
     this.sortBack.addControl(this.expandButton);
     if ((this.sortByMode == 0) || (this.sortByMode == 2))
     {
         this.sortByName.Alpha = 0.5f;
         this.sortByType.Alpha = 1f;
         this.sortByQuantity.Alpha = 0.5f;
     }
     else if ((this.sortByMode == 1) || (this.sortByMode == 3))
     {
         this.sortByName.Alpha = 1f;
         this.sortByType.Alpha = 0.5f;
         this.sortByQuantity.Alpha = 0.5f;
     }
     else if ((this.sortByMode == 7) || (this.sortByMode == 8))
     {
         this.sortByName.Alpha = 0.5f;
         this.sortByType.Alpha = 0.5f;
         this.sortByQuantity.Alpha = 1f;
     }
     else
     {
         this.sortByName.Alpha = 1f;
         this.sortByType.Alpha = 1f;
         this.sortByQuantity.Alpha = 1f;
     }
     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.Position = new Point((base.Width - 14) - 0x11, 10);
     this.closeImage.CustomTooltipID = 0x2774;
     this.mainBackgroundImage.addControl(this.closeImage);
     CustomSelfDrawPanel.WikiLinkControl.init(this.mainBackgroundImage, 0x19, 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);
     CustomSelfDrawPanel.UICardsButtons buttons = new CustomSelfDrawPanel.UICardsButtons((PlayCardsWindow) base.ParentForm) {
         Position = new Point(0x328, 0x25)
     };
     this.mainBackgroundImage.addControl(buttons);
     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);
     if (cardSection != 0)
     {
         CustomSelfDrawPanel.CSDButton button = new CustomSelfDrawPanel.CSDButton {
             ImageNorm = (Image) GFXLibrary.button_cards_all_normal,
             ImageOver = (Image) GFXLibrary.button_cards_all_over,
             ImageClick = (Image) GFXLibrary.button_cards_all_over,
             Position = new Point(390, 0)
         };
         button.Text.Text = SK.Text("PlayCardsPanel_All_Your_Cards", "All Your Cards");
         button.TextYOffset = -3;
         button.Text.Color = ARGBColors.Black;
         button.Text.Size = new Size(button.Size.Width - 0x2d, button.Size.Height);
         button.Text.Position = new Point(0x2d, 0);
         button.Text.Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold);
         button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.showAllCardsClick), "PlayCardsPanel_show_all_cards");
         this.mainBackgroundImage.addControl(button);
     }
     CustomSelfDrawPanel.CSDButton button2 = new CustomSelfDrawPanel.CSDButton {
         ImageNorm = (Image) GFXLibrary.button_cards_in_play_normal,
         ImageOver = (Image) GFXLibrary.button_cards_in_play_over,
         ImageClick = (Image) GFXLibrary.button_cards_in_play_over,
         Position = new Point(570, 0)
     };
     button2.Text.Text = SK.Text("PlayCardsPanel_Cards_In_Play", "Cards In Play");
     button2.TextYOffset = -3;
     button2.Text.Color = ARGBColors.Black;
     button2.Text.Size = new Size(button2.Size.Width - 30, button2.Size.Height);
     button2.Text.Position = new Point(30, 0);
     button2.Text.Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold);
     button2.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.showCardsInPlay), "PlayCardsPanel_cards_in_play");
     this.mainBackgroundImage.addControl(button2);
     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);
     CardTypes.CardDefinition filter = new CardTypes.CardDefinition {
         cardCategory = cardSection
     };
     if ((GameEngine.Instance.World.getTutorialStage() == 8) || (GameEngine.Instance.World.getTutorialStage() == 12))
     {
         filter.rewardcard = true;
     }
     filter.rewardcard = true;
     GameEngine.Instance.World.searchProfileCards(filter, "", ((PlayCardsWindow) base.ParentForm).getNameSearchText());
     if (cardSection < 15)
     {
         this.sectionName = CardSections.getName(cardSection);
     }
     else
     {
         this.sectionName = Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(CardFilters.getName2(cardSection).ToLower());
     }
     this.labelTitle.Text = this.sectionName + " : " + GameEngine.Instance.World.ProfileCardsSearch.Count.ToString();
     this.GetCardsAvailable(false);
     this.RenderCards();
     this.mainBackgroundImage.setMouseWheelDelegate(new CustomSelfDrawPanel.CSDControl.CSD_MouseWheelDelegate(this.mouseWheelHandler));
     if (cardSection == 0)
     {
         this.InitFilters();
     }
     if (cardSection == 0)
     {
         ((PlayCardsWindow) base.ParentForm).tbSearchBox.Visible = !this.searchButton.Visible;
     }
     else
     {
         ((PlayCardsWindow) base.ParentForm).tbSearchBox.Visible = false;
     }
     base.Invalidate();
 }
 public void init(bool initialCall)
 {
     CustomSelfDrawPanel.CSDImage image2;
     this.freeCardInfo = GameEngine.Instance.World.FreeCardInfo;
     if (!this.freeCardInfo.VeteranStages[0] && initialCall)
     {
         RemoteServices.Instance.set_InitialiseFreeCards_UserCallBack(new RemoteServices.InitialiseFreeCards_UserCallBack(this.initialiseFreeCardsCallback));
         RemoteServices.Instance.InitialiseFreeCards();
     }
     else if (initialCall && (DateTime.Now.Subtract(lastVeteranLevelTime).TotalSeconds > 120.0))
     {
         this.UpdateVeteranLevelData();
         lastVeteranLevelTime = DateTime.Now;
     }
     TimeSpan span = this.freeCardInfo.timeUntilNextFreeCard();
     bool flag = false;
     if (((span.TotalSeconds <= 0.0) && this.freeCardInfo.VeteranStages[0]) && (this.freeCardInfo.CurrentVeteranLevel > 0))
     {
         flag = true;
     }
     int num = 0x2e;
     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.MainPanel.Size = base.Size;
     this.MainPanel.Position = new Point(0, 0);
     this.mainBackgroundImage.addControl(this.MainPanel);
     this.MainPanel.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 control = new CustomSelfDrawPanel.CSDImage {
         Image = (Image) GFXLibrary.cardpanel_panel_gradient_top_left,
         Size = GFXLibrary.cardpanel_panel_gradient_top_left.Size,
         Position = new Point(0, 0)
     };
     this.MainPanel.addControl(control);
     image2 = new CustomSelfDrawPanel.CSDImage {
         Image = (Image) GFXLibrary.cardpanel_panel_gradient_bottom_right,
         Size = GFXLibrary.cardpanel_panel_gradient_bottom_right.Size,
         Position = new Point((this.MainPanel.Width - ((Image) GFXLibrary.cardpanel_panel_gradient_bottom_right).Width) - 6, (this.MainPanel.Height - ((Image) GFXLibrary.cardpanel_panel_gradient_bottom_right).Height) - 6)
     };
     this.MainPanel.addControl(image2);
     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.Position = new Point((base.Width - 14) - 0x11, 10);
     this.closeImage.CustomTooltipID = 0x2774;
     this.mainBackgroundImage.addControl(this.closeImage);
     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);
     CustomSelfDrawPanel.CSDFill fill2 = new CustomSelfDrawPanel.CSDFill {
         FillColor = Color.FromArgb(0xff, 130, 0x81, 0x7e),
         Size = new Size(base.Width - 10, 1),
         Position = new Point(5, 0x74)
     };
     this.mainBackgroundImage.addControl(fill2);
     this.labelTitle.Position = new Point(0x1b, 5);
     this.labelTitle.Size = new Size(600, 0x40);
     this.labelTitle.Text = SK.Text("FreeCardsPanel_Free_Cards", "Free Cards");
     this.labelTitle.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
     this.labelTitle.Font = FontManager.GetFont("Arial", 18f, FontStyle.Bold);
     this.labelTitle.Color = ARGBColors.Black;
     this.mainBackgroundImage.addControl(this.labelTitle);
     if ((this.freeCardInfo.CurrentVeteranLevel > 0) && !flag)
     {
         this.greenArea.Size = new Size(0x3bb, num * this.freeCardInfo.CurrentVeteranLevel);
         this.greenArea.Position = new Point(20, 0x7b);
         this.mainBackgroundImage.addControl(this.greenArea);
         this.greenArea.Create((Image) GFXLibrary.free_card_screen_green_panel_top_left, (Image) GFXLibrary.free_card_screen_green_panel_top_mid, (Image) GFXLibrary.free_card_screen_green_panel_top_right, (Image) GFXLibrary.free_card_screen_green_panel_mid_left, (Image) GFXLibrary.free_card_screen_green_panel_mid_mid, (Image) GFXLibrary.free_card_screen_green_panel_mid_right, (Image) GFXLibrary.free_card_screen_green_panel_bottom_left, (Image) GFXLibrary.free_card_screen_green_panel_bottom_mid, (Image) GFXLibrary.free_card_screen_green_panel_bottom_right);
     }
     this.timeProgress.Position = new Point(0x80, 0x55);
     this.timeProgress.Size = new Size(210, 6);
     this.mainBackgroundImage.addControl(this.timeProgress);
     this.timeProgress.Create((Image) GFXLibrary.free_card_screen_progbar_left, (Image) GFXLibrary.free_card_screen_progbar_mid, (Image) GFXLibrary.free_card_screen_progbar_right, (Image) GFXLibrary.free_card_screen_progbar_fill, (Image) GFXLibrary.free_card_screen_progbar_fill, (Image) GFXLibrary.free_card_screen_progbar_fill);
     this.timeProgress.setValues(this.freeCardInfo.durationHours() - span.TotalHours, this.freeCardInfo.durationHours());
     this.labelVeteranLevel.Position = new Point(0x7d, 0x24);
     this.labelVeteranLevel.Size = new Size(600, 0x40);
     this.labelVeteranLevel.Text = SK.Text("FreeCardsPanel_Level", "Kingdoms Veteran Level") + " : " + this.freeCardInfo.CurrentVeteranLevel.ToString();
     this.labelVeteranLevel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
     this.labelVeteranLevel.Font = FontManager.GetFont("Arial", 18f, FontStyle.Bold);
     this.labelVeteranLevel.Color = ARGBColors.Black;
     this.mainBackgroundImage.addControl(this.labelVeteranLevel);
     this.labelFreeCards.Position = new Point(0x80, 0x40);
     this.labelFreeCards.Size = new Size(600, 0x40);
     this.labelFreeCards.Text = SK.Text("FreeCardsPanel_Cards_Per_Week", "Cards per week") + " : " + this.freeCardInfo.freeCardsPerWeek().ToString();
     this.labelFreeCards.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
     this.labelFreeCards.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     this.labelFreeCards.Color = ARGBColors.Black;
     this.mainBackgroundImage.addControl(this.labelFreeCards);
     string str = SK.Text("FreeCardsPanel_Next_Card", "Next Card") + ": ";
     if (((span.TotalSeconds >= 1.0) && (span.TotalDays < 100.0)) && (this.freeCardInfo.CurrentVeteranLevel > 0))
     {
         str = str + VillageMap.createBuildTimeString((int) span.TotalSeconds);
     }
     this.labelNextCards.Position = new Point(0x80, 0x61);
     this.labelNextCards.Size = new Size(600, 0x40);
     this.labelNextCards.Text = str;
     this.labelNextCards.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
     this.labelNextCards.Font = FontManager.GetFont("Arial", 12f, FontStyle.Regular);
     this.labelNextCards.Color = ARGBColors.Black;
     this.mainBackgroundImage.addControl(this.labelNextCards);
     if (this.freeCardInfo.CurrentVeteranLevel > 0)
     {
         this.crestImage.Image = (Image) GFXLibrary.free_card_screen_wax_array[this.freeCardInfo.CurrentVeteranLevel - 1];
         this.crestImage.Position = new Point(0x15, 0x23);
         this.mainBackgroundImage.addControl(this.crestImage);
     }
     if (!flag)
     {
         int x = 0x19;
         int y = 0x7b;
         int num4 = 0x9b;
         int num5 = 0x83;
         int num6 = 190;
         int num7 = 0x87;
         int num8 = 540;
         int num9 = 0x83;
         this.cards1Image.Image = (Image) this.getCardImage(0);
         this.cards1Image.Position = new Point(x, y);
         this.mainBackgroundImage.addControl(this.cards1Image);
         this.cards1Label.Position = new Point(-5, -5);
         this.cards1Label.Size = this.cards1Image.Size;
         this.cards1Label.Text = "1";
         this.cards1Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
         this.cards1Label.Font = FontManager.GetFont("Arial", 18f, FontStyle.Bold);
         this.cards1Label.Color = ARGBColors.White;
         this.cards1Label.DropShadowColor = ARGBColors.Black;
         this.cards1Image.addControl(this.cards1Label);
         this.tick1Image.Image = (Image) this.getTickImage(0);
         this.tick1Image.Position = new Point(num4, num5);
         this.mainBackgroundImage.addControl(this.tick1Image);
         this.description1Label.Position = new Point(num6, num7);
         this.description1Label.Size = new Size(600, 0x40);
         this.description1Label.Text = SK.Text("FreeCardsPanel__Site_Village", "Site Village");
         this.description1Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
         this.description1Label.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
         this.description1Label.Color = this.getTextColour(0);
         this.mainBackgroundImage.addControl(this.description1Label);
         this.level1Button.ImageNorm = (Image) GFXLibrary.cardpanel_button_blue_normal;
         this.level1Button.ImageOver = (Image) GFXLibrary.cardpanel_button_blue_over;
         this.level1Button.ImageClick = (Image) GFXLibrary.cardpanel_button_blue_pressed;
         this.level1Button.Position = new Point(num8, num9);
         this.level1Button.Text.Text = SK.Text("FreeCardsPanel_Increase_Level", "Increase Level");
         this.level1Button.TextYOffset = -2;
         this.level1Button.Text.Color = this.getButtonTextColour(0);
         this.level1Button.Text.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
         this.level1Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.increaseLevel), "FreeCardsPanel_increase_level");
         this.level1Button.Data = 0;
         this.level1Button.Visible = this.isButtonVisible(0);
         this.level1Button.Enabled = this.isButtonEnabled(0);
         this.mainBackgroundImage.addControl(this.level1Button);
         this.cards2Image.Image = (Image) this.getCardImage(1);
         this.cards2Image.Position = new Point(x, y + num);
         this.mainBackgroundImage.addControl(this.cards2Image);
         this.cards2Label.Position = new Point(-5, -5);
         this.cards2Label.Size = this.cards1Image.Size;
         this.cards2Label.Text = "2";
         this.cards2Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
         this.cards2Label.Font = FontManager.GetFont("Arial", 18f, FontStyle.Bold);
         this.cards2Label.Color = ARGBColors.White;
         this.cards2Label.DropShadowColor = ARGBColors.Black;
         this.cards2Image.addControl(this.cards2Label);
         this.tick2Image.Image = (Image) this.getTickImage(1);
         this.tick2Image.Position = new Point(num4, num5 + num);
         this.mainBackgroundImage.addControl(this.tick2Image);
         this.description2Label.Position = new Point(num6, num7 + num);
         this.description2Label.Size = new Size(600, 0x40);
         this.description2Label.Text = SK.Text("FreeCardsPanel_Rank_Yokel", "Get to Rank of Yokel") + " (3)";
         this.description2Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
         this.description2Label.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
         this.description2Label.Color = this.getTextColour(1);
         this.mainBackgroundImage.addControl(this.description2Label);
         this.level2Button.ImageNorm = (Image) GFXLibrary.cardpanel_button_blue_normal;
         this.level2Button.ImageOver = (Image) GFXLibrary.cardpanel_button_blue_over;
         this.level2Button.ImageClick = (Image) GFXLibrary.cardpanel_button_blue_pressed;
         this.level2Button.Position = new Point(num8, num9 + num);
         this.level2Button.Text.Text = SK.Text("FreeCardsPanel_Increase_Level", "Increase Level");
         this.level2Button.TextYOffset = -2;
         this.level2Button.Text.Color = this.getButtonTextColour(1);
         this.level2Button.Text.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
         this.level2Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.increaseLevel), "FreeCardsPanel_increase_level");
         this.level2Button.Data = 1;
         this.level2Button.Visible = this.isButtonVisible(1);
         this.level2Button.Enabled = this.isButtonEnabled(1);
         this.mainBackgroundImage.addControl(this.level2Button);
         this.cards3Image.Image = (Image) this.getCardImage(2);
         this.cards3Image.Position = new Point(x, y + (2 * num));
         this.mainBackgroundImage.addControl(this.cards3Image);
         this.cards3Label.Position = new Point(-5, -5);
         this.cards3Label.Size = this.cards1Image.Size;
         this.cards3Label.Text = "3";
         this.cards3Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
         this.cards3Label.Font = FontManager.GetFont("Arial", 18f, FontStyle.Bold);
         this.cards3Label.Color = ARGBColors.White;
         this.cards3Label.DropShadowColor = ARGBColors.Black;
         this.cards3Image.addControl(this.cards3Label);
         this.tick3Image.Image = (Image) this.getTickImage(2);
         this.tick3Image.Position = new Point(num4, num5 + (2 * num));
         this.mainBackgroundImage.addControl(this.tick3Image);
         this.description3Label.Position = new Point(num6, num7 + (2 * num));
         this.description3Label.Size = new Size(600, 0x40);
         this.description3Label.Text = SK.Text("FreeCardsPanel_Rank_Villein", "Get to Rank of Villein") + " (6)";
         this.description3Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
         this.description3Label.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
         this.description3Label.Color = this.getTextColour(2);
         this.mainBackgroundImage.addControl(this.description3Label);
         this.level3Button.ImageNorm = (Image) GFXLibrary.cardpanel_button_blue_normal;
         this.level3Button.ImageOver = (Image) GFXLibrary.cardpanel_button_blue_over;
         this.level3Button.ImageClick = (Image) GFXLibrary.cardpanel_button_blue_pressed;
         this.level3Button.Position = new Point(num8, num9 + (2 * num));
         this.level3Button.Text.Text = SK.Text("FreeCardsPanel_Increase_Level", "Increase Level");
         this.level3Button.TextYOffset = -2;
         this.level3Button.Text.Color = this.getButtonTextColour(2);
         this.level3Button.Text.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
         this.level3Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.increaseLevel), "FreeCardsPanel_increase_level");
         this.level3Button.Data = 2;
         this.level3Button.Visible = this.isButtonVisible(2);
         this.level3Button.Enabled = this.isButtonEnabled(2);
         this.mainBackgroundImage.addControl(this.level3Button);
         this.cards4Image.Image = (Image) this.getCardImage(3);
         this.cards4Image.Position = new Point(x, y + (3 * num));
         this.mainBackgroundImage.addControl(this.cards4Image);
         this.cards4Label.Position = new Point(-5, -5);
         this.cards4Label.Size = this.cards1Image.Size;
         this.cards4Label.Text = "4";
         this.cards4Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
         this.cards4Label.Font = FontManager.GetFont("Arial", 18f, FontStyle.Bold);
         this.cards4Label.Color = ARGBColors.White;
         this.cards4Label.DropShadowColor = ARGBColors.Black;
         this.cards4Image.addControl(this.cards4Label);
         this.tick4Image.Image = (Image) this.getTickImage(3);
         this.tick4Image.Position = new Point(num4, num5 + (3 * num));
         this.mainBackgroundImage.addControl(this.tick4Image);
         this.description4Label.Position = new Point(num6, num7 + (3 * num));
         this.description4Label.Size = new Size(600, 0x40);
         this.description4Label.Text = SK.Text("FreeCardsPanel_First_Purchase_Crowns", "First Purchase of Crowns");
         this.description4Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
         this.description4Label.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
         this.description4Label.Color = this.getTextColour(3);
         this.mainBackgroundImage.addControl(this.description4Label);
         this.level4Button.ImageNorm = (Image) GFXLibrary.cardpanel_button_blue_normal;
         this.level4Button.ImageOver = (Image) GFXLibrary.cardpanel_button_blue_over;
         this.level4Button.ImageClick = (Image) GFXLibrary.cardpanel_button_blue_pressed;
         this.level4Button.Position = new Point(num8, num9 + (3 * num));
         this.level4Button.Text.Text = SK.Text("FreeCardsPanel_Increase_Level", "Increase Level");
         this.level4Button.TextYOffset = -2;
         this.level4Button.Text.Color = this.getButtonTextColour(3);
         this.level4Button.Text.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
         this.level4Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.increaseLevel), "FreeCardsPanel_increase_level");
         this.level4Button.Data = 3;
         this.level4Button.Visible = this.isButtonVisible(3);
         this.level4Button.Enabled = this.isButtonEnabled(3);
         this.mainBackgroundImage.addControl(this.level4Button);
         this.cards5Image.Image = (Image) this.getCardImage(4);
         this.cards5Image.Position = new Point(x, y + (4 * num));
         this.mainBackgroundImage.addControl(this.cards5Image);
         this.cards5Label.Position = new Point(-5, -5);
         this.cards5Label.Size = this.cards1Image.Size;
         this.cards5Label.Text = "5";
         this.cards5Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
         this.cards5Label.Font = FontManager.GetFont("Arial", 18f, FontStyle.Bold);
         this.cards5Label.Color = ARGBColors.White;
         this.cards5Label.DropShadowColor = ARGBColors.Black;
         this.cards5Image.addControl(this.cards5Label);
         this.tick5Image.Image = (Image) this.getTickImage(4);
         this.tick5Image.Position = new Point(num4, num5 + (4 * num));
         this.mainBackgroundImage.addControl(this.tick5Image);
         this.description5Label.Position = new Point(num6, num7 + (4 * num));
         this.description5Label.Size = new Size(600, 0x40);
         this.description5Label.Text = SK.Text("FreeCardsPanel_Rank_Commoner", "Get to Rank of Commoner") + " (9)";
         this.description5Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
         this.description5Label.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
         this.description5Label.Color = this.getTextColour(4);
         this.mainBackgroundImage.addControl(this.description5Label);
         this.level5Button.ImageNorm = (Image) GFXLibrary.cardpanel_button_blue_normal;
         this.level5Button.ImageOver = (Image) GFXLibrary.cardpanel_button_blue_over;
         this.level5Button.ImageClick = (Image) GFXLibrary.cardpanel_button_blue_pressed;
         this.level5Button.Position = new Point(num8, num9 + (4 * num));
         this.level5Button.Text.Text = SK.Text("FreeCardsPanel_Increase_Level", "Increase Level");
         this.level5Button.TextYOffset = -2;
         this.level5Button.Text.Color = this.getButtonTextColour(4);
         this.level5Button.Text.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
         this.level5Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.increaseLevel), "FreeCardsPanel_increase_level");
         this.level5Button.Data = 4;
         this.level5Button.Visible = this.isButtonVisible(4);
         this.level5Button.Enabled = this.isButtonEnabled(4);
         this.mainBackgroundImage.addControl(this.level5Button);
         this.cards6Image.Image = (Image) this.getCardImage(5);
         this.cards6Image.Position = new Point(x, y + (5 * num));
         this.mainBackgroundImage.addControl(this.cards6Image);
         this.cards6Label.Position = new Point(-5, -5);
         this.cards6Label.Size = this.cards1Image.Size;
         this.cards6Label.Text = "6";
         this.cards6Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
         this.cards6Label.Font = FontManager.GetFont("Arial", 18f, FontStyle.Bold);
         this.cards6Label.Color = ARGBColors.White;
         this.cards6Label.DropShadowColor = ARGBColors.Black;
         this.cards6Image.addControl(this.cards6Label);
         this.tick6Image.Image = (Image) this.getTickImage(5);
         this.tick6Image.Position = new Point(num4, num5 + (5 * num));
         this.mainBackgroundImage.addControl(this.tick6Image);
         this.description6Label.Position = new Point(num6, num7 + (5 * num));
         this.description6Label.Size = new Size(600, 0x40);
         this.description6Label.Text = SK.Text("FreeCardsPanel_Donate_Resources", "Donate Resources to your Parish Capital");
         this.description6Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
         this.description6Label.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
         this.description6Label.Color = this.getTextColour(5);
         this.mainBackgroundImage.addControl(this.description6Label);
         if (!GameEngine.Instance.World.InviteSystemNotImplemented)
         {
             this.level6Button.ImageNorm = (Image) GFXLibrary.cardpanel_button_blue_normal;
             this.level6Button.ImageOver = (Image) GFXLibrary.cardpanel_button_blue_over;
             this.level6Button.ImageClick = (Image) GFXLibrary.cardpanel_button_blue_pressed;
             this.level6Button.Position = new Point(num8, num9 + (5 * num));
             this.level6Button.Text.Text = SK.Text("FreeCardsPanel_Increase_Level", "Increase Level");
             this.level6Button.TextYOffset = -2;
             this.level6Button.Text.Color = this.getButtonTextColour(5);
             this.level6Button.Text.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
             this.level6Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.increaseLevel), "FreeCardsPanel_increase_level");
             this.level6Button.Data = 5;
             this.level6Button.Visible = this.isButtonVisible(5);
             this.level6Button.Enabled = this.isButtonEnabled(5);
             this.mainBackgroundImage.addControl(this.level6Button);
         }
         this.cards7Image.Image = (Image) this.getCardImage(6);
         this.cards7Image.Position = new Point(x, y + (6 * num));
         this.mainBackgroundImage.addControl(this.cards7Image);
         this.cards7Label.Position = new Point(-5, -5);
         this.cards7Label.Size = this.cards1Image.Size;
         this.cards7Label.Text = "7";
         this.cards7Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
         this.cards7Label.Font = FontManager.GetFont("Arial", 18f, FontStyle.Bold);
         this.cards7Label.Color = ARGBColors.White;
         this.cards7Label.DropShadowColor = ARGBColors.Black;
         this.cards7Image.addControl(this.cards7Label);
         this.tick7Image.Image = (Image) this.getTickImage(6);
         this.tick7Image.Position = new Point(num4, num5 + (6 * num));
         this.mainBackgroundImage.addControl(this.tick7Image);
         this.description7Label.Position = new Point(num6, num7 + (6 * num));
         this.description7Label.Size = new Size(600, 0x40);
         this.description7Label.Text = SK.Text("FreeCardsPanel_Rank_Yeoman", "Get to Rank of Yeoman") + " (11)";
         this.description7Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
         this.description7Label.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
         this.description7Label.Color = this.getTextColour(6);
         this.mainBackgroundImage.addControl(this.description7Label);
         if (!GameEngine.Instance.World.InviteSystemNotImplemented)
         {
             this.level7Button.ImageNorm = (Image) GFXLibrary.cardpanel_button_blue_normal;
             this.level7Button.ImageOver = (Image) GFXLibrary.cardpanel_button_blue_over;
             this.level7Button.ImageClick = (Image) GFXLibrary.cardpanel_button_blue_pressed;
             this.level7Button.Position = new Point(num8, num9 + (6 * num));
             this.level7Button.Text.Text = SK.Text("FreeCardsPanel_Increase_Level", "Increase Level");
             this.level7Button.TextYOffset = -2;
             this.level7Button.Text.Color = this.getButtonTextColour(6);
             this.level7Button.Text.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
             this.level7Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.increaseLevel), "FreeCardsPanel_increase_level");
             this.level7Button.Data = 6;
             this.level7Button.Visible = this.isButtonVisible(6);
             this.level7Button.Enabled = this.isButtonEnabled(6);
             this.mainBackgroundImage.addControl(this.level7Button);
         }
         this.cards8Image.Image = (Image) this.getCardImage(7);
         this.cards8Image.Position = new Point(x, y + (7 * num));
         this.mainBackgroundImage.addControl(this.cards8Image);
         this.cards8Label.Position = new Point(-5, -5);
         this.cards8Label.Size = this.cards1Image.Size;
         this.cards8Label.Text = "8";
         this.cards8Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
         this.cards8Label.Font = FontManager.GetFont("Arial", 18f, FontStyle.Bold);
         this.cards8Label.Color = ARGBColors.White;
         this.cards8Label.DropShadowColor = ARGBColors.Black;
         this.cards8Image.addControl(this.cards8Label);
         this.tick8Image.Image = (Image) this.getTickImage(7);
         this.tick8Image.Position = new Point(num4, num5 + (7 * num));
         this.mainBackgroundImage.addControl(this.tick8Image);
         this.description8Label.Position = new Point(num6, num7 + (7 * num));
         this.description8Label.Size = new Size(600, 0x40);
         this.description8Label.Text = SK.Text("FreeCardsPanel_Factions", "Create or Join a Faction");
         this.description8Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
         this.description8Label.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
         this.description8Label.Color = this.getTextColour(7);
         this.mainBackgroundImage.addControl(this.description8Label);
         if (!GameEngine.Instance.World.InviteSystemNotImplemented)
         {
             this.level8Button.ImageNorm = (Image) GFXLibrary.cardpanel_button_blue_normal;
             this.level8Button.ImageOver = (Image) GFXLibrary.cardpanel_button_blue_over;
             this.level8Button.ImageClick = (Image) GFXLibrary.cardpanel_button_blue_pressed;
             this.level8Button.Position = new Point(num8, num9 + (7 * num));
             this.level8Button.Text.Text = SK.Text("FreeCardsPanel_Increase_Level", "Increase Level");
             this.level8Button.TextYOffset = -2;
             this.level8Button.Text.Color = this.getButtonTextColour(7);
             this.level8Button.Text.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
             this.level8Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.increaseLevel), "FreeCardsPanel_increase_level");
             this.level8Button.Data = 7;
             this.level8Button.Visible = this.isButtonVisible(7);
             this.level8Button.Enabled = this.isButtonEnabled(7);
             this.mainBackgroundImage.addControl(this.level8Button);
         }
         this.cards9Image.Image = (Image) this.getCardImage(8);
         this.cards9Image.Position = new Point(x, y + (8 * num));
         this.mainBackgroundImage.addControl(this.cards9Image);
         this.cards9Label.Position = new Point(-6, -5);
         this.cards9Label.Size = this.cards1Image.Size;
         this.cards9Label.Text = "10";
         this.cards9Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
         this.cards9Label.Font = FontManager.GetFont("Arial", 18f, FontStyle.Bold);
         this.cards9Label.Color = ARGBColors.White;
         this.cards9Label.DropShadowColor = ARGBColors.Black;
         this.cards9Image.addControl(this.cards9Label);
         this.tick9Image.Image = (Image) this.getTickImage(8);
         this.tick9Image.Position = new Point(num4, num5 + (8 * num));
         this.mainBackgroundImage.addControl(this.tick9Image);
         this.description9Label.Position = new Point(num6, num7 + (8 * num));
         this.description9Label.Size = new Size(600, 0x40);
         this.description9Label.Text = SK.Text("FreeCardsPanel_Second_Crowns", "Second purchase of Crowns");
         this.description9Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
         this.description9Label.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
         this.description9Label.Color = this.getTextColour(8);
         this.mainBackgroundImage.addControl(this.description9Label);
         if (!GameEngine.Instance.World.InviteSystemNotImplemented)
         {
             this.level9Button.ImageNorm = (Image) GFXLibrary.cardpanel_button_blue_normal;
             this.level9Button.ImageOver = (Image) GFXLibrary.cardpanel_button_blue_over;
             this.level9Button.ImageClick = (Image) GFXLibrary.cardpanel_button_blue_pressed;
             this.level9Button.Position = new Point(num8, num9 + (8 * num));
             this.level9Button.Text.Text = SK.Text("FreeCardsPanel_Increase_Level", "Increase Level");
             this.level9Button.TextYOffset = -2;
             this.level9Button.Text.Color = this.getButtonTextColour(8);
             this.level9Button.Text.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
             this.level9Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.increaseLevel), "FreeCardsPanel_increase_level");
             this.level9Button.Data = 8;
             this.level9Button.Visible = this.isButtonVisible(8);
             this.level9Button.Enabled = this.isButtonEnabled(8);
             this.mainBackgroundImage.addControl(this.level9Button);
         }
         this.cards10Image.Image = (Image) this.getCardImage(9);
         this.cards10Image.Position = new Point(x, y + (9 * num));
         this.mainBackgroundImage.addControl(this.cards10Image);
         this.cards10Label.Position = new Point(-6, -5);
         this.cards10Label.Size = this.cards1Image.Size;
         this.cards10Label.Text = "14";
         this.cards10Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
         this.cards10Label.Font = FontManager.GetFont("Arial", 18f, FontStyle.Bold);
         this.cards10Label.Color = ARGBColors.White;
         this.cards10Label.DropShadowColor = ARGBColors.Black;
         this.cards10Image.addControl(this.cards10Label);
         this.tick10Image.Image = (Image) this.getTickImage(9);
         this.tick10Image.Position = new Point(num4, num5 + (9 * num));
         this.mainBackgroundImage.addControl(this.tick10Image);
         this.description10Label.Position = new Point(num6, num7 + (9 * num));
         this.description10Label.Size = new Size(600, 0x40);
         this.description10Label.Text = SK.Text("FreeCardsPanel_Rank_Squire", "Get to Rank of Squire") + " (15)";
         this.description10Label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
         this.description10Label.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
         this.description10Label.Color = this.getTextColour(9);
         this.mainBackgroundImage.addControl(this.description10Label);
         if (!GameEngine.Instance.World.InviteSystemNotImplemented)
         {
             this.level10Button.ImageNorm = (Image) GFXLibrary.cardpanel_button_blue_normal;
             this.level10Button.ImageOver = (Image) GFXLibrary.cardpanel_button_blue_over;
             this.level10Button.ImageClick = (Image) GFXLibrary.cardpanel_button_blue_pressed;
             this.level10Button.Position = new Point(num8, num9 + (9 * num));
             this.level10Button.Text.Text = SK.Text("FreeCardsPanel_Increase_Level", "Increase Level");
             this.level10Button.TextYOffset = -2;
             this.level10Button.Text.Color = this.getButtonTextColour(9);
             this.level10Button.Text.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
             this.level10Button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.increaseLevel), "FreeCardsPanel_increase_level");
             this.level10Button.Data = 9;
             this.level10Button.Visible = this.isButtonVisible(9);
             this.level10Button.Enabled = this.isButtonEnabled(9);
             this.mainBackgroundImage.addControl(this.level10Button);
         }
         if ((this.freeCardInfo.VeteranStages[2] && !this.isButtonVisible(3)) && !this.freeCardInfo.VeteranStages[3])
         {
             this.buyCrownsButton.ImageNorm = (Image) GFXLibrary.cardpanel_button_blue_normal;
             this.buyCrownsButton.ImageOver = (Image) GFXLibrary.cardpanel_button_blue_over;
             this.buyCrownsButton.ImageClick = (Image) GFXLibrary.cardpanel_button_blue_pressed;
             this.buyCrownsButton.Position = new Point(num8, num9 + (3 * num));
             this.buyCrownsButton.Text.Text = SK.Text("BuyCrownsPanel_Buy_Crowns", "Buy Crowns");
             this.buyCrownsButton.TextYOffset = -2;
             this.buyCrownsButton.Text.Color = ARGBColors.Black;
             this.buyCrownsButton.Text.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
             this.buyCrownsButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.buyCrowns));
             this.buyCrownsButton.Data = 3;
             this.buyCrownsButton.Visible = true;
             this.buyCrownsButton.Enabled = true;
             this.mainBackgroundImage.addControl(this.buyCrownsButton);
         }
         else if ((this.freeCardInfo.VeteranStages[7] && !this.isButtonVisible(8)) && !this.freeCardInfo.VeteranStages[8])
         {
             this.buyCrownsButton.ImageNorm = (Image) GFXLibrary.cardpanel_button_blue_normal;
             this.buyCrownsButton.ImageOver = (Image) GFXLibrary.cardpanel_button_blue_over;
             this.buyCrownsButton.ImageClick = (Image) GFXLibrary.cardpanel_button_blue_pressed;
             this.buyCrownsButton.Position = new Point(num8, num9 + (8 * num));
             this.buyCrownsButton.Text.Text = SK.Text("BuyCrownsPanel_Buy_Crowns", "Buy Crowns");
             this.buyCrownsButton.TextYOffset = -2;
             this.buyCrownsButton.Text.Color = ARGBColors.Black;
             this.buyCrownsButton.Text.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
             this.buyCrownsButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.buyCrowns));
             this.buyCrownsButton.Data = 3;
             this.buyCrownsButton.Visible = true;
             this.buyCrownsButton.Enabled = true;
             this.mainBackgroundImage.addControl(this.buyCrownsButton);
         }
     }
     else
     {
         this.parchmentImage.Image = (Image) GFXLibrary.you_got_free_card_screen_parchment;
         this.parchmentImage.Position = new Point(0xaf, 0x7d);
         this.mainBackgroundImage.addControl(this.parchmentImage);
         this.cardBackImage.Image = (Image) GFXLibrary.you_got_free_card_screen_cardback;
         this.cardBackImage.Position = new Point(0xe2, 40);
         this.parchmentImage.addControl(this.cardBackImage);
         this.revealButton.ImageNorm = (Image) GFXLibrary.cardpanel_button_blue_normal;
         this.revealButton.ImageOver = (Image) GFXLibrary.cardpanel_button_blue_over;
         this.revealButton.ImageClick = (Image) GFXLibrary.cardpanel_button_blue_pressed;
         this.revealButton.Position = new Point(0xf8, 310);
         this.revealButton.Text.Text = SK.Text("FreeCardsPanel_Reveal", "Reveal");
         this.revealButton.TextYOffset = -2;
         this.revealButton.Text.Color = ARGBColors.Black;
         this.revealButton.Text.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
         this.revealButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.revealCard), "FreeCardsPanel_reveal_card");
         this.parchmentImage.addControl(this.revealButton);
         if ((!GameEngine.Instance.World.isBigpointAccount && !Program.bigpointInstall) && (!Program.aeriaInstall && !Program.bigpointPartnerInstall))
         {
             CustomSelfDrawPanel.CSDButton button = new CustomSelfDrawPanel.CSDButton {
                 ImageNorm = (Image) GFXLibrary.banner_ad_friend,
                 OverBrighten = true,
                 Position = new Point(0xc9, (this.parchmentImage.Y + 400) - 10)
             };
             button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.friendClicked), "FreeCardsPanel_invite_friend");
             this.mainBackgroundImage.addControl(button);
         }
     }
     this.fanImage.Image = (Image) GFXLibrary.free_card_screen_card_fan;
     this.fanImage.Position = new Point(650, 6);
     this.mainBackgroundImage.addControl(this.fanImage);
     base.Invalidate();
 }
 private void importCounties(List<int> counties)
 {
     this.selectedCounty = -1;
     if (counties != null)
     {
         this.mapImage.clearControls();
         for (int i = 0; i < 2; i++)
         {
             for (int j = 0; j < counties.Count; j += 4)
             {
                 int countyID = counties[j];
                 int num4 = counties[j + 1];
                 int num5 = counties[j + 2];
                 int local1 = counties[j + 3];
                 Point point = GameEngine.Instance.World.getCountyMarkerLocation(countyID);
                 if (num4 == -1000)
                 {
                     if (i == 0)
                     {
                         CustomSelfDrawPanel.CSDImage image;
                         image = new CustomSelfDrawPanel.CSDImage {
                             Image = (Image) GFXLibrary.selector_square_red_normal,
                             Size = new Size(((Image)GFXLibrary.selector_square_red_normal).Size.Width / 2, ((Image)GFXLibrary.selector_square_red_normal).Size.Height / 2),
                             CustomTooltipID = 0x44d,
                             Position = new Point(((int) (((float) point.X) / this.divider)) - 4, ((int) (((float) point.Y) / this.divider)) - 4),
                             Colorise = Color.FromArgb(0xff, 0x80, 0x80, 0x80)
                         };
                         this.mapImage.addControl(image);
                     }
                 }
                 else if (i == 1)
                 {
                     CustomSelfDrawPanel.CSDButton control = new CustomSelfDrawPanel.CSDButton {
                         Position = new Point(((int) (((float) point.X) / this.divider)) - 8, ((int) (((float) point.Y) / this.divider)) - 8)
                     };
                     control.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.iconOver_Click));
                     control.Data = countyID;
                     control.CustomTooltipID = 0x44c;
                     this.mapImage.addControl(control);
                     if (num4 > (num5 / 2))
                     {
                         control.ImageNorm = (Image) GFXLibrary.selector_square_normal;
                         control.ImageOver = (Image) GFXLibrary.selector_square_over;
                         control.ImageClick = (Image) GFXLibrary.selector_square_pressed;
                     }
                     else if (num4 > (num5 / 7))
                     {
                         control.ImageNorm = (Image) GFXLibrary.selector_square_orange_normal;
                         control.ImageOver = (Image) GFXLibrary.selector_square_orange_over;
                         control.ImageClick = (Image) GFXLibrary.selector_square_orange_pressed;
                     }
                     else
                     {
                         control.ImageNorm = (Image) GFXLibrary.selector_square_red_normal;
                         control.ImageOver = (Image) GFXLibrary.selector_square_red_over;
                         control.ImageClick = (Image) GFXLibrary.selector_square_red_pressed;
                     }
                 }
             }
         }
         this.mapImage.invalidate();
     }
 }
Esempio n. 43
0
 public void init(int cardSection)
 {
     CustomSelfDrawPanel.CSDImage image2;
     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;
     CustomSelfDrawPanel.CSDExtendingPanel control = new CustomSelfDrawPanel.CSDExtendingPanel {
         Size = base.Size,
         Position = new Point(0, 0)
     };
     this.mainBackgroundImage.addControl(control);
     control.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)
     };
     control.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((control.Width - ((Image) GFXLibrary.cardpanel_panel_gradient_bottom_right).Width) - 6, (control.Height - ((Image) GFXLibrary.cardpanel_panel_gradient_bottom_right).Height) - 6)
     };
     control.addControl(image2);
     this.AvailablePanel = new CustomSelfDrawPanel.CSDExtendingPanel();
     this.AvailablePanel.Size = new Size(this.AvailablePanelWidth, 0x177);
     this.AvailablePanel.Position = new Point(8, (base.Height - 8) - 550);
     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.Position = new Point((base.Width - 14) - 0x11, 10);
     this.mainBackgroundImage.addControl(this.closeImage);
     CustomSelfDrawPanel.WikiLinkControl.init(this.mainBackgroundImage, 0x27, 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.greyout.FillColor = Color.FromArgb(0xd7, 0x19, 0x19, 0x19);
     this.greyout.Size = new Size(this.mainBackgroundImage.Width, this.AvailablePanel.Y + this.AvailablePanel.Height);
     this.greyout.Position = new Point(0, 0);
     this.greyout.setClickDelegate(delegate {
     });
     CustomSelfDrawPanel.CSDImage closeGrey = new CustomSelfDrawPanel.CSDImage {
         Image = (Image) GFXLibrary.cardpanel_button_close_normal,
         Size = this.closeImage.Image.Size
     };
     closeGrey.setMouseOverDelegate(() => closeGrey.Image = (Image) GFXLibrary.cardpanel_button_close_over, () => closeGrey.Image = (Image) GFXLibrary.cardpanel_button_close_normal);
     closeGrey.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.CloseGrey), "BuyCardsPanel_close_overlay");
     closeGrey.Position = new Point((base.Width - 14) - 0x11, 10);
     this.greyout.addControl(closeGrey);
     CustomSelfDrawPanel.UICardsButtons buttons = new CustomSelfDrawPanel.UICardsButtons((PlayCardsWindow) base.ParentForm) {
         Position = new Point(0x328, 0x25)
     };
     this.mainBackgroundImage.addControl(buttons);
     this.cardButtons = buttons;
     this.labelTitle.Position = new Point(0x1b, 8);
     this.labelTitle.Size = new Size(0x3a7, 0x40);
     this.labelTitle.Text = SK.Text("BuyCardsPanel_Buy_and_Open_Packs", "Buy and Open Card Packs: Crowns in your treasury") + " : " + GameEngine.Instance.World.ProfileCrowns.ToString();
     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.labelBottom.Position = new Point(0x1b, (this.AvailablePanel.Y + this.AvailablePanel.Height) + 4);
     this.labelBottom.Size = new Size(800, 0x40);
     this.labelBottom.Text = SK.Text("BuyCardsPanel_Click_To_Open", "Click on a pack to open it");
     this.labelBottom.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
     this.labelBottom.Font = FontManager.GetFont("Arial", 16f, FontStyle.Regular);
     this.labelBottom.Color = ARGBColors.Black;
     this.mainBackgroundImage.addControl(this.labelBottom);
     this.packWidth = 100;
     this.packX = this.AvailablePanel.X + BorderPadding;
     this.offerX = (this.packX + this.packWidth) - 0x10;
     this.GetOffercontrolList();
     this.AddOfferControls();
     this.UpdatePacks();
 }
        public void init(int cardSection)
        {
            CustomSelfDrawPanel.CSDImage image2;
            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;
            CustomSelfDrawPanel.CSDExtendingPanel control = new CustomSelfDrawPanel.CSDExtendingPanel {
                Size     = base.Size,
                Position = new Point(0, 0)
            };
            this.mainBackgroundImage.addControl(control);
            control.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)
            };
            control.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((control.Width - ((Image)GFXLibrary.cardpanel_panel_gradient_bottom_right).Width) - 6, (control.Height - ((Image)GFXLibrary.cardpanel_panel_gradient_bottom_right).Height) - 6)
            };
            control.addControl(image2);
            this.AvailablePanel          = new CustomSelfDrawPanel.CSDExtendingPanel();
            this.AvailablePanel.Size     = new Size(this.AvailablePanelWidth, 550);
            this.AvailablePanel.Position = new Point(8, (base.Height - 8) - 550);
            this.AvailablePanel.Alpha    = 0.8f;
            int width         = base.Width;
            int borderPadding = BorderPadding;
            int num9          = 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));
            this.closeImage.Position = new Point((base.Width - 14) - 0x11, 10);
            this.mainBackgroundImage.addControl(this.closeImage);
            CustomSelfDrawPanel.WikiLinkControl.init(this.mainBackgroundImage, 0x26, 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.greyout.FillColor = Color.FromArgb(0xd7, 0x19, 0x19, 0x19);
            this.greyout.Size      = new Size(this.mainBackgroundImage.Width, this.AvailablePanel.Y + this.AvailablePanel.Height);
            this.greyout.Position  = new Point(0, 0);
            this.greyout.setClickDelegate(delegate {
            });
            CustomSelfDrawPanel.CSDImage closeGrey = new CustomSelfDrawPanel.CSDImage {
                Image = (Image)GFXLibrary.cardpanel_button_close_normal,
                Size  = this.closeImage.Image.Size
            };
            closeGrey.setMouseOverDelegate(() => closeGrey.Image = (Image)GFXLibrary.cardpanel_button_close_over, () => closeGrey.Image = (Image)GFXLibrary.cardpanel_button_close_normal);
            closeGrey.Position = new Point((base.Width - 14) - 0x11, 10);
            this.greyout.addControl(closeGrey);
            this.labelTitle.Position  = new Point(0x1b, 8);
            this.labelTitle.Size      = new Size(0x3a7, 0x40);
            this.labelTitle.Text      = SK.Text("BuyCrownsPanel_Buy_Crowns", "Buy Crowns");
            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);
            CustomSelfDrawPanel.UICardsButtons buttons = new CustomSelfDrawPanel.UICardsButtons((PlayCardsWindow)base.ParentForm)
            {
                Position = new Point(0x328, 0x25)
            };
            this.mainBackgroundImage.addControl(buttons);
            this.cardButtons = buttons;
            List <ProductInfo> productList = new List <ProductInfo>();

            if (Program.steamActive)
            {
                this.PlayerCountry  = "UK";
                this.PlayerCurrency = "GBP";
                this.PlayerLanguage = MySettings.load().LanguageIdent;
                XmlRpcAuthProvider provider = XmlRpcAuthProvider.CreateForEndpoint(URLs.ProfileProtocol, URLs.ProfileServerAddressLogin, URLs.ProfileServerPort, URLs.ProfilePath);
                XmlRpcAuthRequest  req      = new XmlRpcAuthRequest(RemoteServices.Instance.UserGuid.ToString().Replace("-", ""), "", "", "", null, null, null, null)
                {
                    SteamID   = Program.steamID,
                    SessionID = RemoteServices.Instance.SessionGuid.ToString().Replace("-", ""),
                    Culture   = this.PlayerLanguage,
                    Currency  = this.PlayerCurrency,
                    Country   = this.PlayerCountry
                };
                productList = provider.SteamGetProductList(req, null, this, 0x3a98).ProductList;
            }
            else if (Program.aeriaInstall)
            {
                XmlRpcAuthProvider provider2 = XmlRpcAuthProvider.CreateForEndpoint(URLs.ProfileProtocol, URLs.ProfileServerAddressLogin, URLs.ProfileServerPort, URLs.ProfilePath);
                XmlRpcAuthRequest  request2  = new XmlRpcAuthRequest(RemoteServices.Instance.UserGuid.ToString().Replace("-", ""), "", "", "", null, null, null, null);
                XmlRpcAuthResponse response  = null;
                this.storedAeriaPoints             = provider2.AeriaGetBalance(request2, null, this, 0x3a98, ref response);
                productList                        = response.ProductList;
                this.buyAPButton.ImageNorm         = (Image)GFXLibrary.misc_button_blue_210wide_normal;
                this.buyAPButton.ImageOver         = (Image)GFXLibrary.misc_button_blue_210wide_over;
                this.buyAPButton.ImageClick        = (Image)GFXLibrary.misc_button_blue_210wide_pushed;
                this.buyAPButton.Position          = new Point(0x13d, 0x49);
                this.buyAPButton.Text.Text         = this.storedAeriaPoints.ToString();
                this.buyAPButton.Text.Alignment    = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_RIGHT;
                this.buyAPButton.Text.Size         = new Size((this.buyAPButton.Width / 2) - 3, this.buyAPButton.Height);
                this.buyAPButton.TextYOffset       = -2;
                this.buyAPButton.Text.Color        = ARGBColors.Black;
                this.buyAPButton.ImageIcon         = (Image)GFXLibrary.aeriaPoints;
                this.buyAPButton.ImageIconPosition = new Point((this.buyAPButton.Width / 2) + 3, 1);
                this.buyAPButton.Text.Font         = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
                this.buyAPButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.purchaseAP));
                this.buyAPButton.CustomTooltipID = 0x286e;
                this.mainBackgroundImage.addControl(this.buyAPButton);
            }
            int y    = 0x42;
            int num2 = 0x5e;
            int num3 = -1;

            if (Program.aeriaInstall)
            {
                y = 0x84;
            }
            NumberFormatInfo nFI   = GameEngine.NFI;
            NumberFormatInfo info2 = GameEngine.NFI_D2;

            foreach (ProductInfo info3 in productList)
            {
                num3++;
                int x = num2;
                if (Program.steamActive)
                {
                    if (num3 > 3)
                    {
                        if (num3 == 4)
                        {
                            y = 0x84;
                        }
                        x += 350;
                    }
                }
                else if (Program.aeriaInstall && (num3 > 2))
                {
                    if (num3 == 3)
                    {
                        y = 0x84;
                    }
                    x += 350;
                }
                CustomSelfDrawPanel.CSDLabel label        = new CustomSelfDrawPanel.CSDLabel();
                CustomSelfDrawPanel.CSDLabel label2       = new CustomSelfDrawPanel.CSDLabel();
                CustomSelfDrawPanel.CSDLabel label3       = new CustomSelfDrawPanel.CSDLabel();
                CustomSelfDrawPanel.CSDLabel label4       = new CustomSelfDrawPanel.CSDLabel();
                CustomSelfDrawPanel.CSDLabel label5       = new CustomSelfDrawPanel.CSDLabel();
                CustomSelfDrawPanel.CSDImage image3       = new CustomSelfDrawPanel.CSDImage();
                CustomSelfDrawPanel.CSDImage crownsbutton = new CustomSelfDrawPanel.CSDImage();
                CustomSelfDrawPanel.CSDImage orderbutton  = new CustomSelfDrawPanel.CSDImage();
                crownsbutton.Image    = (Image)GFXLibrary.cardpanel_payment_button_crowns_normal;
                crownsbutton.Position = new Point(x, y);
                crownsbutton.Height   = crownsbutton.Image.Height;
                crownsbutton.Width    = crownsbutton.Image.Width;
                crownsbutton.setMouseOverDelegate(() => crownsbutton.Image = (Image)GFXLibrary.cardpanel_payment_button_crowns_over, () => crownsbutton.Image = (Image)GFXLibrary.cardpanel_payment_button_crowns_normal);
                crownsbutton.Tag = info3;
                crownsbutton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.productclick));
                this.mainBackgroundImage.addControl(crownsbutton);
                x += crownsbutton.Width + 0x20;
                orderbutton.Image    = (Image)GFXLibrary.cardpanel_payment_button_greywhite_normal;
                orderbutton.Position = new Point(x, (y + 0x12) + 3);
                orderbutton.Height   = orderbutton.Image.Height;
                orderbutton.Width    = orderbutton.Image.Width;
                orderbutton.setMouseOverDelegate(() => orderbutton.Image = (Image)GFXLibrary.cardpanel_payment_button_greywhite_over, () => orderbutton.Image = (Image)GFXLibrary.cardpanel_payment_button_greywhite_normal);
                orderbutton.Tag = info3;
                orderbutton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.productclick));
                label5.Text      = this.strOrderNow;
                label5.Position  = new Point(0, 0);
                label5.Width     = orderbutton.Width;
                label5.Height    = orderbutton.Height;
                label5.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
                label5.Font      = FontManager.GetFont("Arial", 14f, FontStyle.Bold);
                orderbutton.addControl(label5);
                label5.Tag = info3;
                label5.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.productclick));
                int num5 = 14;
                int num6 = 0;
                if (Program.mySettings.LanguageIdent == "fr")
                {
                    num5 = 13;
                    num6 = -5;
                }
                label.Text     = info3.Strikethrough.ToString();
                label.Position = new Point(0x74 + num6, 0x15);
                label.Width    = 300;
                label.Height   = 0x18;
                label.Font     = FontManager.GetFont("Arial", (float)num5, FontStyle.Strikeout);
                label.Color    = ARGBColors.Black;
                crownsbutton.addControl(label);
                label.Tag = info3;
                label.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.productclick));
                label.Size      = label.TextSizeX;
                label2.Text     = info3.Crowns.ToString();
                label2.Position = new Point(label.X + label.Width, label.Y);
                label2.Font     = FontManager.GetFont("Arial", (float)num5, FontStyle.Bold);
                label2.Color    = ARGBColors.Purple;
                label2.Width    = 300;
                label2.Height   = 0x18;
                crownsbutton.addControl(label2);
                label2.Tag = info3;
                label2.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.productclick));
                label2.Size     = label2.TextSizeX;
                label3.Text     = this.strCrowns;
                label3.Position = new Point((label2.X + label2.Width) + num6, label2.Y);
                label3.Font     = FontManager.GetFont("Arial", (float)num5, FontStyle.Bold);
                label3.Color    = ARGBColors.Black;
                label3.Size     = new Size(300, 0x18);
                crownsbutton.addControl(label3);
                label3.Tag = info3;
                label3.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.productclick));
                label3.Size = label3.TextSizeX;
                if (Program.aeriaInstall)
                {
                    label4.Text = " " + ((int)info3.Cost).ToString("F", nFI);
                }
                else
                {
                    label4.Text = info3.Currency + " " + info3.Cost.ToString("F", info2);
                }
                label4.Position = new Point(label.X, (label.Y + label.Height) + 4);
                label4.Font     = FontManager.GetFont("Arial", 14f, FontStyle.Bold);
                label4.Color    = ARGBColors.Black;
                label4.Size     = new Size(300, 0x18);
                crownsbutton.addControl(label4);
                label4.Tag = info3;
                label4.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.productclick));
                label4.Size = label4.TextSizeX;
                if (Program.aeriaInstall)
                {
                    image3.Image    = (Image)GFXLibrary.aeriaPoints;
                    label4.Position = new Point(label.X + 20, label.Y + label.Height);
                    image3.Position = new Point(label.X, (((label.Y + label.Height) + 4) - 2) - 3);
                    image3.Tag      = info3;
                    crownsbutton.addControl(image3);
                }
                y += crownsbutton.Height + 40;
            }
            this.mainBackgroundImage.invalidate();
        }