Example #1
0
 // Token: 0x06002E99 RID: 11929
 // RVA: 0x0012EF98 File Offset: 0x0012D198
 public static Color smethod_13(Color color_0, Color color_1, int int_0, int int_1, int int_2, Enum70 enum70_0)
 {
     if (color_0 == color_1)
     {
         return color_0;
     }
     int num = int_0 - int_1;
     int num2 = int_2 - int_1;
     if (num2 != 0 && num != 0)
     {
         return new Color((byte)Math.Max(0.0, Math.Min(255.0, Class778.smethod_17(enum70_0, (double)num, (double)color_0.get_R(), (double)(color_1.get_R() - color_0.get_R()), (double)num2))), (byte)Math.Max(0.0, Math.Min(255.0, Class778.smethod_17(enum70_0, (double)num, (double)color_0.get_G(), (double)(color_1.get_G() - color_0.get_G()), (double)num2))), (byte)Math.Max(0.0, Math.Min(255.0, Class778.smethod_17(enum70_0, (double)num, (double)color_0.get_B(), (double)(color_1.get_B() - color_0.get_B()), (double)num2))), (byte)Math.Max(0.0, Math.Min(255.0, Class778.smethod_17(enum70_0, (double)num, (double)color_0.get_A(), (double)(color_1.get_A() - color_0.get_A()), (double)num2))));
     }
     return color_0;
 }
Example #2
0
 // Token: 0x06002561 RID: 9569
 // RVA: 0x000E0B34 File Offset: 0x000DED34
 internal static void smethod_0(Color color_3, ref Color color_4, ref Color color_5)
 {
     Color color_6;
     color_6..ctor(color_3.get_R(), color_3.get_G(), color_3.get_B(), 180);
     color_4 = Class610.smethod_1(color_6, 0.5f);
     color_5 = Class610.smethod_2(color_6, 0.1f);
 }
 // Token: 0x06002CF8 RID: 11512
 // RVA: 0x0012396C File Offset: 0x00121B6C
 internal static void smethod_4(Color color_0)
 {
     if (BaseGLControl.nullable_0 == color_0)
     {
         return;
     }
     Gl.glColor4ub(color_0.get_R(), color_0.get_G(), color_0.get_B(), color_0.get_A());
     BaseGLControl.nullable_0 = new Color?(color_0);
 }
Example #4
0
 // Token: 0x060025F8 RID: 9720
 // RVA: 0x0001D78F File Offset: 0x0001B98F
 internal static Color smethod_7(Color color_0, byte byte_0)
 {
     return new Color(color_0.get_R(), color_0.get_G(), color_0.get_B(), byte_0);
 }
Example #5
0
 // Token: 0x060025F6 RID: 9718
 // RVA: 0x0001D75F File Offset: 0x0001B95F
 internal static string smethod_5(Color color_0)
 {
     return string.Format("{0:X2}{1:X2}{2:X2}", color_0.get_R(), color_0.get_G(), color_0.get_B());
 }
Example #6
0
 // Token: 0x060025F4 RID: 9716
 // RVA: 0x000E3A54 File Offset: 0x000E1C54
 internal static Color smethod_3(Color color_0, Color color_1, float float_0)
 {
     return new Color((byte)Class778.smethod_0((float)color_0.get_R(), (float)color_1.get_R(), float_0), (byte)Class778.smethod_0((float)color_0.get_G(), (float)color_1.get_G(), float_0), (byte)Class778.smethod_0((float)color_0.get_B(), (float)color_1.get_B(), float_0), (byte)Class778.smethod_0((float)color_0.get_A(), (float)color_1.get_A(), float_0));
 }
Example #7
0
 // Token: 0x060025F3 RID: 9715
 // RVA: 0x000E39E8 File Offset: 0x000E1BE8
 internal static Color smethod_2(Color color_0, float float_0)
 {
     return new Color((byte)Math.Min(255f, (float)color_0.get_R() / (1f + float_0)), (byte)Math.Min(255f, (float)color_0.get_G() / (1f + float_0)), (byte)Math.Min(255f, (float)color_0.get_B() / (1f + float_0)), color_0.get_A());
 }
