internal void Prepare(int Left, int Top, Point viewportSize)
 {
     if (this.menuToDisplay != null)
     {
         this.ViewportSize = viewportSize;
         Rectangle rect = new Rectangle(Left, Top, this.menuToDisplay.ItemWidth, this.Height);
         StaticMethods.AdjustRectangleInViewport(ref rect, viewportSize);
         this.left = rect.Left;
         this.top  = rect.Top;
         this.Prepare();
     }
 }
Пример #2
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;
                    }
                }
            }
        }
        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) && !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);
            }
            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;
                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;
            }
        }
Пример #4
0
 public void SetTopLeftPoint(int Left, int Top)
 {
     Microsoft.Xna.Framework.Rectangle rect = new Microsoft.Xna.Framework.Rectangle(Left - this.troopSurvey.BackgroundSize.X, Top - this.troopSurvey.BackgroundSize.Y, this.troopSurvey.BackgroundSize.X, this.troopSurvey.BackgroundSize.Y);
     StaticMethods.AdjustRectangleInViewport(ref rect);
     this.troopSurvey.DisplayOffset = new Microsoft.Xna.Framework.Point(rect.X, rect.Y);
 }