Пример #1
0
        private void button2_Click(bool sfx)
        {
            if (sfx)
            {
                GameEngine.Instance.playInterfaceSound("WorldMapScreen_menu_settings");
            }
            MenuPopup popup = new MenuPopup();
            Point     point = base.csd.PointToScreen(this.btnFileMenu.Position);

            popup.setPosition(point.X, point.Y + 0x18);
            popup.setCallBack(new MenuPopup.MenuCallback(this.menu1Callback));
            popup.addMenuItem(SK.Text("MENU_Settings", "Settings"), 1);
            popup.addMenuItem(SK.Text("MENU_Edit_Avatar", "Edit Avatar"), 5);
            popup.addMenuItem(SK.Text("User_Manage_Relations", "Manage Diplomacy"), 300);
            int ownSelectedVillage = InterfaceMgr.Instance.OwnSelectedVillage;

            if (((ownSelectedVillage >= 0) && !GameEngine.Instance.World.isCapital(ownSelectedVillage)) && GameEngine.Instance.World.isUserVillage(ownSelectedVillage))
            {
                popup.addBar();
                popup.addMenuItem(SK.Text("MENU_Rename_Current_Village", "Rename Current Village"), 9);
                CustomSelfDrawPanel.CSDControl control  = popup.addMenuItem(SK.Text("MENU_Convert_Current_Village", "Convert Current Village"), 12);
                CustomSelfDrawPanel.CSDControl control2 = popup.addMenuItem(SK.Text("MENU_Abandon_Current_Village", "Abandon Current Village"), 11);
                control.CustomTooltipID  = 0x4b0;
                control2.CustomTooltipID = 0x4b1;
            }
            popup.showMenu();
        }
 private void restoreAttackClicked()
 {
     CustomSelfDrawPanel.CSDControl clickedControl = base.ClickedControl;
     if (clickedControl != null)
     {
         int data = clickedControl.Data;
         if ((GameEngine.Instance.CastleAttackerSetup != null) && GameEngine.Instance.CastleAttackerSetup.restoreAttackSetup(data))
         {
             this.okClicked();
         }
     }
 }
Пример #3
0
 public void init(CustomSelfDrawPanel.CSDControl parentControl, int initialProgress, int band)
 {
     active            = true;
     this.m_band       = band;
     base.Image        = (Image)GFXLibrary.tutorial_reward_anim[0];
     base.RotateCentre = new PointF(64f, 64f);
     base.Visible      = true;
     parentControl.addControl(this);
     this.restart();
     for (int i = 0; i < initialProgress; i++)
     {
         this.update();
     }
 }
 private void memoriseAttackClicked()
 {
     CustomSelfDrawPanel.CSDControl clickedControl = base.ClickedControl;
     if (clickedControl != null)
     {
         int data = clickedControl.Data;
         if (GameEngine.Instance.CastleAttackerSetup != null)
         {
             if (GameEngine.Instance.CastleAttackerSetup.memoriseAttackSetup(data))
             {
                 this.infoLabel.Text = SK.Text("Advanced_Castle_Troops_Saves", "Troops Memorized");
                 if ((data == 1) && GameEngine.Instance.CastleAttackerSetup.gotAttackSetupSave(1))
                 {
                     this.restoreSetup1Button.Enabled = true;
                 }
                 if ((data == 2) && GameEngine.Instance.CastleAttackerSetup.gotAttackSetupSave(2))
                 {
                     this.restoreSetup2Button.Enabled = true;
                 }
                 if ((data == 3) && GameEngine.Instance.CastleAttackerSetup.gotAttackSetupSave(3))
                 {
                     this.restoreSetup3Button.Enabled = true;
                 }
                 if ((data == 4) && GameEngine.Instance.CastleAttackerSetup.gotAttackSetupSave(4))
                 {
                     this.restoreSetup4Button.Enabled = true;
                 }
                 if ((data == 5) && GameEngine.Instance.CastleAttackerSetup.gotAttackSetupSave(5))
                 {
                     this.restoreSetup5Button.Enabled = true;
                 }
             }
             else
             {
                 this.infoLabel.Text = SK.Text("Advanced_Castle_Troops_Saves_failed", "Troops Memorize Failed");
             }
         }
     }
 }
