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 static void addRewardIcons(CustomSelfDrawPanel.CSDControl parentControl, Point baseLocation, NewQuests.NewQuestDefinition def, int gloryMode) { if (def != null) { CustomSelfDrawPanel.CSDLabel control = null; if (gloryMode > 0) { control = new CustomSelfDrawPanel.CSDLabel { Color = ARGBColors.Black, Position = baseLocation, Size = new Size(110, GFXLibrary.quest_rewards[0].Height), Font = FontManager.GetFont("Arial", 11f, FontStyle.Bold), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT }; parentControl.addControl(control); baseLocation.X += 100; } int num = 0; if ((def.reward_charges.Length > 0) && (gloryMode == 1)) { parentControl.addControl(createRewardIcon(9, -1, new Point(baseLocation.X, baseLocation.Y + 2), 0xc8c)); baseLocation.X += 60; num++; if (((def.getRewardGlory() > 0) && (gloryMode != 0)) && ((GameEngine.Instance.LocalWorldData.Alternate_Ruleset != 1) && (gloryMode > 0))) { CustomSelfDrawPanel.CSDLabel label2 = new CustomSelfDrawPanel.CSDLabel { Text = "+", Color = ARGBColors.Black, Position = new Point((baseLocation.X - 0x12) - 2, (baseLocation.Y + 12) - 2), Size = new Size(50, 30), Font = FontManager.GetFont("Arial", 14f, FontStyle.Bold), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER }; parentControl.addControl(label2); baseLocation.X += 30; } } if (gloryMode >= 0) { if (def.reward_honour > 0) { parentControl.addControl(createRewardIcon(1, def.reward_honour, baseLocation, 0xc83)); baseLocation.X += 120; num++; } if (def.reward_gold > 0) { parentControl.addControl(createRewardIcon(2, def.reward_gold, baseLocation, 0xc84)); baseLocation.X += 120; num++; } if (def.reward_wood > 0) { parentControl.addControl(createRewardIcon(3, def.reward_wood, baseLocation, 0xc85)); baseLocation.X += 120; num++; } if (def.reward_stone > 0) { parentControl.addControl(createRewardIcon(4, def.reward_stone, baseLocation, 0xc86)); baseLocation.X += 120; num++; } if (def.reward_apples > 0) { parentControl.addControl(createRewardIcon(12, def.reward_apples, baseLocation, 0xc8e)); baseLocation.X += 120; num++; } if (def.reward_card_pack > 0) { parentControl.addControl(createRewardIcon(6, def.reward_card_pack, baseLocation, 0xc88)); baseLocation.X += 120; num++; } if (def.reward_2day_premium > 0) { parentControl.addControl(createRewardIcon(7, def.reward_2day_premium, baseLocation, 0xc89)); baseLocation.X += 120; num++; } if (def.reward_faithpoints > 0) { parentControl.addControl(createRewardIcon(8, def.reward_faithpoints, baseLocation, 0xc8a)); baseLocation.X += 120; num++; } if (def.reward_tickets > 0) { parentControl.addControl(createRewardIcon(10, def.reward_tickets, baseLocation, 0xc8d)); baseLocation.X += 120; num++; } } if (((def.getRewardGlory() > 0) && (gloryMode != 0)) && (GameEngine.Instance.LocalWorldData.Alternate_Ruleset != 1)) { if (gloryMode > 0) { CustomSelfDrawPanel.CSDLabel label3 = new CustomSelfDrawPanel.CSDLabel { Text = SK.Text("QUESTS_or", "Or"), Color = ARGBColors.Black, Position = new Point(baseLocation.X, baseLocation.Y + 12), Size = new Size(50, 30), Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER }; parentControl.addControl(label3); baseLocation.X += 50; } parentControl.addControl(createRewardIcon(0, def.getRewardGlory(), baseLocation, 0xc8b)); baseLocation.X += 120; num++; } if (control != null) { if (num == 1) { control.Text = SK.Text("QUEST_Reward", "Reward"); } else { control.Text = SK.Text("QUEST_Rewards", "Rewards"); } } } }
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(); }
public void init(int villageID, bool reset) { NumberFormatInfo nFI; int scoutResourceCarryLevel; Color white = ARGBColors.White; Color black = ARGBColors.Black; Color color1 = ARGBColors.White; this.m_selectedVillage = villageID; this.m_ownVillage = InterfaceMgr.Instance.OwnSelectedVillage; base.clearControls(); int y = 0x27; this.mainBackgroundImage.Image = (Image) GFXLibrary.body_background_canvas; this.mainBackgroundImage.ClipRect = new Rectangle(new Point(), base.Size); this.mainBackgroundImage.Position = new Point(0, y); this.mainBackgroundImage.Size = new Size(base.Size.Width, base.Size.Height - y); this.mainBackgroundImage.Tile = true; base.addControl(this.mainBackgroundImage); this.backgroundBottomEdge.Image = (Image) GFXLibrary.popup_border_bottom; this.backgroundBottomEdge.Position = new Point(0, base.Height - 2); base.addControl(this.backgroundBottomEdge); this.backgroundRightEdge.Image = (Image) GFXLibrary.popup_border_rhs; this.backgroundRightEdge.Position = new Point(base.Width - 2, y); base.addControl(this.backgroundRightEdge); this.cardbar.Position = new Point(0, 4); this.mainBackgroundImage.addControl(this.cardbar); this.cardbar.init(7); this.gfxImage.Image = (Image) GFXLibrary.scout_screen_illustration_01; this.gfxImage.Position = new Point(20, 0x47); this.mainBackgroundImage.addControl(this.gfxImage); this.sliderImage.Position = new Point(0x2c, 0x11c); this.sliderImage.Margin = new Rectangle(0x20, 0x3f, 0x20, 0x19); this.sliderImage.Value = 0; this.sliderImage.Max = 0; this.sliderImage.setValueChangeDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ValueChangedDelegate(this.tracksMoved)); this.mainBackgroundImage.addControl(this.sliderImage); this.sliderImage.Create((Image) GFXLibrary.scout_screen_slider, (Image) GFXLibrary.scout_screen_slider_bar, (Image) GFXLibrary.scout_screen_slider_bar, (Image) GFXLibrary.scout_screen_slider_bar, (Image) GFXLibrary.scout_screen_slider_bar, (Image) GFXLibrary.scout_screen_slider_bar); this.arrowImage.Image = (Image) GFXLibrary.scout_screen_arrowbox; this.arrowImage.Position = new Point(0xee, 0x11c); this.mainBackgroundImage.addControl(this.arrowImage); this.scoutingLabel.Text = SK.Text("ScoutPopup_Scouting_Target", "Scouting") + " '" + GameEngine.Instance.World.getVillageNameOrType(villageID) + "'"; this.scoutingLabel.Color = white; this.scoutingLabel.DropShadowColor = black; this.scoutingLabel.Position = new Point(0, 0xf3); this.scoutingLabel.Size = new Size(700, 30); this.scoutingLabel.Font = FontManager.GetFont("Arial", 16f, FontStyle.Regular); this.scoutingLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER; this.mainBackgroundImage.addControl(this.scoutingLabel); if (AttackTargetsPanel.isFavourite(this.m_selectedVillage)) { this.targetVillageFavourite.ImageNorm = (Image) GFXLibrary.star_market_1; this.targetVillageFavourite.CustomTooltipID = 0x83b; } else { this.targetVillageFavourite.ImageNorm = (Image) GFXLibrary.star_market_3; this.targetVillageFavourite.CustomTooltipID = 0x7e2; } this.targetVillageFavourite.OverBrighten = true; this.targetVillageFavourite.Position = new Point(650, 0xf4); this.targetVillageFavourite.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.villageFavouriteClicked)); this.targetVillageFavourite.Data = 0; this.mainBackgroundImage.addControl(this.targetVillageFavourite); this.numLabel.Text = ""; this.numLabel.Color = white; this.numLabel.DropShadowColor = black; this.numLabel.Position = new Point(0x3f, 0x17); this.numLabel.Size = new Size(0x3b, 0x18); this.numLabel.Font = FontManager.GetFont("Arial", 18f, FontStyle.Regular); this.numLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; this.sliderImage.addControl(this.numLabel); this.timeLabel.Text = "00:00:00"; this.timeLabel.Color = white; this.timeLabel.DropShadowColor = black; this.timeLabel.Position = new Point(-28, 0x17); this.timeLabel.Size = new Size(0xbf, 0x18); this.timeLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Regular); this.timeLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; this.arrowImage.addControl(this.timeLabel); int index = 0; int type = GameEngine.Instance.World.getSpecial(villageID); switch (type) { case 3: case 4: index = 0x18; break; case 5: case 6: index = 0x19; break; case 7: case 8: case 9: case 10: case 11: case 12: case 13: case 14: index = 0x1c; break; case 15: case 0x10: case 0x11: case 0x12: index = 0x35; break; case 40: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: case 0x2f: case 0x30: case 0x31: case 50: index = 0x36; break; case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: case 0x3a: case 0x3b: case 60: index = 0x37; break; case 0x3d: case 0x3e: case 0x3f: case 0x40: case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 70: index = 0x38; break; case 0x47: case 0x48: case 0x49: case 0x4a: case 0x4b: case 0x4c: case 0x4d: case 0x4e: case 0x4f: case 80: index = 0x39; break; case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: case 0x58: case 0x59: case 90: index = 0x3a; break; case 100: if (HolidayPeriods.xmas(VillageMap.getCurrentServerTime())) { index = 0x3b; } else { index = 0x1d; } break; case 0x6a: index = 30; break; case 0x6b: index = 0x1f; break; case 0x6c: index = 0x21; break; case 0x6d: index = 0x20; break; case 0x70: index = 0x22; break; case 0x71: index = 0x23; break; case 0x72: index = 0x24; break; case 0x73: index = 0x29; break; case 0x74: index = 0x25; break; case 0x75: index = 40; break; case 0x76: index = 0x2a; break; case 0x77: index = 0x2d; break; case 0x79: index = 0x2c; break; case 0x7a: index = 0x26; break; case 0x7b: index = 0x2b; break; case 0x7c: index = 0x2e; break; case 0x7d: index = 0x2f; break; case 0x7e: index = 0x30; break; case 0x80: index = 0x3d; break; case 0x81: index = 60; break; case 130: index = 0x3e; break; case 0x83: index = 0x3f; break; case 0x84: index = 0x40; break; case 0x85: index = 0x27; break; default: if (GameEngine.Instance.World.isRegionCapital(villageID)) { index = 0x31; } else if (GameEngine.Instance.World.isCountyCapital(villageID)) { index = 50; } else if (GameEngine.Instance.World.isProvinceCapital(villageID)) { index = 0x33; } else if (GameEngine.Instance.World.isCountryCapital(villageID)) { index = 0x34; } else { index = GameEngine.Instance.World.getVillageSize(villageID); } break; } switch (type) { case 0x6a: case 0x6b: case 0x6c: case 0x6d: case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x80: case 0x81: case 130: case 0x83: case 0x84: case 0x85: { WorldMap.SpecialVillageCache cache = GameEngine.Instance.World.getSpecialVillageData(villageID, false); if (cache == null) { goto Label_0B37; } nFI = GameEngine.NFI; CustomSelfDrawPanel.CSDLabel control = new CustomSelfDrawPanel.CSDLabel { Text = cache.resourceLevel.ToString("N", nFI), Position = new Point(0x9e, 0x55), Size = new Size(150, 20), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER, Color = white, DropShadowColor = black, Font = FontManager.GetFont("Arial", 12f, FontStyle.Regular) }; this.arrowImage.addControl(control); scoutResourceCarryLevel = GameEngine.Instance.LocalWorldData.ScoutResourceCarryLevel; int num5 = GameEngine.Instance.World.UserResearchData.Research_Foraging; scoutResourceCarryLevel = (CardTypes.adjustForagingLevel(GameEngine.Instance.World.UserCardData, scoutResourceCarryLevel) * ResearchData.foragingResearch[num5]) / 2; switch (type) { case 0x77: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x80: case 0x81: case 130: case 0x83: case 0x84: case 0x85: scoutResourceCarryLevel /= 10; goto Label_0A92; } break; } default: goto Label_0B37; } Label_0A92: this.m_carryLevel = scoutResourceCarryLevel; this.scoutCarryingLabel.Text = this.m_carryLevel.ToString("N", nFI); this.scoutCarryingLabel.Position = new Point(0, 90); this.scoutCarryingLabel.Size = new Size(this.sliderImage.Width, 20); this.scoutCarryingLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; this.scoutCarryingLabel.Color = white; this.scoutCarryingLabel.DropShadowColor = black; this.scoutCarryingLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Regular); this.sliderImage.addControl(this.scoutCarryingLabel); Label_0B37: this.targetImage.Image = (Image) GFXLibrary.scout_screen_icons[index]; this.targetImage.Position = new Point(0xb5, 5); this.arrowImage.addControl(this.targetImage); WorldData localWorldData = GameEngine.Instance.LocalWorldData; Point point = GameEngine.Instance.World.getVillageLocation(InterfaceMgr.Instance.OwnSelectedVillage); Point point2 = GameEngine.Instance.World.getVillageLocation(villageID); int x = point.X; int num7 = point.Y; int num8 = point2.X; int num9 = point2.Y; double d = ((x - num8) * (x - num8)) + ((num7 - num9) * (num7 - num9)); d = Math.Sqrt(d) * ((localWorldData.ScoutsMoveSpeed * localWorldData.gamePlaySpeed) * ResearchData.ScoutTimes[GameEngine.Instance.World.UserResearchData.Research_Horsemanship]); this.storedPreCardDistance = d; d *= CardTypes.getScoutSpeed(GameEngine.Instance.World.UserCardData); string str = VillageMap.createBuildTimeString((int) d); this.timeLabel.Text = str; this.timeLabel.CustomTooltipID = 0x4e20; this.timeLabel.CustomTooltipData = (int) d; this.launchButton.ImageNorm = (Image) GFXLibrary.button_with_inset_normal; this.launchButton.ImageOver = (Image) GFXLibrary.button_with_inset_over; this.launchButton.ImageClick = (Image) GFXLibrary.button_with_inset_pushed; this.launchButton.Position = new Point(520, 0x144); this.launchButton.Text.Text = SK.Text("ScoutPopup_Go", "Go"); this.launchButton.Text.Font = FontManager.GetFont("Arial", 16f, FontStyle.Regular); this.launchButton.TextYOffset = 1; this.launchButton.Text.Color = ARGBColors.Black; this.launchButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.launch), "ScoutPopupPanel_launch"); this.launchButton.Enabled = false; this.mainBackgroundImage.addControl(this.launchButton); this.scoutHonourLabel.Text = ""; this.scoutHonourLabel.Color = white; this.scoutHonourLabel.DropShadowColor = black; this.scoutHonourLabel.Position = new Point(0, 410); this.scoutHonourLabel.Size = new Size(700, 30); this.scoutHonourLabel.Font = FontManager.GetFont("Arial", 11f, FontStyle.Regular); this.scoutHonourLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER; this.scoutHonourLabel.Visible = false; this.mainBackgroundImage.addControl(this.scoutHonourLabel); if ((type >= 100) && (type <= 0xc7)) { this.scoutHonourLabel.Text = SK.Text("ScoutPopup_No_Honour_Stash_Out_Of_Range", "No Honour will be received, the stash is out of range."); } else if (type == 5) { this.scoutHonourLabel.Text = SK.Text("ScoutPopup_No_Honour_Wolf_Lair_Out_Of_Range", "No Honour will be received, the Wolf Lair is out of range."); } else if (type == 3) { this.scoutHonourLabel.Text = SK.Text("ScoutPopup_No_Honour_Bandit_Camp_Out_Of_Range", "No Honour will be received, the Bandit Camp is out of range."); } else if (((type == 7) || (type == 9)) || ((type == 11) || (type == 13))) { this.scoutHonourLabel.Text = SK.Text("ScoutPopup_No_Honour_AI_castle_Out_Of_Range", "No Honour will be received, the AI Castle is out of range."); } else if (((type == 15) || (type == 0x11)) || SpecialVillageTypes.IS_TREASURE_CASTLE(type)) { this.scoutHonourLabel.Text = SK.Text("LaunchAttackPopup_Paladin_No_Honour", "No honour will be received for destroying this type of AI castle"); } else { this.scoutHonourLabel.Text = SK.Text("ScoutPopup_No_Honour_Village_Out_Of_Range", "No Honour will be received, the village is out of range."); } this.scoutHonourLabel.Visible = GameEngine.Instance.World.isScoutHonourOutOfRange(InterfaceMgr.Instance.OwnSelectedVillage, villageID) && ((type <= 100) || (type > 0xc7)); this.titleImage.Image = (Image) GFXLibrary.popup_title_bar; this.titleImage.Position = new Point(0, 0); base.addControl(this.titleImage); this.titleLabel.Text = SK.Text("OwnVillagePanel_Send_Out_Scouts", "Send Out Scouts"); this.titleLabel.Color = Color.FromArgb(0xff, 0xff, 0xff); this.titleLabel.DropShadowColor = black; this.titleLabel.Position = new Point(20, 5); this.titleLabel.Size = new Size(base.Width, 0x20); this.titleLabel.Font = FontManager.GetFont("Arial", 18f, FontStyle.Bold); this.titleLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT; this.titleImage.addControl(this.titleLabel); this.closeButton.ImageNorm = (Image) GFXLibrary.int_button_close_normal; this.closeButton.ImageOver = (Image) GFXLibrary.int_button_close_over; this.closeButton.ImageClick = (Image) GFXLibrary.int_button_close_in; this.closeButton.Position = new Point(0x293, 5); this.closeButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.closeClick), "ScoutPopupPanel_close"); this.titleImage.addControl(this.closeButton); CustomSelfDrawPanel.WikiLinkControl.init(this.titleImage, 0x22, new Point(0x261, 5)); if (GameEngine.Instance.getVillage(this.m_ownVillage) != null) { this.onVillageLoadUpdate(this.m_ownVillage, true); } else { GameEngine.Instance.downloadCurrentVillage(); } }
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("&", "&"); 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(); }
private void GetCardsAvailable(bool redosearch) { if (redosearch) { GameEngine.Instance.World.searchProfileCardsRedoLast(); } Dictionary<int, int> dictionary = new Dictionary<int, int>(); foreach (int num in GameEngine.Instance.World.ProfileCardsSearch) { int id = GameEngine.Instance.World.ProfileCards[num].id; if (dictionary.ContainsKey(id)) { Dictionary<int, int> dictionary2; int num7; (dictionary2 = dictionary)[num7 = id] = dictionary2[num7] + 1; } else { dictionary.Add(id, 1); } } foreach (CustomSelfDrawPanel.UICard card in this.UICardList) { card.clearControls(); if (card.Parent != null) { card.Parent.removeControl(card); } } this.UICardList.Clear(); int num3 = GameEngine.Instance.World.getRank() + 1; foreach (int num4 in GameEngine.Instance.World.ProfileCardsSearch) { int key = GameEngine.Instance.World.ProfileCards[num4].id; try { if (dictionary.ContainsKey(key)) { CustomSelfDrawPanel.UICard item = new CustomSelfDrawPanel.UICard { cardCount = dictionary[key], UserID = num4 }; item.UserIDList.Add(num4); item.Definition = GameEngine.Instance.World.ProfileCards[num4]; switch (item.Definition.cardColour) { case 1: item.bigFrame = GFXLibrary.BlueCardOverlayBig; item.bigFrameOver = GFXLibrary.BlueCardOverlayBigOver; break; case 2: item.bigFrame = GFXLibrary.GreenCardOverlayBig; item.bigFrameOver = GFXLibrary.GreenCardOverlayBigOver; break; case 3: item.bigFrame = GFXLibrary.PurpleCardOverlayBig; item.bigFrameOver = GFXLibrary.PurpleCardOverlayBigOver; break; case 4: item.bigFrame = GFXLibrary.RedCardOverlayBig; item.bigFrameOver = GFXLibrary.RedCardOverlayBigOver; break; case 5: item.bigFrame = GFXLibrary.YellowCardOverlayBig; item.bigFrameOver = GFXLibrary.YellowCardOverlayBigOver; break; } item.bigImage = GFXLibrary.Instance.getCardImageBig(item.Definition.id); item.Size = item.bigFrame.Size; item.CustomTooltipID = 0x2775; item.CustomTooltipData = item.Definition.id; item.bigGradeImage = new CustomSelfDrawPanel.CSDImage(); int num6 = CardTypes.getGrade(item.Definition.cardGrade); switch (num6) { case 0x10000: item.bigGradeImage.Image = (Image) GFXLibrary.CardGradeBronze; item.bigGradeImage.Position = new Point(item.Width - item.bigGradeImage.Width, 0); break; case 0x20000: item.bigGradeImage.Image = (Image) GFXLibrary.CardGradeSilver; item.bigGradeImage.Position = new Point(item.Width - item.bigGradeImage.Width, 0); break; case 0x40000: item.bigGradeImage.Image = (Image) GFXLibrary.card_gold_anim[0]; item.bigGradeImage.Position = new Point((item.Width - item.bigGradeImage.Width) - 3, 0); break; case 0x200000: item.bigGradeImage.Image = (Image) GFXLibrary.card_diamond3_anim[0]; item.bigGradeImage.Position = new Point((item.Width - item.bigGradeImage.Width) - 3, -10); break; case 0x400000: item.bigGradeImage.Image = (Image) GFXLibrary.card_sapphire_anim[0]; item.bigGradeImage.Position = new Point((item.Width - item.bigGradeImage.Width) - 3, -12); break; case 0x80000: item.bigGradeImage.Image = (Image) GFXLibrary.card_diamond_anim[0]; item.bigGradeImage.Position = new Point((item.Width - item.bigGradeImage.Width) - 3, -2); break; case 0x100000: item.bigGradeImage.Image = (Image) GFXLibrary.card_diamond2_anim[0]; item.bigGradeImage.Position = new Point((item.Width - item.bigGradeImage.Width) - 3, -7); break; default: item.bigGradeImage.Image = (Image) GFXLibrary.CardGradeBronze; item.bigGradeImage.Position = new Point(item.Width - item.bigGradeImage.Width, 0); break; } item.bigBaseImage = new CustomSelfDrawPanel.CSDImage(); item.bigBaseImage.Position = new Point(10, 11); item.bigBaseImage.Size = item.bigImage.Size; item.bigBaseImage.Image = (Image) item.bigImage; item.addControl(item.bigBaseImage); item.bigFrameImage = new CustomSelfDrawPanel.CSDImage(); item.bigFrameImage.Position = new Point(0, 0); item.bigFrameImage.Size = item.bigFrame.Size; item.bigFrameImage.Image = (Image) item.bigFrame; item.addControl(item.bigFrameImage); switch (num6) { case 0x40000: item.bigFrameExtraImage = new CustomSelfDrawPanel.CSDImage(); item.bigFrameExtraImage.Position = new Point(0, 0); item.bigFrameExtraImage.Image = (Image) GFXLibrary.card_frame_overlay_gold; item.addControl(item.bigFrameExtraImage); break; case 0x80000: case 0x100000: case 0x200000: item.bigFrameExtraImage = new CustomSelfDrawPanel.CSDImage(); item.bigFrameExtraImage.Position = new Point(0, 0); item.bigFrameExtraImage.Image = (Image) GFXLibrary.card_frame_overlay_diamond; item.addControl(item.bigFrameExtraImage); break; case 0x400000: item.bigFrameExtraImage = new CustomSelfDrawPanel.CSDImage(); item.bigFrameExtraImage.Position = new Point(0, 0); item.bigFrameExtraImage.Image = (Image) GFXLibrary.card_frame_overlay_sapphire; item.addControl(item.bigFrameExtraImage); break; } item.bigGradeImage.Size = item.bigGradeImage.Image.Size; item.addControl(item.bigGradeImage); item.bigTitle = new CustomSelfDrawPanel.CSDLabel(); item.bigTitle.Text = CardTypes.getDescriptionFromCard(item.Definition.id); item.bigTitle.Size = new Size(110, 0x30); item.bigTitle.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT; if (((((item.Definition.id == 0x709) || (item.Definition.id == 0x606)) || ((item.Definition.id == 0xc41) || (item.Definition.id == 0x50a))) || ((item.Definition.id == 0x605) || (item.Definition.id == 0x607))) && (Program.mySettings.LanguageIdent == "de")) { item.bigTitle.Font = FontManager.GetFont("Arial", 8f, FontStyle.Bold); } else { item.bigTitle.Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold); } item.bigTitle.Color = ARGBColors.White; item.bigTitle.DropShadowColor = ARGBColors.Black; item.bigTitle.Position = new Point(0x26, 12); item.addControl(item.bigTitle); item.bigEffect = new CustomSelfDrawPanel.CSDLabel(); item.bigEffect.Text = item.Definition.EffectText; item.bigEffect.Size = new Size(150, 0x40); item.bigEffect.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT; item.bigEffect.Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold); if ((Program.mySettings.LanguageIdent == "de") && CardTypes.isGermanSmallDesc(item.Definition.id)) { item.bigEffect.Font = FontManager.GetFont("Arial", 8f, FontStyle.Bold); } item.bigEffect.Color = ARGBColors.White; item.bigEffect.DropShadowColor = ARGBColors.Black; item.bigEffect.Position = new Point(14, 0xae); item.addControl(item.bigEffect); CustomSelfDrawPanel.CSDLabel control = new CustomSelfDrawPanel.CSDLabel { Position = new Point(2, 2), Size = new Size(item.Width, item.Height), Text = "", Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT, Font = FontManager.GetFont("Arial", 18f, FontStyle.Bold), Color = ARGBColors.Yellow, DropShadowColor = ARGBColors.Black }; item.addControl(control); item.countLabel = control; if (num3 < item.Definition.cardRank) { Color red = ARGBColors.Red; } else { Color white = ARGBColors.White; } CustomSelfDrawPanel.CSDLabel label2 = new CustomSelfDrawPanel.CSDLabel { Position = new Point(150, 220), Size = new Size(20, 13), Text = item.Definition.cardRank.ToString(), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER, Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold), Color = ARGBColors.White, DropShadowColor = ARGBColors.Black }; item.addControl(label2); item.rankLabel = label2; item.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.cardClickPlay)); item.ScaleAll(0.95); this.UICardList.Add(item); dictionary.Remove(key); if (num3 < item.Definition.cardRank) { item.Hilight(ARGBColors.Gray); } else { item.Hilight(ARGBColors.White); } continue; } foreach (CustomSelfDrawPanel.UICard card3 in this.UICardList) { if (card3.Definition.id == key) { card3.UserIDList.Add(num4); continue; } } } catch (Exception exception) { UniversalDebugLog.Log("EXCEPTION " + exception.ToString()); } } GFXLibrary.Instance.closeBigCardsLoader(); }
public void BuildOnlineWorldList(List<WorldInfo> list) { this.loggedInWorldControls.Clear(); this.wallScrollArea.clearControls(); if (list.Count > 0) { DateTime time = new DateTime(0x7de, 2, 20, 0, 0, 0); bool playing = list[0].Playing; int y = 0; int height = 0; for (int i = 0; i < list.Count; i++) { CustomSelfDrawPanel.CSDLabel item = new CustomSelfDrawPanel.CSDLabel(); CustomSelfDrawPanel.CSDImage image = new CustomSelfDrawPanel.CSDImage(); CustomSelfDrawPanel.CSDImage image2 = new CustomSelfDrawPanel.CSDImage(); CustomSelfDrawPanel.CSDLabel label2 = new CustomSelfDrawPanel.CSDLabel(); CustomSelfDrawPanel.CSDImage image3 = new CustomSelfDrawPanel.CSDImage(); CustomSelfDrawPanel.CSDImage image4 = new CustomSelfDrawPanel.CSDImage(); if (list[i].Playing != playing) { playing = list[i].Playing; y += 20; } if ((i & 1) == 0) { image3.Image = (Image) GFXLibrary.lineitem_strip_02_dark; } else { image3.Image = (Image) GFXLibrary.lineitem_strip_02_light; } image3.Position = new Point(0, y); this.loggedInWorldControls.Add(image3); height = y + 40; image.Y = y + 7; image2.Y = y + 4; item.Y = y + 9; label2.Y = y + 9; item.Width = 0x90; item.Height = this.worldControlHeight; label2.Width = 0x69; label2.Height = this.worldControlHeight; item.Text = ProfileLoginWindow.getWorldShortDesc(list[i]); image.Image = (Image) GFXLibrary.getLoginWorldFlag(list[i].Supportculture); image.Width = image.Image.Width; image.Height = image.Image.Height; image2.Image = (Image) GFXLibrary.getLoginWorldMap(list[i].MapCulture); image2.Width = image2.Image.Width; image2.Height = image2.Image.Height; switch (list[i].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[i].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; } item.X = 0x18; image.X = (((((item.X - 20) - 0x39) + item.Width) + 8) + 0x4b) + 30; image2.X = ((image.X + image.Width) + 8) + 0x4b; label2.X = (((image2.X + image2.Width) + 8) + 0x4b) - 40; if (list[i].ShortDesc.Contains("****")) { image4.Image = (Image) GFXLibrary.age_fifth_age_28x16; image4.Position = new Point(image.X - 80, (y + 7) - 5); image4.CustomTooltipID = 0xfc7; this.loggedInWorldControls.Add(image4); } else if (list[i].ShortDesc.Contains("***")) { image4.Image = (Image) GFXLibrary.age_fourth_age_28x16; image4.Position = new Point(image.X - 80, (y + 7) - 5); image4.CustomTooltipID = 0xfc2; this.loggedInWorldControls.Add(image4); } else if (list[i].ShortDesc.Contains("**")) { image4.Image = (Image) GFXLibrary.age_third_age_28x16; image4.Position = new Point(image.X - 80, (y + 7) - 5); image4.CustomTooltipID = 0xfba; this.loggedInWorldControls.Add(image4); } else if (list[i].ShortDesc.Contains("*")) { image4.Image = (Image) GFXLibrary.age_second_age_28x16; image4.Position = new Point(image.X - 80, (y + 7) - 5); image4.CustomTooltipID = 0xfb3; this.loggedInWorldControls.Add(image4); } else if (!ProfileLoginWindow.isAIWorld(list[i].KingdomsWorldID) && !ProfileLoginWindow.isSpecialWorld(list[i].KingdomsWorldID)) { image4.Image = (Image) GFXLibrary.age_first_age_28x16; image4.Position = new Point(image.X - 80, (y + 7) - 5); image4.CustomTooltipID = 0xfc6; this.loggedInWorldControls.Add(image4); } if (list[i].Online) { label2.Text = this.strOnline; label2.Color = ARGBColors.Green; CustomSelfDrawPanel.CSDButton button = new CustomSelfDrawPanel.CSDButton { Width = this.worldControlWidth, Height = this.worldControlHeight, Y = y + 5, Tag = list[i] }; button.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.btnWorldAction_Click), "WorldSelectPopupPanel_world_select"); if (list[i].Playing) { button.ImageNorm = this.PlayImage; button.ImageOver = this.PlayImageOver; } else if (list[i].AvailableToJoin) { button.ImageNorm = this.JoinImage; button.ImageOver = this.JoinImageOver; } else { button.ImageNorm = this.ClosedImage; button.ImageOver = this.ClosedImage; button.setClickDelegate(null); button.Active = false; } button.Width = button.ImageNorm.Width; button.Height = button.ImageNorm.Height; button.X = 0x254 - button.Width; this.loggedInWorldControls.Add(button); if (button.Active) { CustomSelfDrawPanel.CSDButton button2 = new CustomSelfDrawPanel.CSDButton { ImageNorm = (Image) GFXLibrary.help_normal, ImageOver = (Image) GFXLibrary.help_over, ImageClick = (Image) GFXLibrary.help_pushed, Position = new Point(0x260, y + 8), Data = list[i].KingdomsWorldID }; button2.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.infoOverlayOpenedClick)); this.loggedInWorldControls.Add(button2); } label2.CustomTooltipID = 0xfaa; } else { if ((list[i].KingdomsWorldID == 0x9c4) && (DateTime.UtcNow > time)) { label2.Text = this.strWorldEnded; label2.Width = 300; } else { label2.Text = this.strOffline; label2.Color = ARGBColors.Red; } label2.CustomTooltipID = 0xfa9; } if (showSpecialWorlds <= 0) { this.loggedInWorldControls.Add(image); } this.loggedInWorldControls.Add(image2); this.loggedInWorldControls.Add(item); this.loggedInWorldControls.Add(label2); y += 40; } foreach (CustomSelfDrawPanel.CSDControl control in this.loggedInWorldControls) { this.wallScrollArea.addControl(control); } this.wallScrollArea.Size = new Size(this.wallScrollArea.Width, height); if (height < this.wallScrollBar.Height) { this.wallScrollBar.Visible = false; } else { this.wallScrollBar.Visible = true; this.wallScrollBar.NumVisibleLines = this.wallScrollBar.Height; this.wallScrollBar.Max = height - this.wallScrollBar.Height; } this.wallScrollArea.invalidate(); this.wallScrollBar.invalidate(); base.Invalidate(); } }
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(); }
private void InitDynamicPanel() { this.DynamicPanel.Position = new Point(((this.EmptyCards[4].X + this.EmptyCards[4].Width) / 2) - 6, this.EmptyCards[0].Y / 2); this.DynamicPanel.Size = new Size(this.cardsButtons.X - this.DynamicPanel.Position.X, this.EmptyCards[0].Height / 2); this.DynamicLabel = new CustomSelfDrawPanel.CSDLabel(); this.DynamicLabel.Position = new Point(0, 0); this.DynamicLabel.Size = this.DynamicPanel.Size; if (!this.fastCashIn) { this.DynamicLabel.Text = this.TextEmptySet; } else { this.DynamicLabel.Text = this.TextEmptyMultiSet; } this.DynamicLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; this.DynamicLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Regular); this.DynamicLabel.Color = ARGBColors.Black; this.DynamicPanel.addControl(this.DynamicLabel); this.DynamicLabel.Visible = true; this.DynamicButton = new CustomSelfDrawPanel.CSDImage(); this.DynamicButton.Image = (Image) GFXLibrary.cardpanel_cashin_normal; this.DynamicButton.Size = this.DynamicButton.Image.Size; this.DynamicButton.Position = new Point((this.DynamicPanel.Width / 2) - (this.DynamicButton.Width / 2), (this.DynamicPanel.Height / 2) - (this.DynamicButton.Height / 2)); this.DynamicPanel.addControl(this.DynamicButton); this.DynamicButton.Visible = false; this.DynamicButton.setMouseOverDelegate(() => this.DynamicButton.Image = (Image) GFXLibrary.cardpanel_cashin_over, () => this.DynamicButton.Image = (Image) GFXLibrary.cardpanel_cashin_normal); this.DynamicButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.CashClick), "ManageCardsPanel_switch_to_cash_in"); this.DynamicButtonLabel = new CustomSelfDrawPanel.CSDLabel(); this.DynamicButtonLabel.Position = new Point(0x77, 0x15); this.DynamicButtonLabel.Size = new Size(0x90, 0x42); this.DynamicButtonLabel.Text = SK.Text("ManageCandsPanel_Cash_In", "Cash In"); this.DynamicButtonLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; if (Program.mySettings.LanguageIdent == "ru") { this.DynamicButtonLabel.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular); } else { this.DynamicButtonLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Regular); } this.DynamicButtonLabel.Color = ARGBColors.Black; this.DynamicButtonLabel.Visible = true; this.DynamicButton.addControl(this.DynamicButtonLabel); this.mainBackgroundImage.addControl(this.DynamicPanel); this.InitSpinners(); }
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; }
public void init(int villageID, bool reset) { NumberFormatInfo nFI; int scoutResourceCarryLevel; Color white = ARGBColors.White; Color black = ARGBColors.Black; Color color1 = ARGBColors.White; this.m_selectedVillage = villageID; this.m_ownVillage = InterfaceMgr.Instance.OwnSelectedVillage; base.clearControls(); int y = 0x27; this.mainBackgroundImage.Image = (Image)GFXLibrary.body_background_canvas; this.mainBackgroundImage.ClipRect = new Rectangle(new Point(), base.Size); this.mainBackgroundImage.Position = new Point(0, y); this.mainBackgroundImage.Size = new Size(base.Size.Width, base.Size.Height - y); this.mainBackgroundImage.Tile = true; base.addControl(this.mainBackgroundImage); this.backgroundBottomEdge.Image = (Image)GFXLibrary.popup_border_bottom; this.backgroundBottomEdge.Position = new Point(0, base.Height - 2); base.addControl(this.backgroundBottomEdge); this.backgroundRightEdge.Image = (Image)GFXLibrary.popup_border_rhs; this.backgroundRightEdge.Position = new Point(base.Width - 2, y); base.addControl(this.backgroundRightEdge); this.cardbar.Position = new Point(0, 4); this.mainBackgroundImage.addControl(this.cardbar); this.cardbar.init(7); this.gfxImage.Image = (Image)GFXLibrary.scout_screen_illustration_01; this.gfxImage.Position = new Point(20, 0x47); this.mainBackgroundImage.addControl(this.gfxImage); this.sliderImage.Position = new Point(0x2c, 0x11c); this.sliderImage.Margin = new Rectangle(0x20, 0x3f, 0x20, 0x19); this.sliderImage.Value = 0; this.sliderImage.Max = 0; this.sliderImage.setValueChangeDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ValueChangedDelegate(this.tracksMoved)); this.mainBackgroundImage.addControl(this.sliderImage); this.sliderImage.Create((Image)GFXLibrary.scout_screen_slider, (Image)GFXLibrary.scout_screen_slider_bar, (Image)GFXLibrary.scout_screen_slider_bar, (Image)GFXLibrary.scout_screen_slider_bar, (Image)GFXLibrary.scout_screen_slider_bar, (Image)GFXLibrary.scout_screen_slider_bar); this.arrowImage.Image = (Image)GFXLibrary.scout_screen_arrowbox; this.arrowImage.Position = new Point(0xee, 0x11c); this.mainBackgroundImage.addControl(this.arrowImage); this.scoutingLabel.Text = SK.Text("ScoutPopup_Scouting_Target", "Scouting") + " '" + GameEngine.Instance.World.getVillageNameOrType(villageID) + "'"; this.scoutingLabel.Color = white; this.scoutingLabel.DropShadowColor = black; this.scoutingLabel.Position = new Point(0, 0xf3); this.scoutingLabel.Size = new Size(700, 30); this.scoutingLabel.Font = FontManager.GetFont("Arial", 16f, FontStyle.Regular); this.scoutingLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER; this.mainBackgroundImage.addControl(this.scoutingLabel); if (AttackTargetsPanel.isFavourite(this.m_selectedVillage)) { this.targetVillageFavourite.ImageNorm = (Image)GFXLibrary.star_market_1; this.targetVillageFavourite.CustomTooltipID = 0x83b; } else { this.targetVillageFavourite.ImageNorm = (Image)GFXLibrary.star_market_3; this.targetVillageFavourite.CustomTooltipID = 0x7e2; } this.targetVillageFavourite.OverBrighten = true; this.targetVillageFavourite.Position = new Point(650, 0xf4); this.targetVillageFavourite.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.villageFavouriteClicked)); this.targetVillageFavourite.Data = 0; this.mainBackgroundImage.addControl(this.targetVillageFavourite); this.numLabel.Text = ""; this.numLabel.Color = white; this.numLabel.DropShadowColor = black; this.numLabel.Position = new Point(0x3f, 0x17); this.numLabel.Size = new Size(0x3b, 0x18); this.numLabel.Font = FontManager.GetFont("Arial", 18f, FontStyle.Regular); this.numLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; this.sliderImage.addControl(this.numLabel); this.timeLabel.Text = "00:00:00"; this.timeLabel.Color = white; this.timeLabel.DropShadowColor = black; this.timeLabel.Position = new Point(-28, 0x17); this.timeLabel.Size = new Size(0xbf, 0x18); this.timeLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Regular); this.timeLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; this.arrowImage.addControl(this.timeLabel); int index = 0; int type = GameEngine.Instance.World.getSpecial(villageID); switch (type) { case 3: case 4: index = 0x18; break; case 5: case 6: index = 0x19; break; case 7: case 8: case 9: case 10: case 11: case 12: case 13: case 14: index = 0x1c; break; case 15: case 0x10: case 0x11: case 0x12: index = 0x35; break; case 40: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: case 0x2f: case 0x30: case 0x31: case 50: index = 0x36; break; case 0x33: case 0x34: case 0x35: case 0x36: case 0x37: case 0x38: case 0x39: case 0x3a: case 0x3b: case 60: index = 0x37; break; case 0x3d: case 0x3e: case 0x3f: case 0x40: case 0x41: case 0x42: case 0x43: case 0x44: case 0x45: case 70: index = 0x38; break; case 0x47: case 0x48: case 0x49: case 0x4a: case 0x4b: case 0x4c: case 0x4d: case 0x4e: case 0x4f: case 80: index = 0x39; break; case 0x51: case 0x52: case 0x53: case 0x54: case 0x55: case 0x56: case 0x57: case 0x58: case 0x59: case 90: index = 0x3a; break; case 100: if (HolidayPeriods.xmas(VillageMap.getCurrentServerTime())) { index = 0x3b; } else { index = 0x1d; } break; case 0x6a: index = 30; break; case 0x6b: index = 0x1f; break; case 0x6c: index = 0x21; break; case 0x6d: index = 0x20; break; case 0x70: index = 0x22; break; case 0x71: index = 0x23; break; case 0x72: index = 0x24; break; case 0x73: index = 0x29; break; case 0x74: index = 0x25; break; case 0x75: index = 40; break; case 0x76: index = 0x2a; break; case 0x77: index = 0x2d; break; case 0x79: index = 0x2c; break; case 0x7a: index = 0x26; break; case 0x7b: index = 0x2b; break; case 0x7c: index = 0x2e; break; case 0x7d: index = 0x2f; break; case 0x7e: index = 0x30; break; case 0x80: index = 0x3d; break; case 0x81: index = 60; break; case 130: index = 0x3e; break; case 0x83: index = 0x3f; break; case 0x84: index = 0x40; break; case 0x85: index = 0x27; break; default: if (GameEngine.Instance.World.isRegionCapital(villageID)) { index = 0x31; } else if (GameEngine.Instance.World.isCountyCapital(villageID)) { index = 50; } else if (GameEngine.Instance.World.isProvinceCapital(villageID)) { index = 0x33; } else if (GameEngine.Instance.World.isCountryCapital(villageID)) { index = 0x34; } else { index = GameEngine.Instance.World.getVillageSize(villageID); } break; } switch (type) { case 0x6a: case 0x6b: case 0x6c: case 0x6d: case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x80: case 0x81: case 130: case 0x83: case 0x84: case 0x85: { WorldMap.SpecialVillageCache cache = GameEngine.Instance.World.getSpecialVillageData(villageID, false); if (cache == null) { goto Label_0B37; } nFI = GameEngine.NFI; CustomSelfDrawPanel.CSDLabel control = new CustomSelfDrawPanel.CSDLabel { Text = cache.resourceLevel.ToString("N", nFI), Position = new Point(0x9e, 0x55), Size = new Size(150, 20), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER, Color = white, DropShadowColor = black, Font = FontManager.GetFont("Arial", 12f, FontStyle.Regular) }; this.arrowImage.addControl(control); scoutResourceCarryLevel = GameEngine.Instance.LocalWorldData.ScoutResourceCarryLevel; int num5 = GameEngine.Instance.World.UserResearchData.Research_Foraging; scoutResourceCarryLevel = (CardTypes.adjustForagingLevel(GameEngine.Instance.World.UserCardData, scoutResourceCarryLevel) * ResearchData.foragingResearch[num5]) / 2; switch (type) { case 0x77: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x80: case 0x81: case 130: case 0x83: case 0x84: case 0x85: scoutResourceCarryLevel /= 10; goto Label_0A92; } break; } default: goto Label_0B37; } Label_0A92: this.m_carryLevel = scoutResourceCarryLevel; this.scoutCarryingLabel.Text = this.m_carryLevel.ToString("N", nFI); this.scoutCarryingLabel.Position = new Point(0, 90); this.scoutCarryingLabel.Size = new Size(this.sliderImage.Width, 20); this.scoutCarryingLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; this.scoutCarryingLabel.Color = white; this.scoutCarryingLabel.DropShadowColor = black; this.scoutCarryingLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Regular); this.sliderImage.addControl(this.scoutCarryingLabel); Label_0B37: this.targetImage.Image = (Image)GFXLibrary.scout_screen_icons[index]; this.targetImage.Position = new Point(0xb5, 5); this.arrowImage.addControl(this.targetImage); WorldData localWorldData = GameEngine.Instance.LocalWorldData; Point point = GameEngine.Instance.World.getVillageLocation(InterfaceMgr.Instance.OwnSelectedVillage); Point point2 = GameEngine.Instance.World.getVillageLocation(villageID); int x = point.X; int num7 = point.Y; int num8 = point2.X; int num9 = point2.Y; double d = ((x - num8) * (x - num8)) + ((num7 - num9) * (num7 - num9)); d = Math.Sqrt(d) * ((localWorldData.ScoutsMoveSpeed * localWorldData.gamePlaySpeed) * ResearchData.ScoutTimes[GameEngine.Instance.World.UserResearchData.Research_Horsemanship]); this.storedPreCardDistance = d; d *= CardTypes.getScoutSpeed(GameEngine.Instance.World.UserCardData); string str = VillageMap.createBuildTimeString((int)d); this.timeLabel.Text = str; this.timeLabel.CustomTooltipID = 0x4e20; this.timeLabel.CustomTooltipData = (int)d; this.launchButton.ImageNorm = (Image)GFXLibrary.button_with_inset_normal; this.launchButton.ImageOver = (Image)GFXLibrary.button_with_inset_over; this.launchButton.ImageClick = (Image)GFXLibrary.button_with_inset_pushed; this.launchButton.Position = new Point(520, 0x144); this.launchButton.Text.Text = SK.Text("ScoutPopup_Go", "Go"); this.launchButton.Text.Font = FontManager.GetFont("Arial", 16f, FontStyle.Regular); this.launchButton.TextYOffset = 1; this.launchButton.Text.Color = ARGBColors.Black; this.launchButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.launch), "ScoutPopupPanel_launch"); this.launchButton.Enabled = false; this.mainBackgroundImage.addControl(this.launchButton); this.scoutHonourLabel.Text = ""; this.scoutHonourLabel.Color = white; this.scoutHonourLabel.DropShadowColor = black; this.scoutHonourLabel.Position = new Point(0, 410); this.scoutHonourLabel.Size = new Size(700, 30); this.scoutHonourLabel.Font = FontManager.GetFont("Arial", 11f, FontStyle.Regular); this.scoutHonourLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER; this.scoutHonourLabel.Visible = false; this.mainBackgroundImage.addControl(this.scoutHonourLabel); if ((type >= 100) && (type <= 0xc7)) { this.scoutHonourLabel.Text = SK.Text("ScoutPopup_No_Honour_Stash_Out_Of_Range", "No Honour will be received, the stash is out of range."); } else if (type == 5) { this.scoutHonourLabel.Text = SK.Text("ScoutPopup_No_Honour_Wolf_Lair_Out_Of_Range", "No Honour will be received, the Wolf Lair is out of range."); } else if (type == 3) { this.scoutHonourLabel.Text = SK.Text("ScoutPopup_No_Honour_Bandit_Camp_Out_Of_Range", "No Honour will be received, the Bandit Camp is out of range."); } else if (((type == 7) || (type == 9)) || ((type == 11) || (type == 13))) { this.scoutHonourLabel.Text = SK.Text("ScoutPopup_No_Honour_AI_castle_Out_Of_Range", "No Honour will be received, the AI Castle is out of range."); } else if (((type == 15) || (type == 0x11)) || SpecialVillageTypes.IS_TREASURE_CASTLE(type)) { this.scoutHonourLabel.Text = SK.Text("LaunchAttackPopup_Paladin_No_Honour", "No honour will be received for destroying this type of AI castle"); } else { this.scoutHonourLabel.Text = SK.Text("ScoutPopup_No_Honour_Village_Out_Of_Range", "No Honour will be received, the village is out of range."); } this.scoutHonourLabel.Visible = GameEngine.Instance.World.isScoutHonourOutOfRange(InterfaceMgr.Instance.OwnSelectedVillage, villageID) && ((type <= 100) || (type > 0xc7)); this.titleImage.Image = (Image)GFXLibrary.popup_title_bar; this.titleImage.Position = new Point(0, 0); base.addControl(this.titleImage); this.titleLabel.Text = SK.Text("OwnVillagePanel_Send_Out_Scouts", "Send Out Scouts"); this.titleLabel.Color = Color.FromArgb(0xff, 0xff, 0xff); this.titleLabel.DropShadowColor = black; this.titleLabel.Position = new Point(20, 5); this.titleLabel.Size = new Size(base.Width, 0x20); this.titleLabel.Font = FontManager.GetFont("Arial", 18f, FontStyle.Bold); this.titleLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT; this.titleImage.addControl(this.titleLabel); this.closeButton.ImageNorm = (Image)GFXLibrary.int_button_close_normal; this.closeButton.ImageOver = (Image)GFXLibrary.int_button_close_over; this.closeButton.ImageClick = (Image)GFXLibrary.int_button_close_in; this.closeButton.Position = new Point(0x293, 5); this.closeButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.closeClick), "ScoutPopupPanel_close"); this.titleImage.addControl(this.closeButton); CustomSelfDrawPanel.WikiLinkControl.init(this.titleImage, 0x22, new Point(0x261, 5)); if (GameEngine.Instance.getVillage(this.m_ownVillage) != null) { this.onVillageLoadUpdate(this.m_ownVillage, true); } else { GameEngine.Instance.downloadCurrentVillage(); } }
public void rebuild() { int[] completedQuests = null; int y = 0; this.questsScrollArea.clearControls(); if (this.isQuestList) { if (this.completedQuests == null) { NewQuestsData data = GameEngine.Instance.World.getNewQuestData(); if (data == null) { return; } completedQuests = data.completedQuests; } else { completedQuests = this.completedQuests.ToArray(); } for (int i = 0; i < completedQuests.Length; i++) { int quest = completedQuests[i]; NewQuestLine control = new NewQuestLine(); if (y != 0) { y += 5; } control.Position = new Point(0, y); control.init(quest, i); this.questsScrollArea.addControl(control); y += control.Height; } } else { CustomSelfDrawPanel.CSDLabel label = new CustomSelfDrawPanel.CSDLabel(); switch (this._questID) { case 0x22: case 0x30: case 4: case 0x10: case 0x65: case 0x7a: case 0x40: case 0x54: if ((!GameEngine.Instance.World.isBigpointAccount && !Program.aeriaInstall) && (!Program.bigpointPartnerInstall && !Program.arcInstall)) { label.Text = SK.Text("QUESTS_IAF_Help1", "Learn about how inviting your friends to the game can earn you up to $160 worth of crowns."); } else { label.Text = SK.Text("QUESTS_IAF_Help2", "Why not invite a friend to play Kingdoms? They can fight alongside you and you will help us to further develop the game. "); } break; default: label.Text = SK.NoStoreText("Z_QUEST_HELP_" + this.questText); break; } label.Color = ARGBColors.Black; label.Position = new Point(0x24, 30); label.Size = new Size(this.questsScrollArea.Width, this.questsScrollArea.Height); label.Font = FontManager.GetFont("Arial", 12f, FontStyle.Regular); label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; this.mainBackgroundImage.addControl(label); } this.questsScrollArea.Size = new Size(this.questsScrollArea.Width, y); if (y < this.questsScrollBar.Height) { this.questsScrollBar.Visible = false; } else { this.questsScrollBar.Visible = true; this.questsScrollBar.NumVisibleLines = this.questsScrollBar.Height; this.questsScrollBar.Max = y - this.questsScrollBar.Height; } this.questsScrollArea.invalidate(); this.questsScrollBar.invalidate(); this.mainBackgroundImage.invalidate(); }
public void init(int cardSection) { this.currentCardSection = cardSection; base.clearControls(); this.mainBackgroundImage.Image = (Image) GFXLibrary.body_background_001; 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 = (this.ContentWidth - 150) - 40; this.InplayPanelWidth = (this.ContentWidth - BorderPadding) - this.AvailablePanelWidth; this.AvailablePanel = new CustomSelfDrawPanel.CSDExtendingPanel(); this.AvailablePanel.Size = new Size(this.AvailablePanelWidth, (base.Height - 0x10) - BorderPadding); this.AvailablePanel.Position = new Point(0x10, 0x10); this.mainBackgroundImage.addControl(this.AvailablePanel); this.AvailablePanel.Create((Image) GFXLibrary.int_insetpanel_a_top_left, (Image) GFXLibrary.int_insetpanel_a_middle_top, (Image) GFXLibrary.int_insetpanel_a_top_right, (Image) GFXLibrary.int_insetpanel_a_middle_left, (Image) GFXLibrary.int_insetpanel_a_middle, (Image) GFXLibrary.int_insetpanel_a_middle_right, (Image) GFXLibrary.int_insetpanel_a_bottom_left, (Image) GFXLibrary.int_insetpanel_a_middle_bottom, (Image) GFXLibrary.int_insetpanel_a_bottom_right); int width = (base.Width - (BorderPadding * 3)) - this.AvailablePanel.Width; int height = 100; if (buttonpic == null) { buttonpic = new Bitmap(width, height); using (Graphics graphics = Graphics.FromImage(buttonpic)) { Brush green = Brushes.Green; graphics.FillRectangle(green, new Rectangle(new Point(0, 0), buttonpic.Size)); } } this.closeButton.Size = new Size(width, 0x26); this.closeButton.Text.Text = SK.Text("GENERIC_Close", "Close"); this.closeButton.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; this.closeButton.Text.Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold); this.closeButton.TextYOffset = -1; this.closeButton.Text.Color = ARGBColors.Black; this.mainBackgroundImage.addControl(this.closeButton); this.closeButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.closeClick), "Cards_Close"); this.closeButton.setNormalExtImage((Image) GFXLibrary.int_buttonbar_left_normal, (Image) GFXLibrary.int_buttonbar_middle_normal, (Image) GFXLibrary.int_buttonbar_right_normal); this.closeButton.setOverExtImage((Image) GFXLibrary.int_buttonbar_left_over, (Image) GFXLibrary.int_buttonbar_middle_over, (Image) GFXLibrary.int_buttonbar_right_over); this.closeButton.Position = new Point((base.Width - this.closeButton.Width) - BorderPadding, BorderPadding); this.playbutton.Size = new Size(width, height); this.playbutton.Position = new Point((base.Width - this.closeButton.Width) - BorderPadding, (this.closeButton.Y + this.closeButton.Height) + (BorderPadding / 2)); this.playbutton.Image = buttonpic; this.mainBackgroundImage.addControl(this.playbutton); CustomSelfDrawPanel.CSDLabel control = new CustomSelfDrawPanel.CSDLabel { Position = new Point(0, 0), Size = new Size(width, height), Text = SK.Text("OpenCardsPanel_Open_Cards", "Open Cards"), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT, Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold), Color = ARGBColors.White, DropShadowColor = ARGBColors.Black }; this.playbutton.addControl(control); this.buybutton.Size = new Size(width, 100); this.buybutton.Position = new Point((base.Width - this.closeButton.Width) - BorderPadding, (this.playbutton.Y + this.playbutton.Height) + (BorderPadding / 2)); this.buybutton.Image = buttonpic; this.mainBackgroundImage.addControl(this.buybutton); control = new CustomSelfDrawPanel.CSDLabel { Position = new Point(0, 0), Size = new Size(width, height), Text = SK.Text("OpenCardsPanel_Buy_Cards", "Buy Cards"), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT, Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold), Color = ARGBColors.White, DropShadowColor = ARGBColors.Black }; this.buybutton.addControl(control); this.premiumbutton.Size = new Size(width, 100); this.premiumbutton.Position = new Point((base.Width - this.closeButton.Width) - BorderPadding, (this.buybutton.Y + this.buybutton.Height) + (BorderPadding / 2)); this.premiumbutton.Image = buttonpic; this.mainBackgroundImage.addControl(this.premiumbutton); control = new CustomSelfDrawPanel.CSDLabel { Position = new Point(0, 0), Size = new Size(width, height), Text = SK.Text("OpenCardsPanel_Premium", "Premium"), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT, Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold), Color = ARGBColors.White, DropShadowColor = ARGBColors.Black }; this.premiumbutton.addControl(control); this.managebutton.Size = new Size(width, 100); this.managebutton.Position = new Point((base.Width - this.closeButton.Width) - BorderPadding, (this.premiumbutton.Y + this.premiumbutton.Height) + (BorderPadding / 2)); this.managebutton.Image = buttonpic; this.mainBackgroundImage.addControl(this.managebutton); control = new CustomSelfDrawPanel.CSDLabel { Position = new Point(0, 0), Size = new Size(width, height), Text = SK.Text("OpenCardsPanel_Manage_Cards", "Manage Cards"), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT, Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold), Color = ARGBColors.White, DropShadowColor = ARGBColors.Black }; this.managebutton.addControl(control); this.crownsbutton.Size = new Size(width, 100); this.crownsbutton.Position = new Point((base.Width - this.closeButton.Width) - BorderPadding, (this.managebutton.Y + this.managebutton.Height) + (BorderPadding / 2)); this.crownsbutton.Image = buttonpic; this.mainBackgroundImage.addControl(this.crownsbutton); control = new CustomSelfDrawPanel.CSDLabel { Position = new Point(0, 0), Size = new Size(width, height), Text = SK.Text("OpenCardsPanel_Get_Crowns", "Get Crowns"), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT, Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold), Color = ARGBColors.White, DropShadowColor = ARGBColors.Black }; this.crownsbutton.addControl(control); this.labelTitle.Position = new Point(BorderPadding, 2); this.labelTitle.Size = new Size(300, 0x40); this.labelTitle.Text = SK.Text("OpenCardsPanel_Latest_Offers", "Latest Offers"); this.labelTitle.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT; this.labelTitle.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold); this.labelTitle.Color = ARGBColors.White; this.labelTitle.DropShadowColor = ARGBColors.Black; this.mainBackgroundImage.addControl(this.labelTitle); }
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(int villageID, bool reset) { base.clearControls(); this.languageArea.Size = base.Size; this.AddControlToPanel(this.languageArea); this.BackColor = ARGBColors.White; this.addTitleButtons(); CustomSelfDrawPanel.CSDButton c = new CustomSelfDrawPanel.CSDButton { ImageNorm = this.CloseImage, ImageOver = this.CloseImageOver, Position = new Point(0x25c, 570) }; c.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.closeClick), "WorldSelectPopupPanel_close"); this.AddControlToPanel(c); CustomSelfDrawPanel.CSDLabel label = new CustomSelfDrawPanel.CSDLabel { Text = SK.Text("WORLD_SELECT_Name", "Name"), Position = new Point(0x5c, 0x3f), Size = new Size(300, 30), Color = ARGBColors.Black, Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold) }; this.AddControlToPanel(label); this.supportLabel.Text = SK.Text("WORLD_SELECT_Support", "Support Language"); this.supportLabel.Position = new Point(0x91, 0x3f); this.supportLabel.Size = new Size(300, 30); this.supportLabel.Color = ARGBColors.Black; this.supportLabel.Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold); this.supportLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER; this.AddControlToPanel(this.supportLabel); CustomSelfDrawPanel.CSDLabel label2 = new CustomSelfDrawPanel.CSDLabel { Text = SK.Text("WORLD_SELECT_Map", "Map"), Position = new Point(0x131, 0x3f), Size = new Size(200, 30), Color = ARGBColors.Black, Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER }; this.AddControlToPanel(label2); CustomSelfDrawPanel.CSDLabel label3 = new CustomSelfDrawPanel.CSDLabel { Text = SK.Text("WORLD_SELECT_Status", "Status"), Position = new Point(0x1c8, 0x3f), Size = new Size(300, 30), Color = ARGBColors.Black, Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold) }; this.AddControlToPanel(label3); this.wallScrollArea.Position = new Point(this.scrX, this.scrY); this.wallScrollArea.Size = new Size(this.scrWidth, this.scrHeight); this.wallScrollArea.ClipRect = new Rectangle(new Point(0, 0), new Size(this.scrWidth, this.scrHeight)); this.AddControlToPanel(this.wallScrollArea); this.mouseWheelOverlay.Position = this.wallScrollArea.Position; this.mouseWheelOverlay.Size = this.wallScrollArea.Size; this.mouseWheelOverlay.setMouseWheelDelegate(new CustomSelfDrawPanel.CSDControl.CSD_MouseWheelDelegate(this.mouseWheelMoved)); this.AddControlToPanel(this.mouseWheelOverlay); int num1 = this.wallScrollBar.Value; this.wallScrollBar.Position = new Point(this.scrWidth + this.scrX, this.scrY); this.wallScrollBar.Size = new Size(0x18, this.scrHeight); this.AddControlToPanel(this.wallScrollBar); this.wallScrollBar.Value = 0; this.wallScrollBar.Max = 100; this.wallScrollBar.NumVisibleLines = 0x19; this.wallScrollBar.Create(null, null, null, (Image) GFXLibrary._24wide_thumb_top, (Image) GFXLibrary._24wide_thumb_middle, (Image) GFXLibrary._24wide_thumb_bottom); this.wallScrollBar.setValueChangeDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ValueChangedDelegate(this.wallScrollBarMoved)); this.showOwnWorlds.CheckedImage = (Image) GFXLibrary.mrhp_world_filter_check[0]; this.showOwnWorlds.UncheckedImage = (Image) GFXLibrary.mrhp_world_filter_check[1]; this.showOwnWorlds.Position = new Point(15, 570); this.showOwnWorlds.Checked = showOwnWorldsStatus; this.showOwnWorlds.CBLabel.Text = SK.Text("WORLD_Always_Show_Your_Worlds", "Always show worlds you are playing."); this.showOwnWorlds.CBLabel.Color = ARGBColors.Black; this.showOwnWorlds.CBLabel.Position = new Point(20, -1); this.showOwnWorlds.CBLabel.Size = new Size(400, 0x19); this.showOwnWorlds.CBLabel.Font = FontManager.GetFont("Arial", 8f, FontStyle.Regular); this.showOwnWorlds.setCheckChangedDelegate(new CustomSelfDrawPanel.CSDCheckBox.CSD_CheckChangedDelegate(this.ownToggled)); this.AddControlToPanel(this.showOwnWorlds); Dictionary<string, LocalizationLanguage> dictionary = new Dictionary<string, LocalizationLanguage>(); this.selectedWorldRect.Position = new Point(); this.selectedWorldRect.FillColor = Color.FromArgb(0xc0, 0xc0, 0xc0); this.selectedWorldRect.Size = new Size(0x22, 0x16); this.languageArea.addControl(this.selectedWorldRect); this.selectedWorldRect2.Position = new Point(); this.selectedWorldRect2.FillColor = ARGBColors.Black; this.selectedWorldRect2.Size = new Size(0x20, 20); this.languageArea.addControl(this.selectedWorldRect2); bool flag = false; foreach (WorldInfo info in ProfileLoginWindow.WorldList) { if (dictionary.ContainsKey(info.Supportculture)) { continue; } if (info.Supportculture == "eu") { flag = true; continue; } LocalizationLanguage language = new LocalizationLanguage { CultureCode = info.Supportculture }; dictionary.Add(info.Supportculture, language); CustomSelfDrawPanel.CSDImage control = new CustomSelfDrawPanel.CSDImage(); string cultureCode = language.CultureCode; switch (cultureCode) { case "pt": case "br": cultureCode = "br"; break; } control.Image = (Image) GFXLibrary.getLoginWorldFlag(cultureCode); control.Width = control.Image.Width; control.Height = control.Image.Height; switch (language.CultureCode) { case "en": control.CustomTooltipID = 0xfab; break; case "de": control.CustomTooltipID = 0xfac; break; case "fr": control.CustomTooltipID = 0xfad; break; case "ru": control.CustomTooltipID = 0xfae; break; case "es": control.CustomTooltipID = 0xfb2; break; case "pl": control.CustomTooltipID = 0xfb6; break; case "tr": control.CustomTooltipID = 0xfb9; break; case "it": control.CustomTooltipID = 0xfbd; break; case "eu": control.CustomTooltipID = 0xfc1; break; case "pt": control.CustomTooltipID = 0xfc5; break; } control.Position = new Point((((this.scrWidth + 0x35) + 90) - (dictionary.Count * (control.Width + 2))) - 4, 0x2d); this.languageArea.addControl(control); control.Tag = language; control.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.language_Click), "WorldSelectPopupPanel_language_flags"); } if (flag) { CustomSelfDrawPanel.CSDImage image2; LocalizationLanguage language2 = new LocalizationLanguage { CultureCode = "eu" }; dictionary.Add("eu", language2); image2 = new CustomSelfDrawPanel.CSDImage { Image = (Image) GFXLibrary.getLoginWorldFlag("eu"), Width = ((Image)GFXLibrary.getLoginWorldFlag("eu")).Width, Height = ((Image) GFXLibrary.getLoginWorldFlag("eu")).Height, CustomTooltipID = 0xfc1, Position = new Point((((this.scrWidth + 0x35) + 90) - (dictionary.Count * (((Image) GFXLibrary.getLoginWorldFlag("eu")).Width + 2))) - 4, 0x2d) }; this.languageArea.addControl(image2); image2.Tag = language2; image2.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.language_Click), "WorldSelectPopupPanel_language_flags"); } this.lastLang = ProfileLoginWindow.LastSelectedSupportCulture; this.updateFlagAlpha(); this.infoOverlay.Position = new Point(0, 0); this.infoOverlay.Size = base.Size; this.infoOverlay.FillColor = Color.FromArgb(0x80, 0, 0, 0); this.infoOverlay.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.infoOverlayCloseClicked)); this.infoOverlay.Visible = false; this.AddControlToPanel(this.infoOverlay); this.infoOverlayPanel.Position = new Point(200, 150); this.infoOverlayPanel.Size = new Size(base.Width - 400, base.Height - 300); this.infoOverlayPanel.FillColor = ARGBColors.White; this.infoOverlay.addControl(this.infoOverlayPanel); this.infoOverlayClose.ImageNorm = this.CloseImage; this.infoOverlayClose.ImageOver = this.CloseImageOver; this.infoOverlayClose.Position = new Point(200, 270); this.infoOverlayClose.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.infoOverlayCloseClicked), "WorldSelectPopupPanel_close"); this.infoOverlayPanel.addControl(this.infoOverlayClose); this.infoOverlayHeading.Position = new Point(0x51, 10); this.infoOverlayPanel.addControl(this.infoOverlayHeading); this.infoOverlayDuration.Text = SK.Text("WorldSelect_WorldDuration", "Days since World Start"); this.infoOverlayDuration.Position = new Point(40, 70); this.infoOverlayDuration.Size = new Size(240, 50); this.infoOverlayDuration.Color = ARGBColors.Black; this.infoOverlayDuration.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT; this.infoOverlayDuration.Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold); this.infoOverlayPanel.addControl(this.infoOverlayDuration); this.infoOverlayDurationValue.Text = "?"; this.infoOverlayDurationValue.Position = new Point(0xb9, 70); this.infoOverlayDurationValue.Size = new Size(200, 50); this.infoOverlayDurationValue.Color = ARGBColors.Black; this.infoOverlayDurationValue.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_RIGHT; this.infoOverlayDurationValue.Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold); this.infoOverlayPanel.addControl(this.infoOverlayDurationValue); this.infoOverlayGameAge.Text = SK.Text("WorldSelect_GameAge", "Game Type"); this.infoOverlayGameAge.Position = new Point(40, 110); this.infoOverlayGameAge.Size = new Size(240, 50); this.infoOverlayGameAge.Color = ARGBColors.Black; this.infoOverlayGameAge.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT; this.infoOverlayGameAge.Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold); this.infoOverlayPanel.addControl(this.infoOverlayGameAge); this.infoOverlayGameAgeValue.Text = "?"; this.infoOverlayGameAgeValue.Position = new Point(0xb9, 110); this.infoOverlayGameAgeValue.Size = new Size(200, 50); this.infoOverlayGameAgeValue.Color = ARGBColors.Black; this.infoOverlayGameAgeValue.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_RIGHT; this.infoOverlayGameAgeValue.Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold); this.infoOverlayPanel.addControl(this.infoOverlayGameAgeValue); this.infoOverlayHouses.Text = SK.Text("WorldSelect_RemainingHouses", "Houses Left in Glory Race"); this.infoOverlayHouses.Position = new Point(40, 150); this.infoOverlayHouses.Size = new Size(240, 50); this.infoOverlayHouses.Color = ARGBColors.Black; this.infoOverlayHouses.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT; this.infoOverlayHouses.Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold); this.infoOverlayPanel.addControl(this.infoOverlayHouses); this.infoOverlayHousesValue.Text = "?"; this.infoOverlayHousesValue.Position = new Point(0xb9, 150); this.infoOverlayHousesValue.Size = new Size(200, 50); this.infoOverlayHousesValue.Color = ARGBColors.Black; this.infoOverlayHousesValue.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_RIGHT; this.infoOverlayHousesValue.Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold); this.infoOverlayPanel.addControl(this.infoOverlayHousesValue); this.infoOverlayActivePlayers.Text = SK.Text("WorldSelect_ActivePlayer", "Active Players"); this.infoOverlayActivePlayers.Position = new Point(40, 190); this.infoOverlayActivePlayers.Size = new Size(240, 50); this.infoOverlayActivePlayers.Color = ARGBColors.Black; this.infoOverlayActivePlayers.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT; this.infoOverlayActivePlayers.Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold); this.infoOverlayPanel.addControl(this.infoOverlayActivePlayers); this.infoOverlayActivePlayersValue.Text = "?"; this.infoOverlayActivePlayersValue.Position = new Point(0xb9, 190); this.infoOverlayActivePlayersValue.Size = new Size(200, 50); this.infoOverlayActivePlayersValue.Color = ARGBColors.Black; this.infoOverlayActivePlayersValue.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_RIGHT; this.infoOverlayActivePlayersValue.Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold); this.infoOverlayPanel.addControl(this.infoOverlayActivePlayersValue); List<WorldInfo> list = Program.profileLogin.GetWorldsBySupportCulture(ProfileLoginWindow.LastSelectedSupportCulture, showOwnWorldsStatus, showSpecialWorlds); this.BuildOnlineWorldList(list); }
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(); }
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(int mode, ReportCapturePopup parent) { this.m_mode = mode; base.clearControls(); this.backgroundImage.Image = (Image)GFXLibrary.popup_background_01; this.backgroundImage.Position = new Point(0, 0); base.addControl(this.backgroundImage); float pointSize = 9f; if (Program.mySettings.LanguageIdent == "pl") { pointSize = 8f; } if (mode == 2) { this.captureLabel.Text = SK.Text("Report_Marking_And_Deleting", "Report Marking and Deleting"); } this.captureLabel.Color = ARGBColors.White; this.captureLabel.Position = new Point(13, 7); this.captureLabel.Size = new Size(0x14f, 20); this.captureLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold); this.captureLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT; this.backgroundImage.addControl(this.captureLabel); this.okButton.ImageNorm = (Image)GFXLibrary.button_blue_01_normal; this.okButton.ImageOver = (Image)GFXLibrary.button_blue_01_over; this.okButton.ImageClick = (Image)GFXLibrary.button_blue_01_in; this.okButton.Position = new Point(240, 0x145); this.okButton.Text.Text = SK.Text("GENERIC_OK", "OK"); this.okButton.Text.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular); this.okButton.Text.Color = ARGBColors.Black; this.okButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.okClicked), "ReportDeletePanel_ok"); this.backgroundImage.addControl(this.okButton); CustomSelfDrawPanel.CSDLabel control = new CustomSelfDrawPanel.CSDLabel { Text = SK.Text("ReportDeleting_Delete_Reports", "Delete Reports"), Color = ARGBColors.Black, Position = new Point(0, 50), Size = new Size(this.backgroundImage.Width, 20), Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER }; this.backgroundImage.addControl(control); CustomSelfDrawPanel.CSDButton button = 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((this.backgroundImage.Width - GFXLibrary.mail2_button_blue_141wide_normal.Width) / 2, 70) }; button.Text.Text = SK.Text("ReportDeleting_All", "All"); button.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; button.Text.Font = FontManager.GetFont("Arial", pointSize, FontStyle.Bold); button.TextYOffset = -3; button.Text.Color = ARGBColors.Black; button.setClickDelegate(() => ReportsPanel.Instance.deleteAllReports(), "ReportDeletePanel_delete_all"); this.backgroundImage.addControl(button); CustomSelfDrawPanel.CSDButton button2 = 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((this.backgroundImage.Width - GFXLibrary.mail2_button_blue_141wide_normal.Width) / 2, 100) }; button2.Text.Text = SK.Text("ReportDeleting_All_Shown", "All Shown"); button2.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; button2.Text.Font = FontManager.GetFont("Arial", pointSize, FontStyle.Bold); button2.TextYOffset = -3; button2.Text.Color = ARGBColors.Black; button2.setClickDelegate(() => ReportsPanel.Instance.deleteShownReports(), "ReportDeletePanel_delete_shown"); this.backgroundImage.addControl(button2); 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((this.backgroundImage.Width - GFXLibrary.mail2_button_blue_141wide_normal.Width) / 2, 130) }; button3.Text.Text = SK.Text("ReportDeleting_All_Marked", "All Marked"); button3.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; button3.Text.Font = FontManager.GetFont("Arial", pointSize, FontStyle.Bold); button3.TextYOffset = -3; button3.Text.Color = ARGBColors.Black; button3.setClickDelegate(() => ReportsPanel.Instance.deleteMarkedReports(), "ReportDeletePanel_delete_marked"); this.backgroundImage.addControl(button3); CustomSelfDrawPanel.CSDLabel label2 = new CustomSelfDrawPanel.CSDLabel { Text = SK.Text("ReportDeleting_Mark_As_Read", "Mark Reports As Read"), Color = ARGBColors.Black, Position = new Point(0, 170), Size = new Size(this.backgroundImage.Width, 20), Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER }; this.backgroundImage.addControl(label2); 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((this.backgroundImage.Width - GFXLibrary.mail2_button_blue_141wide_normal.Width) / 2, 190) }; button4.Text.Text = SK.Text("ReportDeleting_All", "All"); button4.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; button4.Text.Font = FontManager.GetFont("Arial", pointSize, FontStyle.Bold); button4.TextYOffset = -3; button4.Text.Color = ARGBColors.Black; button4.setClickDelegate(() => ReportsPanel.Instance.markAsReadAllReports(), "ReportDeletePanel_mark_all_as_read"); this.backgroundImage.addControl(button4); 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((this.backgroundImage.Width - GFXLibrary.mail2_button_blue_141wide_normal.Width) / 2, 220) }; button5.Text.Text = SK.Text("ReportDeleting_All_Shown", "All Shown"); button5.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; button5.Text.Font = FontManager.GetFont("Arial", pointSize, FontStyle.Bold); button5.TextYOffset = -3; button5.Text.Color = ARGBColors.Black; button5.setClickDelegate(() => ReportsPanel.Instance.markAsReadShownReports(), "ReportDeletePanel_mark_shown_as_read"); this.backgroundImage.addControl(button5); 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((this.backgroundImage.Width - GFXLibrary.mail2_button_blue_141wide_normal.Width) / 2, 250) }; button6.Text.Text = SK.Text("ReportDeleting_All_Marked", "All Marked"); button6.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; button6.Text.Font = FontManager.GetFont("Arial", pointSize, FontStyle.Bold); button6.TextYOffset = -3; button6.Text.Color = ARGBColors.Black; button6.setClickDelegate(() => ReportsPanel.Instance.markAsReadMarkedReports(), "ReportDeletePanel_mark_marked_as_read"); this.backgroundImage.addControl(button6); parent.Size = this.backgroundImage.Size; base.Invalidate(); parent.Invalidate(); }
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(int mode, ReportCapturePopup parent) { this.m_mode = mode; base.clearControls(); this.backgroundImage.Image = (Image) GFXLibrary.popup_background_01; this.backgroundImage.Position = new Point(0, 0); base.addControl(this.backgroundImage); float pointSize = 9f; if (Program.mySettings.LanguageIdent == "pl") { pointSize = 8f; } if (mode == 2) { this.captureLabel.Text = SK.Text("Report_Marking_And_Deleting", "Report Marking and Deleting"); } this.captureLabel.Color = ARGBColors.White; this.captureLabel.Position = new Point(13, 7); this.captureLabel.Size = new Size(0x14f, 20); this.captureLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold); this.captureLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT; this.backgroundImage.addControl(this.captureLabel); this.okButton.ImageNorm = (Image) GFXLibrary.button_blue_01_normal; this.okButton.ImageOver = (Image) GFXLibrary.button_blue_01_over; this.okButton.ImageClick = (Image) GFXLibrary.button_blue_01_in; this.okButton.Position = new Point(240, 0x145); this.okButton.Text.Text = SK.Text("GENERIC_OK", "OK"); this.okButton.Text.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular); this.okButton.Text.Color = ARGBColors.Black; this.okButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.okClicked), "ReportDeletePanel_ok"); this.backgroundImage.addControl(this.okButton); CustomSelfDrawPanel.CSDLabel control = new CustomSelfDrawPanel.CSDLabel { Text = SK.Text("ReportDeleting_Delete_Reports", "Delete Reports"), Color = ARGBColors.Black, Position = new Point(0, 50), Size = new Size(this.backgroundImage.Width, 20), Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER }; this.backgroundImage.addControl(control); CustomSelfDrawPanel.CSDButton button = 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((this.backgroundImage.Width - GFXLibrary.mail2_button_blue_141wide_normal.Width) / 2, 70) }; button.Text.Text = SK.Text("ReportDeleting_All", "All"); button.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; button.Text.Font = FontManager.GetFont("Arial", pointSize, FontStyle.Bold); button.TextYOffset = -3; button.Text.Color = ARGBColors.Black; button.setClickDelegate(() => ReportsPanel.Instance.deleteAllReports(), "ReportDeletePanel_delete_all"); this.backgroundImage.addControl(button); CustomSelfDrawPanel.CSDButton button2 = 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((this.backgroundImage.Width - GFXLibrary.mail2_button_blue_141wide_normal.Width) / 2, 100) }; button2.Text.Text = SK.Text("ReportDeleting_All_Shown", "All Shown"); button2.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; button2.Text.Font = FontManager.GetFont("Arial", pointSize, FontStyle.Bold); button2.TextYOffset = -3; button2.Text.Color = ARGBColors.Black; button2.setClickDelegate(() => ReportsPanel.Instance.deleteShownReports(), "ReportDeletePanel_delete_shown"); this.backgroundImage.addControl(button2); 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((this.backgroundImage.Width - GFXLibrary.mail2_button_blue_141wide_normal.Width) / 2, 130) }; button3.Text.Text = SK.Text("ReportDeleting_All_Marked", "All Marked"); button3.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; button3.Text.Font = FontManager.GetFont("Arial", pointSize, FontStyle.Bold); button3.TextYOffset = -3; button3.Text.Color = ARGBColors.Black; button3.setClickDelegate(() => ReportsPanel.Instance.deleteMarkedReports(), "ReportDeletePanel_delete_marked"); this.backgroundImage.addControl(button3); CustomSelfDrawPanel.CSDLabel label2 = new CustomSelfDrawPanel.CSDLabel { Text = SK.Text("ReportDeleting_Mark_As_Read", "Mark Reports As Read"), Color = ARGBColors.Black, Position = new Point(0, 170), Size = new Size(this.backgroundImage.Width, 20), Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER }; this.backgroundImage.addControl(label2); 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((this.backgroundImage.Width - GFXLibrary.mail2_button_blue_141wide_normal.Width) / 2, 190) }; button4.Text.Text = SK.Text("ReportDeleting_All", "All"); button4.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; button4.Text.Font = FontManager.GetFont("Arial", pointSize, FontStyle.Bold); button4.TextYOffset = -3; button4.Text.Color = ARGBColors.Black; button4.setClickDelegate(() => ReportsPanel.Instance.markAsReadAllReports(), "ReportDeletePanel_mark_all_as_read"); this.backgroundImage.addControl(button4); 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((this.backgroundImage.Width - GFXLibrary.mail2_button_blue_141wide_normal.Width) / 2, 220) }; button5.Text.Text = SK.Text("ReportDeleting_All_Shown", "All Shown"); button5.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; button5.Text.Font = FontManager.GetFont("Arial", pointSize, FontStyle.Bold); button5.TextYOffset = -3; button5.Text.Color = ARGBColors.Black; button5.setClickDelegate(() => ReportsPanel.Instance.markAsReadShownReports(), "ReportDeletePanel_mark_shown_as_read"); this.backgroundImage.addControl(button5); 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((this.backgroundImage.Width - GFXLibrary.mail2_button_blue_141wide_normal.Width) / 2, 250) }; button6.Text.Text = SK.Text("ReportDeleting_All_Marked", "All Marked"); button6.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; button6.Text.Font = FontManager.GetFont("Arial", pointSize, FontStyle.Bold); button6.TextYOffset = -3; button6.Text.Color = ARGBColors.Black; button6.setClickDelegate(() => ReportsPanel.Instance.markAsReadMarkedReports(), "ReportDeletePanel_mark_marked_as_read"); this.backgroundImage.addControl(button6); parent.Size = this.backgroundImage.Size; base.Invalidate(); parent.Invalidate(); }
private int RefreshCards(CustomSelfDrawPanel.CSDImage content, List<CustomSelfDrawPanel.UICard> list, int width) { int[] numArray = null; if (GameEngine.Instance.World.lastUserCardSearchCriteria != null) { switch (GameEngine.Instance.World.lastUserCardSearchCriteria.newCardCategoryFilter) { case 0x1001: numArray = CardTypes.newCategories_ApplesOrder; break; case 0x1002: numArray = CardTypes.newCategories_CheeseOrder; break; case 0x1003: numArray = CardTypes.newCategories_MeatOrder; break; case 0x1004: numArray = CardTypes.newCategories_BreadOrder; break; case 0x1005: numArray = CardTypes.newCategories_VegOrder; break; case 0x1006: numArray = CardTypes.newCategories_FishOrder; break; case 0x1007: numArray = CardTypes.newCategories_AleOrder; break; case 0x2001: numArray = CardTypes.newCategories_WoodOrder; break; case 0x2002: numArray = CardTypes.newCategories_StoneOrder; break; case 0x2003: numArray = CardTypes.newCategories_IronOrder; break; case 0x2004: numArray = CardTypes.newCategories_PitchOrder; break; case 0x4001: numArray = CardTypes.newCategories_VenisonOrder; break; case 0x4002: numArray = CardTypes.newCategories_FurnitureOrder; break; case 0x4003: numArray = CardTypes.newCategories_MetalwareOrder; break; case 0x4004: numArray = CardTypes.newCategories_ClothesOrder; break; case 0x4005: numArray = CardTypes.newCategories_WineOrder; break; case 0x4006: numArray = CardTypes.newCategories_SaltOrder; break; case 0x4007: numArray = CardTypes.newCategories_SpicesOrder; break; case 0x4008: numArray = CardTypes.newCategories_SilkOrder; break; case 0x8001: numArray = CardTypes.newCategories_BowsOrder; break; case 0x8002: numArray = CardTypes.newCategories_PikesOrder; break; case 0x8003: numArray = CardTypes.newCategories_ArmourOrder; break; case 0x8004: numArray = CardTypes.newCategories_SwordsOrder; break; case 0x8005: numArray = CardTypes.newCategories_CatapultsOrder; break; case 0x10001: numArray = CardTypes.newCategories_CastleConOrder; break; case 0x10002: numArray = CardTypes.newCategories_DefencesOrder; break; case 0x10003: numArray = CardTypes.newCategories_WallsOrder; break; case 0x10004: numArray = CardTypes.newCategories_KnightsOrder; break; case 0x20001: numArray = CardTypes.newCategories_ScoutingOrder; break; case 0x20002: numArray = CardTypes.newCategories_SpeedOrder; break; case 0x20003: numArray = CardTypes.newCategories_RecruitmentOrder; break; case 0x20004: numArray = CardTypes.newCategories_TroopsOrder; break; case 0x20005: numArray = CardTypes.newCategories_DiplomacyOrder; break; case 0x40001: numArray = CardTypes.newCategories_TradeOrder; break; case 0x40002: numArray = CardTypes.newCategories_ReligionOrder; break; case 0x40003: numArray = CardTypes.newCategories_HonourOrder; break; case 0x40004: numArray = CardTypes.newCategories_GoldOrder; break; case 0x40005: numArray = CardTypes.newCategories_PopOrder; break; case 0x40006: numArray = CardTypes.newCategories_ResearchOrder; break; case 0x40007: numArray = CardTypes.newCategories_CapacityOrder; break; case 0x40008: numArray = CardTypes.newCategories_ConstructionOrder; break; } } if (GameEngine.Instance.World.getTutorialStage() == 8) { list.Sort(CustomSelfDrawPanel.UICard.TUT2cardsNameComparer); } else if (GameEngine.Instance.World.getTutorialStage() == 12) { list.Sort(CustomSelfDrawPanel.UICard.TUTcardsNameComparer); } else if (this.sortByMode == 0) { list.Sort(CustomSelfDrawPanel.UICard.cardsNameComparer); } else if (this.sortByMode == 1) { list.Sort(CustomSelfDrawPanel.UICard.cardsIDComparer); } else if (this.sortByMode == 2) { list.Sort(CustomSelfDrawPanel.UICard.cardsNameComparerReverse); } else if (this.sortByMode == 3) { list.Sort(CustomSelfDrawPanel.UICard.cardsIDComparerReverse); } else if (this.sortByMode == 7) { list.Sort(CustomSelfDrawPanel.UICard.cardsQuantityComparer); } else if (this.sortByMode == 8) { list.Sort(CustomSelfDrawPanel.UICard.cardsQuantityComparerReverse); } int num = GameEngine.Instance.World.getRank() + 1; content.clearDirectControlsOnly(); foreach (CustomSelfDrawPanel.UICard card in this.dummyCards) { card.clearControls(); } this.dummyCards.Clear(); int num2 = 0; int x = 0x10; int y = 0; if (this.currentCardSection == 0) { x = 0; } if (numArray != null) { this.sortBack.Visible = false; this.AvailablePanelContent.ClipRect = new Rectangle(this.AvailablePanelContent.ClipRect.X, this.AvailablePanelContent.ClipRect.Y, this.AvailablePanelContent.ClipRect.Width, this.AvailablePanel.Height - (BorderPadding * 2)); int num5 = 0; int num6 = -1; for (int i = 0; i < numArray.Length; i += 3) { if (numArray[i + 2] != num6) { int cardType = numArray[i]; int num9 = numArray[i + 1] * 0xb2; int num10 = (numArray[i + 2] - num5) * 0xed; bool flag = false; CustomSelfDrawPanel.UICard control = null; foreach (CustomSelfDrawPanel.UICard card3 in list) { if (CardTypes.getCardType(card3.Definition.id) == cardType) { flag = true; control = card3; } } CardTypes.CardDefinition def = CardTypes.getCardDefinition(cardType); if ((!flag && (((def.cardRank <= 0) || (def.cardRarity <= 0)) || (def.available != 1))) && (num9 == 0)) { bool flag2 = false; int num11 = CardTypes.getCardType(cardType); if ((num11 >= 0xbd7) && (num11 <= 0xbf5)) { for (int j = 0; j < numArray.Length; j += 3) { if (((numArray[j + 2] == numArray[i + 2]) && (cardType != numArray[j])) && (CardTypes.getCardDefinition(numArray[j]).available == 1)) { numArray[j + 1]--; flag2 = true; } } } if (!flag2) { num5++; num6 = numArray[i + 2]; continue; } } if ((num10 + 0xed) > num2) { num2 = num10 + 0xed; } if (flag) { control.Position = new Point(num9, num10); content.addControl(control); if ((num < control.Definition.cardRank) || (control.UserIDList.Count == 0)) { control.rankLabel.Color = ARGBColors.Red; control.Hilight(ARGBColors.Gray); } else { control.rankLabel.Color = ARGBColors.White; control.Hilight(ARGBColors.White); } if (control.cardCount > 1) { control.countLabel.Text = control.cardCount.ToString(); if (control.cardCount >= 100) { control.countLabel.Font = FontManager.GetFont("Arial", 16f, FontStyle.Bold); } else { control.countLabel.Font = FontManager.GetFont("Arial", 18f, FontStyle.Bold); } } } else if (((def.cardRank > 0) && (def.cardRarity > 0)) && (def.available == 1)) { CustomSelfDrawPanel.UICard card4 = BuyCardsPanel.makeUICard(def, RemoteServices.Instance.UserID, 0x2710); card4.Position = new Point(num9, num10); content.addControl(card4); CustomSelfDrawPanel.CSDFill fill = new CustomSelfDrawPanel.CSDFill { FillColor = Color.FromArgb(170, 0, 0, 0), Alpha = 0.2f, Position = new Point(2, 1), Size = new Size((card4.Size.Width - 2) - 4, (card4.Size.Height - 1) - 5) }; card4.addControl(fill); this.dummyCards.Add(card4); card4.CustomTooltipID = 0x2775; card4.CustomTooltipData = cardType; CustomSelfDrawPanel.CSDLabel label = new CustomSelfDrawPanel.CSDLabel(); if (def.cardPoints > 0) { label.Text = SK.Text("CARDS_GetCard", "Get Card"); label.Data = def.id; label.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.linkToBuy)); } else { label.Text = SK.Text("CARDS_No_Cards", "No Cards"); } label.Position = new Point(num9 + 3, num10 + 5); label.Size = new Size(0x9d, 0xd9); label.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; label.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold); label.Color = ARGBColors.White; label.CustomTooltipID = 0x2775; label.CustomTooltipData = cardType; content.addControl(label); } } } } else { if (!this.usingRecentFilter) { this.sortBack.Visible = true; } this.AvailablePanelContent.ClipRect = new Rectangle(this.AvailablePanelContent.ClipRect.X, this.AvailablePanelContent.ClipRect.Y, this.AvailablePanelContent.ClipRect.Width, (this.AvailablePanel.Height - (BorderPadding * 2)) - 0x18); int num13 = 0; int num14 = 0; foreach (CustomSelfDrawPanel.UICard card5 in list) { card5.Position = new Point(x, y); content.addControl(card5); num14 = y; if (x > width) { x = 0x10; if (this.currentCardSection == 0) { x = 0; } if (!this.compressedCards) { y += card5.Height + 8; } else { y += 0x3a; } } else { x += card5.Width + 12; } if (this.compressedCards && (num13 < (list.Count - 4))) { card5.ClipRect = new Rectangle(0, 0, card5.Width, 60); card5.bigEffect.Visible = false; card5.rankLabel.Visible = false; } else { card5.ClipRect = Rectangle.Empty; card5.bigEffect.Visible = true; card5.rankLabel.Visible = true; } if (this.compressedCards) { CustomSelfDrawPanel.CSDLine line = new CustomSelfDrawPanel.CSDLine { Position = new Point(card5.Position.X + 3, card5.Position.Y + 1), Size = new Size(card5.Width - 7, 0), LineColor = Color.FromArgb(0x80, ARGBColors.Black) }; content.addControl(line); } num13++; if ((num < card5.Definition.cardRank) || (card5.UserIDList.Count == 0)) { card5.rankLabel.Color = ARGBColors.Red; card5.Hilight(ARGBColors.Gray); } else { card5.rankLabel.Color = ARGBColors.White; card5.Hilight(ARGBColors.White); } if (card5.cardCount > 1) { card5.countLabel.Text = card5.cardCount.ToString(); if (card5.cardCount >= 100) { card5.countLabel.Font = FontManager.GetFont("Arial", 16f, FontStyle.Bold); } else { card5.countLabel.Font = FontManager.GetFont("Arial", 18f, FontStyle.Bold); } } } if (list.Count > 0) { num2 = (num14 + list[0].Height) + 8; } } disableCardsInPlay(this.UICardList); content.invalidate(); return num2; }
public void BuildOfflineWorldList(List<WorldInfo> list) { if ((this.loggedOutWorldControls != null) && (this.loggedOutWorldControls.Count > 0)) { foreach (CustomSelfDrawPanel.CSDControl control in this.loggedOutWorldControls) { this.WorldsPanelcontrols_LoggedOut.removeControl(control); } this.loggedOutWorldControls.Clear(); } else if (this.loggedOutWorldControls == null) { this.loggedOutWorldControls = new List<CustomSelfDrawPanel.CSDControl>(); } int num = 0; for (int i = 0; i < list.Count; i++) { if (list[i].Online) { num++; } } string str = ""; Color green = ARGBColors.Green; if (num == 0) { str = SK.Text("LOGIN_ALL_OFFLINE", "All Worlds Offline"); green = ARGBColors.Red; } else if (num == list.Count) { str = SK.Text("LOGIN_ALL_ONLINE", "All Worlds Online"); } else { str = SK.Text("LOGIN_WORLDS_ONLINE", "Worlds Online : ") + num.ToString() + " / " + list.Count.ToString(); green = ARGBColors.Black; } CustomSelfDrawPanel.CSDLabel item = new CustomSelfDrawPanel.CSDLabel { Text = str, Color = green, Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold), Position = new Point(0, 0), Size = new Size(this.WorldsPanelcontrols_LoggedOut.Width, 80), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER }; this.loggedOutWorldControls.Add(item); 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, 20), 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.loggedOutWorldControls.Add(statusLinkLabel); foreach (CustomSelfDrawPanel.CSDControl control2 in this.loggedOutWorldControls) { this.WorldsPanelcontrols_LoggedOut.addControl(control2); } this.WorldsPanelcontrols_LoggedOut.Invalidate(true); }
public void init(int cardSection) { this.currentCardSection = cardSection; base.clearControls(); this.mainBackgroundImage.Image = (Image)GFXLibrary.body_background_001; 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 = (this.ContentWidth - 150) - 40; this.InplayPanelWidth = (this.ContentWidth - BorderPadding) - this.AvailablePanelWidth; this.AvailablePanel = new CustomSelfDrawPanel.CSDExtendingPanel(); this.AvailablePanel.Size = new Size(this.AvailablePanelWidth, (base.Height - 0x10) - BorderPadding); this.AvailablePanel.Position = new Point(0x10, 0x10); this.mainBackgroundImage.addControl(this.AvailablePanel); this.AvailablePanel.Create((Image)GFXLibrary.int_insetpanel_a_top_left, (Image)GFXLibrary.int_insetpanel_a_middle_top, (Image)GFXLibrary.int_insetpanel_a_top_right, (Image)GFXLibrary.int_insetpanel_a_middle_left, (Image)GFXLibrary.int_insetpanel_a_middle, (Image)GFXLibrary.int_insetpanel_a_middle_right, (Image)GFXLibrary.int_insetpanel_a_bottom_left, (Image)GFXLibrary.int_insetpanel_a_middle_bottom, (Image)GFXLibrary.int_insetpanel_a_bottom_right); int width = (base.Width - (BorderPadding * 3)) - this.AvailablePanel.Width; int height = 100; if (buttonpic == null) { buttonpic = new Bitmap(width, height); using (Graphics graphics = Graphics.FromImage(buttonpic)) { Brush green = Brushes.Green; graphics.FillRectangle(green, new Rectangle(new Point(0, 0), buttonpic.Size)); } } this.closeButton.Size = new Size(width, 0x26); this.closeButton.Text.Text = SK.Text("GENERIC_Close", "Close"); this.closeButton.Text.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER; this.closeButton.Text.Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold); this.closeButton.TextYOffset = -1; this.closeButton.Text.Color = ARGBColors.Black; this.mainBackgroundImage.addControl(this.closeButton); this.closeButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.closeClick), "Cards_Close"); this.closeButton.setNormalExtImage((Image)GFXLibrary.int_buttonbar_left_normal, (Image)GFXLibrary.int_buttonbar_middle_normal, (Image)GFXLibrary.int_buttonbar_right_normal); this.closeButton.setOverExtImage((Image)GFXLibrary.int_buttonbar_left_over, (Image)GFXLibrary.int_buttonbar_middle_over, (Image)GFXLibrary.int_buttonbar_right_over); this.closeButton.Position = new Point((base.Width - this.closeButton.Width) - BorderPadding, BorderPadding); this.playbutton.Size = new Size(width, height); this.playbutton.Position = new Point((base.Width - this.closeButton.Width) - BorderPadding, (this.closeButton.Y + this.closeButton.Height) + (BorderPadding / 2)); this.playbutton.Image = buttonpic; this.mainBackgroundImage.addControl(this.playbutton); CustomSelfDrawPanel.CSDLabel control = new CustomSelfDrawPanel.CSDLabel { Position = new Point(0, 0), Size = new Size(width, height), Text = SK.Text("OpenCardsPanel_Open_Cards", "Open Cards"), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT, Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold), Color = ARGBColors.White, DropShadowColor = ARGBColors.Black }; this.playbutton.addControl(control); this.buybutton.Size = new Size(width, 100); this.buybutton.Position = new Point((base.Width - this.closeButton.Width) - BorderPadding, (this.playbutton.Y + this.playbutton.Height) + (BorderPadding / 2)); this.buybutton.Image = buttonpic; this.mainBackgroundImage.addControl(this.buybutton); control = new CustomSelfDrawPanel.CSDLabel { Position = new Point(0, 0), Size = new Size(width, height), Text = SK.Text("OpenCardsPanel_Buy_Cards", "Buy Cards"), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT, Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold), Color = ARGBColors.White, DropShadowColor = ARGBColors.Black }; this.buybutton.addControl(control); this.premiumbutton.Size = new Size(width, 100); this.premiumbutton.Position = new Point((base.Width - this.closeButton.Width) - BorderPadding, (this.buybutton.Y + this.buybutton.Height) + (BorderPadding / 2)); this.premiumbutton.Image = buttonpic; this.mainBackgroundImage.addControl(this.premiumbutton); control = new CustomSelfDrawPanel.CSDLabel { Position = new Point(0, 0), Size = new Size(width, height), Text = SK.Text("OpenCardsPanel_Premium", "Premium"), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT, Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold), Color = ARGBColors.White, DropShadowColor = ARGBColors.Black }; this.premiumbutton.addControl(control); this.managebutton.Size = new Size(width, 100); this.managebutton.Position = new Point((base.Width - this.closeButton.Width) - BorderPadding, (this.premiumbutton.Y + this.premiumbutton.Height) + (BorderPadding / 2)); this.managebutton.Image = buttonpic; this.mainBackgroundImage.addControl(this.managebutton); control = new CustomSelfDrawPanel.CSDLabel { Position = new Point(0, 0), Size = new Size(width, height), Text = SK.Text("OpenCardsPanel_Manage_Cards", "Manage Cards"), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT, Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold), Color = ARGBColors.White, DropShadowColor = ARGBColors.Black }; this.managebutton.addControl(control); this.crownsbutton.Size = new Size(width, 100); this.crownsbutton.Position = new Point((base.Width - this.closeButton.Width) - BorderPadding, (this.managebutton.Y + this.managebutton.Height) + (BorderPadding / 2)); this.crownsbutton.Image = buttonpic; this.mainBackgroundImage.addControl(this.crownsbutton); control = new CustomSelfDrawPanel.CSDLabel { Position = new Point(0, 0), Size = new Size(width, height), Text = SK.Text("OpenCardsPanel_Get_Crowns", "Get Crowns"), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT, Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold), Color = ARGBColors.White, DropShadowColor = ARGBColors.Black }; this.crownsbutton.addControl(control); this.labelTitle.Position = new Point(BorderPadding, 2); this.labelTitle.Size = new Size(300, 0x40); this.labelTitle.Text = SK.Text("OpenCardsPanel_Latest_Offers", "Latest Offers"); this.labelTitle.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT; this.labelTitle.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold); this.labelTitle.Color = ARGBColors.White; this.labelTitle.DropShadowColor = ARGBColors.Black; this.mainBackgroundImage.addControl(this.labelTitle); }
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 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; }
private void GetOfflineWorldsCallback(IAuthProvider sender, IAuthResponse response) { if (response.SuccessCode != 1) { this.throwClientErrorConnection(this.lblLoginError, response.Message); } else { WorldList = ((XmlRpcAuthResponse) response).WorldList; LanguageList = new Dictionary<string, LocalizationLanguage>(); foreach (WorldInfo info in WorldList) { if (!LanguageList.ContainsKey(info.Supportculture)) { LocalizationLanguage language = new LocalizationLanguage { CultureCode = info.Supportculture }; LanguageList.Add(info.Supportculture, language); } } if (Program.mySettings.NumWorldsCount < 0) { Program.mySettings.NumWorldsCount = WorldList.Count; Program.mySettings.NumWorldsLastChanged = DateTime.MinValue; Program.mySettings.Save(); } else if (Program.mySettings.NumWorldsCount != WorldList.Count) { Program.mySettings.NumWorldsCount = WorldList.Count; Program.mySettings.NumWorldsLastChanged = DateTime.Now; Program.mySettings.Save(); NewWorldsAvailable = true; } else { TimeSpan span = (TimeSpan) (DateTime.Now - Program.mySettings.NumWorldsLastChanged); if (span.TotalDays < 7.0) { NewWorldsAvailable = true; } } if (DateTime.Now < new DateTime(0x7dc, 2, 0x12)) { NewWorldsAvailable = false; } List<WorldInfo> worldsBySupportCulture = this.GetWorldsBySupportCulture(""); this.BuildOfflineWorldList(worldsBySupportCulture); if (NewWorldsAvailable) { if (this.lblNewWorlds == null) { this.lblNewWorlds = new CustomSelfDrawPanel.CSDLabel(); } this.lblNewWorlds.Text = SK.Text("LOGIN_New_Worlds", "A New World is available!"); this.lblNewWorlds.Color = ARGBColors.Green; this.lblNewWorlds.Position = new Point(10, this.LoginPanelControls_LoggedOut.Height - 70); this.lblNewWorlds.Size = new Size(this.LoginPanelControls_LoggedOut.Width - 20, 40); this.lblNewWorlds.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER; this.lblNewWorlds.Font = FontManager.GetFont("Arial", 8f, FontStyle.Regular); this.LoginPanelControls_LoggedOut.removeControl(this.lblNewWorlds); this.LoginPanelControls_LoggedOut.addControl(this.lblNewWorlds); } if (this.chkAutoLogin != null) { this.chkAutoLogin.Visible = false; } if (Program.mySettings.LastWorldID >= 0) { string str = ""; foreach (WorldInfo info2 in worldsBySupportCulture) { if (info2.KingdomsWorldID == Program.mySettings.LastWorldID) { str = getWorldShortDesc(info2); break; } } if (str.Length > 0) { if (this.chkAutoLogin != null) { this.LoginPanelControls_LoggedOut.removeControl(this.chkAutoLogin); } this.chkAutoLogin = new CustomSelfDrawPanel.CSDCheckBox(); this.chkAutoLogin.CheckedImage = (Image) GFXLibrary.mrhp_world_filter_check[0]; this.chkAutoLogin.UncheckedImage = (Image) GFXLibrary.mrhp_world_filter_check[1]; this.chkAutoLogin.Position = new Point(10, this.LoginPanelControls_LoggedOut.Height - 90); this.chkAutoLogin.Checked = Program.mySettings.AutoLogin; this.chkAutoLogin.CBLabel.Text = SK.Text("LOGIN_Auto_Load", "Auto Connect to : ") + str; this.chkAutoLogin.CBLabel.Color = ARGBColors.Black; this.chkAutoLogin.CBLabel.Position = new Point(20, -1); this.chkAutoLogin.CBLabel.Size = new Size(this.LoginPanelControls_LoggedOut.Width, 0x19); this.chkAutoLogin.CBLabel.Font = FontManager.GetFont("Arial", 8f, FontStyle.Regular); this.chkAutoLogin.setCheckChangedDelegate(new CustomSelfDrawPanel.CSDCheckBox.CSD_CheckChangedDelegate(this.autoLoadToggled)); this.chkAutoLogin.Visible = true; this.LoginPanelControls_LoggedOut.addControl(this.chkAutoLogin); this.LoginPanelControls_LoggedOut.Invalidate(); } } } }
private CustomSelfDrawPanel.CSDLabel getNextLabel() { if (this.curLabelID >= this.labelCache.Count) { CustomSelfDrawPanel.CSDLabel item = new CustomSelfDrawPanel.CSDLabel(); this.labelCache.Add(item); this.curLabelID++; return item; } this.curLabelID++; return this.labelCache[this.curLabelID - 1]; }
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("&", "&"); 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 static CustomSelfDrawPanel.UICard makeUICard(CardTypes.CardDefinition def, int userid, int playerRank) { Color red; CustomSelfDrawPanel.UICard card = new CustomSelfDrawPanel.UICard { UserID = userid }; card.UserIDList.Add(userid); card.Definition = def; switch (card.Definition.cardColour) { case 1: card.bigFrame = GFXLibrary.BlueCardOverlayBig; card.bigFrameOver = GFXLibrary.BlueCardOverlayBigOver; break; case 2: card.bigFrame = GFXLibrary.GreenCardOverlayBig; card.bigFrameOver = GFXLibrary.GreenCardOverlayBigOver; break; case 3: card.bigFrame = GFXLibrary.PurpleCardOverlayBig; card.bigFrameOver = GFXLibrary.PurpleCardOverlayBigOver; break; case 4: card.bigFrame = GFXLibrary.RedCardOverlayBig; card.bigFrameOver = GFXLibrary.RedCardOverlayBigOver; break; case 5: card.bigFrame = GFXLibrary.YellowCardOverlayBig; card.bigFrameOver = GFXLibrary.YellowCardOverlayBigOver; break; } card.bigImage = GFXLibrary.Instance.getCardImageBig(card.Definition.id); card.Size = card.bigFrame.Size; card.CustomTooltipID = 0x2775; card.CustomTooltipData = card.Definition.id; card.bigGradeImage = new CustomSelfDrawPanel.CSDImage(); int num = CardTypes.getGrade(card.Definition.cardGrade); switch (num) { case 0x10000: card.bigGradeImage.Image = (Image) GFXLibrary.CardGradeBronze; card.bigGradeImage.Position = new Point(card.Width - card.bigGradeImage.Width, 0); break; case 0x20000: card.bigGradeImage.Image = (Image) GFXLibrary.CardGradeSilver; card.bigGradeImage.Position = new Point(card.Width - card.bigGradeImage.Width, 0); break; case 0x40000: card.bigGradeImage.Image = (Image) GFXLibrary.card_gold_anim[0]; card.bigGradeImage.Position = new Point((card.Width - card.bigGradeImage.Width) - 3, 0); break; case 0x200000: card.bigGradeImage.Image = (Image) GFXLibrary.card_diamond3_anim[0]; card.bigGradeImage.Position = new Point((card.Width - card.bigGradeImage.Width) - 3, -10); break; case 0x400000: card.bigGradeImage.Image = (Image) GFXLibrary.card_sapphire_anim[0]; card.bigGradeImage.Position = new Point((card.Width - card.bigGradeImage.Width) - 3, -12); break; case 0x80000: card.bigGradeImage.Image = (Image) GFXLibrary.card_diamond_anim[0]; card.bigGradeImage.Position = new Point((card.Width - card.bigGradeImage.Width) - 3, -2); break; case 0x100000: card.bigGradeImage.Image = (Image) GFXLibrary.card_diamond2_anim[0]; card.bigGradeImage.Position = new Point((card.Width - card.bigGradeImage.Width) - 3, -7); break; default: card.bigGradeImage.Image = (Image) GFXLibrary.CardGradeBronze; card.bigGradeImage.Position = new Point(card.Width - card.bigGradeImage.Width, 0); break; } card.bigBaseImage = new CustomSelfDrawPanel.CSDImage(); card.bigBaseImage.Position = new Point(10, 11); card.bigBaseImage.Size = card.bigImage.Size; card.bigBaseImage.Image = (Image) card.bigImage; card.addControl(card.bigBaseImage); card.bigFrameImage = new CustomSelfDrawPanel.CSDImage(); card.bigFrameImage.Position = new Point(0, 0); card.bigFrameImage.Size = card.bigFrame.Size; card.bigFrameImage.Image = (Image) card.bigFrame; card.addControl(card.bigFrameImage); switch (num) { case 0x40000: card.bigFrameExtraImage = new CustomSelfDrawPanel.CSDImage(); card.bigFrameExtraImage.Position = new Point(0, 0); card.bigFrameExtraImage.Image = (Image) GFXLibrary.card_frame_overlay_gold; card.addControl(card.bigFrameExtraImage); break; case 0x80000: case 0x100000: case 0x200000: card.bigFrameExtraImage = new CustomSelfDrawPanel.CSDImage(); card.bigFrameExtraImage.Position = new Point(0, 0); card.bigFrameExtraImage.Image = (Image) GFXLibrary.card_frame_overlay_diamond; card.addControl(card.bigFrameExtraImage); break; case 0x400000: card.bigFrameExtraImage = new CustomSelfDrawPanel.CSDImage(); card.bigFrameExtraImage.Position = new Point(0, 0); card.bigFrameExtraImage.Image = (Image) GFXLibrary.card_frame_overlay_sapphire; card.addControl(card.bigFrameExtraImage); break; } card.bigGradeImage.Size = card.bigGradeImage.Image.Size; card.addControl(card.bigGradeImage); card.bigTitle = new CustomSelfDrawPanel.CSDLabel(); card.bigTitle.Text = CardTypes.getDescriptionFromCard(card.Definition.id); card.bigTitle.Size = new Size(110, 0x30); card.bigTitle.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT; if (((((card.Definition.id == 0x709) || (card.Definition.id == 0x606)) || ((card.Definition.id == 0xc41) || (card.Definition.id == 0x50a))) || ((card.Definition.id == 0x605) || (card.Definition.id == 0x607))) && (Program.mySettings.LanguageIdent == "de")) { card.bigTitle.Font = FontManager.GetFont("Arial", 8f, FontStyle.Bold); } else { card.bigTitle.Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold); } card.bigTitle.Color = ARGBColors.White; card.bigTitle.DropShadowColor = ARGBColors.Black; card.bigTitle.Position = new Point(0x26, 12); card.addControl(card.bigTitle); card.bigEffect = new CustomSelfDrawPanel.CSDLabel(); card.bigEffect.Text = card.Definition.EffectText; card.bigEffect.Size = new Size(150, 0x40); card.bigEffect.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT; card.bigEffect.Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold); if ((Program.mySettings.LanguageIdent == "de") && CardTypes.isGermanSmallDesc(card.Definition.id)) { card.bigEffect.Font = FontManager.GetFont("Arial", 8f, FontStyle.Bold); } card.bigEffect.Color = ARGBColors.White; card.bigEffect.DropShadowColor = ARGBColors.Black; card.bigEffect.Position = new Point(14, 0xae); card.addControl(card.bigEffect); CustomSelfDrawPanel.CSDLabel control = new CustomSelfDrawPanel.CSDLabel { Position = new Point(2, 2), Size = new Size(card.Width, card.Height), Text = "", Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT, Font = FontManager.GetFont("Arial", 18f, FontStyle.Bold), Color = ARGBColors.Yellow, DropShadowColor = ARGBColors.Black }; card.addControl(control); card.countLabel = control; if (playerRank < card.Definition.cardRank) { red = ARGBColors.Red; } else { red = ARGBColors.White; } CustomSelfDrawPanel.CSDLabel label2 = new CustomSelfDrawPanel.CSDLabel { Position = new Point(150, 220), Size = new Size(20, 13), Text = card.Definition.cardRank.ToString(), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_CENTER, Font = FontManager.GetFont("Arial", 10f, FontStyle.Bold), Color = red, DropShadowColor = ARGBColors.Black }; card.addControl(label2); card.rankLabel = label2; if (playerRank < card.Definition.cardRank) { card.Hilight(ARGBColors.Gray); } else { card.Hilight(ARGBColors.White); } card.ScaleAll(0.95); return card; }
public void init(int cardSection) { CustomSelfDrawPanel.CSDImage image2; this.inSend = false; 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, 0x181); this.AvailablePanel.Position = new Point(8, (base.Height - 8) - 0x181); 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 num8 = 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, 0x25, 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.mainBackgroundImage.Height); this.greyout.Position = new Point(0, 0); 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(0x3a7, 0x40); this.labelTitle.Text = SK.Text("PremiumCardsPanel_Buy_and_Open_Packs", "Buy and Play Premium Tokens: 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.premiumInPlay = GameEngine.Instance.World.UserCardData.premiumCard > 0; if (GameEngine.Instance.World.UserCardData.premiumCard == 0x1010) { this.maxExpirySeconds = 604800.0; } else if (GameEngine.Instance.World.UserCardData.premiumCard == 0x1012) { this.maxExpirySeconds = 2592000.0; } else if (GameEngine.Instance.World.UserCardData.premiumCard == 0x1011) { this.maxExpirySeconds = 172800.0; } else if (GameEngine.Instance.World.UserCardData.premiumCard == 0x1014) { this.maxExpirySeconds = 0.0; } this.currentExpirySeconds = GameEngine.Instance.World.UserCardData.premiumCardExpiry.Subtract(VillageMap.getCurrentServerTime()).TotalSeconds; this.expiryDays = this.currentExpirySeconds / 86400.0; this.expiryHours = (this.currentExpirySeconds % 86400.0) / 3600.0; this.expiryMinutes = (this.currentExpirySeconds % 3600.0) / 60.0; if (this.maxExpirySeconds > 0.0) { double num = this.currentExpirySeconds / this.maxExpirySeconds; this.expiryBarCurrent = Convert.ToInt32(Math.Floor((double) (num * expiryBarMax))); } else { this.expiryBarCurrent = -1; } if (GameEngine.Instance.World.UserCardData.premiumCard > 0) { this.premiumTokenImage = GFXLibrary.PremiumTokens[GameEngine.Instance.World.UserCardData.premiumCard][0]; } else { this.premiumTokenImage = GFXLibrary.PremiumTokens[0x1010][0]; } this.PremiumInplayImage.Visible = false; this.PremiumInplayImage.Image = this.premiumTokenImage; this.PremiumInplayImage.Size = this.premiumTokenImage.Size; this.PremiumInplayImage.Position = new Point(((this.AvailablePanel.X + this.AvailablePanel.Width) - 0x20) - this.PremiumInplayImage.Width, this.cardsButtons.Y + 8); this.PremiumInplayImage.setMouseOverDelegate(delegate { if (GameEngine.Instance.World.UserCardData.premiumCard > 0) { this.PremiumInplayImage.Image = GFXLibrary.PremiumTokens[GameEngine.Instance.World.UserCardData.premiumCard][1]; } }, delegate { if (GameEngine.Instance.World.UserCardData.premiumCard > 0) { this.PremiumInplayImage.Image = GFXLibrary.PremiumTokens[GameEngine.Instance.World.UserCardData.premiumCard][0]; } }); this.mainBackgroundImage.addControl(this.PremiumInplayImage); if (this.expiryBarCurrent >= 0) { this.TimerOuter = new CustomSelfDrawPanel.CSDFill(); this.TimerInner = new CustomSelfDrawPanel.CSDFill(); } else { this.TimerInner = null; this.TimerOuter = null; } this.PremiumTokensLabel = new CustomSelfDrawPanel.CSDLabel(); this.PremiumTokensLabel.Position = new Point(this.AvailablePanel.X + 0x20, this.AvailablePanel.Y - 0x18); this.PremiumTokensLabel.Size = new Size(450, 0x20); this.PremiumTokensLabel.Text = SK.Text("PremiumCardsPanel_Current_Tokens", "Current Premium Tokens") + " : " + GameEngine.Instance.World.ProfilePremiumTokens.Count.ToString() + ((GameEngine.Instance.World.ProfilePremiumTokens.Count > 0) ? (" (" + SK.Text("PremiumCardsPanel_Click_To_Play", "click one to play") + ")") : ""); this.PremiumTokensLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT; this.PremiumTokensLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Regular); this.PremiumTokensLabel.Color = ARGBColors.Black; this.mainBackgroundImage.addControl(this.PremiumTokensLabel); CustomSelfDrawPanel.CSDImage image3 = new CustomSelfDrawPanel.CSDImage(); BaseImage image4 = GFXLibrary.cardpanel_premium_ad; image3.Image = (Image) image4; image3.Size = image4.Size; image3.Position = new Point(0, 0); CustomSelfDrawPanel.CSDImage PremiumAdvert7 = new CustomSelfDrawPanel.CSDImage(); CustomSelfDrawPanel.CSDImage PremiumAdvert30 = new CustomSelfDrawPanel.CSDImage(); BaseImage AdImage7 = GFXLibrary.premiumAdvert7; BaseImage AdImage7_over = GFXLibrary.premiumAdvert7_over; BaseImage AdImage30 = GFXLibrary.premiumAdvert30; BaseImage AdImage30_over = GFXLibrary.premiumAdvert30_over; PremiumAdvert7.Image = (Image) AdImage7; PremiumAdvert7.Size = AdImage7.Size; PremiumAdvert7.Position = new Point(0, 0); this.AvailablePanelContent.addControl(PremiumAdvert7); PremiumAdvert30.Image = (Image) AdImage30; PremiumAdvert30.Size = AdImage30.Size; PremiumAdvert30.Position = new Point(0x16b, 0); this.AvailablePanelContent.addControl(PremiumAdvert30); PremiumAdvert7.Data = 0x1010; PremiumAdvert30.Data = 0x1012; PremiumAdvert7.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.ClickedOffer), "PremiumCardsPanel_buy_premium"); PremiumAdvert30.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.ClickedOffer), "PremiumCardsPanel_buy_premium"); PremiumAdvert7.setMouseOverDelegate(() => PremiumAdvert7.Image = (Image) AdImage7_over, () => PremiumAdvert7.Image = (Image) AdImage7); PremiumAdvert30.setMouseOverDelegate(() => PremiumAdvert30.Image = (Image) AdImage30_over, () => PremiumAdvert30.Image = (Image) AdImage30); image3.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.ClickedOffer), "PremiumCardsPanel_buy_premium"); image3.Data = 0x1010; CustomSelfDrawPanel.CSDLabel label = new CustomSelfDrawPanel.CSDLabel { Position = new Point(0, image3.Height + 8), Size = new Size(600, 0x20), Text = SK.Text("PremiumCardsPanel_Benefits", "Premium Benefits"), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT, Font = FontManager.GetFont("Arial", 14f, FontStyle.Bold), Color = ARGBColors.Gold }; this.AvailablePanelContent.addControl(label); CustomSelfDrawPanel.CSDLabel label2 = new CustomSelfDrawPanel.CSDLabel { Position = new Point(0, ((image3.Height + 8) + label.Height) + 4), Size = new Size(600, 30), Text = SK.Text("PremiumCardsPanel_Building_Queue", "Building Queue"), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT, Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold), Color = ARGBColors.Goldenrod }; this.AvailablePanelContent.addControl(label2); CustomSelfDrawPanel.CSDLabel label3 = new CustomSelfDrawPanel.CSDLabel { Position = new Point(110, ((label2.Y + label2.Height) + 4) - 11), Size = new Size(590, 50), Text = SK.Text("PremiumCardsPanel_Buildings_Queue_Info", "This allows up to 5 buildings to be queued for construction in the village. You can also move all buildings within your village screen."), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT, Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular), Color = ARGBColors.White }; this.AvailablePanelContent.addControl(label3); CustomSelfDrawPanel.CSDImage image5 = new CustomSelfDrawPanel.CSDImage { Image = (Image) GFXLibrary.premiumIcons[0], Position = new Point(4, ((label2.Y + label2.Height) + 4) - 10) }; this.AvailablePanelContent.addControl(image5); CustomSelfDrawPanel.CSDLabel label4 = new CustomSelfDrawPanel.CSDLabel { Position = new Point(0, (label3.Y + label3.Height) + 4), Size = new Size(600, 30), Text = SK.Text("PremiumCardsPanel_Research_Queue", "Research Queue"), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT, Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold), Color = ARGBColors.Goldenrod }; this.AvailablePanelContent.addControl(label4); CustomSelfDrawPanel.CSDLabel label5 = new CustomSelfDrawPanel.CSDLabel { Position = new Point(110, ((label4.Y + label4.Height) + 4) - 11), Size = new Size(590, 50), Text = SK.Text("PremiumCardsPanel_Research_Queue_Info", "This allows up to 5 researches to be queued in the research screen."), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT, Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular), Color = ARGBColors.White }; this.AvailablePanelContent.addControl(label5); CustomSelfDrawPanel.CSDImage image6 = new CustomSelfDrawPanel.CSDImage { Image = (Image) GFXLibrary.premiumIcons[1], Position = new Point(4, ((label4.Y + label4.Height) + 4) - 10) }; this.AvailablePanelContent.addControl(image6); CustomSelfDrawPanel.CSDLabel label6 = new CustomSelfDrawPanel.CSDLabel { Position = new Point(0, (label5.Y + label5.Height) + 4), Size = new Size(600, 30), Text = SK.Text("PremiumCardsPanel_Auto_Trading", "Auto Trading"), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT, Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold), Color = ARGBColors.Goldenrod }; this.AvailablePanelContent.addControl(label6); CustomSelfDrawPanel.CSDLabel label7 = new CustomSelfDrawPanel.CSDLabel { Position = new Point(110, ((label6.Y + label6.Height) + 4) - 11), Size = new Size(590, 50), Text = SK.Text("PremiumCardsPanel_Auto_Trading_Info", "This allows the trade one type of good to the parish capitals market automatically while you are logged out.") + " (" + SK.Text("PremiumCardsPanel_Auto_Extra", "Activates once every 2 to 4 hours.") + ")", Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT, Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular), Color = ARGBColors.White }; this.AvailablePanelContent.addControl(label7); CustomSelfDrawPanel.CSDImage image7 = new CustomSelfDrawPanel.CSDImage { Image = (Image) GFXLibrary.premiumIcons[2], Position = new Point(4, ((label6.Y + label6.Height) + 4) - 10) }; this.AvailablePanelContent.addControl(image7); CustomSelfDrawPanel.CSDLabel label8 = new CustomSelfDrawPanel.CSDLabel { Position = new Point(0, (label7.Y + label7.Height) + 4), Size = new Size(600, 30), Text = SK.Text("PremiumCardsPanel_Auto_Scouting", "Auto Scouting"), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT, Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold), Color = ARGBColors.Goldenrod }; this.AvailablePanelContent.addControl(label8); CustomSelfDrawPanel.CSDLabel label9 = new CustomSelfDrawPanel.CSDLabel { Position = new Point(110, ((label8.Y + label8.Height) + 4) - 11), Size = new Size(590, 50), Text = SK.Text("PremiumCardsPanel_Auto_Scouting_Info", "This will send out all available scouts to stashes within the parish the village is located, automatically while you are logged out.") + " (" + SK.Text("PremiumCardsPanel_Auto_Extra", "Activates once every 2 to 4 hours.") + ")", Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT, Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular), Color = ARGBColors.White }; this.AvailablePanelContent.addControl(label9); CustomSelfDrawPanel.CSDImage image8 = new CustomSelfDrawPanel.CSDImage { Image = (Image) GFXLibrary.premiumIcons[3], Position = new Point(4, ((label8.Y + label8.Height) + 4) - 10) }; this.AvailablePanelContent.addControl(image8); CustomSelfDrawPanel.CSDLabel label10 = new CustomSelfDrawPanel.CSDLabel { Position = new Point(0, (label9.Y + label9.Height) + 4), Size = new Size(600, 30), Text = SK.Text("PremiumCardsPanel_Auto_Attacking", "Auto Attacking"), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT, Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold), Color = ARGBColors.Goldenrod }; this.AvailablePanelContent.addControl(label10); CustomSelfDrawPanel.CSDLabel label11 = new CustomSelfDrawPanel.CSDLabel { Position = new Point(110, ((label10.Y + label10.Height) + 4) - 11), Size = new Size(590, 50), Text = SK.Text("PremiumCardsPanel_Auto_Attacking_Info", "This will send out attacks to chosen targets automatically while you are logged out.") + " (" + SK.Text("PremiumCardsPanel_Auto_Extra", "Activates once every 2 to 4 hours.") + ")", Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT, Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular), Color = ARGBColors.White }; this.AvailablePanelContent.addControl(label11); CustomSelfDrawPanel.CSDImage image9 = new CustomSelfDrawPanel.CSDImage { Image = (Image) GFXLibrary.premiumIcons[4], Position = new Point(4, ((label10.Y + label10.Height) + 4) - 10) }; this.AvailablePanelContent.addControl(image9); CustomSelfDrawPanel.CSDLabel label12 = new CustomSelfDrawPanel.CSDLabel { Position = new Point(0, (label11.Y + label11.Height) + 4), Size = new Size(600, 30), Text = SK.Text("PremiumCardsPanel_Auto_Recruit", "Auto Recruit"), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT, Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold), Color = ARGBColors.Goldenrod }; this.AvailablePanelContent.addControl(label12); CustomSelfDrawPanel.CSDLabel label13 = new CustomSelfDrawPanel.CSDLabel { Position = new Point(110, ((label12.Y + label12.Height) + 4) - 11), Size = new Size(590, 50), Text = SK.Text("PremiumCardsPanel_Auto_Recruit_Info", "This will automatically conscript idle peasants to your army.") + " (" + SK.Text("PremiumCardsPanel_Auto_Extra", "Activates once every 2 to 4 hours.") + ")", Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT, Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular), Color = ARGBColors.White }; this.AvailablePanelContent.addControl(label13); CustomSelfDrawPanel.CSDImage image10 = new CustomSelfDrawPanel.CSDImage { Image = (Image) GFXLibrary.premiumIcons[5], Position = new Point(4, ((label12.Y + label12.Height) + 4) - 10) }; this.AvailablePanelContent.addControl(image10); CustomSelfDrawPanel.CSDLabel label14 = new CustomSelfDrawPanel.CSDLabel { Position = new Point(0, (label13.Y + label13.Height) + 4), Size = new Size(600, 30), Text = SK.Text("PremiumCardsPanel_Village_Overview", "Village Overview"), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT, Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold), Color = ARGBColors.Goldenrod }; this.AvailablePanelContent.addControl(label14); CustomSelfDrawPanel.CSDLabel label15 = new CustomSelfDrawPanel.CSDLabel { Position = new Point(110, ((label14.Y + label14.Height) + 4) - 11), Size = new Size(590, 50), Text = SK.Text("PremiumCardsPanel_Village_Overview_Info", "This allows players to keep track of essential information on all their villages, such as income from taxes, housing capacity, popularity and more."), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT, Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular), Color = ARGBColors.White }; this.AvailablePanelContent.addControl(label15); CustomSelfDrawPanel.CSDImage image11 = new CustomSelfDrawPanel.CSDImage { Image = (Image) GFXLibrary.premiumIcons[6], Position = new Point(4, ((label14.Y + label14.Height) + 4) - 10) }; this.AvailablePanelContent.addControl(image11); CustomSelfDrawPanel.CSDLabel label16 = new CustomSelfDrawPanel.CSDLabel { Position = new Point(0, (label15.Y + label15.Height) + 4), Size = new Size(600, 30), Text = SK.Text("PremiumCardsPanel_Vacation_Mode", "Vacation Mode"), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT, Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold), Color = ARGBColors.Goldenrod }; this.AvailablePanelContent.addControl(label16); CustomSelfDrawPanel.CSDLabel label17 = new CustomSelfDrawPanel.CSDLabel { Position = new Point(110, ((label16.Y + label16.Height) + 4) - 11), Size = new Size(590, 50), Text = SK.Text("PremiumCardsPanel_Vacation_Mode_Info", "This allows players to protect their villages from attack for up to 15 days."), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT, Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular), Color = ARGBColors.White }; this.AvailablePanelContent.addControl(label17); CustomSelfDrawPanel.CSDImage image12 = new CustomSelfDrawPanel.CSDImage { Image = (Image) GFXLibrary.premiumIcons[7], Position = new Point(4, ((label16.Y + label16.Height) + 4) - 10) }; this.AvailablePanelContent.addControl(image12); CustomSelfDrawPanel.CSDLabel label18 = new CustomSelfDrawPanel.CSDLabel { Position = new Point(0, (label17.Y + label17.Height) + 4), Size = new Size(600, 30), Text = SK.Text("PremiumCardsPanel_AdvancedTrading", "Advanced Trading Option"), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT, Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold), Color = ARGBColors.Goldenrod }; this.AvailablePanelContent.addControl(label18); CustomSelfDrawPanel.CSDLabel label19 = new CustomSelfDrawPanel.CSDLabel { Position = new Point(110, ((label18.Y + label18.Height) + 4) - 11), Size = new Size(590, 50), Text = SK.Text("PremiumCardsPanel_AdvancedTrading_Info", "This allows players to find the best prices for goods in nearby Markets."), Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT, Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular), Color = ARGBColors.White }; this.AvailablePanelContent.addControl(label19); CustomSelfDrawPanel.CSDImage image13 = new CustomSelfDrawPanel.CSDImage { Image = (Image) GFXLibrary.premiumIcons[8], Position = new Point(4, ((label18.Y + label18.Height) + 4) - 10) }; this.AvailablePanelContent.addControl(image13); int height = (label19.Y + label19.Height) + 6; this.AvailablePanelContent.Position = new Point(BorderPadding, BorderPadding); this.AvailablePanelContent.Size = new Size(this.AvailablePanel.Width, height); this.AvailablePanelContent.ClipRect = new Rectangle(0, 0, this.AvailablePanel.Width - BorderPadding, this.AvailablePanel.Height - (BorderPadding * 2)); 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; } this.expiryLabel = new CustomSelfDrawPanel.CSDLabel(); if (this.TimerInner != null) { this.ExpiryBar = new CustomSelfDrawPanel.CSDHorzProgressBar(); this.ExpiryBar.Size = new Size(170, 0); this.ExpiryBar.Position = new Point(this.PremiumInplayImage.X - 13, this.PremiumInplayImage.Y + this.PremiumInplayImage.Height); this.ExpiryBar.Create((Image) GFXLibrary.cardpanel_prem_timer_back_left, (Image) GFXLibrary.cardpanel_prem_timer_back_mid, (Image) GFXLibrary.cardpanel_prem_timer_back_right, (Image) GFXLibrary.cardpanel_prem_timer_fill_left, (Image) GFXLibrary.cardpanel_prem_timer_fill_mid, (Image) GFXLibrary.cardpanel_prem_timer_fill_right); this.ExpiryBar.setValues(this.currentExpirySeconds, this.maxExpirySeconds); this.mainBackgroundImage.addControl(this.ExpiryBar); this.expiryLabel.Position = new Point(this.ExpiryBar.X, this.ExpiryBar.Y + this.ExpiryBar.Height); this.expiryLabel.Size = new Size(this.ExpiryBar.Width, 0x10); } else { this.expiryLabel.Position = new Point(this.PremiumInplayImage.X - 13, this.PremiumInplayImage.Y + this.PremiumInplayImage.Height); this.expiryLabel.Size = new Size(170, 0x10); } this.expiryLabel.Visible = false; this.expiryLabel.Text = Math.Floor(this.expiryDays).ToString().PadLeft(2, '0') + ":" + Math.Floor(this.expiryHours).ToString().PadLeft(2, '0') + ":" + Math.Floor(this.expiryMinutes).ToString().PadLeft(2, '0') + " (" + SK.Text("PremiumCardsPanel_Day_Hour_Minute", "dd:hh:mm") + ")"; this.expiryLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_CENTER; this.expiryLabel.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular); this.expiryLabel.Color = ARGBColors.Black; this.mainBackgroundImage.addControl(this.expiryLabel); this.UpdatePremiumTokens(); this.UpdateExpiry(); }