Example #1
0
        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);
        }
Example #2
0
        public void startJourneyTileBased(Point newStartPos, Point newEndPos, double distThroughJourney)
        {
            Point realStart = VillageBuildingsData.tileToPixel(newStartPos);
            Point realEnd   = VillageBuildingsData.tileToPixel(newEndPos);

            this.startJourney(realStart, realEnd, distThroughJourney);
        }
Example #3
0
 public void startJourney(Point realStart, Point realEnd, double distThroughJourney)
 {
     this.startPos = (PointF)realStart;
     this.endPos   = (PointF)realEnd;
     if (distThroughJourney >= 1.0)
     {
         this.currentPos = this.endPos;
         this.state      = VillagePeopleStates.STATIONARY;
     }
     else
     {
         TimeSpan span = VillageBuildingsData.calcTravelTime(GameEngine.Instance.LocalWorldData, realStart, realEnd);
         this.startTime = DateTime.Now;
         this.endTime   = DateTime.Now.Add(span);
         if (distThroughJourney != 0.0 && !double.IsNaN(distThroughJourney))
         {
             double num = span.TotalSeconds * distThroughJourney;
             this.startTime = this.startTime.AddSeconds(0.0 - num); // TODO Ex here
             this.endTime   = this.endTime.AddSeconds(0.0 - num);
         }
         this.state  = VillagePeopleStates.MOVING;
         this.facing = SpriteWrapper.getFacing(this.startPos, this.endPos, 8);
         this.updateJourney();
     }
 }
 public void updateSymbolGFX()
 {
     this.symbolSprite.Visible  = false;
     this.symbolSprite.SpriteNo = 0x3a;
     if (VillageBuildingsData.buildingRequiresWorker(this.buildingType) && this.complete)
     {
         if (!this.buildingActive)
         {
             this.symbolSprite.initAnim(0x3b, 11, 1, 100);
             this.symbolSprite.Visible = true;
         }
         else if (!this.gotEmployee)
         {
             this.symbolSprite.Visible = true;
         }
     }
 }
Example #5
0
        public void setText(ParishWallDetailInfo_ReturnType returnData, DonatePopup parent)
        {
            base.clearControls();
            int num = 0;

            foreach (WallInfo info in returnData.detailedInfo)
            {
                if (info.detailedInfo.detail1 > 0)
                {
                    num++;
                }
                if (info.detailedInfo.detail2 > 0)
                {
                    num++;
                }
                if (info.detailedInfo.detail3 > 0)
                {
                    num++;
                }
                if (info.detailedInfo.detail4 > 0)
                {
                    num++;
                }
                if (info.detailedInfo.detail5 > 0)
                {
                    num++;
                }
                if (info.detailedInfo.detail6 > 0)
                {
                    num++;
                }
                if (info.detailedInfo.detail7 > 0)
                {
                    num++;
                }
                if (info.detailedInfo.detail8 > 0)
                {
                    num++;
                }
            }
            int num2 = GFXLibrary.parishwall_tan_bar_01_short.Height + 3;

            this.backgroundImage.Size     = new Size(GFXLibrary.parishwall_tan_bar_01_short.Width + 20, ((num2 * num) + 20) - 3);
            this.backgroundImage.Position = new Point(0, 0);
            base.addControl(this.backgroundImage);
            this.backgroundImage.Create((Image)GFXLibrary.parishwall_solid_rounded_rectangle_tan_upper_left, (Image)GFXLibrary.parishwall_solid_rounded_rectangle_tan_upper_middle, (Image)GFXLibrary.parishwall_solid_rounded_rectangle_tan_upper_right, (Image)GFXLibrary.parishwall_solid_rounded_rectangle_tan_middle_left, (Image)GFXLibrary.parishwall_solid_rounded_rectangle_tan_middle_middle, (Image)GFXLibrary.parishwall_solid_rounded_rectangle_tan_middle_right, (Image)GFXLibrary.parishwall_solid_rounded_rectangle_tan_bottom_left, (Image)GFXLibrary.parishwall_solid_rounded_rectangle_tan_bottom_middle, (Image)GFXLibrary.parishwall_solid_rounded_rectangle_tan_bottom_right);
            int index = 0;

            foreach (WallInfo info2 in returnData.detailedInfo)
            {
                if (info2.detailedInfo.detail1 > 0)
                {
                    int resource = VillageBuildingsData.getRequiredResourceType(info2.data1, 0);
                    this.backgroundImage.addControl(this.addRow(index, info2.data1, info2.detailedInfo.detail1, resource));
                    index++;
                }
                if (info2.detailedInfo.detail2 > 0)
                {
                    int num5 = VillageBuildingsData.getRequiredResourceType(info2.data1, 1);
                    this.backgroundImage.addControl(this.addRow(index, info2.data1, info2.detailedInfo.detail2, num5));
                    index++;
                }
                if (info2.detailedInfo.detail3 > 0)
                {
                    int num6 = VillageBuildingsData.getRequiredResourceType(info2.data1, 2);
                    this.backgroundImage.addControl(this.addRow(index, info2.data1, info2.detailedInfo.detail3, num6));
                    index++;
                }
                if (info2.detailedInfo.detail4 > 0)
                {
                    int num7 = VillageBuildingsData.getRequiredResourceType(info2.data1, 3);
                    this.backgroundImage.addControl(this.addRow(index, info2.data1, info2.detailedInfo.detail4, num7));
                    index++;
                }
                if (info2.detailedInfo.detail5 > 0)
                {
                    int num8 = VillageBuildingsData.getRequiredResourceType(info2.data1, 4);
                    this.backgroundImage.addControl(this.addRow(index, info2.data1, info2.detailedInfo.detail5, num8));
                    index++;
                }
                if (info2.detailedInfo.detail6 > 0)
                {
                    int num9 = VillageBuildingsData.getRequiredResourceType(info2.data1, 5);
                    this.backgroundImage.addControl(this.addRow(index, info2.data1, info2.detailedInfo.detail6, num9));
                    index++;
                }
                if (info2.detailedInfo.detail7 > 0)
                {
                    int num10 = VillageBuildingsData.getRequiredResourceType(info2.data1, 6);
                    this.backgroundImage.addControl(this.addRow(index, info2.data1, info2.detailedInfo.detail7, num10));
                    index++;
                }
                if (info2.detailedInfo.detail8 > 0)
                {
                    int num11 = VillageBuildingsData.getRequiredResourceType(info2.data1, 7);
                    this.backgroundImage.addControl(this.addRow(index, info2.data1, info2.detailedInfo.detail8, num11));
                    index++;
                }
            }
            parent.Size = this.backgroundImage.Size;
            base.Invalidate();
            parent.Invalidate();
        }
Example #6
0
 public void initResources(AGUR parent, int resource)
 {
     this.btnOK.Text     = SK.Text("GENERIC_OK", "OK");
     this.btnCancel.Text = SK.Text("GENERIC_Cancel", "Cancel");
     this.label1.Text    = SK.Text("ReasonPopup_Enter_Reason", "Enter Reason For this Action");
     this.Text           = base.Title = SK.Text("ReasonPopup_Reason", "Reason") + " : " + VillageBuildingsData.getResourceNames(resource);
     this.m_agur         = parent;
 }
Example #7
0
 public void init(int buildingType)
 {
     this.lblBuildingType.Text = VillageBuildingsData.getBuildingName(buildingType);
     this.lblHelpText.Text     = VillageBuildingsData.getCapitalBuildingHelpText(buildingType);
 }