public override void setData(GetReport_ReturnType returnData) { base.setData(returnData); switch (returnData.reportType) { case 0x49: base.lblMainText.Text = returnData.otherUser + " (" + GameEngine.Instance.World.getVillageName(returnData.attackingVillage) + ")"; base.lblSubTitle.Text = SK.Text("Reports_Sent_Resources_To", "Has sent resources to"); base.lblSecondaryText.Text = base.reportOwner + " (" + GameEngine.Instance.World.getVillageName(returnData.defendingVillage) + ")"; break; case 0x4e: base.lblMainText.Text = GameEngine.Instance.World.getVillageName(returnData.attackingVillage); base.lblSubTitle.Text = SK.Text("Report_Auto_Sent_Resources_To", "Has Auto-Sent resources to"); base.lblSecondaryText.Text = GameEngine.Instance.World.getVillageName(returnData.defendingVillage); break; } base.imgFurther.Image = (Image)GFXLibrary.getCommodity32Image(base.m_returnData.genericData1); base.imgFurther.setSizeToImage(); base.imgFurther.Position = new Point((base.Width / 2) - base.imgFurther.Width, base.btnDelete.Position.Y); base.lblFurther.Text = base.m_returnData.genericData2.ToString("N", base.nfi); base.lblFurther.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT; base.lblFurther.Size = new Size(base.Width, base.imgFurther.Height); base.lblFurther.Position = new Point(base.imgFurther.Rectangle.Right + 10, base.imgFurther.Position.Y); base.showFurtherInfo(); }
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 update() { this.backGround.update(); if (this.m_trader != null) { if (this.m_trader.trader.traderState != this.lastState) { this.lastState = this.m_trader.trader.traderState; this.backGround.updateTravelButton(this.homeVillageButton, this.m_trader.trader.homeVillageID); this.backGround.updateTravelButton(this.targetVillageButton, this.m_trader.trader.targetVillageID); this.resourceImage.Visible = false; this.resourceAmountLabel.Visible = false; if (this.lastState == 0) { InterfaceMgr.Instance.closeTraderInfoPanel(); return; } if (((this.lastState == 1) || (this.lastState == 3)) || (this.lastState == 6)) { this.backGround.updatePanelText(SK.Text("SelectArmyPanel_Trading", "Trading")); if (GameEngine.Instance.World.isUserVillage(this.m_trader.trader.homeVillageID)) { this.resourceImage.Image = (Image)GFXLibrary.getCommodity32DSImage(this.m_trader.trader.resource); this.resourceImage.Visible = true; NumberFormatInfo nFI = GameEngine.NFI; this.resourceAmountLabel.TextDiffOnly = GameEngine.Instance.World.getTradingAmount(this.m_trader.traderID).ToString("N", nFI); this.resourceAmountLabel.Visible = true; } if (this.lastState == 6) { this.travelDirection.Image = (Image)GFXLibrary.mrhp_travelling_arrows[1]; } else { this.travelDirection.Image = (Image)GFXLibrary.mrhp_travelling_arrows[0]; } } else if ((this.lastState == 2) || (this.lastState == 4)) { this.backGround.updatePanelText(SK.Text("SelectArmyPanel_Returning", "Returning")); this.travelDirection.Image = (Image)GFXLibrary.mrhp_travelling_arrows[1]; } else if (this.lastState == 5) { this.backGround.updatePanelText(SK.Text("SelectArmyPanel_Collecting", "Collecting")); this.travelDirection.Image = (Image)GFXLibrary.mrhp_travelling_arrows[0]; } } double num2 = DXTimer.GetCurrentMilliseconds() / 1000.0; double num3 = this.m_trader.localEndTime - num2; if (num3 < 0.0) { num3 = 0.0; } string subHeading = VillageMap.createBuildTimeString((int)num3); this.backGround.updateSubHeading(subHeading); } }
private void tabPage3_Enter() { if ((this.lastTab != 2) && !this.ignore) { GFXLibrary.Instance.changeView(GFXLibrary.getPanelDescFromID(0xcb)); this.lastTab = 2; this.tabChangeCallback(2); } }
private void tabPage2_Enter() { if ((this.lastTab != 1) && !this.ignore) { GFXLibrary.Instance.changeView(GFXLibrary.getPanelDescFromID(0xca)); this.lastTab = 1; GameEngine.Instance.forceResetVillageIfChangedFromCapital(); this.tabChangeCallback(1); } }
private void tabPage9_Enter() { if ((this.lastTab != 8) && !this.ignore) { GFXLibrary.Instance.changeView(GFXLibrary.getPanelDescFromID(0xd1)); this.lastTab = 8; GameEngine.Instance.GameDisplayMode = GameEngine.GameDisplays.DISPLAY_TEMP_DUMMY; GameEngine.Instance.ResetVillageIfChangedFromCapital(); this.tabChangeCallback(8); } }
public void setResources(int resourceType, int amount) { if (resourceType != -1) { base.lblFurther.Text = amount.ToString(); base.imgFurther.Image = (Image)GFXLibrary.getCommodity32Image(resourceType); } base.lblDate.Y = base.lblDate.Position.Y - 20; base.imgFurther.setSizeToImage(); base.imgFurther.Position = new Point((base.Width / 2) - base.imgFurther.Width, base.btnDelete.Rectangle.Bottom - 80); base.lblFurther.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.CENTER_LEFT; base.lblFurther.Size = new Size(base.Width, Math.Max(base.imgFurther.Height, 30)); base.lblFurther.Position = new Point(base.imgFurther.Rectangle.Right + 10, base.imgFurther.Position.Y); base.showFurtherInfo(); }
public void init(int pizzazzImage) { int num; Sound.playVillageEnvironmental(0x2e, false, false); Sound.forceFullPlayOfNextEnvironmental(); base.clearControls(); this.transparentBackground.Size = base.Size; this.transparentBackground.FillColor = Color.FromArgb(0xff, 0, 0xff); base.addControl(this.transparentBackground); this.background.Position = new Point(0, 0); this.background.Size = new Size(0x27e, 0x148); base.addControl(this.background); this.background.Create((Image)GFXLibrary._9sclice_fancy_top_left, (Image)GFXLibrary._9sclice_fancy_top_mid, (Image)GFXLibrary._9sclice_fancy_top_right, (Image)GFXLibrary._9sclice_fancy_mid_left, (Image)GFXLibrary._9sclice_fancy_mid_mid, (Image)GFXLibrary._9sclice_fancy_mid_right, (Image)GFXLibrary._9sclice_fancy_bottom_left, (Image)GFXLibrary._9sclice_fancy_bottom_mid, (Image)GFXLibrary._9sclice_fancy_bottom_right); this.background.ForceTiling(); this.rewardArea.Position = new Point(0xbf, 0x29); this.rewardArea.Size = new Size(0x100, 0x100); this.background.addControl(this.rewardArea); this.firework1.init(this.rewardArea, 0x24, 0); this.firework2.init(this.rewardArea, 0x20, 0); this.firework3.init(this.rewardArea, 0x1c, 0); this.firework4.init(this.rewardArea, 0x18, 0); this.firework5.init(this.rewardArea, 20, 0); this.firework6.init(this.rewardArea, 0x10, 0); this.firework7.init(this.rewardArea, 12, 0); this.firework8.init(this.rewardArea, 8, 0); this.firework9.init(this.rewardArea, 4, 0); this.firework10.init(this.rewardArea, 0, 0); this.firework1a.init(this.rewardArea, 0x24, 1); this.firework2a.init(this.rewardArea, 0x20, 1); this.firework3a.init(this.rewardArea, 0x1c, 1); this.firework4a.init(this.rewardArea, 0x18, 1); this.firework5a.init(this.rewardArea, 20, 1); this.firework6a.init(this.rewardArea, 0x10, 1); this.firework7a.init(this.rewardArea, 12, 1); this.firework8a.init(this.rewardArea, 8, 1); this.firework9a.init(this.rewardArea, 4, 1); this.firework10a.init(this.rewardArea, 0, 1); this.starImage.Image = (Image)GFXLibrary.wheel_star[0]; this.starImage.Position = new Point(0, 0); this.starImage.RotateCentre = new PointF(128f, 128f); this.starImage.Visible = false; this.starSpinMode = 1; this.rewardArea.addControl(this.starImage); switch (pizzazzImage) { case 1: this.rewardImage.Image = (Image)GFXLibrary.getCommodity64DSImage(13); this.rewardImage.Position = new Point(0x53, 0x4f); this.rewardArea.addControl(this.rewardImage); return; case 2: this.rewardImage.Image = (Image)GFXLibrary.getCommodity64DSImage(6); this.rewardImage.Position = new Point(0x4c, 0x4c); this.rewardArea.addControl(this.rewardImage); this.reward2Image.Image = (Image)GFXLibrary.getCommodity64DSImage(7); this.reward2Image.Position = new Point(0x60, 0x60); this.rewardArea.addControl(this.reward2Image); return; case 3: case 5: case 6: case 8: case 10: num = -1; switch (pizzazzImage) { case 3: num = 2; goto Label_0542; case 5: num = 15; goto Label_0542; case 6: num = 1; goto Label_0542; case 8: num = 5; goto Label_0542; case 10: num = 14; goto Label_0542; } break; case 4: this.rewardImage.Image = (Image)GFXLibrary.com_64_honour_DS; this.rewardImage.Position = new Point(0x54, 0x54); this.rewardArea.addControl(this.rewardImage); return; case 7: this.rewardImage.Image = GFXLibrary.PremiumTokens[0x1011][0]; this.rewardImage.Position = new Point(0x60, 0x60); this.rewardImage.Size = new Size(this.rewardImage.Image.Width / 2, this.rewardImage.Image.Height / 2); this.rewardArea.addControl(this.rewardImage); return; case 9: this.rewardImage.Image = (Image)GFXLibrary.getCommodity64DSImage(6); this.rewardImage.Position = new Point(0x53, 0x4f); this.rewardArea.addControl(this.rewardImage); return; default: return; } Label_0542: this.rewardImage.Image = (Image)GFXLibrary.wheel_icons[num]; this.rewardImage.Size = new Size(0x80, 0x80); this.rewardImage.Position = new Point(0x40, 0x40); this.rewardArea.addControl(this.rewardImage); }
public void init() { base.clearControls(); NumberFormatInfo nFI = GameEngine.NFI; this.mainBackgroundImage.Image = (Image)GFXLibrary.body_background_canvas; this.mainBackgroundImage.Position = new Point(0, 0); base.addControl(this.mainBackgroundImage); this.mainBackgroundArea.Position = new Point(0, 0); this.mainBackgroundArea.Size = new Size(0x3e0, 0x236); this.mainBackgroundImage.addControl(this.mainBackgroundArea); 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(0x3b4, 10); this.closeButton.CustomTooltipID = 900; this.closeButton.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.closeClick), "CapitalResourcesPanel2_close"); this.mainBackgroundArea.addControl(this.closeButton); CustomSelfDrawPanel.WikiLinkControl.init(this.mainBackgroundArea, 11, new Point(0x382, 10)); Color color = Color.FromArgb(0xe0, 0xcb, 0x92); Color color2 = Color.FromArgb(0x4a, 0x43, 0x30); this.lightPanel.Position = new Point(0x9d, 0x57); this.lightPanel.Size = new Size(0x157, 390); this.mainBackgroundArea.addControl(this.lightPanel); this.lightPanel.Create((Image)GFXLibrary.lite_9slice_panel_top_left, (Image)GFXLibrary.lite_9slice_panel_top_mid, (Image)GFXLibrary.lite_9slice_panel_top_right, (Image)GFXLibrary.lite_9slice_panel_mid_left, (Image)GFXLibrary.lite_9slice_panel_mid_mid, (Image)GFXLibrary.lite_9slice_panel_mid_right, (Image)GFXLibrary.lite_9slice_panel_bottom_left, (Image)GFXLibrary.lite_9slice_panel_bottom_mid, (Image)GFXLibrary.lite_9slice_panel_bottom_right); this.illustration.Image = (Image)GFXLibrary.donate_illustration; this.illustration.Position = new Point(0x201, 0x57); this.mainBackgroundArea.addControl(this.illustration); this.stockpileHeaderLabel.Text = SK.Text("ResourcesPanel_Parish_Resources", "Parish Resources"); this.stockpileHeaderLabel.Color = color; this.stockpileHeaderLabel.DropShadowColor = color2; this.stockpileHeaderLabel.Position = new Point(9, 9); this.stockpileHeaderLabel.Size = new Size(0x3e0, 50); this.stockpileHeaderLabel.Font = FontManager.GetFont("Arial", 20f, FontStyle.Bold); this.stockpileHeaderLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT; this.mainBackgroundArea.addControl(this.stockpileHeaderLabel); this.stockpileLimitLabel.Text = SK.Text("ResourcesPanel_Parish_Capacity", "Capacity of the Warehouse") + ": " + 0x186a0.ToString("N", nFI); this.stockpileLimitLabel.Color = color; this.stockpileLimitLabel.DropShadowColor = color2; this.stockpileLimitLabel.Position = new Point(0x20b, 0x1a2); this.stockpileLimitLabel.Size = new Size(0x145, 50); this.stockpileLimitLabel.Font = FontManager.GetFont("Arial", 12f, FontStyle.Bold); this.stockpileLimitLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT; this.mainBackgroundArea.addControl(this.stockpileLimitLabel); this.woodLabel.Text = "0"; this.woodLabel.Color = color; this.woodLabel.DropShadowColor = color2; this.woodLabel.Position = new Point(120, 50); this.woodLabel.Size = new Size(200, 50); this.woodLabel.Font = FontManager.GetFont("Arial", 14f, FontStyle.Bold); this.woodLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT; this.lightPanel.addControl(this.woodLabel); this.stoneLabel.Text = "0"; this.stoneLabel.Color = color; this.stoneLabel.DropShadowColor = color2; this.stoneLabel.Position = new Point(120, 0x87); this.stoneLabel.Size = new Size(200, 50); this.stoneLabel.Font = FontManager.GetFont("Arial", 14f, FontStyle.Bold); this.stoneLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT; this.lightPanel.addControl(this.stoneLabel); this.ironLabel.Text = "0"; this.ironLabel.Color = color; this.ironLabel.DropShadowColor = color2; this.ironLabel.Position = new Point(120, 220); this.ironLabel.Size = new Size(200, 50); this.ironLabel.Font = FontManager.GetFont("Arial", 14f, FontStyle.Bold); this.ironLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT; this.lightPanel.addControl(this.ironLabel); this.pitchLabel.Text = "0"; this.pitchLabel.Color = color; this.pitchLabel.DropShadowColor = color2; this.pitchLabel.Position = new Point(120, 0x131); this.pitchLabel.Size = new Size(200, 50); this.pitchLabel.Font = FontManager.GetFont("Arial", 14f, FontStyle.Bold); this.pitchLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT; this.lightPanel.addControl(this.pitchLabel); this.woodImage.Image = (Image)GFXLibrary.getCommodity64DSImage(6); this.woodImage.Position = new Point(0x12, 0x18); this.lightPanel.addControl(this.woodImage); this.stoneImage.Image = (Image)GFXLibrary.getCommodity64DSImage(7); this.stoneImage.Position = new Point(0x12, 0x6d); this.lightPanel.addControl(this.stoneImage); this.ironImage.Image = (Image)GFXLibrary.getCommodity64DSImage(8); this.ironImage.Position = new Point(0x12, 0xc2); this.lightPanel.addControl(this.ironImage); this.pitchImage.Image = (Image)GFXLibrary.getCommodity64DSImage(9); this.pitchImage.Position = new Point(0x12, 0x117); this.lightPanel.addControl(this.pitchImage); this.update(); }