Example #8
0
 // Token: 0x060025F2 RID: 9714
 // RVA: 0x000E3948 File Offset: 0x000E1B48
 internal static Color smethod_1(Color color_0, float float_0)
 {
     float_0 *= 0.5f;
     return new Color((byte)Math.Min(255f, (float)color_0.get_R() * (1f + 0.5f * float_0) + 255f * float_0), (byte)Math.Min(255f, (float)color_0.get_G() * (1f + 0.5f * float_0) + 255f * float_0), (byte)Math.Min(255f, (float)color_0.get_B() * (1f + 0.5f * float_0) + 255f * float_0), color_0.get_A());
 }
Example #9
0
 // Token: 0x0600250D RID: 9485
 // RVA: 0x000DF4CC File Offset: 0x000DD6CC
 internal void Draw(List<Class880> list_0, float float_0, Color color_0, float float_1, string string_0, bool bool_0)
 {
     if (Class115.bool_26)
     {
         if (Class115.int_0 < 2 && string_0.StartsWith("Standard"))
         {
             string_0 += "11";
         }
         if (string_0 == null)
         {
             this.effect_0.set_CurrentTechnique(this.effect_0.get_Techniques().get_Item(0));
         }
         else
         {
             EffectTechnique currentTechnique = this.effect_0.get_Techniques().get_Item(string_0);
             this.effect_0.set_CurrentTechnique(currentTechnique);
         }
         this.effect_0.Begin();
         EffectPass effectPass = this.effect_0.get_CurrentTechnique().get_Passes().get_Item(0);
         int num;
         int num2;
         if (bool_0)
         {
             this.graphicsDevice_0.set_VertexDeclaration(this.vertexDeclaration_0);
             this.graphicsDevice_0.get_Vertices().get_Item(0).SetSource(this.vertexBuffer_0, 0, this.int_0);
             this.graphicsDevice_0.set_Indices(this.indexBuffer_0);
             this.graphicsDevice_0.get_RenderState().set_CullMode(1);
             num = this.int_4;
             num2 = this.int_2;
         }
         else
         {
             this.graphicsDevice_0.set_VertexDeclaration(this.vertexDeclaration_1);
             this.graphicsDevice_0.get_Vertices().get_Item(0).SetSource(this.vertexBuffer_1, 0, this.int_0);
             this.graphicsDevice_0.set_Indices(this.indexBuffer_1);
             this.graphicsDevice_0.get_RenderState().set_CullMode(2);
             num = this.int_5;
             num2 = this.int_3;
         }
         effectPass.Begin();
         this.effectParameter_3.SetValue(float_1);
         Vector4 value;
         value..ctor((float)color_0.get_R() / 255f, (float)color_0.get_G() / 255f, (float)color_0.get_B() / 255f, (float)color_0.get_A() / 255f);
         this.effectParameter_1.SetValue(value);
         this.effectParameter_2.SetValue(float_0);
         Color color = color_0;
         foreach (Class880 current in list_0)
         {
             Matrix value2 = current.method_2() * Matrix.get_Identity() * Class297.matrix_0;
             this.effectParameter_4.SetValue(value2);
             Class881 class = current as Class881;
Example #10
0
 // Token: 0x060033C2 RID: 13250
 // RVA: 0x00162818 File Offset: 0x00160A18
 internal override void vmethod_0(Color color_0)
 {
     if (this.class531_2.vmethod_6() != null && this.class531_2.vmethod_6().enum112_0 == Enum112.flag_1 && (int)(color_0.get_R() + color_0.get_G() + color_0.get_B()) > 600)
     {
         this.class531_2.color_0 = Color.get_Black();
         this.list_0.Remove(this.class531_2);
     }
     base.vmethod_0(color_0);
 }
Example #11
0
 // Token: 0x06002D58 RID: 11608
 // RVA: 0x001263EC File Offset: 0x001245EC
 internal static Class731 smethod_5(string string_0, float float_2, Vector2 vector2_0, Color color_0, Enum73 enum73_0, bool bool_0, bool bool_1, Enum72 enum72_0, bool bool_2, ref Vector2 vector2_1, ref RectangleF[] rectangleF_0, Color color_1, Color color_2, int int_0, bool bool_3, bool bool_4, string string_1, Vector4 vector4_0, Vector2 vector2_2, Class731 class731_0, int int_1, int int_2)
 {
     Class731 result;
     lock (Class747.object_0)
     {
         rectangleF_0 = null;
         try
         {
             using (Graphics graphics = Graphics.FromHwnd(IntPtr.Zero))
             {
                 using (StringFormat stringFormat = new StringFormat())
                 {
                     if (Class747.float_0 == 0f)
                     {
                         Class747.float_0 = 96f / graphics.DpiX;
                     }
                     float_2 *= Class747.float_0;
                     if (string_0 == null)
                     {
                         vector2_1 = Vector2.get_Zero();
                         result = null;
                     }
                     else
                     {
                         graphics.TextRenderingHint = TextRenderingHint.AntiAlias;
                         if (string_1.StartsWith("Aller"))
                         {
                             string text = Class747.smethod_9(string_0);
                             if (text != null)
                             {
                                 string_1 = text;
                             }
                         }
                         if (int_1 == 0 && int_2 <= 0)
                         {
                             if (int_2 == -1)
                             {
                                 int_2 = string_0.Length;
                             }
                         }
                         else
                         {
                             string_0 = string_0.Substring(int_1, int_2);
                         }
                         if (float_2 < 20f && string_1.EndsWith(" Light"))
                         {
                             string_1 = string_1.Replace(" Light", string.Empty);
                         }
                         FontStyle fontStyle = FontStyle.Regular;
                         if (bool_0)
                         {
                             if (string_1.EndsWith(" Light"))
                             {
                                 string_1 = string_1.Replace(" Light", string.Empty);
                             }
                             fontStyle |= FontStyle.Bold;
                         }
                         if (bool_1)
                         {
                             fontStyle |= FontStyle.Underline;
                         }
                         switch (enum72_0)
                         {
                         case Enum72.const_0:
                         case Enum72.const_1:
                             stringFormat.Alignment = StringAlignment.Near;
                             break;
                         case Enum72.const_2:
                             stringFormat.Alignment = StringAlignment.Center;
                             break;
                         case Enum72.const_3:
                             stringFormat.Alignment = StringAlignment.Far;
                             break;
                         }
                         if (!Class905.smethod_16() && string_1.StartsWith("Aller"))
                         {
                             for (char c = '0'; c <= '9'; c += '\u0001')
                             {
                                 string_0 = string_0.Replace(c, c + '');
                             }
                         }
                         Font font = Class747.smethod_11(string_1, float_2 * Class747.float_1, fontStyle);
                         if (Class747.float_1 != 1f)
                         {
                             vector2_0 *= Class747.float_1;
                         }
                         SizeF sizeF;
                         try
                         {
                             if (string_0.Length == 0)
                             {
                                 string_0 = " ";
                             }
                             sizeF = ((vector2_0 != Vector2.get_Zero()) ? graphics.MeasureString(string_0, font, new SizeF(vector2_0.X, vector2_0.Y), stringFormat) : graphics.MeasureString(string_0, font));
                         }
                         catch (InvalidOperationException)
                         {
                             vector2_1 = Vector2.get_Zero();
                             result = null;
                             return result;
                         }
                         int num = (int)(sizeF.Width + 1f);
                         int num2 = (int)(sizeF.Height + 1f);
                         if (vector2_0.Y != 0f)
                         {
                             num2 = (int)vector2_0.Y;
                         }
                         if (vector2_0.X != 0f && (enum72_0 != Enum72.const_0 || color_1.get_A() > 0))
                         {
                             num = (int)vector2_0.X;
                         }
                         if (vector2_2 != Vector2.get_Zero() && vector2_0 == Vector2.get_Zero())
                         {
                             num += (int)(vector2_2.X * 2f);
                             num2 += (int)(vector2_2.Y * 2f);
                         }
                         vector2_1 = new Vector2((float)num, (float)num2);
                         float num3 = Math.Max(0.5f, Math.Min(1f, float_2 * Class747.float_1 / 14f));
                         if (bool_4)
                         {
                             rectangleF_0 = new RectangleF[string_0.Length];
                             int num4 = string_0.Length / 32 + 1;
                             for (int i = 0; i < num4; i++)
                             {
                                 int num5 = i * 32;
                                 int num6 = Math.Min(string_0.Length - num5, 32);
                                 CharacterRange[] array = new CharacterRange[num6];
                                 for (int j = 0; j < num6; j++)
                                 {
                                     array[j] = new CharacterRange(j + num5, 1);
                                 }
                                 stringFormat.SetMeasurableCharacterRanges(array);
                                 Region[] array2 = graphics.MeasureCharacterRanges(string_0, font, new RectangleF(vector2_2.X, vector2_2.Y, (vector2_0.X == 0f) ? float.PositiveInfinity : vector2_0.X, (vector2_0.Y == 0f) ? float.PositiveInfinity : vector2_0.Y), stringFormat);
                                 for (int k = 0; k < num6; k++)
                                 {
                                     Region region = array2[k];
                                     rectangleF_0[k + num5] = region.GetBounds(graphics);
                                 }
                             }
                         }
                         int num8;
                         if (bool_3)
                         {
                             int num7 = 0;
                             num8 = 0;
                             int l = 0;
                             while (l < string_0.Length)
                             {
                                 if (string_0[l++] != ' ')
                                 {
                                     break;
                                 }
                                 num7++;
                             }
                             int m = string_0.Length - 1;
                             while (m >= l)
                             {
                                 if (string_0[m--] != ' ')
                                 {
                                     break;
                                 }
                                 num8++;
                             }
                             if (num7 == string_0.Length)
                             {
                                 num8 += num7;
                             }
                         }
                         else
                         {
                             using (Bitmap bitmap = new Bitmap(num, num2, PixelFormat.Format32bppArgb))
                             {
                                 using (Graphics graphics2 = Graphics.FromImage(bitmap))
                                 {
                                     graphics2.TextRenderingHint = graphics.TextRenderingHint;
                                     graphics2.SmoothingMode = SmoothingMode.HighQuality;
                                     graphics2.InterpolationMode = InterpolationMode.HighQualityBicubic;
                                     if (color_1.get_A() > 0)
                                     {
                                         if (vector4_0 != Vector4.get_Zero())
                                         {
                                             Class747.smethod_6(graphics2, new Rectangle(0, 0, num, num2), new SolidBrush(Class778.smethod_6(color_1)), vector4_0);
                                             if (int_0 > 0)
                                             {
                                                 Class747.smethod_7(graphics2, new Rectangle(0, 0, num - (int)Math.Ceiling((double)((float)int_0 / 2f)), num2 - (int)Math.Ceiling((double)((float)int_0 / 2f))), new Pen(Class778.smethod_6(color_2), (float)int_0), vector4_0);
                                             }
                                         }
                                         else
                                         {
                                             graphics2.Clear(Class778.smethod_6(color_1));
                                             if (int_0 > 0)
                                             {
                                                 graphics2.DrawRectangle(new Pen(Class778.smethod_6(color_2), (float)int_0), new Rectangle(int_0 / 2, int_0 / 2, num - int_0, num2 - int_0));
                                             }
                                         }
                                     }
                                     else
                                     {
                                         graphics2.Clear(Color.FromArgb(1, (int)color_0.get_R(), (int)color_0.get_G(), (int)color_0.get_B()));
                                     }
                                     using (Brush brush = new SolidBrush(Class778.smethod_6(color_0)))
                                     {
                                         if (vector2_0 != Vector2.get_Zero())
                                         {
                                             vector2_0.X -= vector2_2.X * 2f;
                                             vector2_0.Y -= vector2_2.Y * 2f;
                                             switch (enum73_0)
                                             {
                                             case Enum73.const_1:
                                                 graphics2.DrawString(string_0, font, Class747.brush_0, new RectangleF(vector2_2.X - num3, num3 + vector2_2.Y, vector2_0.X, vector2_0.Y), stringFormat);
                                                 graphics2.DrawString(string_0, font, Class747.brush_0, new RectangleF(vector2_2.X + num3, num3 + vector2_2.Y, vector2_0.X, vector2_0.Y), stringFormat);
                                                 break;
                                             case Enum73.const_2:
                                             {
                                                 Brush brush2 = Class747.brush_1;
                                                 if (color_1.get_A() == 0 && int_0 == 1 && color_2.get_A() > 0)
                                                 {
                                                     brush2 = new SolidBrush(Class778.smethod_6(color_2));
                                                 }
                                                 graphics2.DrawString(string_0, font, brush2, new RectangleF(vector2_2.X + num3, vector2_2.Y + num3, vector2_0.X, vector2_0.Y), stringFormat);
                                                 graphics2.DrawString(string_0, font, brush2, new RectangleF(vector2_2.X + num3, vector2_2.Y - num3, vector2_0.X, vector2_0.Y), stringFormat);
                                                 graphics2.DrawString(string_0, font, brush2, new RectangleF(vector2_2.X - num3, vector2_2.Y + num3, vector2_0.X, vector2_0.Y), stringFormat);
                                                 graphics2.DrawString(string_0, font, brush2, new RectangleF(vector2_2.X - num3, vector2_2.Y - num3, vector2_0.X, vector2_0.Y), stringFormat);
                                                 break;
                                             }
                                             }
                                             graphics2.DrawString(string_0, font, brush, new RectangleF(vector2_2.X, vector2_2.Y, vector2_0.X, vector2_0.Y), stringFormat);
                                         }
                                         else
                                         {
                                             switch (enum73_0)
                                             {
                                             case Enum73.const_1:
                                                 graphics2.DrawString(string_0, font, Class747.brush_0, vector2_2.X - num3, vector2_2.Y + num3);
                                                 graphics2.DrawString(string_0, font, Class747.brush_0, vector2_2.X + num3, vector2_2.Y + num3);
                                                 break;
                                             case Enum73.const_2:
                                             {
                                                 Brush brush3 = Class747.brush_1;
                                                 if (color_1.get_A() == 0 && int_0 == 1 && color_2.get_A() > 0)
                                                 {
                                                     brush3 = new SolidBrush(Class778.smethod_6(color_2));
                                                 }
                                                 graphics2.DrawString(string_0, font, brush3, vector2_2.X + num3, vector2_2.Y + num3);
                                                 graphics2.DrawString(string_0, font, brush3, vector2_2.X - num3, vector2_2.Y + num3);
                                                 graphics2.DrawString(string_0, font, brush3, vector2_2.X + num3, vector2_2.Y - num3);
                                                 graphics2.DrawString(string_0, font, brush3, vector2_2.X - num3, vector2_2.Y - num3);
                                                 break;
                                             }
                                             }
                                             graphics2.DrawString(string_0, font, brush, vector2_2.X, vector2_2.Y);
                                         }
                                     }
                                     BitmapData bitmapData = bitmap.LockBits(new Rectangle(0, 0, num, num2), ImageLockMode.ReadOnly, bitmap.PixelFormat);
                                     if (class731_0 != null && !class731_0.bool_2 && class731_0.method_0() == num)
                                     {
                                         if (class731_0.method_1() == num2)
                                         {
                                             class731_0.method_7(bitmapData.Scan0, num, num2, string_0);
                                             goto IL_936;
                                         }
                                     }
                                     class731_0 = Class731.smethod_7(bitmapData.Scan0, num, num2, true, string_0);
                                     IL_936:
                                     bitmap.UnlockBits(bitmapData);
                                     result = class731_0;
                                     return result;
                                 }
                             }
                         }
                         vector2_1 = new Vector2((float)num + (float)num8 * 5.145f * float_2 / 12f, (float)num2);
                         result = null;
                     }
                 }
             }
         }
         catch (Exception)
         {
             vector2_1 = Vector2.get_Zero();
             result = null;
         }
     }
     return result;
 }
Example #12
0
 // Token: 0x06002E92 RID: 11922
 // RVA: 0x0002317D File Offset: 0x0002137D
 internal static Color smethod_6(Color color_0)
 {
     return Color.FromArgb((int)color_0.get_A(), (int)color_0.get_R(), (int)color_0.get_G(), (int)color_0.get_B());
 }