Пример #5
0
 public void AddOfferControls()
 {
     this.OfferList.Sort((Comparison<CustomSelfDrawPanel.UICardOffer>) ((first, next) => first.Offer.Sequence.CompareTo(next.Offer.Sequence)));
     int num = 100;
     int height = 0;
     for (int i = 0; i < this.OfferList.Count; i++)
     {
         CustomSelfDrawPanel.UICardOffer offer = this.OfferList[i];
         offer.Position = new Point((i & 1) * 330, 5 + (num * i));
         this.AvailablePanelContent.addControl(offer);
         height = (offer.Position.Y + offer.Height) + 4;
     }
     this.AvailablePanelContent.Position = new Point(BorderPadding, 0);
     this.AvailablePanelContent.Size = new Size(this.AvailablePanel.Width, height);
     this.AvailablePanelContent.ClipRect = new Rectangle(0, 0, this.AvailablePanel.Width - BorderPadding, this.AvailablePanel.Height);
     this.AvailablePanel.addControl(this.AvailablePanelContent);
     if (height < this.AvailablePanelContent.ClipRect.Height)
     {
         height = this.AvailablePanelContent.ClipRect.Height;
     }
     this.scrollbarAvailable.Position = new Point((this.AvailablePanel.Width - BorderPadding) - (BorderPadding / 2), this.AvailablePanel.Y + (BorderPadding / 2));
     this.scrollbarAvailable.Size = new Size(BorderPadding, this.AvailablePanel.Height - BorderPadding);
     this.mainBackgroundImage.addControl(this.scrollbarAvailable);
     this.scrollbarAvailable.Value = 0;
     this.scrollbarAvailable.StepSize = 200;
     this.scrollbarAvailable.Max = this.AvailablePanelContent.Height - this.AvailablePanelContent.ClipRect.Height;
     this.scrollbarAvailable.NumVisibleLines = this.AvailablePanelContent.ClipRect.Height;
     this.scrollbarAvailable.OffsetTL = new Point(1, 5);
     this.scrollbarAvailable.OffsetBR = new Point(0, -10);
     this.scrollbarAvailable.setValueChangeDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ValueChangedDelegate(this.AvailableContentScroll));
     this.scrollbarAvailable.Create(null, null, null, (Image) GFXLibrary.cardpanel_scroll_thumb_top, (Image) GFXLibrary.cardpanel_scroll_thumb_mid, (Image) GFXLibrary.cardpanel_scroll_thumb_botom);
     if (height <= this.AvailablePanelContent.ClipRect.Height)
     {
         this.scrollbarAvailable.Visible = false;
     }
     CustomSelfDrawPanel.CSDControl control = new CustomSelfDrawPanel.CSDControl {
         Position = new Point(0, 0),
         Size = base.Size
     };
     this.mainBackgroundImage.addControl(control);
     this.mainBackgroundImage.setMouseWheelDelegate(new CustomSelfDrawPanel.CSDControl.CSD_MouseWheelDelegate(this.mouseWheelHandler));
 }
Пример #6
0
 private void AddControlToPanel(CustomSelfDrawPanel.CSDControl c)
 {
     base.addControl(c);
 }
