private void applyData(ResearchData data) { int researchType = -1; int level = 0; this.researchAllowed = true; int num3 = data.research_points; if (data.research_queueEntries != null) { num3 -= data.research_queueEntries.Length; } if (data.researchingType >= 0) { if (!GameEngine.Instance.World.isAccountPremium() || !data.canDoMoreResearch()) { this.researchAllowed = false; } DateTime time = VillageMap.getCurrentServerTime(); if ((this.selectedQueueSlot >= 0) && ((data.research_queueEntries == null) || (this.selectedQueueSlot >= data.research_queueEntries.Length))) { this.selectedQueueSlot = -1; } if (this.selectedQueueSlot < 0) { TimeSpan span = (TimeSpan) (data.research_completionTime - time); int secsLeft = (int) (span.TotalSeconds + 0.5); if (secsLeft < 0) { secsLeft = 0; } this.timeProgressText.Text = SK.Text("Research_Completed_In", "Completed In") + " : " + VillageMap.createBuildTimeString(secsLeft); this.timeProgressText.Visible = true; if (GameEngine.Instance.World.isResearchLagging()) { this.timeProgressText.Text = this.timeProgressText.Text + " (" + SK.Text("Research_Lagging", "Research Overdue, Please wait") + ")"; } TimeSpan span2 = data.calcResearchTime(data.research_pointCount - 1, GameEngine.Instance.World.UserCardData, GameEngine.Instance.LocalWorldData); if (GameEngine.Instance.LocalWorldData.Alternate_Ruleset == 1) { span2 = new TimeSpan(span2.Ticks / 2L); } int totalSeconds = (int) span2.TotalSeconds; if (totalSeconds < 1) { totalSeconds = 1; } if ((totalSeconds == 30) && (GameEngine.Instance.World.getTutorialStage() == 5)) { totalSeconds = 11; } double curValue = span.TotalSeconds; if (curValue < 0.0) { curValue = 0.0; } curValue = totalSeconds - curValue; if (curValue < 0.0) { curValue = 0.0; } this.timeProgressBar.setValues(curValue, (double) totalSeconds); this.currentResearchCancelButton.Text.Text = SK.Text("GENERIC_Cancel", "Cancel"); researchType = data.researchingType; level = data.research[data.researchingType]; } else { TimeSpan span3 = (TimeSpan) (data.research_completionTime - time); if (this.selectedQueueSlot > 0) { for (int i = 0; i < this.selectedQueueSlot; i++) { TimeSpan span4 = data.calcResearchTime(data.research_pointCount + i, GameEngine.Instance.World.UserCardData, GameEngine.Instance.LocalWorldData); if (GameEngine.Instance.LocalWorldData.Alternate_Ruleset == 1) { span4 = new TimeSpan(span4.Ticks / 2L); } span3 += span4; } } int num8 = (int) (span3.TotalSeconds + 0.5); if (num8 < 0) { num8 = 0; } this.timeProgressText.Text = SK.Text("Research_Starts_In", "Starts In") + " : " + VillageMap.createBuildTimeString(num8); this.timeProgressText.Visible = true; this.timeProgressBar.setValues(0.0, 0.0); researchType = data.research_queueEntries[this.selectedQueueSlot]; level = 0; this.currentResearchCancelButton.Text.Text = SK.Text("Research_Remove_From_Queue", "Remove From Queue"); } this.currentResearchCancelButton.Enabled = true; } else { TimeSpan span5 = data.calcResearchTime(data.research_pointCount, GameEngine.Instance.World.UserCardData, GameEngine.Instance.LocalWorldData); if (GameEngine.Instance.LocalWorldData.Alternate_Ruleset == 1) { span5 = new TimeSpan(span5.Ticks / 2L); } int num9 = (int) span5.TotalSeconds; this.currentResearchCancelButton.Enabled = false; this.timeProgressText.Text = SK.Text("Research_Next_Duration", "Next Research Duration") + " : " + VillageMap.createBuildTimeString(num9); this.timeProgressBar.setValues(0.0, 0.0); } if (this.tooltipToShow >= 0) { researchType = this.tooltipToShow / 0x3e8; level = (this.tooltipToShow % 0x3e8) - 1; } if (researchType >= 0) { this.currentResearchInfoBoxHeadingText.Visible = true; this.currentResearchInfoBoxHeadingText.Text = ResearchData.getResearchName(researchType); this.currentResearchText.Text = this.currentResearchInfoBoxHeadingText.Text; this.currentResearchText.Visible = true; this.currentResearchImage.Image = (Image) this.getIllustration(researchType); if (this.currentResearchImage.Image != null) { this.currentResearchImage.Visible = true; } else { this.currentResearchImage.Visible = false; } this.currentResearchInfoBoxRow1Text.Text = ResearchData.getDescriptionText(researchType, level); this.currentResearchInfoBoxRow2Text.Text = ""; this.currentResearchInfoBoxRow3Text.Text = ResearchData.getEffectText(researchType, level, GameEngine.Instance.World.ThirdAgeWorld, GameEngine.Instance.World.FourthAgeWorld, GameEngine.Instance.LocalWorldData.Alternate_Ruleset == 1, GameEngine.Instance.LocalWorldData); this.currentResearchInfoBoxRow1Text.Visible = true; this.currentResearchInfoBoxRow2Text.Visible = this.dragOverlay.Visible; this.currentResearchInfoBoxRow3Text.Visible = this.dragOverlay.Visible; this.currentResearchBackgroundImage.Visible = true; this.currentResearchBackgroundImage2.Visible = false; if ((Program.mySettings.LanguageIdent == "tr") && ((((researchType == 14) || (researchType == 0x42)) || ((researchType == 0x2e) || (researchType == 0x29))) || ((researchType == 0x2b) || (researchType == 0x2a)))) { this.currentResearchText.Font = FontManager.GetFont("Arial", 8f, FontStyle.Regular); } else if ((Program.mySettings.LanguageIdent == "pl") && (((researchType == 14) || (researchType == 0x25)) || ((researchType == 0x2d) || (researchType == 50)))) { this.currentResearchText.Font = FontManager.GetFont("Arial", 8f, FontStyle.Regular); } else if ((Program.mySettings.LanguageIdent == "it") && (((researchType == 0x11) || (researchType == 0x43)) || (researchType == 0x29))) { this.currentResearchText.Font = FontManager.GetFont("Arial", 8f, FontStyle.Regular); } else if ((Program.mySettings.LanguageIdent == "pt") && ((((researchType == 0) || (researchType == 0x27)) || ((researchType == 0x11) || (researchType == 0x42))) || ((((researchType == 0x40) || (researchType == 10)) || ((researchType == 0x2b) || (researchType == 0x2c))) || ((researchType == 0x2d) || (researchType == 0x2e))))) { this.currentResearchText.Font = FontManager.GetFont("Arial", 8f, FontStyle.Regular); } else if ((Program.mySettings.LanguageIdent == "pt") && ((researchType == 0x22) || (researchType == 0x2a))) { this.currentResearchText.Font = FontManager.GetFont("Arial", 7.5f, FontStyle.Regular); } else { this.currentResearchText.Font = FontManager.GetFont("Arial", 10f, FontStyle.Regular); } } else { this.currentResearchBackgroundImage2.Visible = true; this.currentResearchBackgroundImage.Visible = false; this.currentResearchInfoBoxRow1Text.Visible = false; this.currentResearchInfoBoxRow2Text.Visible = false; this.currentResearchInfoBoxRow3Text.Visible = false; this.currentResearchText.Visible = false; this.currentResearchImage.Visible = false; this.currentResearchInfoBoxHeadingText.Text = SK.Text("Research_No_Current", "No current research"); } this.pointsText.Text = SK.Text("Research_Research_Points", "Research Points") + " : " + num3.ToString(); NumberFormatInfo nFI = GameEngine.NFI; if (num3 <= 0) { this.researchAllowed = false; } double num10 = data.calcPointGoldCost(GameEngine.Instance.World.UserCardData, GameEngine.Instance.LocalWorldData); this.buyPointText.Text = num10.ToString("N", nFI); if (num10 <= GameEngine.Instance.World.getCurrentGold()) { this.buyPointButton.Enabled = true; } else { this.buyPointButton.Enabled = false; } this.queuedResearchImage1.Visible = false; this.queuedResearchImage2.Visible = false; this.queuedResearchImage3.Visible = false; this.queuedResearchImage4.Visible = false; this.queuedResearchImage5.Visible = false; this.queuedResearchImage6.Visible = false; this.queuedResearchImage7.Visible = false; this.queuedResearchButton1.Enabled = false; this.queuedResearchButton2.Enabled = false; this.queuedResearchButton3.Enabled = false; this.queuedResearchButton4.Enabled = false; this.queuedResearchButton5.Enabled = false; this.queuedResearchButton6.Enabled = false; this.queuedResearchButton7.Enabled = false; if (((data.research_queueEntries != null) && (data.research_queueEntries.Length > 0)) && (data.researchingType >= 0)) { for (int j = 0; j < data.research_queueEntries.Length; j++) { CustomSelfDrawPanel.CSDImage image = null; CustomSelfDrawPanel.CSDButton button = null; switch (j) { case 0: image = this.queuedResearchImage1; button = this.queuedResearchButton1; break; case 1: image = this.queuedResearchImage2; button = this.queuedResearchButton2; break; case 2: image = this.queuedResearchImage3; button = this.queuedResearchButton3; break; case 3: image = this.queuedResearchImage4; button = this.queuedResearchButton4; break; case 4: image = this.queuedResearchImage5; button = this.queuedResearchButton5; break; case 5: image = this.queuedResearchImage6; button = this.queuedResearchButton6; break; case 6: image = this.queuedResearchImage7; button = this.queuedResearchButton7; break; } image.Visible = true; image.Image = (Image) this.getIllustration(data.research_queueEntries[j]); image.Size = new Size(image.Size.Width / 2, image.Size.Height / 2); image.CustomTooltipID = 0x12e; image.CustomTooltipData = j; button.Enabled = true; button.ImageNorm = (Image) GFXLibrary.research_border_research_ill_normal; button.ImageOver = (Image) GFXLibrary.research_border_research_ill_over; button.ImageClick = (Image) GFXLibrary.research_border_research_ill_over; button.CustomTooltipID = 0x12e; button.CustomTooltipData = j; } } if (this.selectedQueueSlot >= 0) { CustomSelfDrawPanel.CSDButton button2 = null; switch (this.selectedQueueSlot) { case 0: button2 = this.queuedResearchButton1; break; case 1: button2 = this.queuedResearchButton2; break; case 2: button2 = this.queuedResearchButton3; break; case 3: button2 = this.queuedResearchButton4; break; case 4: button2 = this.queuedResearchButton5; break; case 5: button2 = this.queuedResearchButton6; break; case 6: button2 = this.queuedResearchButton7; break; } button2.ImageNorm = (Image) GFXLibrary.border_research_ill_selected_normal; button2.ImageOver = (Image) GFXLibrary.border_research_ill_selected_normal; button2.ImageClick = (Image) GFXLibrary.border_research_ill_selected_normal; } if (GameEngine.Instance.World.isAccountPremium()) { this.queuedResearchNoPremiumText.Visible = false; } else { this.queuedResearchNoPremiumText.Visible = true; } }