public void update() { this.backGround.update(); bool visible = this.lblProtectionType.Visible; int num = 0; TimeSpan span = new TimeSpan(); if (GameEngine.Instance.World.isVillageInterdictProtected(this.m_selectedVillage)) { DateTime time = GameEngine.Instance.World.getInterdictTime(this.m_selectedVillage); DateTime time2 = VillageMap.getCurrentServerTime(); span = (TimeSpan)(time - time2); num = 1; } if (num == 1) { int totalSeconds = (int)span.TotalSeconds; string str = VillageMap.createBuildTimeStringFull(totalSeconds); this.lblProtected.TextDiffOnly = SK.Text("OtherVillagePanel_Cannot_Be_Attacked_For_X_Time", "Cannot be attacked for") + " : " + str; this.lblProtectionType.TextDiffOnly = SK.Text("OtherVillagePanel_Interdict", "Interdict"); this.lblProtectionType.Visible = true; } else { this.lblProtected.TextDiffOnly = ""; this.lblProtectionType.TextDiffOnly = ""; this.lblProtectionType.Visible = false; } if (visible != this.lblProtectionType.Visible) { this.updateSize(); } }
public void update() { this.backGround.update(); int[] numArray = new int[3]; TimeSpan[] spanArray = new TimeSpan[3]; int numInfos = this.numInfos; this.numInfos = 0; bool visible = this.lblProtected.Visible; int num2 = 0; TimeSpan span = new TimeSpan(); if (GameEngine.Instance.World.isVillageExcommunicated(this.m_selectedVillage)) { DateTime time = GameEngine.Instance.World.getExcommunicationTime(this.m_selectedVillage); DateTime time2 = VillageMap.getCurrentServerTime(); span = (TimeSpan)(time - time2); num2 = 3; spanArray[this.numInfos] = span; numArray[this.numInfos] = num2; this.numInfos++; } if (GameEngine.Instance.World.isVillageInterdictProtected(this.m_selectedVillage)) { DateTime time3 = GameEngine.Instance.World.getInterdictTime(this.m_selectedVillage); DateTime time4 = VillageMap.getCurrentServerTime(); span = (TimeSpan)(time3 - time4); num2 = 1; spanArray[this.numInfos] = span; numArray[this.numInfos] = num2; this.numInfos++; } if (GameEngine.Instance.World.isVillagePeaceTimeProtected(this.m_selectedVillage)) { DateTime time5 = GameEngine.Instance.World.getPeaceTime(this.m_selectedVillage); DateTime time6 = VillageMap.getCurrentServerTime(); TimeSpan span2 = (TimeSpan)(time5 - time6); if (span2 > span) { span = span2; num2 = 2; } spanArray[this.numInfos] = span2; numArray[this.numInfos] = 2; this.numInfos++; } if (GameEngine.Instance.World.isVillageVacationProtected(this.m_selectedVillage)) { num2 = 4; numArray[this.numInfos] = 4; this.numInfos++; } if (this.numInfos > 0) { if (this.selectedProtection < this.numInfos) { num2 = numArray[(this.numInfos - 1) - this.selectedProtection]; span = spanArray[(this.numInfos - 1) - this.selectedProtection]; } else { this.selectedProtection = 0; } } switch (num2) { case 1: { int totalSeconds = (int)span.TotalSeconds; string str = VillageMap.createBuildTimeStringFull(totalSeconds); this.lblProtected.TextDiffOnly = SK.Text("OtherVillagePanel_Cannot_Be_Attacked_For_X_Time", "Cannot be attacked for") + " : " + str; this.lblProtectionType.TextDiffOnly = SK.Text("OtherVillagePanel_Interdict", "Interdict"); this.lblProtectionType.Visible = true; this.lblProtected.Visible = true; break; } case 2: { int secsLeft = (int)span.TotalSeconds; string str2 = VillageMap.createBuildTimeStringFull(secsLeft); this.lblProtected.TextDiffOnly = SK.Text("OtherVillagePanel_Cannot_Be_Attacked_For_X_Time", "Cannot be attacked for") + " : " + str2; this.lblProtectionType.TextDiffOnly = SK.Text("OtherVillagePanel_Peace", "Peace"); this.lblProtectionType.Visible = true; this.lblProtected.Visible = true; break; } case 3: { int num5 = (int)span.TotalSeconds; string str3 = VillageMap.createBuildTimeStringFull(num5); this.lblProtected.TextDiffOnly = SK.Text("OtherVillagePanel_Excom_For_X_Time", "No Monks for") + " : " + str3; this.lblProtectionType.TextDiffOnly = SK.Text("OtherVillagePanel_Excom", "Excommunicated"); this.lblProtectionType.Visible = true; this.lblProtected.Visible = true; break; } case 4: this.lblProtected.TextDiffOnly = SK.Text("OtherVillagePanel_Cannot_Be_Attacked", "Cannot be attacked"); this.lblProtectionType.TextDiffOnly = SK.Text("OtherVillagePanel_Vacation", "Vacation Mode"); this.lblProtectionType.Visible = true; this.lblProtected.Visible = true; break; default: this.lblProtectionType.Visible = false; this.lblProtected.Visible = false; break; } if (visible != this.lblProtected.Visible) { this.updateSize(); if (!visible) { this.selectedProtection = 0; } } if (numInfos != this.numInfos) { if (this.numInfos >= 2) { this.leftButton.Visible = true; this.rightButton.Visible = true; } else { this.leftButton.Visible = false; this.rightButton.Visible = false; } } }
public void update() { this.backGround.update(); int[] numArray = new int[3]; TimeSpan[] spanArray = new TimeSpan[3]; int numInfos = this.numInfos; this.numInfos = 0; int tooltipData = GameEngine.Instance.World.getParishPlagueLevel(this.m_selectedVillage); if (tooltipData != this.lastPlague) { if (tooltipData <= 0) { this.backGround.updatePanelType(0x5dc); this.lblPlagueValue.TextDiffOnly = ""; } else if (this.lastPlague <= 0) { this.backGround.updatePanelType(0x5e0); this.lblPlagueValue.TextDiffOnly = tooltipData.ToString(); } this.backGround.setTooltipData(tooltipData); this.lastPlague = tooltipData; } bool visible = this.lblProtectionType.Visible; int num3 = 0; TimeSpan span = new TimeSpan(); if (GameEngine.Instance.World.isVillageInterdictProtected(this.m_selectedVillage)) { DateTime time = GameEngine.Instance.World.getInterdictTime(this.m_selectedVillage); DateTime time2 = VillageMap.getCurrentServerTime(); span = (TimeSpan)(time - time2); num3 = 1; spanArray[this.numInfos] = span; numArray[this.numInfos] = num3; this.numInfos++; } if (GameEngine.Instance.World.isVillagePeaceTimeProtected(this.m_selectedVillage)) { DateTime time3 = GameEngine.Instance.World.getPeaceTime(this.m_selectedVillage); DateTime time4 = VillageMap.getCurrentServerTime(); TimeSpan span2 = (TimeSpan)(time3 - time4); if (span2 > span) { span = span2; num3 = 2; spanArray[this.numInfos] = span; numArray[this.numInfos] = num3; this.numInfos++; } } if (this.numInfos > 0) { if (this.selectedProtection < this.numInfos) { num3 = numArray[(this.numInfos - 1) - this.selectedProtection]; span = spanArray[(this.numInfos - 1) - this.selectedProtection]; } else { this.selectedProtection = 0; } } switch (num3) { case 1: { int totalSeconds = (int)span.TotalSeconds; string str = VillageMap.createBuildTimeStringFull(totalSeconds); this.lblProtected.TextDiffOnly = SK.Text("OtherVillagePanel_Cannot_Be_Attacked_For_X_Time", "Cannot be attacked for") + " : " + str; this.lblProtectionType.TextDiffOnly = SK.Text("OtherVillagePanel_Interdict", "Interdict"); this.lblProtectionType.Visible = true; break; } case 2: { int secsLeft = (int)span.TotalSeconds; string str2 = VillageMap.createBuildTimeStringFull(secsLeft); this.lblProtected.TextDiffOnly = SK.Text("OtherVillagePanel_Cannot_Be_Attacked_For_X_Time", "Cannot be attacked for") + " : " + str2; this.lblProtectionType.TextDiffOnly = SK.Text("OtherVillagePanel_Peace", "Peace"); this.lblProtectionType.Visible = true; break; } default: this.lblProtected.TextDiffOnly = ""; this.lblProtectionType.TextDiffOnly = ""; this.lblProtectionType.Visible = false; break; } if (visible != this.lblProtectionType.Visible) { this.updateSize(); if (!visible) { this.selectedProtection = 0; } } if (numInfos != this.numInfos) { if (this.numInfos >= 2) { this.leftButton.Visible = true; this.rightButton.Visible = true; } else { this.leftButton.Visible = false; this.rightButton.Visible = false; } } }
public void update() { this.backGround.update(); int[] numArray = new int[3]; TimeSpan[] spanArray = new TimeSpan[3]; int numInfos = this.numInfos; this.numInfos = 0; bool visible = this.lblProtectionType.Visible; int num2 = 0; TimeSpan span = new TimeSpan(); if (GameEngine.Instance.World.isVillageInterdictProtected(this.m_selectedVillage)) { DateTime time = GameEngine.Instance.World.getInterdictTime(this.m_selectedVillage); DateTime time2 = VillageMap.getCurrentServerTime(); span = (TimeSpan)(time - time2); num2 = 1; spanArray[this.numInfos] = span; numArray[this.numInfos] = num2; this.numInfos++; } if (GameEngine.Instance.World.isVillagePeaceTimeProtected(this.m_selectedVillage)) { DateTime time3 = GameEngine.Instance.World.getPeaceTime(this.m_selectedVillage); DateTime time4 = VillageMap.getCurrentServerTime(); TimeSpan span2 = (TimeSpan)(time3 - time4); if (span2 > span) { span = span2; num2 = 2; } spanArray[this.numInfos] = span2; numArray[this.numInfos] = 2; this.numInfos++; } if (GameEngine.Instance.World.isVillageVacationProtected(this.m_selectedVillage)) { num2 = 3; numArray[this.numInfos] = 3; this.numInfos++; } if (this.numInfos > 0) { if (this.selectedProtection < this.numInfos) { num2 = numArray[(this.numInfos - 1) - this.selectedProtection]; span = spanArray[(this.numInfos - 1) - this.selectedProtection]; } else { this.selectedProtection = 0; } } switch (num2) { case 1: { int totalSeconds = (int)span.TotalSeconds; string str = VillageMap.createBuildTimeStringFull(totalSeconds); this.lblProtected.TextDiffOnly = SK.Text("OtherVillagePanel_Cannot_Be_Attacked_For_X_Time", "Cannot be attacked for") + " : " + str; this.lblProtectionType.TextDiffOnly = SK.Text("OtherVillagePanel_Interdict", "Interdict"); this.lblProtectionType.Visible = true; break; } case 2: { int secsLeft = (int)span.TotalSeconds; string str2 = VillageMap.createBuildTimeStringFull(secsLeft); this.lblProtected.TextDiffOnly = SK.Text("OtherVillagePanel_Cannot_Be_Attacked_For_X_Time", "Cannot be attacked for") + " : " + str2; this.lblProtectionType.TextDiffOnly = SK.Text("OtherVillagePanel_Peace", "Peace"); this.lblProtectionType.Visible = true; break; } case 3: this.lblProtected.TextDiffOnly = SK.Text("OtherVillagePanel_Cannot_Be_Attacked", "Cannot be attacked"); this.lblProtectionType.TextDiffOnly = SK.Text("OtherVillagePanel_Vacation", "Vacation Mode"); this.lblProtectionType.Visible = true; break; default: { int num5 = GameEngine.Instance.World.getVillageFaction(InterfaceMgr.Instance.OwnSelectedVillage); int num6 = GameEngine.Instance.World.getVillageFaction(this.m_selectedVillage); if (GameEngine.Instance.World.isUserVillage(this.m_selectedVillage)) { this.lblProtected.TextDiffOnly = SK.Text("OtherVillagePanel_Cannot_Attack_Own_Village", "Cannot attack your own village"); this.lblProtectionType.TextDiffOnly = SK.Text("OtherVillagePanel_Your_Village", "Your Village"); this.lblProtectionType.Visible = true; } else if ((num5 == num6) && (num5 >= 0)) { if (GameEngine.Instance.LocalWorldData.Alternate_Ruleset != 1) { this.lblProtected.TextDiffOnly = SK.Text("OtherVillagePanel_Cannot_Attack_Faction_Member", "Cannot attack Faction Member"); } this.lblProtectionType.TextDiffOnly = SK.Text("OtherVillagePanel_Your_Faction", "Your Faction"); this.lblProtectionType.Visible = true; } else { this.lblProtected.TextDiffOnly = ""; this.lblProtectionType.Visible = false; } break; } } if (visible != this.lblProtectionType.Visible) { this.updateSize(); if (!visible) { this.selectedProtection = 0; } } if (numInfos != this.numInfos) { if (this.numInfos >= 2) { this.leftButton.Visible = true; this.rightButton.Visible = true; } else { this.leftButton.Visible = false; this.rightButton.Visible = false; } } }