Exemplo n.º 1
0
 // Token: 0x0600006D RID: 109 RVA: 0x0000689C File Offset: 0x00004A9C
 public ctlDamageDisplay()
 {
     BackColorChanged += ctlDamageDisplay_BackColorChanged;
     Load             += ctlDamageDisplay_Load;
     Paint            += ctlDamageDisplayt_Paint;
     pStyle            = (Enums.eDDStyle) 3;
     pText             = 0;
     pGraph            = (Enums.eDDGraph) 2;
     pFadeBackStart    = Color.Lime;
     pFadeBackEnd      = Color.Yellow;
     pFadeBaseStart    = Color.Blue;
     pFadeBaseEnd      = Color.LightBlue;
     pFadeEnhStart     = Color.Blue;
     pFadeEnhEnd       = Color.Red;
     pTextColor        = Color.Black;
     pvPadding         = 6;
     phPadding         = 3;
     pAlign            = (Enums.eDDAlign) 1;
     nBase             = 100f;
     nEnhanced         = 196f;
     nMaxEnhanced      = 207f;
     nHighestBase      = 200f;
     nHighestEnhanced  = 414f;
     pString           = "196 (100)";
     InitializeComponent();
 }
        // Token: 0x06000077 RID: 119 RVA: 0x00007244 File Offset: 0x00005444
        public void DrawText(Rectangle Bounds)
        {
            RectangleF   layoutRectangle = new RectangleF(0f, 0f, 0f, 0f);
            StringFormat stringFormat    = new StringFormat();
            float        height          = this.Font.GetHeight(this.myGFX);

            this.bxBuffer.Graphics.TextRenderingHint = TextRenderingHint.AntiAliasGridFit;
            layoutRectangle.X = (float)(checked (Bounds.X + this.phPadding));
            if (this.pStyle == (Enums.eDDStyle) 3)
            {
                layoutRectangle.Y = (float)Bounds.Y + ((float)Bounds.Height - height) / 2f + 2f;
            }
            else
            {
                layoutRectangle.Y = (float)Bounds.Y + ((float)Bounds.Height - height) / 2f - 1f;
            }
            layoutRectangle.Width  = (float)(checked (Bounds.Width - this.phPadding * 2));
            layoutRectangle.Height = (float)Bounds.Height;
            Brush brush = new SolidBrush(this.pTextColor);

            switch (this.pAlign)
            {
            case Enums.eDDAlign.Left:
                stringFormat.Alignment = StringAlignment.Near;
                break;

            case Enums.eDDAlign.Center:
                stringFormat.Alignment = StringAlignment.Center;
                break;

            case Enums.eDDAlign.Right:
                stringFormat.Alignment = StringAlignment.Far;
                break;
            }
            Enums.eDDText eDDText = this.pText;
            if (eDDText == 0)
            {
            }
            SizeF sizeF = this.bxBuffer.Graphics.MeasureString(this.pString, this.Font);

            if (sizeF.Width > layoutRectangle.Width)
            {
                this.bxBuffer.Graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
                Font font = new Font(this.Font.Name, this.Font.Size * (layoutRectangle.Width / sizeF.Width), this.Font.Style, GraphicsUnit.Point);
                this.bxBuffer.Graphics.DrawString(this.pString, font, brush, layoutRectangle, stringFormat);
            }
            else
            {
                this.bxBuffer.Graphics.TextRenderingHint = TextRenderingHint.AntiAliasGridFit;
                this.bxBuffer.Graphics.DrawString(this.pString, this.Font, brush, layoutRectangle, stringFormat);
            }
        }