Exemplo n.º 1
0
 public static float m0000cd(string p0, float p1, c000128 p2, int p3, int p4)
 {
     if ((p0 == null) || (p0 == ""))
     {
         return 0f;
     }
     if (p2 == null)
     {
         p2 = f00008e;
     }
     float num = 0f;
     float num2 = 0f;
     if (p0.Length == 1)
     {
         num += p2.m00021b(p0[0]) * p1;
     }
     else
     {
         for (int i = p3; i < (p3 + p4); i++)
         {
             if (((p0[i] == '\r') && (i < (p0.Length - 1))) && (p0[i + 1] == '\n'))
             {
                 num2 = Math.Max(num, num2);
                 num = 0f;
                 i++;
             }
             else if ((p0[i] == '\n') || (p0[i] == '\r'))
             {
                 num2 = Math.Max(num, num2);
                 num = 0f;
             }
             else
             {
                 num += p2.m00021a(p0[i]) * p1;
             }
         }
     }
     return Math.Max(num, num2);
 }
Exemplo n.º 2
0
 public static string m0000cf(string p0, float p1, float p2, c000128 p3)
 {
     if ((p0 != null) && (p0 != ""))
     {
         int startIndex = 0;
         float num2 = 0f;
         int num3 = 0;
         float num5 = p1;
         if (p3 == null)
         {
             p3 = m00009c();
         }
         do
         {
             int num4 = p0[startIndex];
             if (num4 != 10)
             {
                 if (num4 < 0x21)
                 {
                     num2 += p3.m00021a(num4) * p1;
                     startIndex++;
                     if (startIndex == p0.Length)
                     {
                         return p0;
                     }
                     continue;
                 }
                 num2 += p3.m00021a(num4) * p1;
                 if (num2 < p2)
                 {
                     startIndex++;
                     if (startIndex == p0.Length)
                     {
                         return p0;
                     }
                     continue;
                 }
                 int num6 = startIndex;
             Label_005A:
                 if (num6 > 0)
                 {
                     if (((p0[num6] == ' ') || (p0[num6] == '/')) || (p0[num6] == '\\'))
                     {
                         p0 = p0.Insert(num6 + 1, "\n");
                         num3++;
                         startIndex = num6 + 2;
                         num2 = 0f;
                         if (startIndex >= p0.Length)
                         {
                             return p0;
                         }
                     }
                     else
                     {
                         if (p0[num6] != '\n')
                         {
                             num6--;
                             goto Label_005A;
                         }
                         for (int i = startIndex; i < p0.Length; i++)
                         {
                             startIndex = i + 1;
                             if (((p0[i] == ' ') || (p0[i] == '/')) || (p0[i] == '\\'))
                             {
                                 p0 = p0.Insert(i + 1, "\n");
                                 num3++;
                                 startIndex = i + 2;
                                 num2 = 0f;
                                 break;
                             }
                         }
                         if (startIndex == p0.Length)
                         {
                             return p0;
                         }
                     }
                 }
                 if (num2 != 0f)
                 {
                     p0 = p0.Insert(startIndex, "\n");
                     startIndex++;
                     num3++;
                     num2 = 0f;
                 }
                 continue;
             }
             num3++;
             startIndex++;
             num2 = 0f;
         }
         while (startIndex != p0.Length);
     }
     return p0;
 }
Exemplo n.º 3
0
 public static int m0000ca(float p0, string p1, float p2, int p3, c000128 p4, enum078 p5)
 {
     float num3;
     if (string.IsNullOrEmpty(p1))
     {
         return 0;
     }
     if (p4 == null)
     {
         if (f00008e == null)
         {
             throw new ArgumentNullException("No bitmapFont passed as an argument and the TextManager does not have its DefaultFont set");
         }
         p4 = f00008e;
     }
     float num = 0f;
     int num2 = 0;
     if (p5 == enum078.f000001)
     {
         for (num2 = 0; (num2 + p3) < p1.Length; num2++)
         {
             num3 = p4.m00021a(p1[num2 + p3]) * p2;
             if ((num + num3) > p0)
             {
                 return num2;
             }
             num += num3;
         }
         return num2;
     }
     if (p5 == enum078.f000043)
     {
         num2 = 0;
         while ((p3 - num2) > -1)
         {
             num3 = p4.m00021a(p1[p3 - num2]) * p2;
             if ((num + num3) > p0)
             {
                 return num2;
             }
             num += num3;
             num2++;
         }
         return num2;
     }
     int num4 = p1.Length / 2;
     int num5 = num4;
     int num6 = num4 + 1;
     while ((num5 > -1) || (num6 < p1.Length))
     {
         if (num5 > -1)
         {
             num3 = p4.m00021a(p1[num5]) * p2;
             if ((num + num3) > p0)
             {
                 return num2;
             }
             num += num3;
             num5--;
             num2++;
         }
         if (num6 < p1.Length)
         {
             num3 = p4.m00021a(p1[num6]) * p2;
             if ((num + num3) > p0)
             {
                 return num2;
             }
             num += num3;
             num6++;
             num2++;
         }
     }
     return num2;
 }