Пример #7
0
 private void lblVillageName_Click()
 {
     if (((this.villageListMenu != null) && this.villageListMenu.Visible) || InterfaceMgr.Instance.menuPopupClosedRecently())
     {
         GameEngine.Instance.playInterfaceSound("WorldMapScreen_village_droplist_close");
         InterfaceMgr.Instance.closeMenuPopup();
     }
     else
     {
         GameEngine.Instance.playInterfaceSound("WorldMapScreen_village_droplist_open");
         this.villageListMenu = new MenuPopup();
         this.villageListMenu.setCallBack(new MenuPopup.MenuCallback(this.comboVillageList_SelectionChangeCommitted));
         this.villageListMenu.setDoubleClickCallBack(new MenuPopup.MenuCallback(this.doubleClickedItem));
         this.villageListMenu.setLineHeight(15);
         this.villageListMenu.closeOnClickOnly();
         this.villageListMenu.mouseOverDelegates(new MenuPopup.MenuItemRolloverDelegate(this.mouseOverItem), new MenuPopup.MenuItemRolloverDelegate(this.mouseLeaveItem));
         this.villageListMenu.setBackColour(Color.FromArgb(0xff, 0xba, 0xaf, 0xa3));
         Point point = base.PointToScreen(this.villageButton.Position);
         this.villageListMenu.setPosition(point.X + 0x12, point.Y + 0x15);
         List <WorldMap.VillageNameItem> list = GameEngine.Instance.World.getUserVillageNamesListAndCapitals();
         int num = 0;
         foreach (WorldMap.VillageNameItem item in list)
         {
             if (item.capital || (item.villageID < 0))
             {
                 break;
             }
             num++;
         }
         if (num >= 3)
         {
             this.villageListMenu.addMenuItem(SK.Text("Menu_Your_Villages", "Your Villages") + " (" + num.ToString() + ")", -1).Enabled = false;
         }
         else
         {
             this.villageListMenu.addMenuItem(SK.Text("Menu_Your_Villages", "Your Villages"), -1).Enabled = false;
         }
         this.villageListMenu.addBar();
         bool flag = false;
         foreach (WorldMap.VillageNameItem item2 in list)
         {
             if (item2.villageID < 0)
             {
                 this.villageListMenu.newColumn();
                 flag = true;
             }
             bool bold = false;
             if (flag && GameEngine.Instance.World.isUserVillage(item2.villageID))
             {
                 bold = true;
             }
             CustomSelfDrawPanel.CSDControl control3 = this.villageListMenu.addMenuItem(item2.villageName, item2.villageID, bold);
             if (item2.villageID < 0)
             {
                 control3.Enabled = false;
                 this.villageListMenu.addBar();
             }
         }
         this.villageListMenu.showMenu();
         MainWindow.captureCloseMenuEvent = true;
     }
 }
 public ToolTipZone(int x, int y, int width, int height, int tooltipID, CustomSelfDrawPanel.CSDControl relative)
 {
     this.rect = new Rectangle(x, y, width, height);
     this.ID = tooltipID;
     this.relatedCSDControl = relative;
 }
        public void checkToggled()
        {
            if (this.m_mode == 1)
            {
                CustomSelfDrawPanel.CSDControl clickedControl = base.ClickedControl;
                if (clickedControl != null)
                {
                    switch (clickedControl.Data)
                    {
                    case -4:
                        ReportsPanel.Instance.ShowVillageLost = !ReportsPanel.Instance.ShowVillageLost;
                        ReportsPanel.Instance.updateFilters();
                        return;

                    case -3:
                        ReportsPanel.Instance.ShowForwardedMessagesOnly = !ReportsPanel.Instance.ShowForwardedMessagesOnly;
                        ReportsPanel.Instance.updateFilters();
                        return;

                    case -2:
                        ReportsPanel.Instance.ShowParishAttacks = !ReportsPanel.Instance.ShowParishAttacks;
                        ReportsPanel.Instance.updateFilters();
                        return;

                    case -1:
                        ReportsPanel.Instance.ShowReadMessages = !ReportsPanel.Instance.ShowReadMessages;
                        ReportsPanel.Instance.updateFilters();
                        return;

                    case 0:
                        ReportsPanel.Instance.Filters.attacks = this.attackCheck.Checked;
                        ReportsPanel.Instance.updateFilters();
                        return;

                    case 1:
                        ReportsPanel.Instance.Filters.defense = this.defenceCheck.Checked;
                        ReportsPanel.Instance.updateFilters();
                        return;

                    case 2:
                        ReportsPanel.Instance.Filters.enemyWarnings = this.enemyCheck.Checked;
                        ReportsPanel.Instance.updateFilters();
                        return;

                    case 3:
                        ReportsPanel.Instance.Filters.reinforcements = this.reinforceCheck.Checked;
                        ReportsPanel.Instance.updateFilters();
                        return;

                    case 4:
                        ReportsPanel.Instance.Filters.scouting = this.scoutingCheck.Checked;
                        ReportsPanel.Instance.updateFilters();
                        return;

                    case 5:
                        ReportsPanel.Instance.Filters.foraging = this.foragingCheck.Checked;
                        ReportsPanel.Instance.updateFilters();
                        return;

                    case 6:
                        ReportsPanel.Instance.Filters.trade = this.tradeCheck.Checked;
                        ReportsPanel.Instance.updateFilters();
                        return;

                    case 7:
                        ReportsPanel.Instance.Filters.vassals = this.vassalsCheck.Checked;
                        ReportsPanel.Instance.updateFilters();
                        return;

                    case 8:
                        ReportsPanel.Instance.Filters.religion = this.religionCheck.Checked;
                        ReportsPanel.Instance.updateFilters();
                        return;

                    case 9:
                        ReportsPanel.Instance.Filters.research = this.researchCheck.Checked;
                        ReportsPanel.Instance.updateFilters();
                        return;

                    case 10:
                        ReportsPanel.Instance.Filters.elections = this.electionsCheck.Checked;
                        ReportsPanel.Instance.updateFilters();
                        return;

                    case 11:
                        ReportsPanel.Instance.Filters.factions = this.factionsCheck.Checked;
                        ReportsPanel.Instance.updateFilters();
                        return;

                    case 12:
                        ReportsPanel.Instance.Filters.cards = this.cardsCheck.Checked;
                        ReportsPanel.Instance.updateFilters();
                        return;

                    case 13:
                        ReportsPanel.Instance.Filters.achievements = this.achievementsCheck.Checked;
                        ReportsPanel.Instance.updateFilters();
                        return;

                    case 14:
                        ReportsPanel.Instance.Filters.buyVillages = this.buyVillagesCheck.Checked;
                        ReportsPanel.Instance.updateFilters();
                        return;

                    case 15:
                        ReportsPanel.Instance.Filters.quests = this.questsCheck.Checked;
                        ReportsPanel.Instance.updateFilters();
                        return;

                    case 0x10:
                        ReportsPanel.Instance.Filters.spins = this.spinsCheck.Checked;
                        ReportsPanel.Instance.updateFilters();
                        return;

                    case 0x11:
                        ReportsPanel.Instance.Filters.house = this.houseCheck.Checked;
                        ReportsPanel.Instance.updateFilters();
                        break;

                    default:
                        return;
                    }
                }
            }
        }
 public void init(int cardSection)
 {
     CustomSelfDrawPanel.CSDImage image2;
     CustomSelfDrawPanel.CSDControl.CSD_MouseOverDelegate overDelegate = null;
     CustomSelfDrawPanel.CSDControl.CSD_MouseOverDelegate leaveDelegate = null;
     this.currentCardSection = cardSection;
     base.clearControls();
     this.mainBackgroundImage.Image = GFXLibrary.dummy;
     this.mainBackgroundImage.Position = new Point(0, 0);
     this.mainBackgroundImage.Size = base.Size;
     this.mainBackgroundImage.Tile = true;
     base.addControl(this.mainBackgroundImage);
     this.ContentWidth = base.Width - (2 * BorderPadding);
     this.AvailablePanelWidth = 800;
     this.InplayPanelWidth = (this.ContentWidth - BorderPadding) - this.AvailablePanelWidth;
     CustomSelfDrawPanel.CSDExtendingPanel panel = new CustomSelfDrawPanel.CSDExtendingPanel {
         Size = base.Size,
         Position = new Point(0, 0)
     };
     this.mainBackgroundImage.addControl(panel);
     panel.Create((Image) GFXLibrary.cardpanel_panel_back_top_left, (Image) GFXLibrary.cardpanel_panel_back_top_mid, (Image) GFXLibrary.cardpanel_panel_back_top_right, (Image) GFXLibrary.cardpanel_panel_back_mid_left, (Image) GFXLibrary.cardpanel_panel_back_mid_mid, (Image) GFXLibrary.cardpanel_panel_back_mid_right, (Image) GFXLibrary.cardpanel_panel_back_bottom_left, (Image) GFXLibrary.cardpanel_panel_back_bottom_mid, (Image) GFXLibrary.cardpanel_panel_back_bottom_right);
     CustomSelfDrawPanel.CSDImage image = new CustomSelfDrawPanel.CSDImage {
         Image = (Image) GFXLibrary.cardpanel_panel_gradient_top_left,
         Size = GFXLibrary.cardpanel_panel_gradient_top_left.Size,
         Position = new Point(0, 0)
     };
     panel.addControl(image);
     image2 = new CustomSelfDrawPanel.CSDImage {
         Image = (Image) GFXLibrary.cardpanel_panel_gradient_bottom_right,
         Size = GFXLibrary.cardpanel_panel_gradient_bottom_right.Size,
         Position = new Point((panel.Width - ((Image) GFXLibrary.cardpanel_panel_gradient_bottom_right).Width) - 6, (panel.Height - ((Image) GFXLibrary.cardpanel_panel_gradient_bottom_right).Height) - 6)
     };
     panel.addControl(image2);
     this.AvailablePanel = new CustomSelfDrawPanel.CSDExtendingPanel();
     this.AvailablePanel.Size = new Size(this.AvailablePanelWidth, 0x177);
     this.AvailablePanel.Position = new Point(8, (base.Height - 8) - 0x177);
     this.AvailablePanel.Alpha = 0.8f;
     this.mainBackgroundImage.addControl(this.AvailablePanel);
     this.AvailablePanel.Create((Image) GFXLibrary.cardpanel_panel_black_top_left, (Image) GFXLibrary.cardpanel_panel_black_top_mid, (Image) GFXLibrary.cardpanel_panel_black_top_right, (Image) GFXLibrary.cardpanel_panel_black_mid_left, (Image) GFXLibrary.cardpanel_panel_black_mid_mid, (Image) GFXLibrary.cardpanel_panel_black_mid_right, (Image) GFXLibrary.cardpanel_panel_black_bottom_left, (Image) GFXLibrary.cardpanel_panel_black_bottom_mid, (Image) GFXLibrary.cardpanel_panel_black_bottom_right);
     int width = base.Width;
     int borderPadding = BorderPadding;
     int num3 = this.AvailablePanel.Width;
     this.closeImage.Image = (Image) GFXLibrary.cardpanel_button_close_normal;
     this.closeImage.Size = this.closeImage.Image.Size;
     this.closeImage.setMouseOverDelegate(() => this.closeImage.Image = (Image) GFXLibrary.cardpanel_button_close_over, () => this.closeImage.Image = (Image) GFXLibrary.cardpanel_button_close_normal);
     this.closeImage.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.closeClick), "Cards_Close");
     this.closeImage.CustomTooltipID = 0x2774;
     this.closeImage.Position = new Point((base.Width - 14) - 0x11, 10);
     this.mainBackgroundImage.addControl(this.closeImage);
     CustomSelfDrawPanel.WikiLinkControl.init(this.mainBackgroundImage, 40, new Point((((base.Width - 1) - 0x11) - 50) + 3, 5), true);
     CustomSelfDrawPanel.CSDFill fill = new CustomSelfDrawPanel.CSDFill {
         FillColor = Color.FromArgb(0xff, 130, 0x81, 0x7e),
         Size = new Size(base.Width - 10, 1),
         Position = new Point(5, 0x22)
     };
     this.mainBackgroundImage.addControl(fill);
     this.cardsButtons = new CustomSelfDrawPanel.UICardsButtons((PlayCardsWindow) base.ParentForm);
     this.cardsButtons.Position = new Point(0x328, 0x25);
     this.mainBackgroundImage.addControl(this.cardsButtons);
     this.labelTitle.Position = new Point(0x1b, 8);
     this.labelTitle.Size = new Size(600, 0x40);
     this.labelTitle.Text = "";
     this.labelTitle.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
     this.labelTitle.Font = FontManager.GetFont("Arial", 16f, FontStyle.Bold);
     this.labelTitle.Color = ARGBColors.Black;
     this.mainBackgroundImage.addControl(this.labelTitle);
     this.labelTitlePoints.Position = new Point(0x1b, 8);
     this.labelTitlePoints.Size = new Size(600, 0x40);
     this.labelTitlePoints.Text = "";
     this.labelTitlePoints.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
     this.labelTitlePoints.Font = FontManager.GetFont("Arial", 16f, FontStyle.Bold);
     this.labelTitlePoints.Color = ARGBColors.Black;
     this.mainBackgroundImage.addControl(this.labelTitlePoints);
     this.imageTitlePoints.Image = (Image) GFXLibrary.cardpanel_manage_card_points_icon;
     this.imageTitlePoints.Position = new Point(400, 5);
     this.mainBackgroundImage.addControl(this.imageTitlePoints);
     this.searchButton.ImageNorm = (Image) GFXLibrary.int_statsscreen_search_button_normal;
     this.searchButton.ImageOver = (Image) GFXLibrary.int_statsscreen_search_button_over;
     this.searchButton.ImageClick = (Image) GFXLibrary.int_statsscreen_search_button_pushed;
     this.searchButton.Position = new Point(0x32b, 7);
     this.searchButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.searchClicked), "StatsPanel_search");
     this.searchButton.CustomTooltipID = 0x284f;
     this.searchButton.Visible = true;
     this.mainBackgroundImage.addControl(this.searchButton);
     this.clearSearchButton.ImageNorm = (Image) GFXLibrary.int_statsscreen_search_clear_button_normal;
     this.clearSearchButton.ImageOver = (Image) GFXLibrary.int_statsscreen_search_clear_button_over;
     this.clearSearchButton.ImageClick = (Image) GFXLibrary.int_statsscreen_search_clear_button_pushed;
     this.clearSearchButton.Position = new Point(740, 7);
     this.clearSearchButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.clearSearchClicked), "StatsPanel_clear_search");
     this.clearSearchButton.Visible = false;
     this.clearSearchButton.CustomTooltipID = 0x2850;
     this.mainBackgroundImage.addControl(this.clearSearchButton);
     this.addPointsData();
     CustomSelfDrawPanel.CSDLabel label = new CustomSelfDrawPanel.CSDLabel {
         Position = new Point((2 * BorderPadding) + this.AvailablePanelWidth, BorderPadding),
         Size = new Size(300, 0x40),
         Text = SK.Text("ManageCandsPanel_Cards_In_Play", "Cards In Play"),
         Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT,
         Font = FontManager.GetFont("Arial", 16f, FontStyle.Bold),
         Color = ARGBColors.White,
         DropShadowColor = ARGBColors.Black
     };
     this.cardTitle = new CustomSelfDrawPanel.CSDLabel();
     this.cardTitle.Position = new Point(0x10, 40);
     this.cardTitle.Size = new Size(600, 0x40);
     this.cardTitle.Text = string.Empty;
     this.cardTitle.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
     this.cardTitle.Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold);
     this.cardTitle.Color = ARGBColors.White;
     this.cardTitle.DropShadowColor = ARGBColors.Black;
     this.mainBackgroundImage.addControl(this.cardTitle);
     this.labelFeedback = new CustomSelfDrawPanel.CSDLabel();
     this.labelFeedback.Position = new Point(0x10, 500);
     this.labelFeedback.Size = new Size(600, 0x40);
     this.labelFeedback.Text = "";
     this.labelFeedback.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
     this.labelFeedback.Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold);
     this.labelFeedback.Color = ARGBColors.White;
     this.labelFeedback.DropShadowColor = ARGBColors.Black;
     this.mainBackgroundImage.addControl(this.labelFeedback);
     this.buttonCash = new CustomSelfDrawPanel.CSDImage();
     this.buttonBonus = new CustomSelfDrawPanel.CSDImage();
     this.buttonCatalog = new CustomSelfDrawPanel.CSDImage();
     this.buttonCash.Image = (Image) GFXLibrary.cardpanel_button_blue_normal;
     this.buttonCash.Size = this.buttonCash.Image.Size;
     this.buttonBonus.Image = (Image) GFXLibrary.cardpanel_button_blue_normal;
     this.buttonBonus.Size = this.buttonBonus.Image.Size;
     this.buttonCatalog.Image = (Image) GFXLibrary.cardpanel_button_blue_normal;
     this.buttonCatalog.Size = this.buttonCash.Image.Size;
     this.buttonCash.Position = new Point((this.AvailablePanel.X + (this.AvailablePanel.Width / 2)) - this.buttonCash.Width, this.cardsButtons.Y + 4);
     this.buttonBonus.Position = new Point(this.buttonCash.X, this.buttonCash.Y);
     this.buttonCatalog.Position = new Point(this.buttonCash.X - this.buttonCash.Width, this.buttonCash.Y);
     this.buttonBonus.setMouseOverDelegate(() => this.buttonBonus.Image = (Image) GFXLibrary.cardpanel_button_blue_over, () => this.buttonBonus.Image = (Image) GFXLibrary.cardpanel_button_blue_normal);
     this.buttonCash.setMouseOverDelegate(() => this.buttonCash.Image = (Image) GFXLibrary.cardpanel_button_blue_over, () => this.buttonCash.Image = (Image) GFXLibrary.cardpanel_button_blue_normal);
     this.buttonCatalog.setMouseOverDelegate(() => this.buttonCatalog.Image = (Image) GFXLibrary.cardpanel_button_blue_over, () => this.buttonCatalog.Image = (Image) GFXLibrary.cardpanel_button_blue_normal);
     this.buttonBonus.Visible = false;
     this.buttonCash.Visible = true;
     this.fastCashIn = Program.mySettings.fastCashIn;
     this.fastCashInCheckBox = new CustomSelfDrawPanel.CSDCheckBox();
     this.fastCashInCheckBox.CheckedImage = (Image) GFXLibrary.reports_checkbox_checked;
     this.fastCashInCheckBox.UncheckedImage = (Image) GFXLibrary.reports_checkbox_empty;
     this.fastCashInCheckBox.Position = new Point(this.AvailablePanel.X + 590, this.cardsButtons.Y + 160);
     this.fastCashInCheckBox.Checked = this.fastCashIn;
     this.fastCashInCheckBox.CBLabel.Text = SK.Text("ManageCards_multicashin", "Multi-Cash In");
     this.fastCashInCheckBox.CBLabel.Color = ARGBColors.Black;
     this.fastCashInCheckBox.CBLabel.Position = new Point(20, -1);
     this.fastCashInCheckBox.CBLabel.Size = new Size(250, 0x19);
     this.fastCashInCheckBox.CBLabel.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     this.fastCashInCheckBox.setCheckChangedDelegate(delegate {
         Program.mySettings.fastCashIn = this.fastCashIn = this.fastCashInCheckBox.Checked;
         this.RefreshSet();
     });
     this.mainBackgroundImage.addControl(this.fastCashInCheckBox);
     this.buyAndPlayCheckBox = new CustomSelfDrawPanel.CSDCheckBox();
     this.buyAndPlayCheckBox.CheckedImage = (Image) GFXLibrary.reports_checkbox_checked;
     this.buyAndPlayCheckBox.UncheckedImage = (Image) GFXLibrary.reports_checkbox_empty;
     this.buyAndPlayCheckBox.Position = new Point(this.AvailablePanel.X + 100, this.cardsButtons.Y + 0x5c);
     this.buyAndPlayCheckBox.Checked = false;
     this.buyAndPlayCheckBox.Visible = false;
     this.buyAndPlayCheckBox.CBLabel.Text = SK.Text("ManageCards_buyAndPlay", "Play Card Immediately");
     this.buyAndPlayCheckBox.CBLabel.Color = ARGBColors.Black;
     this.buyAndPlayCheckBox.CBLabel.Position = new Point(20, -1);
     this.buyAndPlayCheckBox.CBLabel.Size = new Size(250, 0x19);
     this.buyAndPlayCheckBox.CBLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold);
     this.buyAndPlayCheckBox.setCheckChangedDelegate(new CustomSelfDrawPanel.CSDCheckBox.CSD_CheckChangedDelegate(this.buyAndPlayCheckChanged));
     this.mainBackgroundImage.addControl(this.buyAndPlayCheckBox);
     CustomSelfDrawPanel.CSDLabel label2 = new CustomSelfDrawPanel.CSDLabel {
         Position = new Point(0, -2),
         Size = this.buttonCash.Size,
         Text = SK.Text("ManageCandsPanel_Cash_In", "Cash In"),
         Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER,
         Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular),
         Color = ARGBColors.Black
     };
     this.buttonCash.addControl(label2);
     CustomSelfDrawPanel.CSDLabel label3 = new CustomSelfDrawPanel.CSDLabel {
         Position = new Point(0, -2),
         Size = this.buttonCash.Size,
         Text = SK.Text("ManageCandsPanel_Cash_In", "Cash In"),
         Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER,
         Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular),
         Color = ARGBColors.Black
     };
     this.buttonBonus.addControl(label3);
     this.labelBuyCash = new CustomSelfDrawPanel.CSDLabel();
     this.labelBuyCash.Position = new Point(0, -2);
     this.labelBuyCash.Size = this.buttonCash.Size;
     this.labelBuyCash.Text = SK.Text("ManageCandsPanel_Get_Cards", "Get Cards");
     this.labelBuyCash.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER;
     this.labelBuyCash.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular);
     this.labelBuyCash.Color = ARGBColors.Black;
     this.LabelClickToRemove = new CustomSelfDrawPanel.CSDLabel();
     this.LabelClickToRemove.Position = new Point(this.AvailablePanel.X, this.cardsButtons.Y);
     this.LabelClickToRemove.Size = new Size(600, 0x12);
     this.LabelClickToRemove.Text = "";
     this.LabelClickToRemove.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
     this.LabelClickToRemove.Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold);
     this.LabelClickToRemove.Color = ARGBColors.Black;
     this.mainBackgroundImage.addControl(this.LabelClickToRemove);
     this.buttonCatalog.addControl(this.labelBuyCash);
     this.buttonCatalog.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.SwitchToBuy), "ManageCardsPanel_switch_to_buy_cards");
     if (GameEngine.Instance.World.ProfileCardsSet.Count < 5)
     {
         this.buttonCash.Colorise = ARGBColors.Gray;
         this.buttonCash.setMouseOverDelegate(null, null);
         this.buttonCash.setClickDelegate(null);
     }
     else
     {
         this.buttonCash.Colorise = ARGBColors.White;
         if (overDelegate == null)
         {
             overDelegate = () => this.buttonCash.Image = (Image) GFXLibrary.cardpanel_button_blue_over;
         }
         if (leaveDelegate == null)
         {
             leaveDelegate = () => this.buttonCash.Image = (Image) GFXLibrary.cardpanel_button_blue_normal;
         }
         this.buttonCash.setMouseOverDelegate(overDelegate, leaveDelegate);
         this.buttonCash.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.CashClick), "ManageCardsPanel_switch_to_cash_in");
     }
     this.LayoutPanelMode = this.PanelMode = PANEL_MODE_CASH;
     CardTypes.CardDefinition filter = new CardTypes.CardDefinition();
     GameEngine.Instance.World.searchProfileCards(filter, "", ((PlayCardsWindow) base.ParentForm).getNameSearchText());
     ((PlayCardsWindow) base.ParentForm).tbSearchBox.Visible = false;
     this.ResizeAvailable(0x177);
     this.GetCardsAvailable(false);
     this.RenderCards(this.UICardList);
     this.InitEmptyCards();
     this.RefreshSet();
     this.InitDynamicPanel();
     this.CatalogFilterDefinition.cardCategory = 0;
     this.CatalogFilterDefinition.cardColour = 0;
     this.InitCatalog();
     CustomSelfDrawPanel.CSDControl control = new CustomSelfDrawPanel.CSDControl {
         Position = new Point(0, 0),
         Size = base.Size
     };
     this.mainBackgroundImage.addControl(control);
     this.mainBackgroundImage.setMouseWheelDelegate(new CustomSelfDrawPanel.CSDControl.CSD_MouseWheelDelegate(this.mouseWheelHandler));
     this.InitFilters();
     this.InitTabs();
     this.mainBackgroundImage.invalidate();
     GameEngine.shiftPressedAlways = false;
 }