private void screen_OnMouseLeftUp(Point position) { if (StaticMethods.PointInRectangle(position, this.FirstPageButtonDisplayPosition)) { //this.RichText.FirstPage(); //this.FirstPageButtonDisplayTexture = this.FirstPageButtonDisabledTexture; } else if ((this.RichText.CurrentPageIndex >= (this.RichText.PageCount - 1)) && ((this.iConfirmationDialog == null) || !this.iConfirmationDialog.IsShowing)) { if (!this.firstShowing) { this.Close(Session.MainGame.mainGameScreen); } this.firstShowing = false; } else { this.RichText.NextPage(); this.startShowingTime = DateTime.Now; if (this.RichText.CurrentPageIndex > 0) { this.FirstPageButtonDisplayTexture = this.FirstPageButtonTexture; } } }
private void screen_OnMouseMove(Point position, bool leftDown) { if (base.Enabled) { if (!this.IsRecordShowing) { if (StaticMethods.PointInRectangle(position, this.ToolDisplayPosition)) { Session.MainGame.mainGameScreen.ResetMouse(); this.ToolDisplayTexture = this.ToolSelectedTexture; } else { this.ToolDisplayTexture = this.ToolTexture; } } else { if (Platform.PlatFormType == PlatFormType.Win || Platform.PlatFormType == PlatFormType.Desktop) { if (StaticMethods.PointInRectangle(position, this.RecordDisplayPosition)) { Session.MainGame.mainGameScreen.ResetMouse(); } } } } }
internal void Update() { if (Session.Current.Scenario.Date.Season == GameSeason.春) { this.SeasonTexture = this.SpringTexture; } else if (Session.Current.Scenario.Date.Season == GameSeason.夏) { this.SeasonTexture = this.SummerTexture; } else if (Session.Current.Scenario.Date.Season == GameSeason.秋) { this.SeasonTexture = this.AutumnTexture; } else { this.SeasonTexture = this.WinterTexture; } this.DateText.Text = Session.Current.Scenario.Date.ToDateString(); if (Session.Current.Scenario.CurrentFaction != null) { if ((Session.Current.Scenario.CurrentFaction == Session.Current.Scenario.CurrentPlayer) || Session.GlobalVariables.SkyEye) { this.FactionText.Text = string.Concat(new object[] { Session.Current.Scenario.CurrentFaction.Name, " 【", Session.Current.Scenario.CurrentFaction.TotalTechniquePoint, "】" }); } else { this.FactionText.Text = Session.Current.Scenario.CurrentFaction.Name; } } }
public TextItem(string text, Rectangle position) { this.Text = text; this.TextTexture = null; this.Position = position; this.AlignedPosition = Rectangle.Empty; }
public void Reset() { this.playing = false; this.DaysLeft = 0; this.daysLeftBackUp = 0; this.PlayDisplayTexture = this.PlayTexture; this.Updated = false; }
private void screen_OnMouseRightUp(Point position) { if ((base.IsDrawing && this.IsMapShowing) && StaticMethods.PointInRectangle(position, this.MapPosition)) { this.IsMapShowing = false; this.ToolDisplayTexture = this.ToolTexture; } }
public void Initialize(MainGameScreen screen) { //this.Conment = new FreeText(screen.GraphicsDevice, new System.Drawing.Font("宋体", 10f), Color.White); this.Conment = new FreeText(new Font("宋体", 10f, ""), Color.White); this.Conment.Align = TextAlign.Middle; this.currentPositionTexture = screen.Textures.TileFrameTextures[0]; this.EffectingAreaTexture = screen.Textures.TileFrameTextures[4]; }
internal void ResetDisplayTextures() { this.FirstDigitUpperArrowDisplayTexture = this.UpperArrowTexture; this.FirstDigitLowerArrowDisplayTexture = this.LowerArrowTexture; this.SecondDigitUpperArrowDisplayTexture = this.UpperArrowTexture; this.SecondDigitLowerArrowDisplayTexture = this.LowerArrowTexture; this.ResetPlayDisplayTexture(); this.StopDisplayTexture = this.StopTexture; }
public void Pause() { if (((this.DaysLeft > 1) && this.playing) && (this.daysLeftBackUp == 0)) { this.daysLeftBackUp = this.DaysLeft - 1; this.DaysLeft = 1; this.PlayDisplayTexture = this.PlaySelectedTexture; this.Updated = false; } }
private void ResetPlayDisplayTexture() { if (this.playing) { this.PlayDisplayTexture = this.PauseTexture; } else { this.PlayDisplayTexture = this.PlayTexture; } }
private void screen_OnButtonMouseMove(Point position, bool leftDown) { if (StaticMethods.PointInRectangle(position, this.ButtonDisplayPosition)) { this.ButtonDisplayTexture = this.ButtonSelectedTexture; } else { this.ButtonDisplayTexture = this.ButtonTexture; } }
private void screen_OnMouseMove(Point position, bool leftDown) { if (Session.MainGame.mainGameScreen.PeekUndoneWork().Kind == UndoneWorkKind.Dialog) { if (StaticMethods.PointInRectangle(position, this.OKButtonDisplayPosition)) { if (this.OKButtonEnabled) { this.OKButtonDisplayTexture = this.OKButtonSelectedTexture; } } else if (StaticMethods.PointInRectangle(position, this.CancelButtonDisplayPosition)) { if (this.CancelButtonEnabled) { this.CancelButtonDisplayTexture = this.CancelButtonSelectedTexture; } } else if (StaticMethods.PointInRectangle(position, this.ArchitectureListButtonDisplayPosition)) { this.ArchitectureListButtonDisplayTexture = this.ArchitectureListButtonSelectedTexture; } else if (StaticMethods.PointInRectangle(position, this.AIDetailButtonDisplayPosition)) { this.AIDetailButtonDisplayTexture = this.AIDetailButtonSelectedTexture; } else if (StaticMethods.PointInRectangle(position, this.OrientationButtonDisplayPosition)) { if (this.OrientationButtonEnabled) { this.OrientationButtonDisplayTexture = this.OrientationButtonSelectedTexture; } } else { this.ArchitectureListButtonDisplayTexture = this.ArchitectureListButtonTexture; this.AIDetailButtonDisplayTexture = this.AIDetailButtonTexture; if (this.OKButtonEnabled) { this.OKButtonDisplayTexture = this.OKButtonTexture; } if (this.CancelButtonEnabled) { this.CancelButtonDisplayTexture = this.CancelButtonTexture; } if (this.OrientationButtonEnabled) { this.OrientationButtonDisplayTexture = this.OrientationButtonTexture; } } } }
private bool DequeueAndDisplay(Screen screen) { if (this.DisplayQueue.Count > 0) { this.startShowingTime = DateTime.Now; GameObjectAndBranchName name = this.DisplayQueue.Dequeue(); this.shijiantupian = this.shijiantupianduilie.Dequeue(); this.shijiantupianjuxing = this.juxingduilie.Dequeue(); this.SetPosition(ShowPosition.Bottom, screen); this.shijianshengyin = this.shijianshengyinduilie.Dequeue(); this.SpeakingPerson = name.person; this.NameText.Text = name.person.Name; if (name.TryToShowString != null && name.TryToShowString.Length > 1) { this.TryToShowString = name.TryToShowString; } else { this.TryToShowString = ""; } if (TryToShowString != null && TryToShowString.Length > 1) { this.SetPosition(ShowPosition.BottomLeft, screen); } this.RichText.Clear(); if (this.diyigeshengyin) { screen.PlayNormalSound(this.shijianshengyin); this.diyigeshengyin = false; } this.RichText.Texts = name.texts; this.RichText.ResortTexts(); if (name.iConfirmationDialog != null) { this.iConfirmationDialog = name.iConfirmationDialog; this.iConfirmationDialog.SetPersonTextDialog(this.iPersonTextDialog); this.iConfirmationDialog.AddYesFunction(name.YesFunction); this.iConfirmationDialog.AddNoFunction(name.NoFunction); this.iConfirmationDialog.IsShowing = true; } else { this.iConfirmationDialog = null; this.YesFunction = null; this.NoFunction = null; } return(false); } return(true); }
private void screen_OnMouseMove(Point position, bool leftDown) { if (this.RichText.CurrentPageIndex > 0) { if (StaticMethods.PointInRectangle(position, this.FirstPageButtonDisplayPosition)) { this.FirstPageButtonDisplayTexture = this.FirstPageButtonSelectedTexture; } else { this.FirstPageButtonDisplayTexture = this.FirstPageButtonTexture; } } }
private void screen_OnMouseMove(Point position, bool leftDown) { if (base.Enabled) { if (StaticMethods.PointInRectangle(position, this.SystemDisplayPosition)) { this.SystemDisplayTexture = this.SystemSelectedTexture; } else { this.SystemDisplayTexture = this.SystemTexture; } } }
internal void SetStyle(string style) { OptionStyle style2 = null; this.Styles.TryGetValue(style, out style2); if (style2 != null) { this.TitleTexture = style2.TitleTexture; this.TitleWidth = style2.TitleWidth; this.TitleHeight = style2.TitleHeight; this.TitleMargin = style2.TitleMargin; this.TitleText = style2.TitleText; this.OptionTextList = style2.OptionTextList; this.ItemHeight = style2.ItemHeight; this.Margin = style2.Margin; this.OptionTexture = style2.OptionTexture; this.OptionSelectedTexture = style2.OptionSelectedTexture; } }
public void SetIsShowing(Screen screen, bool value) { if (this.isShowing != value && Setting.Current.GlobalVariables.DialogShowTime > 0) { this.isShowing = value; if (value) { if ((this.iContextMenu != null) && this.iContextMenu.IsShowing) { this.iContextMenu.IsShowing = false; } this.firstShowing = true; screen.IsHolding = true; this.diyigeshengyin = true; screen.PushUndoneWork(new UndoneWorkItem(UndoneWorkKind.tupianwenzi, UndoneWorkSubKind.None)); screen.OnMouseLeftDown += new Screen.MouseLeftDown(this.screen_OnMouseLeftDown); screen.OnMouseLeftUp += new Screen.MouseLeftUp(this.screen_OnMouseLeftUp); screen.OnMouseMove += new Screen.MouseMove(this.screen_OnMouseMove); this.FirstPageButtonDisplayTexture = this.FirstPageButtonDisabledTexture; screen.EnableLaterMouseEvent = false; this.Close(screen); } else { screen.IsHolding = false; if (screen.PopUndoneWork().Kind != UndoneWorkKind.tupianwenzi) { //throw new Exception("The UndoneWork is not a tupianwenzi."); } screen.OnMouseLeftDown -= new Screen.MouseLeftDown(this.screen_OnMouseLeftDown); screen.OnMouseLeftUp -= new Screen.MouseLeftUp(this.screen_OnMouseLeftUp); screen.OnMouseMove -= new Screen.MouseMove(this.screen_OnMouseMove); screen.EnableLaterMouseEvent = true; this.iConfirmationDialog = null; if (this.CloseFunction != null) { this.CloseFunction(); this.CloseFunction = null; } } } }
private void screen_OnMouseMove(Point position, bool leftDown) { if (StaticMethods.PointInRectangle(position, this.YesDisplayPosition)) { this.YesDisplayTexture = this.YesSelectedTexture; } else { this.YesDisplayTexture = this.YesTexture; } if (StaticMethods.PointInRectangle(position, this.NoDisplayPosition)) { this.NoDisplayTexture = this.NoSelectedTexture; } else { this.NoDisplayTexture = this.NoTexture; } }
private void screen_OnMouseMove(Point position, bool leftDown) { if (base.Enabled) { if (StaticMethods.PointInRectangle(position, this.PlayDisplayPosition)) { if (this.PlayDisplayTexture == this.PlayTexture) { this.PlayDisplayTexture = this.PlaySelectedTexture; } else if (this.PlayDisplayTexture == this.PauseTexture) { this.PlayDisplayTexture = this.PauseSelectedTexture; } this.StopDisplayTexture = this.StopTexture; } else if (StaticMethods.PointInRectangle(position, this.StopDisplayPosition)) { this.StopDisplayTexture = this.StopSelectedTexture; this.ResetPlayDisplayTexture(); } //else if (StaticMethods.PointInRectangle(position, this.FirstDigitUpperArrowDisplayPosition)) //{ // this.FirstDigitUpperArrowDisplayTexture = this.UpperArrowSelectedTexture; //} //else if (StaticMethods.PointInRectangle(position, this.FirstDigitLowerArrowDisplayPosition)) //{ // this.FirstDigitLowerArrowDisplayTexture = this.LowerArrowSelectedTexture; //} //else if (StaticMethods.PointInRectangle(position, this.SecondDigitUpperArrowDisplayPosition)) //{ // this.SecondDigitUpperArrowDisplayTexture = this.UpperArrowSelectedTexture; //} //else if (StaticMethods.PointInRectangle(position, this.SecondDigitLowerArrowDisplayPosition)) //{ // this.SecondDigitLowerArrowDisplayTexture = this.LowerArrowSelectedTexture; //} else { this.ResetDisplayTextures(); } } }
private void screen_OnMouseLeftDown(Point position) { if (base.IsDrawing) { if (StaticMethods.PointInRectangle(position, this.ToolDisplayPosition)) { if (InputManager.IsDownPre == false) { this.IsMapShowing = !this.IsMapShowing; } if (base.Enabled) { if (this.IsMapShowing) { this.ToolDisplayTexture = this.ToolSelectedTexture; } else { this.ToolDisplayTexture = this.ToolTexture; } } } else if (this.IsMapShowing && StaticMethods.PointInRectangle(position, this.TroopToolDisplayPosition)) { if (InputManager.IsDownPre == false) { this.showTroop = !this.showTroop; } if (this.showTroop) { this.TroopToolDisplayTexture = this.TroopToolSelectedTexture; } else { this.TroopToolDisplayTexture = this.TroopToolTexture; } } else if (this.IsMapShowing && StaticMethods.PointInRectangle(position, this.MapPosition)) { this.JumpTo(position); } } }
private void screen_OnMouseMove(Point position, bool leftDown) { if (Session.MainGame.mainGameScreen.PeekUndoneWork().Kind == UndoneWorkKind.Dialog) { if (StaticMethods.PointInRectangle(position, this.DestinationButtonDisplayPosition)) { this.DestinationButtonDisplayTexture = this.DestinationButtonSelectedTexture; this.InputNumberButtonDisplayTexture = this.InputNumberButtonTexture; if (this.StartButtonEnabled) { this.StartButtonDisplayTexture = this.StartButtonTexture; } } else if (StaticMethods.PointInRectangle(position, this.InputNumberButtonDisplayPosition)) { this.DestinationButtonDisplayTexture = this.DestinationButtonTexture; this.InputNumberButtonDisplayTexture = this.InputNumberButtonSelectedTexture; if (this.StartButtonEnabled) { this.StartButtonDisplayTexture = this.StartButtonTexture; } } else if (StaticMethods.PointInRectangle(position, this.StartButtonDisplayPosition)) { this.DestinationButtonDisplayTexture = this.DestinationButtonTexture; this.InputNumberButtonDisplayTexture = this.InputNumberButtonTexture; if (this.StartButtonEnabled) { this.StartButtonDisplayTexture = this.StartButtonSelectedTexture; } } else { this.DestinationButtonDisplayTexture = this.DestinationButtonTexture; this.InputNumberButtonDisplayTexture = this.InputNumberButtonTexture; if (this.StartButtonEnabled) { this.StartButtonDisplayTexture = this.StartButtonTexture; } } } }
public void Stop() { if ((this.playing && (this.DaysLeft > 1)) && (this.daysLeftBackUp == 0)) { this.DaysLeft = 1; this.PlayDisplayTexture = this.PlayTexture; this.Updated = false; } else if (((!this.playing && (this.daysLeftBackUp > 0)) && (this.DaysLeft == 0)) && ((Session.Current.Scenario.CurrentFaction == Session.Current.Scenario.CurrentPlayer) && Session.Current.Scenario.CurrentPlayer.Controlling)) { if (Session.Current.Scenario.CurrentPlayer.Passed) { Session.Current.Scenario.CurrentPlayer.Passed = false; } this.daysLeftBackUp = 0; this.PlayDisplayTexture = this.PlayTexture; this.Updated = false; } }
private void screen_OnMouseLeftDown(Point position) { if (StaticMethods.PointInRectangle(position, this.FirstPageButtonDisplayPosition)) { this.RichText.FirstPage(); this.FirstPageButtonDisplayTexture = this.FirstPageButtonDisabledTexture; } else if ((this.RichText.CurrentPageIndex >= (this.RichText.PageCount - 1)) && (this.iConfirmationDialog == null)) { this.IsShowing = false; } else { this.RichText.NextPage(); this.startShowingTime = DateTime.Now; if (this.RichText.CurrentPageIndex > 0) { this.FirstPageButtonDisplayTexture = this.FirstPageButtonTexture; } } }
public void Run() { if ((((this.DaysLeft == 0) && (this.daysLeftBackUp == 0)) && (this.DaysToGo > 0)) && !this.playing) { if ((Session.Current.Scenario.CurrentFaction == Session.Current.Scenario.CurrentPlayer) && Session.Current.Scenario.CurrentPlayer.Controlling) { if (Session.Current.Scenario.CurrentPlayer != null) { Session.Current.Scenario.CurrentPlayer.Passed = true; Session.Current.Scenario.CurrentPlayer.Controlling = false; } if (Session.Current.Scenario.IsLastPlayer(Session.Current.Scenario.CurrentPlayer)) { this.RunDays(this.DaysToGo); } } } else if (((this.DaysLeft > 1) && this.playing) && (this.daysLeftBackUp == 0)) //这里是暂停 { this.yizhiyunxing = false; this.daysLeftBackUp = this.DaysLeft - 1; this.DaysLeft = 1; this.PlayDisplayTexture = this.PlaySelectedTexture; this.Updated = false; } else if ((((this.daysLeftBackUp > 0) && !this.playing) && (this.DaysLeft == 0)) && ((Session.Current.Scenario.CurrentFaction == Session.Current.Scenario.CurrentPlayer) && Session.Current.Scenario.CurrentPlayer.Controlling)) { if (Session.Current.Scenario.CurrentPlayer != null) { Session.Current.Scenario.CurrentPlayer.Passed = true; Session.Current.Scenario.CurrentPlayer.Controlling = false; } if (Session.Current.Scenario.IsLastPlayer(Session.Current.Scenario.CurrentPlayer)) { this.RunDays(0); } } }
private void screen_OnMouseMove(Point position, bool leftDown) { if (base.IsDrawing && !Session.MainGame.mainGameScreen.DrawingSelector) { if (!this.IsMapShowing) { if (base.Enabled) { this.ToolDisplayTexture = this.ToolTexture; } } else if (StaticMethods.PointInRectangle(position, this.MapPosition)) { this.isPreparedToJump = true; Session.MainGame.mainGameScreen.ResetMouse(); if (leftDown) { this.JumpTo(position); } else if (this.isPreparedToJump) { Architecture architectureByPosition = Session.Current.Scenario.GetArchitectureByPosition(this.GetTranslatedPosition(position)); if (architectureByPosition != null) { this.Conment.DisplayOffset = position; this.Conment.Text = architectureByPosition.Name + " " + architectureByPosition.FactionString; } else { this.Conment.Text = ""; } } } else { this.isPreparedToJump = false; } } }
internal void RunDays(int Days) { if (Days == -999) { this.yizhiyunxing = true; } this.playing = true; this.DaysLeft += Days + this.daysLeftBackUp; this.daysLeftBackUp = 0; if (this.DaysLeft > MAX_DAY || this.yizhiyunxing) { this.DaysLeft = MAX_DAY; } this.Updated = false; if (this.PlayDisplayTexture == this.PlayTexture) { this.PlayDisplayTexture = this.PauseTexture; } else if (this.PlayDisplayTexture == this.PlaySelectedTexture) { this.PlayDisplayTexture = this.PauseSelectedTexture; } }
internal void DateStop() { if (this.Date.EndRunning() && !Session.GlobalVariables.EnableResposiveThreading) { if (this.yizhiyunxing) { this.DaysLeft = MAX_DAY; } this.Date.Go(); if (this.DaysLeft == 0) { this.playing = false; if (this.PlayDisplayTexture == this.PauseSelectedTexture) { this.PlayDisplayTexture = this.PlaySelectedTexture; } else { this.PlayDisplayTexture = this.PlayTexture; } } this.Updated = false; } }
internal void Update() { if (Session.Current.Scenario.Date.Season == GameSeason.春) { this.SeasonTexture = this.SpringTexture; } else if (Session.Current.Scenario.Date.Season == GameSeason.夏) { this.SeasonTexture = this.SummerTexture; } else if (Session.Current.Scenario.Date.Season == GameSeason.秋) { this.SeasonTexture = this.AutumnTexture; } else { this.SeasonTexture = this.WinterTexture; } this.DateText.Text = Session.Current.Scenario.Date.ToDateString(); if (Session.Current.Scenario.CurrentFaction != null) { if ((Session.Current.Scenario.CurrentFaction == Session.Current.Scenario.CurrentPlayer) || Session.GlobalVariables.SkyEye) { String counsellor = Session.Current.Scenario.CurrentFaction.Counsellor; String governor = Session.Current.Scenario.CurrentFaction.Governor; String fiveTigers = Session.Current.Scenario.CurrentFaction.FiveTigers; if (counsellor != null && governor != null && fiveTigers != null) { this.CounsellorNameText.Text = counsellor; this.GovernorNameText.Text = governor; this.FiveTigerText.Text = fiveTigers; } this.FactionText.Text = string.Concat(new object[] { Session.Current.Scenario.CurrentFaction.Name, " 【", Session.Current.Scenario.CurrentFaction.TotalTechniquePoint, "】" }); //阿柒:新增势力信息显示 this.LeaderNameText.Text = string.Concat(new object[] { Session.Current.Scenario.CurrentFaction.LeaderName }); this.PrinceNameText.Text = string.Concat(new object[] { Session.Current.Scenario.CurrentFaction.PrinceName }); this.PersonCountText.Text = string.Concat(new object[] { Session.Current.Scenario.CurrentFaction.PersonCount }); this.PopulationText.Text = string.Concat(new object[] { Session.Current.Scenario.CurrentFaction.Population }); this.ArmyText.Text = string.Concat(new object[] { Session.Current.Scenario.CurrentFaction.Army }); this.FundText.Text = string.Concat(new object[] { Session.Current.Scenario.CurrentFaction.Fund }); if (Session.Current.Scenario.CurrentFaction.Food > 10000) { this.FoodText.Text = string.Concat(new object[] { (int)(Session.Current.Scenario.CurrentFaction.Food / 10000), "万" }); } else { this.FoodText.Text = string.Concat(new object[] { Session.Current.Scenario.CurrentFaction.Food }); } this.CapitalNameText.Text = string.Concat(new object[] { Session.Current.Scenario.CurrentFaction.CapitalName }); this.guanjuezifuchuanText.Text = string.Concat(new object[] { Session.Current.Scenario.CurrentFaction.guanjuezifuchuan, "(势力声望:", Session.Current.Scenario.CurrentFaction.Reputation, ")" }); this.chaotinggongxianduText.Text = string.Concat(new object[] { Session.Current.Scenario.CurrentFaction.chaotinggongxiandu, " •升官所需", Session.Current.Scenario.CurrentFaction.shengguanxuyaogongxiandu }); this.CityCountText.Text = string.Concat(new object[] { Session.Current.Scenario.CurrentFaction.CityCount, " •升官所需", Session.Current.Scenario.CurrentFaction.shengguanxuyaochengchi }); this.FactionText.Text = string.Concat(new object[] { Session.Current.Scenario.CurrentFaction.Name, " • ", Session.Current.Scenario.CurrentFaction.TotalTechniquePoint, }); this.FactionTechText.Text = string.Concat(new object[] { Session.Current.Scenario.GameCommonData.AllTechniques.GetTechnique(Session.Current.Scenario.CurrentFaction.UpgradingTechnique), "•", "余", Session.Current.Scenario.CurrentFaction.UpgradingDaysLeft * Session.Parameters.DayInTurn, "天" }); } else { this.FactionText.Text = Session.Current.Scenario.CurrentFaction.Name; } } }
public void Initialize(MainGameScreen screen) { this.veilTexture = screen.Textures.MapVeilTextures[0]; }
public void Update() { Rectangle rectangle; this.FactionColor = Color.White; string meigongzuoderenshuzifuchuan; if (this.ArchitectureToSurvey.BelongedFaction != null) { this.FactionColor = this.ArchitectureToSurvey.BelongedFaction.FactionColor; } if (((this.ViewingFaction != null) && !Session.GlobalVariables.SkyEye) && (this.ViewingFaction != this.ArchitectureToSurvey.BelongedFaction)) { this.Controlling = false; rectangle = new Rectangle(this.Left - this.BackgroundSize.X, this.Top - this.BackgroundSize.Y, this.BackgroundSize.X, this.BackgroundSize.Y); StaticMethods.AdjustRectangleInViewport(ref rectangle); this.DisplayOffset = new Point(rectangle.X, rectangle.Y); this.NameText.Text = this.ArchitectureToSurvey.Name; this.KindText.Text = this.ArchitectureToSurvey.KindString; this.FactionText.Text = this.ArchitectureToSurvey.FactionString; this.PopulationText.Text = this.ArchitectureToSurvey.PopulationInInformationLevel(this.Level); this.MilitaryPopulationText.Text = this.ArchitectureToSurvey.MilitaryPopulationInInformationLevel(this.Level); //this.ArmyText.Text = this.ArchitectureToSurvey.ArmyQuantityInInformationLevel(this.Level); //////////////////////////////////////////////////////////临时代码 ,合理的应该恢复上句并修改GameObjects.Architecture if (this.Level == InformationLevel.未知 || this.Level == InformationLevel.无 || this.Level == InformationLevel.低) { this.ArmyText.Text = this.ArchitectureToSurvey.ArmyQuantityInInformationLevel(this.Level); } else { this.ArmyText.Text = this.ArchitectureToSurvey.MilitaryCount.ToString() + "/" + this.ArchitectureToSurvey.ArmyQuantity.ToString(); } ///////////////////////////////////////////////////////////// this.DominationText.Text = this.ArchitectureToSurvey.DominationInInformationLevel(this.Level); this.EnduranceText.Text = this.ArchitectureToSurvey.EnduranceInInformationLevel(this.Level); this.MayorNameText.Text = this.ArchitectureToSurvey.MayorName; } else { this.Controlling = true; rectangle = new Rectangle(this.Left - this.ControllingBackgroundSize.X, this.Top - this.ControllingBackgroundSize.Y, this.ControllingBackgroundSize.X, this.ControllingBackgroundSize.Y); StaticMethods.AdjustRectangleInViewport(ref rectangle); meigongzuoderenshuzifuchuan = meigongzuoderenshu(this.ArchitectureToSurvey).ToString(); this.DisplayOffset = new Point(rectangle.X, rectangle.Y); this.NameText.Text = this.ArchitectureToSurvey.Name; if (Switch1 == "on") { if (this.ArchitectureToSurvey.FactionString == "----") { this.KindText.Text = "----"; } else { this.KindText.Text = this.ArchitectureToSurvey.BelongedFaction.LeaderName; } } else { this.KindText.Text = this.ArchitectureToSurvey.KindString; } this.FactionText.Text = this.ArchitectureToSurvey.FactionString; this.PopulationText.Text = this.ArchitectureToSurvey.Population.ToString(); this.MilitaryPopulationText.Text = this.ArchitectureToSurvey.MilitaryPopulation.ToString(); this.ArmyText.Text = this.ArchitectureToSurvey.MilitaryCount.ToString() + "/" + this.ArchitectureToSurvey.ArmyQuantity.ToString(); this.DominationText.Text = this.ArchitectureToSurvey.DominationString; this.EnduranceText.Text = this.ArchitectureToSurvey.EnduranceString; this.FundText.Text = this.ArchitectureToSurvey.Fund.ToString(); if (this.ArchitectureToSurvey.Food < 10000) { this.FoodText.Text = (this.ArchitectureToSurvey.Food / 10000.0f).ToString("f1") + "万"; } else { this.FoodText.Text = Math.Floor(this.ArchitectureToSurvey.Food / 10000.0f).ToString() + "万"; } this.PersonCountText.Text = meigongzuoderenshuzifuchuan + "/" + this.ArchitectureToSurvey.PersonCount.ToString(); this.FacilityCountText.Text = this.ArchitectureToSurvey.SheshiMiaoshu; this.NoFactionPersonCountText.Text = this.ArchitectureToSurvey.NoFactionPersonCount.ToString(); this.AgricultureText.Text = this.ArchitectureToSurvey.AgricultureString; this.CommerceText.Text = this.ArchitectureToSurvey.CommerceString; this.TechnologyText.Text = this.ArchitectureToSurvey.TechnologyString; this.MoraleText.Text = this.ArchitectureToSurvey.MoraleString; this.BuildingDaysLeftText.Text = this.ArchitectureToSurvey.BuildingDaysLeft.ToString(); this.MayorNameText.Text = this.ArchitectureToSurvey.MayorName; //↓判断建筑种类对应文理 if (Switch1 == "on") { AKinds = this.ArchitectureToSurvey.KindString; if (AKinds == AKindfor1) { AKBackgroundTexture = AKBackground1Texture; } else if (AKinds == AKindfor2) { AKBackgroundTexture = AKBackground2Texture; } else if (AKinds == AKindfor3) { AKBackgroundTexture = AKBackground3Texture; } else if (AKinds == AKindfor4) { AKBackgroundTexture = AKBackground4Texture; } else if (AKinds == AKindfor5) { AKBackgroundTexture = AKBackground5Texture; } else if (AKinds == AKindfor6) { AKBackgroundTexture = AKBackground6Texture; } else if (AKinds == AKindfor7) { AKBackgroundTexture = AKBackground7Texture; } else if (AKinds == AKindfor8) { AKBackgroundTexture = AKBackground8Texture; } else if (AKinds == AKindfor9) { AKBackgroundTexture = AKBackground9Texture; } else if (AKinds == AKindfor10) { AKBackgroundTexture = AKBackground10Texture; } else if (AKinds == AKindfor11) { AKBackgroundTexture = AKBackground11Texture; } else if (AKinds == AKindfor12) { AKBackgroundTexture = AKBackground12Texture; } else if (AKinds == AKindfor13) { AKBackgroundTexture = AKBackground13Texture; } else if (AKinds == AKindfor14) { AKBackgroundTexture = AKBackground14Texture; } else if (AKinds == AKindfor15) { AKBackgroundTexture = AKBackground15Texture; } else if (AKinds == AKindfor16) { AKBackgroundTexture = AKBackground16Texture; } else if (AKinds == AKindfor17) { AKBackgroundTexture = AKBackground17Texture; } else if (AKinds == AKindfor18) { AKBackgroundTexture = AKBackground18Texture; } else if (AKinds == AKindfor19) { AKBackgroundTexture = AKBackground19Texture; } else if (AKinds == AKindfor20) { AKBackgroundTexture = AKBackground20Texture; } else if (AKinds == AKindfor21) { AKBackgroundTexture = AKBackground21Texture; } else if (AKinds == AKindfor22) { AKBackgroundTexture = AKBackground22Texture; } else if (AKinds == AKindfor23) { AKBackgroundTexture = AKBackground23Texture; } else if (AKinds == AKindfor24) { AKBackgroundTexture = AKBackground24Texture; } else if (AKinds == AKindfor25) { AKBackgroundTexture = AKBackground25Texture; } else if (AKinds == AKindfor26) { AKBackgroundTexture = AKBackground26Texture; } else if (AKinds == AKindfor27) { AKBackgroundTexture = AKBackground27Texture; } else if (AKinds == AKindfor28) { AKBackgroundTexture = AKBackground28Texture; } else { AKBackgroundTexture = AKBackground0Texture; } } //↓进度条对应文理 if (Switch2 == "on") { if (this.ArchitectureToSurvey.Domination == 0 || this.ArchitectureToSurvey.DominationCeiling == 0) { Bar2 = 0; } else { Bar2 = 100 * this.ArchitectureToSurvey.Domination / this.ArchitectureToSurvey.DominationCeiling; } if (this.ArchitectureToSurvey.Endurance == 0 || this.ArchitectureToSurvey.EnduranceCeiling == 0) { Bar3 = 0; } else { Bar3 = 100 * this.ArchitectureToSurvey.Endurance / this.ArchitectureToSurvey.EnduranceCeiling; } if (this.ArchitectureToSurvey.Agriculture == 0 || this.ArchitectureToSurvey.AgricultureCeiling == 0) { Bar4 = 0; } else { Bar4 = 100 * this.ArchitectureToSurvey.Agriculture / this.ArchitectureToSurvey.AgricultureCeiling; } if (this.ArchitectureToSurvey.Commerce == 0 || this.ArchitectureToSurvey.CommerceCeiling == 0) { Bar5 = 0; } else { Bar5 = 100 * this.ArchitectureToSurvey.Commerce / this.ArchitectureToSurvey.CommerceCeiling; } if (this.ArchitectureToSurvey.Technology == 0 || this.ArchitectureToSurvey.TechnologyCeiling == 0) { Bar6 = 0; } else { Bar6 = 100 * this.ArchitectureToSurvey.Technology / this.ArchitectureToSurvey.TechnologyCeiling; } if (this.ArchitectureToSurvey.Morale == 0 || this.ArchitectureToSurvey.MoraleCeiling == 0) { Bar7 = 0; } else { Bar7 = 100 * this.ArchitectureToSurvey.Morale / this.ArchitectureToSurvey.MoraleCeiling; } if (this.ArchitectureToSurvey.FacilityPositionCount - this.ArchitectureToSurvey.FacilityPositionLeft == 0 || this.ArchitectureToSurvey.FacilityPositionCount == 0) { Bar8 = 0; } else { Bar8 = 100 * (this.ArchitectureToSurvey.FacilityPositionCount - this.ArchitectureToSurvey.FacilityPositionLeft) / this.ArchitectureToSurvey.FacilityPositionCount; } DominationBarTexture = Domination6BarTexture; if (Bar2 < 10) { DominationBarTexture = Domination1BarTexture; } else if (Bar2 < 20) { DominationBarTexture = Domination2BarTexture; } else if (Bar2 < 50) { DominationBarTexture = Domination3BarTexture; } else if (Bar2 < 80) { DominationBarTexture = Domination4BarTexture; } else if (Bar2 < 100) { DominationBarTexture = Domination5BarTexture; } EnduranceBarTexture = Endurance6BarTexture; if (Bar3 < 10) { EnduranceBarTexture = Endurance1BarTexture; } else if (Bar3 < 20) { EnduranceBarTexture = Endurance2BarTexture; } else if (Bar3 < 50) { EnduranceBarTexture = Endurance3BarTexture; } else if (Bar3 < 80) { EnduranceBarTexture = Endurance4BarTexture; } else if (Bar3 < 100) { EnduranceBarTexture = Endurance5BarTexture; } AgricultureBarTexture = Agriculture6BarTexture; if (Bar4 < 10) { AgricultureBarTexture = Agriculture1BarTexture; } else if (Bar4 < 20) { AgricultureBarTexture = Agriculture2BarTexture; } else if (Bar4 < 50) { AgricultureBarTexture = Agriculture3BarTexture; } else if (Bar4 < 80) { AgricultureBarTexture = Agriculture4BarTexture; } else if (Bar4 < 100) { AgricultureBarTexture = Agriculture5BarTexture; } CommerceBarTexture = Commerce6BarTexture; if (Bar5 < 10) { CommerceBarTexture = Commerce1BarTexture; } else if (Bar5 < 20) { CommerceBarTexture = Commerce2BarTexture; } else if (Bar5 < 50) { CommerceBarTexture = Commerce3BarTexture; } else if (Bar5 < 80) { CommerceBarTexture = Commerce4BarTexture; } else if (Bar5 < 100) { CommerceBarTexture = Commerce5BarTexture; } TechnologyBarTexture = Technology6BarTexture; if (Bar6 < 10) { TechnologyBarTexture = Technology1BarTexture; } else if (Bar6 < 20) { TechnologyBarTexture = Technology2BarTexture; } else if (Bar6 < 50) { TechnologyBarTexture = Technology3BarTexture; } else if (Bar6 < 80) { TechnologyBarTexture = Technology4BarTexture; } else if (Bar6 < 100) { TechnologyBarTexture = Technology5BarTexture; } MoraleBarTexture = Morale6BarTexture; if (Bar7 < 10) { MoraleBarTexture = Morale1BarTexture; } else if (Bar7 < 20) { MoraleBarTexture = Morale2BarTexture; } else if (Bar7 < 50) { MoraleBarTexture = Morale3BarTexture; } else if (Bar7 < 80) { MoraleBarTexture = Morale4BarTexture; } else if (Bar7 < 100) { MoraleBarTexture = Morale5BarTexture; } FacilityCountBarTexture = FacilityCount6BarTexture; if (Bar8 < 10) { FacilityCountBarTexture = FacilityCount1BarTexture; } else if (Bar8 < 20) { FacilityCountBarTexture = FacilityCount2BarTexture; } else if (Bar8 < 50) { FacilityCountBarTexture = FacilityCount3BarTexture; } else if (Bar8 < 80) { FacilityCountBarTexture = FacilityCount4BarTexture; } else if (Bar8 < 100) { FacilityCountBarTexture = FacilityCount5BarTexture; } } } }